[MPlayer-dev-eng] [PATCH] Fix playback of 24-bit audio when sndio ao is used
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Mar 11 20:51:06 CET 2014
On Tue, Mar 11, 2014 at 08:19:18PM +0100, Alexandre Ratchov wrote:
> On Tue, Mar 11, 2014 at 07:52:34PM +0100, Reimar Döffinger wrote:
> > On Thu, Feb 27, 2014 at 11:14:44PM +0100, Alexandre Ratchov wrote:
> > > On Thu, Feb 27, 2014 at 12:19:53AM -0500, Brad Smith wrote:
> > > > Here is a diff from Alexandre Ratchov to fix 24-bit audio with the sndio
> > > > backend. Without the diff playing 24-bit audio results in white noise.
> > > >
> > >
> > > Thanks, Brad. FWIW, the bug is that we don't set and check par.msb,
> > > and we end-up with the wrong encoding (ex. 24 bits lsb-aligned in
> > > 32-bit words, while mplayer assumes 32-bit samples).
> > >
> > > The diff adds the correct par.msb setting and the necessary checks,
> > > and enables 24-bit in 3-byte packets encodings.
> >
> > I missed this before, but I am not sure this explanation is correct.
> > Why is setting par.bps not enough?
>
> par.bits must be set to change the encoding, par.bps is optional.
>
> > The problem looked to me like
> > for bits == 24 sndio will default to bps == 4 instead of 3.
>
> Exactly. And in this case the 24-bits may end up LSB-aligned, so
> the format is not equivalent to 32-bit (with LSB discarded).
So setting par.bps = 3; does not work for convincing sndio
to take a real 24 bit format (3 byte/sample) as input?
The documentation to sounded like it would, as long as
you explicitly set par.bps to 3.
Either way I committed the patch so it should at least be
working, I just prefer to also understand the details.
More information about the MPlayer-dev-eng
mailing list