[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Little-endian sound broken on TiBook/dmasound_pmac?



On Mon, May 21, 2001 at 01:38:46PM +0200, Michel Dänzer wrote:
> Daniel Kobras wrote:
> > Is 16bit little-endian sound working for anyone using dmasound_pmac? I've
> > tried with various pristine 2.4 kernels as well as benh's latest 2.4.4 an my
> > TiBook. (Awacs/Screamer Codec Mfct: 1 Rev 3 it reports.) Big-endian sound
> > output works fine. Little-endian sound on the other hand produces only
> > garbage, and I very much suspect it's the wrong endianness. /dev/sndstat
> > tells me that the soft format is correctly set to little-endian, hard format
> > is big-endian though, so I suspect the hw byte swap isn't working correctly.
> > I'd really like to know whether this problem is specific to TiBooks, or if
> > there's a general bug in the dmasound_pmac driver.
> 
> The latter.
> 
> Recent Apple sound hardware (Pismos and G4s as well AFAIK) can't do the byte
> order conversion. 

Ah, I see. Thanks for the explanation. 

> Iain Sandoe put software conversion in the dmasound driver at some point, but
> that's arguably a wrong approach. Of course it shouldn't advertise the
> ability to play little endian when in fact it can't...

In a perfect world, yes. But there are simply too many broken programs out
there that rely on AFMT_S16_LE being available without properly checking for
it. (And even if they check, few have a suitable fallback.) Most of the
programs using the old SNDCTL_DSP_SAMPLESIZE call rather than SNDCTL_DSP_SETFMT
belong into this category. They push a value of 16, and rarely realise this
implies little-endianness of the data. Stuffing a conversion layer into the
driver therefore makes tons of sense, and avoids a pile of legacy problems.

Regards,

Daniel.



Reply to: