[LAU] Round 6: [was Re: Report: Pulse Audio vs Jack on Fedora 11]

Patrick Shirkey pshirkey at boosthardware.com
Sat Aug 8 02:15:45 EDT 2009


For this round I have decided to work on determining the audio stability 
of the two systems running together with a broad test suite of desktop 
apps that a normal user might use on a daily basis.

In qjackctl l have added the command "pulseaudio -k" to the "run before 
starting" config option and the command to restart "pulseaudio -D -nF 
~/jackd.pa" to the "run after starting" config option.

(Since starting this round I have also run pulseaudio as a jack client 
overnight with no load. It was still connected in the morning so that is 
a good sign.)

The jackd.pa script was posted Thursday in round 3.


PA 0.9.16 will happily go down when told to with "pulseaudio -k"
PA will restart and load the jack-sink/source modules
I can play an audio file with totem->PA->jack while also playing a track 
with alsaplayer->jack.


I have found that PA doesn't last for long while playing audio. While 
playing totem it will dropout after about 3 - 5 minutes then PA will go 
down. Disconnecting alsaplayer from jack that can also bring down PA. So 
far no problems with youtube/libflashplayer(64) but I haven't tested it 
for more than a minute as it is the last thing I have got working 
through PA.




+++++++++++++++
RESULTS - Round 6
+++++++++++++++


Winners

Pulse. Managed to take out Jack and the alsa drivers and still able to 
be used afterwards without a reboot.

Jack. Survived repeated possible serious threats from pulse instability. 
Although eventually taken out by alsa drivers. Was able to come back up 
without a reboot.

libflashplayer (64bit). After linking the three alsa-pulse libraries 
from /usr/lib64/alsa-lib to /usr/lib/alsa-lib I can play flash over 
pulseaudio. Would like to get libflashplayer to use /usr/lib64/ as the 
path but it seems to be hardcoded to /usr/lib/.


Loosers

Firefox. Quite a long process to figure out how to get the flash plugin 
working through pulse audio. No matter what I do I can't get the 
realplayer plugins to play through pulseaudio. That means if I want to 
look at a webpage while I have some background music running I won't 
hear any sounds on it. It also means that if I am listening to a radio 
stream I won't hear my system sounds. It also means I have to kill 
firefox if I want to start jack.

Skype. Still can't get it to play audio through pulse. Case made even 
less likely now that I have linked the 64 bit libs to get libflashplayer 
to work. What is so hard about linking to /usr/lib64/ that the adobe 
developers have decided not to use that method?


++++++++++++++++++++++++++++++++++++++++++++++++

                                                TESTS
                         (included here as a web resource)

++++++++++++++++++++++++++++++++++++++++++++++++


- I would like to try another app instead of totem so I try to use 
firefox and stream some audio off the web with a flash/realplayer based 
radio (BBC - Benji B). Unfortunately this version of firefox 3.5.2 wants 
to use alsa directly. I try to find the firefoxrc file to add a hook for 
sound playback but cannot. I decide to make my own ".mozilla/firefox/rc" 
and add the following line:

FIREFOX_DSP="padsp"


- Now I find that after pulse last went down it has now left a stale 
connection in the jack system. I cannot restart pulseaudio. Alsaplayer 
is still playing. It's been about 30 minutes of playback now. I decide 
to restart jack. Now I can't restart. It looks like the drivers have 
been fsckd.

I kill the alsa system. Have to run this a couple of times to get things 
to fully die.

/etc/init.d/alsasound stop

Then restart with "modprobe snd-hda-intel"

Now I restart jack by pressing the start button in qjcakctl which runs 
the srcipts as described above. I see only the system input channels in 
the connections window. Looks like the alsa drivers have had a rough 
time with the last take down.

And I see this in the messages window.

===================================================

start
poll on 5 fd's

client event poll on 14 for
qjackctl starts at 2430521278

back from client event poll
after 78 usecs

server thread back from poll

marking client PulseAudio
JACK Source with SOCKET error state = Not triggered errors = 0

trying to lock graph to
remove 1 problems

we have problem clients
(problems = 1

++ Removing failed clients ...

client alsa_pcm error status 0

client qjackctl error status 0

client PulseAudio JACK Source
error status 10000000

removing failed client
PulseAudio JACK Source state = Not triggered errors = 10000000

removing client "PulseAudio
JACK Source"

removing client "PulseAudio
JACK Source" from the processing chain

+++ deactivate PulseAudio
JACK Source

++ jack_sort_graph

++ jack_rechain_graph():

+++ client is now alsa_pcm
active ? 1

+++ client is now qjackctl
active ? 1

client qjackctl: start_fd=7,
execution_order=0.

client event poll on 14 for
qjackctl starts at 2430521834

back from client event poll
after 37 usecs

client qjackctl: wait_fd=9,
execution_order=1 (last client).

-- jack_rechain_graph()

-- jack_sort_graph

-- Removing failed clients ...

after removing clients,
problems = 0

start poll on 4 fd's

15:04:01.839 Post-startup script
terminated with exit status=256.

15:04:01.840 JACK connection change.

15:04:01.841 XRUN callback (1
skipped).

load = 3.9610 max usecs:
1672.000, spare = 19661.000

load = 2.3860 max usecs:
173.000, spare = 21160.000

load = 1.5750 max usecs:
163.000, spare = 21170.000


===================================================

Looks like a serious pulseaudio problem this time. Maybe I have to reboot?

I stop jack and run "pulseaudio -D" instead and it works. I check the 
audio input and output tabs. There is no alsa input but the output is there.

Conflicting reports from pulse and jack about the device i/o's is not a 
good thing. I kill the sound drivers again, reload the alsa driver with 
"modprobe snd-hda-intel" and start pulse with "pulseaudio -D".

Things are back to normal in pulse now. Totem will play but no there's 
no sound in my speakers. I start alsamixer and notice that the channel 
for the headphone jack is set to zero and muted. This was not like that 
before I took the alsa drivers out. Seems strange the system did not 
save that setting seperately. All the other settings are the same as 
previously so it must be to do with the irq for the headphone jack not 
being triggered or somthing like that. I select the headphone channel, 
press "m" to unmute and turn up the volume and find that the track totem 
is playing can now be heard.

Still no audio from the BBC through firefox+realplayer. Bummer. I 
restart firefox and can play the stream but now totem will not play so 
my settings in the rc file have not worked.

- I decide to test jack again. I stop the bbc stream and close the popup 
window. I start jack but it cannot start. I close totem even though it 
is not playing and still cannot start. I kill firefox and now I can 
start jack.

This time round the alsa i/o's are back and pulse has joined the party 
again. Looks like there is a firefox issue with letting go of the sound 
device after being used that is probably a major source of headaches and 
frustration for a lot of people.

I would like to know how to make sure the firefox uses pulseaudio seeing 
as the only suggestion I could find didn't work.

I try putting the rc file in /etc/fireforx/firefoxrc and restarting 
firefox. Firefox still doesn't show up in the "Sound Preferences" panel.

- I follow the instructions on this page:

http://pulseaudio.revolutionlinux.com/PulseAudio

and this mod to the libflashsupport:

Change line 3:
from CFLAGS=-fPIC -shared -O2 -Wall -Werror
to CFLAGS=-fPIC -shared -O2 -Wall

and rerun: make ;make install;


This is supposed to fix all the pulse issues as the 64bit version uses 
pulse natively as the default sound device and falls back to alsa if it 
can't find pulse.

Restart firefox and open up 
http://www.youtube.com/watch?v=EfSwEaeOsJE&feature=channel

No sound but video plays...

Open up the BBC radio and stream refuses to start playing. No doubt 
waiting for the alsa device to become available.

try reinstalling:

yum install alsa-plugins-pulseaudio.i586

Same error messages as skype while playing youtube videos:

socket(): Address family not supported by protocol
ALSA lib pulse.c:272:(pulse_connect) PulseAudio: Unable to connect: 
Connection refused

- At this point I have to concede that it is looking grim for being able 
to use Pulse as the catch all for desktop software and running Pulse 
through jack. So I ask on the pulseaudio list for some ideas on how to 
get around it.

The answer is that I have to compile and install a 32 bit version of 
pulse libs on my 64 bit system. Lovely. I try installing the 32 bit 
packages from Fedora base but that procedure creates a problem with the 
flash plugin as now it will only report:

ALSA lib pulse.c:272:(pulse_connect) PulseAudio: Unable to connect: 
Connection refused

I'm not even sure why the the 64 bit version of libflashplayer is 
looking for the 32 bit pulse libs.

As a possible fix I add this to my ~/.asoundrc

pcm.!dmix {
     type pulse
}

Restart firefox. No sound from the libflashplayer-64 plugin through 
pulse. Same error as above. Cannot find 32 bit library. Decide to link 
the 64 bit libs to the 32 bit folder. This time I link all the pulse 
libs instead of the one reported as missing.

ln /usr/lib64/alsa-lib/libasound_module_*_pulse.so /usr/lib/alsa-lib/

Restart firefox and flash is not complaining about a missing library any 
more. Check "Sound Preferences" to see if teh stream is being played 
through pulse and I can see the "ALSA plug-in [npviewer.bin]". Volume is 
set to 100% but still cannot hear any sound.

Test alsaplayer with jack and sound is working. So must be something 
wrong with the pulse connection. Check the output for pulse and it has 
managed to set itself to my (HDMI) outputs for some reason. I change it 
to jack-sink. Flash movie has stopped playing... Restart the video and 
Viola!!!!

The libflashplayer-64 plugin sound is now working through pulse and jack.

Full instructions have been sent for this in my previous post.

----------------
Realplayer
----------------

- I notice that this error message is being reported by firefox at startup:

LoadPlugin: failed to initialize shared library 
/opt/real/RealPlayer/mozilla/nphelix.so 
[/opt/real/RealPlayer/mozilla/nphelix.so: wrong ELF class: ELFCLASS32]

That looks like it should be easy to fix. I find a 64 bit version of the 
Helix nightly build. Dowload, untar (make sure it has it's own folder 
though), run helix.bin and ...

  ./hxplay.bin: error while loading shared libraries: libstdc++.so.5: 
cannot open shared object file: No such file or directory

I try the quick and dirty method...

ln -s /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.5

./hxplay.bin: /usr/lib64/libstdc++.so.5: version `CXXABI_1.2' not found 
(required by ./hxplay.bin)
./hxplay.bin: /usr/lib64/libstdc++.so.5: version `GLIBCPP_3.2' not found 
(required by ./hxplay.bin)

Damn. Now I need an old version of libstdc++ in order to run the lastest 
64 bit build of helix/realplayer on Fedora 11. What's even more annoying 
is the the 32 bit build of realplayer can install and run on the same 
machine. The plugin loads and runs in firefox even with the 32bit 
incompatibility error and plays audio directly to the alsa layer but not 
to the pulseaudio layer. Bizzare!

Luckily I find that there is a compatibility library:

yum install compat-libstdc++-33

Now I can run the helix installer which works very well. However now the 
player doesn't load in the browser popup.

I also get these errors:

================
*** NSPlugin Wrapper *** ERROR: NPP_DestroyStream() wait for reply: 
Connection closed
*** NSPlugin Wrapper *** 
WARNING:(../src/npw-wrapper.c:2123):invoke_NPP_URLNotify: assertion 
failed: (rpc_method_invoke_possible(plugin->connection))
*** NSPlugin Wrapper *** 
WARNING:(../src/npw-wrapper.c:1858):invoke_NPP_Destroy: assertion 
failed: (rpc_method_invoke_possible(plugin->connection))
*** NSPlugin Wrapper *** ERROR: NPObject 0x7f9931e7d4d0 is no longer valid!
*** NSPlugin Wrapper *** ERROR: NPP_DestroyStream() wait for reply: 
Connection closed
*** NSPlugin Wrapper *** 
WARNING:(../src/npw-wrapper.c:2123):invoke_NPP_URLNotify: assertion 
failed: (rpc_method_invoke_possible(plugin->connection))
*** NSPlugin Wrapper *** 
WARNING:(../src/npw-wrapper.c:1977):invoke_NPP_GetValue: assertion 
failed: (rpc_method_invoke_possible(plugin->connection))
================

  I try to uninstall and reinstall but it is very difficult to uninstall 
being that there is no uninstall script and the script that is provided 
if you download directly from the last entry in the helix Faq doesn't 
actually work because as well as deleting the player from the system you 
also need to :

rm -rf ~/.config/helix/hxplayerrc

Reinstall helix
export PATH=$PATH:/opt/real/helix
restart firefox
load up bbc player

Now I get this error from firefox.

*** NSPlugin Wrapper *** ERROR: NPP_DestroyStream() wait for reply: 
Connection closed
*** NSPlugin Wrapper *** 
WARNING:(../src/npw-wrapper.c:2123):invoke_NPP_URLNotify: assertion 
failed: (rpc_method_invoke_possible(plugin->connection))















Patrick Shirkey
Boost Hardware Ltd


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linuxaudio.org/pipermail/linux-audio-user/attachments/20090808/0cdbf736/attachment.htm 


More information about the Linux-audio-user mailing list