Firefox has ALSA/Pulse Audio issues when playing flash video

Bug #356687 reported by schwascore on 2009-04-06
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Undecided
Unassigned

Bug Description

1) Ubuntu 9.04 Development Branch
2) Firefox 3.0.8+nobinonly-0ubuntu2
3) Expected: Flash videos play with proper audio.
4) What happens: Flash video plays the first 5-10 seconds and then the browser crashes. This problem occurs on multiple websites (hulu, bbc, etc.). Here is the terminal output from a crash:

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create stream: Invalid argument

E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
firefox: pulse.c:200: pulse_new: Assertion `p->context' failed.
Aborted (core dumped)

Alexander Sack (asac) on 2009-04-14
affects: firefox-3.0 (Ubuntu) → flashplugin-nonfree (Ubuntu)
Alexander Sack (asac) wrote :

guess pulseaudio is better target.

affects: flashplugin-nonfree (Ubuntu) → pulseaudio (Ubuntu)
Download full text (5.4 KiB)

Can you try the pulseaudio package in my ppa along with the test kernel at
http://kernel.ubuntu.com/~dtchen/ ?

On Apr 15, 2009 12:08 PM, "Launchpad Bug Tracker" <email address hidden>
wrote:

You have been subscribed to a public bug:

1) Ubuntu 9.04 Development Branch
2) Firefox 3.0.8+nobinonly-0ubuntu2
3) Expected: Flash videos play with proper audio.
4) What happens: Flash video plays the first 5-10 seconds and then the
browser crashes. This problem occurs on multiple websites (hulu, bbc,
etc.). Here is the terminal output from a crash:

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create
stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create
stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create
stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create
stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create
stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create
stream: Invalid argument

ALSA lib pcm_pulse.c:626:(pulse_prepare) PulseAudio: Unable to create
stream: Invalid argument

E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: sh...

Read more...

Joris Slob (jorisslob-gmail) wrote :

I ran into the same problem/bug. I have no good knowledge about custom kernels and such. I don't suppose there is an easier workaround?

David Dean (dave-dean) wrote :

I fixed this on my computer by:

sudo aptitude remove flashplugin-nonfree
sudo aptitude remove flashplugin-installer
sudo aptitude install adobe-flashplugin

And now I can watch the whale video again (http://www.youtube.com/watch?v=ZdVHZwI8pcA), and order is restored to the universe.

yegor (yegor) wrote :

David's fix works for me.

Joris Slob (jorisslob-gmail) wrote :

I didn't find adobe-flashplugin in my repositories,
but just removing the flashplugin-nonfree and then using aptitude to install flashplugin-nonfree again worked for me.

Helge Stenström (h-stenstrom) wrote :

I'm affected by the bug, using Ubuntu 9.04 and Firefox 3.0.10. adobe-flashplugin is not in my repositories. Where is it?

 I don't have any *flashplugin* package installed (yet), still I can play flash, until Firefox crashes after 2-3 seconds. How does that work? The messages in the terminal from where Firefox is started are similar to those of the original poster.

Helge Stenström (h-stenstrom) wrote :

Related to this bug: Something in Konqueror crashes when I play Youtube videos. After 3 seconds of video, the flash parts of the screen go blank. After a while, there is a window saying

A Fatal Error Occurred
The application nspluginviewer (nspluginviewer) crashed and caused the signal 6 (SIGABRT).
Please help us improve the software you use by filing a report at http://bugs.kde.org. Useful details include how to reproduce the error, documents that were loaded, etc

This is surely related to the Firefox problem, but I'm not sure how.

Helge Stenström (h-stenstrom) wrote :

It seems to me, that playing flash video (youtube) is handled by $HOME/.mozilla/plugins/libflashplayer.so. This file is quite old (from June 2007), while the problems began with Ubuntu 9.04. My conclusion is that installation of flashplugin-installer might be a workaround, but not a solution of the root cause.

I think I remember some problems related to pulseaudio when I tried out Amarok (music player). I can't confirm right now, because Amarok has no setting of it's own that selects pulseaudio or some other mechanism. But I supports that this problem is related to pulseaudio.

Helge Stenström (h-stenstrom) wrote :

Sorry, I didn't see that this bug was already attached to pulseaudio. I thought it was attached to Firefox.

Helge Stenström (h-stenstrom) wrote :

There is a very similar bug report for RedHat at https://bugzilla.redhat.com/show_bug.cgi?id=438277#c8, but it's from October 2008, and it's marked Status: CLOSED NOTABUG. I'm not sure why.

If you have conflicting system-wide and user Flash plugins, that is not
something that Firefox or PulseAudio could help resolve. User plugins are
always honoured preferentially.

On May 8, 2009 3:40 PM, "Helge Stenström" <email address hidden> wrote:

It seems to me, that playing flash video (youtube) is handled by
$HOME/.mozilla/plugins/libflashplayer.so. This file is quite old (from
June 2007), while the problems began with Ubuntu 9.04. My conclusion is
that installation of flashplugin-installer might be a workaround, but
not a solution of the root cause.

I think I remember some problems related to pulseaudio when I tried out
Amarok (music player). I can't confirm right now, because Amarok has no
setting of it's own that selects pulseaudio or some other mechanism. But
I supports that this problem is related to pulseaudio.

-- Firefox has ALSA/Pulse Audio issues when playing flash video
https://bugs.launchpad.net/bugs/35...

Helge Stenström (h-stenstrom) wrote :

There is a function pulse_prepare in the file pcm_pulse.c in ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-1.0.18.tar.bz2. I'm not sure which Ubuntu package that corresponds to, but it might be libasound2-plugins or libasound2.
Could the bug be in that package, rather than pulseaudio?

Some lines from the source.
err =
     pulse_wait_stream_state(pcm->p, pcm->stream, PA_STREAM_READY);
 if (err < 0) {
  SNDERR("PulseAudio: Unable to create stream: %s\n", pa_strerror(pa_context_errno(pcm->p->context)));
  pa_stream_unref(pcm->stream);
  pcm->stream = NULL;
  goto finish;
 }

The function pulse_wait_stream_state is defined in pulse.c in the same package.
It uses the function pulse_check_connection(), which is defined in the same file, and if that function succeeds, pa_threaded_mainloop_wait() is called, but I don't think that happens.

My understanding of C ends there, and i was unable to see where Alsa called pulseaudio. Hope this helps someone.

The file shm.c could be a part of the packate tendra, which a free C/C++ compiler built around the TDF/ANDF format
which provides strict conformance checks for a range of APIs. Among those currently supported are ANSI and ISO C, POSIX 1 & 2, System V, Unix95, XPG3 and XPG4.
It doesn't sound relevant to the bug.

graabein (kyler2k) wrote :

I am also experiencing this bug as described in the op.

Patrice Lachance (bibiz99944x) wrote :

I had this problem too with Ubuntu 9.04 x64 and Firefox 3.5, downloaded from mozilla.com, but not with Firefox 3.0.x shipped with Jaunty.

Previously mentioned solutions haven't worked for me but I solved the problem by replacing $HOME/.mozilla/plugins/libflashplayer.so with a symbolic link to /usr/lib/flashplugin-installer/libflashplayer.so.

cd $HOME/.mozilla/plugins
mv libflashplayer.so libflashplayer.so.bak
ln -s /usr/lib/flashplugin-installer/libflashplayer.so

Lennart says that he's stopped the assert from being called - see http://pulseaudio.org/ticket/595

He says that there is still something "leaking ALSA snd_pcm_t objects".

This was reported in https://bugs.launchpad.net/pulseaudio/+bug/371147 and I later lodged a bug against pulseaudio - it's the ALSA plugin that's causing this issue.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.