Jump to content
RealModScene
gavin_darkglider

Custom Patch set for Pulseaudio network sinks

Recommended Posts

Figured someone else running linux with pulseaudio would want this, and considering I just spent 6 hours going through pulseaudio patches that havnt made it upstream yet, and manually applying them to the latest pulseaudio(8.0) code, that someone else might be interested.

 

What is patched.

1. Added opus compression to module-tunnel-sink-new(Compressed network audio streams)

3. Added pa mainloop support to rtpoll.

3. Changed module-tunnel-sink-new and module-tunnel-source-new to support new rtpoll mainloop, instead of pa mainloop

 

What this means is you can compress network streams, and the rtpoll changes fix module-tunnel-combine, which requires rtpoll, and doesnt support modules using pa_mainloop support. Without the rtpoll patches, pulseaudio will crash if you attempt to load module-combine-sink with a network stream as a slave.  Which means you can now combine all network streams into 1 stream, which will send audio to multiple servers, at the same time.

If you are interested, here are the original patches, that I combined into this patch:

1. http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/22605 (patches 5/6, and 6/6. the rest were applied upstream)

2. https://bugs.freedesktop.org/show_bug.cgi?id=56993

I have only tested this patch set with the latest version 8.0 of pulseaudio, but with a few offset changes it should compile with 7.1 as well.

 

I am assuming if you are downloading this, you know how to patch code. If you need help, feel free to pm me.

 

Enjoy.

 

For gentoo users:

 

1. Rename patch file to have a .patch extension instead of a .txt extension.

2. put the file in /etc/portage/patches/media-sound/pulseaudio/ (you will have to create the directory)

3. emerge -av libopus

4. emerge -av pulseaudio

5. reboot computer.

 

You will need to apply patch to all computers on the network(or at least the ones you plan on using network sound with), or the opus compression wont work.

read through link number 2 for the original patches, for detailed instructions for setting up network sinks.

pulseaudio8-opus-rtpoll-patches.txt

  • Like 1

Share this post


Link to post
Share on other sites

Testing a new version of the patch now, that will help keep all of the audio streams in sync. This new patch is for module-combine-sync, which adds a latency option, by allowing you to pass a new value to what was a compiler constant in the module. If you dont set the option on the command line, or in the default.pa file, it will use the default value of 200ms, I have found that when using local sound cards with network sinks, the network sink was a couple seconds behind, or if it wasnt to begin with it would be after about 30 seconds of playing. I have found if you set this to a much lower value, such as 45 to 50, 90% of that lag disappears. :) Needs further testing, especially under network load. 

Share this post


Link to post
Share on other sites

Not sure if it's of any use especially over a network, vlc has syncing option built in whether it's subs,audio or vid.Option is in menu bar under tools,syncing can be set to faster or slower

 

edit: not sure if increasing or decreasing can be done for just audio files

Share this post


Link to post
Share on other sites

So this is for linux audio streaming locally?

Interesting....

The opus compression protocol isnt necessarily for streaming locally, and any network service can be accessed across the internet, but yes, I figured this way I can hook a raspberry pi to the stereo, and can send all of the sound that comes out of my computer to my stereo over wifi, so I dont have to run cables all over the place. And the combine-sink patches would allow me to put multiple raspberry pi's all over the house, then be able to play what ever sound through all of them at once.

 

Not sure if it's of any use especially over a network, vlc has syncing option built in whether it's subs,audio or vid.Option is in menu bar under tools,syncing can be set to faster or slower

 

edit: not sure if increasing or decreasing can be done for just audio files

This  applies to pulseaudio, which sits under vlc, or any other sound producing app for that matter. It handles all audio streams, and then directs it  either to alsa, or to a network sink, which with this patch, you can now compress that stream, so it works quite nicely over wifi, with a much smaller bandwidth fingerprint.

 

As for the patches for module-combine-sink, which are actually patches for other modules, that arent supported by that module, so support can be added fairly easy, allow you to use you computer speakers, and your network sync speakers at the same time, and play the same thing out of both simultaneously. before that was patched, if you tried to combine a network sink it would crash pulseaudio, which causes problems with any app that is currently putting out sound.

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...