[MPlayer-dev-eng] [PATCH] Fix playback of 24-bit audio when sndio ao is used

Alexandre Ratchov alex at caoua.org
Wed Mar 12 11:03:38 CET 2014


On Wed, Mar 12, 2014 at 08:03:19AM +0100, Reimar Döffinger wrote:
> 
> 
> On 12.03.2014, at 07:13, Alexandre Ratchov <alex at caoua.org> wrote:
> 
> > On Tue, Mar 11, 2014 at 08:51:06PM +0100, Reimar Döffinger wrote:
> >> 
> >> 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.
> > 
> > basically, the audio layer does:
> > 
> >    if (ISSET(par.bits) {
> >        if (ISSET(par.bps)) {
> >            /* set packet size */
> >        }
> >        /* set encoding */
> >    }
> > 
> > so if par.bits is not set then the code to set the encoding is not
> > triggered. It's this way because par.bps was added later; but the
> > way you thought it works makes more sense; this will probably
> > change.
> 
> I don't follow, the code you quoted matches my understanding
> (even if it's as you say maybe not ideal). We did already set
> par.bits. By just adding setting par.bps we should be getting the
> desired 24 bit format MPlayer wanted, right?

Yes, we'll request the format MPlayer wanted.

> Thus the whole par.msb-related code should just be an additional
> safety net but not normally necessary to make 24 bit audio
> working?

Yes. The check change is to handle the (very rare) case when the
device would return 24-bit LSB-packed in 4 bytes.

-- Alexandre


More information about the MPlayer-dev-eng mailing list