Driver mmap kernel memory

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

 



Hi,

I have a 16 bit alsa driver that allocates kernel memory, uses
SNDRV_DMA_TYPE_CONTINUOUS, snd_dma_continuous_data(GFP_KERNEL), and
specifies MMAP | MMAP_VALID et.al. The idea is that user space writes
into this mmapped memory, and from the kernel I send the data to the
sound device. 

For testing, I've modified this driver to check the values in the buffer
to be increasing 1, 2, 3, etc.. and written a test program that opens
alsa and writes these values in a buffer using snd_pcm_writei.

I observe that some samples are from the previous iteration in the
buffer, but the surrounding samples are ok. For example with 2000 frames
buffer size, period size 500, then in the third iteration I read 2000,
4001, 4002, ... instead of 4000, 4001, 4002, ...

Memory test ran ok, so that's not the problem, and also linux is running
stable.

The rate is 8 khz, and I'm not getting alsa underruns.

Has anyone seen this behaviour before, and how to fix it ? Or, any hints
how to reproduce the alsa mmap behaviour in a smaller software stack ?

Thanks in advance,

Micha

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux