pcm_pulse.c:275: pulse_write: Assertion `pcm->last_size >= (size * pcm->frame_size)' failed. (Intrepid & pulseaudio_0.9.11-0ubuntu1~ppa3 - TheMuso PPA)

Bug #262326 reported by Conn O Griofa
6
Affects Status Importance Assigned to Milestone
ALSA driver
Invalid
Undecided
Unassigned
PulseAudio
Fix Released
Unknown
alsa-plugins (Ubuntu)
Invalid
Undecided
Unassigned
pulseaudio (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The pcm_pulse plugins do not work correctly *for some ALSA applications* with PulseAudio 0.9.11 from TheMuso's repository (I am using the patched version, see bug #262322). Applications with native PulseAudio support work correctly.

System: Intrepid i386 (w/latest updates) & pulseaudio 0.9.11-0ubuntu1~ppa3
Sound card: 00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

Example 1:
conn@dimension:~$ mplayer /usr/share/example-content/ubuntu\ Sax.ogg -ao pulse
<snip>
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 1.7 (01.6) of 26.0 (25.9) 0.5%
<snip>

Example 2 (asoundconf set-pulseaudio has been enabled):
conn@dimension:~$ mplayer /usr/share/example-content/ubuntu\ Sax.ogg -ao alsa
<snip>
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
mplayer: pcm_pulse.c:275: pulse_write: Assertion `pcm->last_size >= (size * pcm->frame_size)' failed.
<snip>

Expected results: both examples play sound correctly (same behaviour as 0.9.10)
Actual results: Example 1 plays correctly, while Example 2 fails to play an audio stream, with the error output above.

Edit: At first I thought that all ALSA applications suffered from this problem, but I was mistaken.

Confirmed to cause assertion failures: Skype, mplayer
Confirmed to work correctly (sound plays, no assertion failures or warnings): GStreamer ALSA backend (Totem, Rhythmbox, etc.), flashplugin-nonfree 10.0.0.569ubuntu1 without libflashsupport (not yet in Intrepid, available in my PPA).
Other: VLC using ALSA plugin (no assertion errors, listed as client in Volume Control, but it plays silence).

nullack (nullack)
Changed in alsa-plugins:
status: New → Confirmed
Conn O Griofa (psyke83)
description: updated
description: updated
Revision history for this message
Conn O Griofa (psyke83) wrote :

Luke,

I've tested the latest PulseAudio from GIT, and this issue persists - hopefully this will prevent you wasting some time ;). It seems likely the problem is (at least partially) within alsa-plugins.

You may also want to keep an eye on this thread: https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-August/002222.html

Revision history for this message
Conn O Griofa (psyke83) wrote :

I have also tested alsa-plugins 1.0.18rc2 with PulseAudio 0.9.11 and 0.9.12git - no difference.

Also related? http://www.nabble.com/-Cooker--New-pulseaudio-in-main-testing-td18686932.html

P.S. I also forgot to mention that I am using the latest kernel, so that's not the problem:

conn@dimension:~/Desktop$ uname -a
Linux dimension 2.6.27-1-generic #1 SMP Sat Aug 23 23:20:09 UTC 2008 i686 GNU/Linux

Revision history for this message
plun (plun) wrote :

plun@dunder:~$ mplayer /usr/share/example-content/ubuntu\ Sax.ogg -ao alsa
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (Family: 15, Model: 2, Stepping: 7)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /usr/share/example-content/ubuntu Sax.ogg.
[Ogg] stream 0: audio (Vorbis), -aid 0
Ogg file format detected.
==========================================================================
Forced audio codec: mad
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
mplayer: pcm_pulse.c:278: pulse_write: Assertion `pcm->last_size >= (size * pcm->frame_size)' failed.

Confirmed.

Revision history for this message
cariboo (cariboo) wrote :

I just updated to the latest kernel 2.6.27-2- and I can confirm the bug.

Revision history for this message
Luka Napotnik (luka-napotnik) wrote :

I can confirm the bug too.

Revision history for this message
Conn O Griofa (psyke83) wrote :

It seems this upstream bugs are related:

https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2601
http://pulseaudio.org/ticket/23

From trial and error, I discovered the following:

conn@dimension:~$ aplay --buffer-size=224 /usr/share/sounds/*.wav
Playing WAVE '/usr/share/sounds/card_shuffle.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
aplay: pcm_pulse.c:278: pulse_write: Assertion `pcm->last_size >= (size * pcm->frame_size)' failed.
Aborted by signal Aborted...
conn@dimension:~$

conn@dimension:~$ aplay --buffer-size=223 /usr/share/sounds/*.wav
Playing WAVE '/usr/share/sounds/card_shuffle.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
underrun!!! (at least 376125347.661 ms long)
underrun!!! (at least 186.047 ms long)
underrun!!! (at least 830.282 ms long)
underrun!!! (at least 895.334 ms long)
underrun!!! (at least 947.175 ms long)
underrun!!! (at least 14.656 ms long)
underrun!!! (at least 29.695 ms long)
^CAborted by signal Interrupt...

Using a buffer size of >223 causes assertion failures, and a buffer size of <=223 works (audio plays through PulseAudio, and despite buffer underrun warnings I hear no stutter).

The fixes on those upstream reports are already committed to our packages, so something else needs to be done.

Revision history for this message
kaij74 (kaij74) wrote :

It looks like this bug is now fixed in latest 0.9.12git.

Revision history for this message
plun (plun) wrote :

Test with mozilla-swfdec, ver 0.7.4

Loading stream: http://s.ytimg.com/yt/swf/watch-vfl53733.swf
unhandled event 19
Loading stream: http://www.youtube.com/crossdomain.xml
Loading stream: http://v20.cache.googlevideo.com/get_video?video_id=EQ-JyAGUsys&origin=dal-v127.dal.youtube.com&signature=AEEC02C9CE5A3AE48EADFAC740CC95F3F9CB9298.64E84F226C6566872D7B86222659C7C9BF525B1C&ip=85.226.33.207&ipbits=8&expire=1220654788&key=yt1&sver=2
firefox: pcm_pulse.c:278: pulse_write: Assertion `pcm->last_size >= (size * pcm->frame_size)' failed.
Aborted (core dumped)

Crashes both Firefox 3.02 and 3.1

Changed in pulseaudio:
status: New → Confirmed
Changed in pulseaudio:
status: Unknown → New
Revision history for this message
plun (plun) wrote :

Milestone 0.9.12 seems to be completed

http://www.pulseaudio.org/milestone/0.9.12

Revision history for this message
kaij74 (kaij74) wrote :

Works fine now with 0.9.12 version. No more crashes and errors in logs.

Revision history for this message
Conn O Griofa (psyke83) wrote :

I can also confirm the issue is resolved. Marking Fix Released for the pulseaudio task and Invalid for alsa-plugins.

Changed in alsa-plugins:
status: Confirmed → Invalid
Changed in pulseaudio:
status: Confirmed → Fix Released
Changed in pulseaudio:
status: New → Fix Released
Changed in alsa-driver:
status: Unknown → In Progress
Revision history for this message
dino99 (9d9) wrote :

outdated flavor, report about a newer active version if needed

Changed in alsa-driver:
importance: Unknown → Undecided
status: In Progress → New
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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