pulseaudio crashes on resampler.c:1230,

Bug #885347 reported by Retromingent
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Ubuntu 11.10 (upgraded from 11.04). After upgrade: Pulseaudio crashes on error below (have verbose output from pulseaudio) when certain HTML embedded audio files are played in Chrome, Firefox or Opera. This affects entire sound system. For example, playing Amarok song then going to browser and going to site that plays music (www.screvs.com), pulseaudio then crashes and all sound including Amarok stops. Uninstalled pulseaudio and there are no more problems. Reinstalled pulseaudio and problems came back.

D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] source.c: Processing rewind...
E: [alsa-sink] resampler.c: Assertion '(unsigned) data.input_frames_used == in_n_frames' failed at pulsecore/resampler.c:1230, function libsamplerate_resample(). Aborting.

Revision history for this message
Retromingent (ray-rwalk2730) wrote :
Revision history for this message
Retromingent (ray-rwalk2730) wrote :

The error in pulseaudio is from a failed assert for the in_n_frames check against input_frames_used:
                     pa_assert((unsigned) data.input_frames_used == in_n_frames);

I ran pulseaudio through GDB and re-created error. Here are the exact steps I took to do that:
Ubuntu 11.10
pulseaudio 1.0

1. Uninstalled pulseaudio and installed pulseaudio-dbg so I'd have symbols
2. Started pulseaudio under GDB
3. Re-created error:
         a) Started Chrome browser (version 15)
         b) Went to website that has HTML <embed> audio track (*not* HTML 5)
         c) pulseaudio crashed as expected and reported in this ticket

Here is the GDB back trace at the time of this error:

(gdb) bt
#0 0x00007ffff66483a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff664bb0b in __GI_abort () at abort.c:92
#2 0x00007ffff7b7bba5 in libsamplerate_resample (r=0x7f1610, input=0x7f1758, in_n_frames=441, output=0x7f1788, out_n_frames=0x7fffee01f3fc) at pulsecore/resampler.c:1214
#3 0x00007ffff7b7e0b9 in resample (input=0x7f1758, r=0x7f1610) at pulsecore/resampler.c:1137
#4 pa_resampler_run (r=0x7f1610, in=0x7fffee01f550, out=0x7fffee01f570) at pulsecore/resampler.c:1193
#5 0x00007ffff7b8ac91 in pa_sink_input_peek (i=0x7ece10, slength=17024, chunk=0x7fffee01f670, volume=0x7fffee01f688) at pulsecore/sink-input.c:875
#6 0x00007ffff7b911aa in fill_mix_info (s=0x68b5f0, length=0x7fffee021d18, info=0x7fffee01f670, maxinfo=32) at pulsecore/sink.c:913
#7 0x00007ffff7b939d7 in pa_sink_render_into (s=0x68b5f0, target=0x7fffee021d70) at pulsecore/sink.c:1152
#8 0x00007ffff7b93f29 in pa_sink_render_into_full (s=0x68b5f0, target=0x7fffee021e00) at pulsecore/sink.c:1236
#9 0x00007fffee044770 in mmap_write (on_timeout=false, polled=false, sleep_usec=<synthetic pointer>, u=0x6f0b10) at modules/alsa/alsa-sink.c:627
#10 thread_func (userdata=0x6f0b10) at modules/alsa/alsa-sink.c:1639
#11 0x00007ffff7931c78 in ?? () from /usr/lib/x86_64-linux-gnu/libpulsecommon-1.0.so
#12 0x00007ffff7048efc in start_thread (arg=0x7fffee022700) at pthread_create.c:304
#13 0x00007ffff66f389d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#14 0x0000000000000000 in ?? ()

Revision history for this message
Retromingent (ray-rwalk2730) wrote :

Some more GDB output from working with mkbosmans on freenode #pusleaudio:

gdb) select-frame 2
(gdb) p in_n_frames
$1 = 441
(gdb) p data.input_frames_used
$2 = 440
(gdb) p r->i_ss.rate
$5 = 44100
(gdb) p r->o_ss.rate
$6 = 48000
(gdb) p out_n_frames
$7 = (unsigned int *) 0x7fffee01f3fc
(gdb) p data.output_frames_gen
$8 = 480
(gdb) p out_n_frames->
A syntax error in expression, near `'.
(gdb) p *out_n_frames
$9 = 608
(gdb)

"mkbosmans 01:00:31 PM
hey, that's weird. So pulse asks for 441 samples to be converted. libsamplerate produces 480 output samples (which is correct), but reports that it only needed 440 input samples (which seems one fewer than expected)
Retromingent, I don't think I have an immediate resolution to this. Can you please file a bug report or send an email to the mailing list with the backtrace and the values of the variables you just discovered? That way we don't loose track of this, and perhaps I'll look into it at some later time."

Revision history for this message
Retromingent (ray-rwalk2730) wrote :

Found that this bug only occurs when the resample method is src-linear (set in /etc/pulse/daemon.conf). Other resample methods do not fail on this assert.

Revision history for this message
Maarten Bosmans (mkbosmans) wrote :

I sent a message to the libsamplerate mailing list, asking whether the assert in pulseaudio is correct to begin with.

Retromingent, can you post the libsamplerate version you're using?

Changed in pulseaudio (Ubuntu):
assignee: nobody → Maarten Bosmans (mkbosmans)
status: New → In Progress
Revision history for this message
Retromingent (ray-rwalk2730) wrote :

Sure, but I don't see the libsamplerate version announced in syslog (even with verbose) and I don't see a parameter for it in daemon.conf so I'm not sure how to obtain it. But it would the one with pulseaudio 1.0. Let me know.

Revision history for this message
Maarten Bosmans (mkbosmans) wrote : Re: [Bug 885347] Re: pulseaudio crashes on resampler.c:1230,

pulseaudio and libsamplerate are separate programs/libraries. So
there's not a fixed version correlation. It depends on what version
Ubuntu has packaged.

Use: aptitude show libsamplerate0

Revision history for this message
Retromingent (ray-rwalk2730) wrote :

I see. Good to know. Thank you. Here it is:

Package: libsamplerate0
State: installed
Automatically installed: no
Version: 0.1.7-3ubuntu1
Priority: optional
Section: libs
Maintainer: Ubuntu Developers <email address hidden>
Uncompressed Size: 1,556 k
Depends: libc6 (>= 2.2.5)
PreDepends: multiarch-support
Breaks: libsamplerate0 (!= 0.1.7-3ubuntu1)
Replaces: libsamplerate0 (< 0.1.7-3ubuntu1)
Description: Audio sample rate conversion library
 libsamplerate (aka Secret Rabbit Code) is a library for audio rate conversion.

 libsamplerate currently provides three different sample rate conversion algorithms; zero order hold, linear interpolation and FIR filter interpolation (using filters derived from the mathematical
 SINC function). The first two algorithms (zero order hold and linear) are included for completeness and are not recommended for any application where high quality sample rate conversion is
 required. For the FIR/Sinc algorithm, three converters are provided; SRC_SINC_FASTEST, SRC_SINC_MEDIUM_QUALITY and SRC_SINC_BEST_QUALITY to allow a trade off between conversion speed and
 conversion quality.

 libsamplerate is capable of downsampling to 1/256 of the original sample rate and upsampling to 256 times the original sample rate. It is also capable of time varying conversions for vary speed
 effects and synchronising of two unlocked sample rates.
Homepage: http://www.mega-nerd.com/SRC/

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu.
Ubuntu 11.10 (oneiric) reached end-of-life on May 9, 2013.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test.

Changed in pulseaudio (Ubuntu):
assignee: Maarten Bosmans (mkbosmans) → nobody
status: In Progress → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for pulseaudio (Ubuntu) because there has been no activity for 60 days.]

Changed in pulseaudio (Ubuntu):
status: Incomplete → Expired
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.