Broken sound?

Paul Mackerras paulus at cs.anu.edu.au
Fri Jul 16 10:57:48 EST 1999


Joseph Palani Garcia <jpgarcia at execpc.com> wrote:

> this is a known endian problem.  ppc archetecure is big endian, while most
> other linux-running platforms are little endian.  recent setups, like R5
> implement sound as little endian.  not everyone has caught up with this

Not so.  The kernel driver can handle either big-endian or
little-endian 16-bit data.  The default is 8-bit data, though, for
which endianness doesn't matter.

The AFMT_S16_NE symbol, which says what the native endianness is, is
defined to be the same as AFMT_S16_BE on big-endian platforms like the
PPC.  There is a potential problem though because the
linux/soundcard.h include file checks for the existence of the symbol
`PPC' (among others) to test whether the platform is big-endian.  If
you compile your program with the -ansi switch to gcc, it defines
__PPC__ and __PPC but not PPC so then you get AFMT_S16_NE defined to
be equal to AFMT_S16_LE. :-(

Paul.

[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]





More information about the Linuxppc-dev mailing list