[vlc-devel] alsa output: stuttering when playing 5.1 audio

Rafaël Carré funman at videolan.org
Thu Jan 17 13:52:31 CET 2008


Le Tue, 15 Jan 2008 19:51:44 +0100,
"Matthias P. Nowak" <mpnowak at broadpark.no> a écrit :

> Hi,
> 
> Thanks for this nice player. I watched movies, but when I tried 5.1
> audio I got stuttering audio and the debug message "Alsa: broken pipe"
> or similar. And i found the fix - could some of you apply my patch?

Since I can not test alsa myself, nor do I own 5.1 hardware, I'll wait
for confirmations that the patch runs OK.

It looks fine, I checked aplay, and it has the same behaviour than
after applying your patch.

> Error description:
> VLC 0.8.6c plays audio directly to alsa (1.0.14) on Linux 2.6.23.12.
> The alsa device is the default one. An .AC3 file with audio 5.1 is
> opened and in vlc 5.1 is chosen as audio-device. Then stuttering
> occurs and an error message saying something about a broken thing
> appears.
> 
> Diagnosis:
> Turning debugging on and additional hacking reveals:
> - the buffersize is reported as of 5461 bytes, which violates
> alignment requirements for 16-bit sound.
> - as 1024*32 / 6 (number of channels) it should be 5461.333 ... 8-(
> - this seems to have caused some buffer underruns -> hence the "broken
> pipe" error message.
> 
> Fix: the patch http://paste.videolan.org/2955

The paste website added CR to the end of lines, and removed "@@" from
the beginning of the patch.

It is better if you send next patches attached to your mail, also
because paste entries can expirate.

Thanks for your help :)

> It exchanges setting the period_size and buffer_size around line 570.
> When the buffer_size is set as the last action it takes care of the 6
> channels and allocates a buffersize that is appropriate (not a power
> of 2) for all channels. It seems, when buffersize is set first, and
> then the number of channels that the alsa does not correct the
> buffersize, hence the broken number 5461.333 and the underrun.
> 
> best regards
> 
> Matthias
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel


-- 
Rafaël Carré
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080117/e58517e9/attachment.sig>


More information about the vlc-devel mailing list