[alsa-devel] Recorded frames sign 'error' after switchign to EABI kernel?

Edwin van der Horst edwinvdh at gmail.com
Tue Jan 13 10:35:28 CET 2009

Hello all,

I'm using the ALSA API for quite some time now in my application,
all worked fine until I switched to EABI kernel/compiler.

My application reads signed 16 bit frames (S16_LE) using readi call:

long FCAudio::readRecordedPCM(char * dest,int len)
    frames  = snd_pcm_readi(recHandle, dest, (len / asRec.bytesPS));
//read data hw

This worked fine on the non EABi kernel.
After I switched to the EABI enabled kernel and compiler, I heard
massive 'hiss/noise' on recorded audio.
I took a dump of the recorded frames, and this came out:

sample data:
| ff |  58 |  ff | e1 | ff | e2 | 0 | 0 | 0 | 48 | ff | e0 | ff | e3 |
ff | e1 | 0 | 13 | ff | ca | ff | ae | 0 | 3 | ff | ee | ff | be|

at first this seemed like correct data to me , but on a closer look
the MSB(yte) is always 0x00 or 0xff
I can't figure out why this is: I'm expecting 2 bytes of sample data,
and in the current case I get 1 byte of correct data, and the other
byte is only used for sign indication (0x00 or 0xFF).

I can't figure out why this is, can anyone point me in the right direction?
It's worth noting that arecord and aplay both work correctly, and
using snd_pcm_dump(); I get settings as expedted and are correct.

Thanks in advance...

Edwin van der Horst

More information about the Alsa-devel mailing list