Pulseaudio crash with A2DP, Bug #641

April 25th, 2014 § 1 comment

This is just a milemarker for those who may also be having an issue similar to what I experienced lately.  Hopefully the below summary is useful to somebody.

Problem #1: Bluetooth speakers connect to Ubuntu Linux just fine, but audio quality is crap.

Solution #1: Some BT speakers somehow get auto-identified as bluetooth headsets (aka for making phone calls) instead of speakers (primarily for music), and thus use a lower quality bluetooth profile.   Pulseaudio (On ubuntu in the sound settings -> hardware tab) allows you to easily toggle between profiles.

Problem #2: Switching between the standard profile and the A2DP higher quality profile causes pulseaudio to crash.  The crash output is something along the lines of:

E: sink.c: Assertion 'pa_frame_aligned(length, &s->sample_spec)' failed at
 pulsecore/sink.c:939, function pa_sink_render_full(). Aborting.

Semi-Solution #2: I don’t know of any proper solutions to the problem as of yet.  Googling gets you to to places like this,  http://comments.gmane.org/gmane.comp.audio.pulseaudio.bugs/2317 which only suggest a workaround of changing the default-sample-channel setting in daemon.conf to 2 instead of the default of 6.  This fix worked for me (I only have 2 BT speakers), but obviously may be problematic for more complicated setups.

I haven’t tried using a more modern build of Pulseaudio/Pulseaudio modules yet, totally plausible that its fixed in trunk.  It’s not exactly trivial to get a fully updated version of Pulse in a 12.04 Ubuntu LTS release, however.  For now, it’s working so I’ll save poking that bear for another time.