From cbda18d165d1ccf8ab3b503260acd4960911bf5d Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 9 Feb 2014 12:04:11 +0100 Subject: oss: use native-endian format, so it works on big endian CPUs tested on i386 and mips (openwrt): --- System info: --- Machine: mips/linux Version: 0.4.10 (libre v0.4.7) Build: 32-bit big endian Kernel: Linux OpenWrt 3.3.8 #1 Sat Mar 23 16:49:30 UTC 2013 Uptime: 1 sec Started: Thu Feb 6 19:21:28 2014 Compiler: 4.6.4 --- modules/oss/oss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/oss/oss.c b/modules/oss/oss.c index 3acd9df..d7bff51 100644 --- a/modules/oss/oss.c +++ b/modules/oss/oss.c @@ -92,7 +92,7 @@ static int set_fragment(int fd, uint32_t sampc) static int oss_reset(int fd, uint32_t srate, uint8_t ch, int sampc, int nonblock) { - int format = AFMT_S16_LE; + int format = AFMT_S16_NE; /* native endian */ int speed = srate; int channels = ch; int blocksize = 0; @@ -118,8 +118,8 @@ static int oss_reset(int fd, uint32_t srate, uint8_t ch, int sampc, (void)ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blocksize); - info("oss: init: %u bit %d Hz %d ch, blocksize=%d\n", - format, speed, channels, blocksize); + info("oss: init: %d Hz %d ch, blocksize=%d\n", + speed, channels, blocksize); return 0; } -- cgit v1.2.3