Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 18483  / 2 Years ago, sun, february 27, 2022, 6:05:05

I use PulseAudio to send sound over the LAN to an audio server.



When playing any Flash media in Firefox or Chrome, the sound flutters (example), as if the volume were going up and down every second.



I have discovered that I can stop the sound fluttering if I follow these steps:




  • Start a Flash video, such as a video on YouTube


  • Run pulseaudio --kill on the server


  • Wait about 7 seconds




After this, the PulseAudio server automatically respawns, and the sound in the Flash video is fine.



The problem is that I have to do this every time I start a Flash video. This is obviously not desireable.



How do I make whatever it is that makes the sound work when I go through these steps stick so that I don't have to do them?



I doubt that someone will come up with an immediate and simple fix (though that would be nice), so the bounty could go to anyone who provides at least a method of diagonosing the problem.






Details



Here are my sound device output settings. As far as I can tell, all four devices point to the exact same physical device.



sound settings



PulseAudio log output, taken while attempting to play a Flash video.



I've tried to get logging details from Flash, but despite installing and enabling Flash for debugging, it has not generated any ouput at all.



The problem does not exhibit with any other software, so I am reasonably certain it's specific to how Flash interacts with my sound set up.



Here is some error output that might be helpful:



$ cat /var/log/syslog | grep pulseaudio
Jul 30 01:40:08 mythbuntu pulseaudio[17388]: [pulseaudio] module.c: Failed to open module "module-esound-protocol-tcp": file not found
Jul 30 01:40:08 mythbuntu pulseaudio[17388]: [pulseaudio] module-gconf.c: pa_module_load() failed
Jul 30 01:40:08 mythbuntu pulseaudio[17388]: [pulseaudio] module.c: module-combine is deprecated: Please use module-combine-sink instead of module-combine!
Jul 30 01:40:08 mythbuntu pulseaudio[17388]: [pulseaudio] module-combine.c: We will now load module-combine-sink. Please make sure to remove module-combine from your configuration.
Jul 30 01:55:07 mythbuntu pulseaudio[17406]: [pulseaudio] module.c: Failed to open module "module-esound-protocol-tcp": file not found
Jul 30 01:55:07 mythbuntu pulseaudio[17406]: [pulseaudio] module-gconf.c: pa_module_load() failed
Jul 30 01:55:07 mythbuntu pulseaudio[17406]: [pulseaudio] module.c: module-combine is deprecated: Please use module-combine-sink instead of module-combine!
Jul 30 01:55:07 mythbuntu pulseaudio[17406]: [pulseaudio] module-combine.c: We will now load module-combine-sink. Please make sure to remove module-combine from your configuration.
Jul 30 02:04:43 mythbuntu pulseaudio[17433]: [pulseaudio] module.c: Failed to open module "module-esound-protocol-tcp": file not found
Jul 30 02:04:43 mythbuntu pulseaudio[17433]: [pulseaudio] module-gconf.c: pa_module_load() failed
Jul 30 02:04:43 mythbuntu pulseaudio[17433]: [pulseaudio] module.c: module-combine is deprecated: Please use module-combine-sink instead of module-combine!
Jul 30 02:04:43 mythbuntu pulseaudio[17433]: [pulseaudio] module-combine.c: We will now load module-combine-sink. Please make sure to remove module-combine from your configuration.


Here is the output from pactl list from the server (computer with speakers).



Here is the output from pactl list from the client.


More From » sound

 Answers
5

Preface



I was able to replicate Dave's issue in experiments, and they lead me to believe that Flash is somehow sending the sound to PulseAudio in such a way that it creates a lot of network traffic (think lots of tiny packets, not bandwidth); this overwhelms the network "tunnel" PulseAudio has created, i.e. you have



Youtube => [PA-client => network => PA-server] => speakers


I could solve the issue by putting both the client and server on their own virtual network, giving them effectively infinitely fast connectivity (10 Gbits/sec) between them; obviously, that doesn't work for real-world networks :)



So, a bit of googling and this post and this one gave me the idea of dropping the tunnel (middleman, as Dave aptly put it), and having the client talk directly to the server, i.e.



Youtube => network => PA-server => speakers


And that worked for me; Flash videos/sound play flawlessly.



Let's try it!



This assumes your client-server are on a local network (router, etc.)




  1. Preliminary: On the client machine, if you have an existing setup, open paprefs and uncheck everything; then kill PulseAudio to be sure.


  2. On the server machine (i.e., the one with the speakers), start PA Preferences (paprefs) and set it up as follows:



    enter image description here
    enter image description here
    enter image description here
    enter image description here




    • Then close it, and kill PulseAudio in a terminal as shown, wait, and check that it is now listening on port 4713:



    enter image description here




    • If you don't see it, open paprefs again and check the remaining boxes in the Network Access and Network Server tabs (they don't hurt)


    • Make sure you know the server's IP address - use ifconfig, etc. We'll use 192.168.0.4 in our example.



  3. On the client machine, open a terminal, and test our direct connection first, with a speech sample WAV (replace 192.168... with your server IP!)




    wget http://www.signalogic.com/melp/EngSamples/Orig/female.wav
    paplay --server=192.168.0.4:4713 female.wav



    • Abort with Ctrl-C if it works, it can get boring ;)




Now, close all running browser instances, and then start it (assuming Firefox here with the following syntax):



PULSE_SERVER=192.168.0.4:4713 firefox &



  • Replace 192... with the appropriate IP for your server!


  • In that Firefox instance, open up Youtube (or whichever Flash video site), and try playing videos back --- fingers crossed, it should work without stuttering/pausing!




Make it stick



If you want to make this fix apply to all programs instead of having to put PULSE_SERVER=192.168.0.4:4713 in front of every command, edit /etc/environment on the client and add PULSE_SERVER=192.168.0.4:4713 on a new line at the end of the file. Also add a line break at the end.



This will make all sound on the client go to the Pulseaudio server, so be sure that's what you want before making this edit to your /etc/environment file.



Reboot, and enjoy a smooooooth audio experience. ;)


[#39289] Monday, February 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cocal

Total Points: 236
Total Questions: 111
Total Answers: 123

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
;