alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* out of sync capture samples with MMAP on MIPS
@ 2018-05-23 18:36 Daniel Danzberger
  2018-05-25 12:20 ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Danzberger @ 2018-05-23 18:36 UTC (permalink / raw)
  To: alsa-devel

I am using alsa's mmap() interface to capture audio samples on some AR71xx MIPS
devices via USB and sometimes the sampled audio sounds very disordered.

After debugging deeper into this issue I found that samples are fine in the
kernel's vmalloc'ed buffer (runtime->dma_area). But once they get accessed from
userspace via mmaped memory, the samples differ.

I wrote a module + userspace program to demonstrate the issue:
git@github.com:dddaniel/mmaptest.git

The userspace tool reads the data a couple of times with a small delay.
As you see below, after a couple of reads the data gets closer to look like in
the kernel buffer:
---
root@OpenWrt:/# mmaptest-user
mmap addr: 0x77a04000
[  760.464968] mmap page 7573000 at va 87573000
check memory ...FAIL (at byte 0)
check memory ...FAIL (at byte 96)
check memory ...FAIL (at byte 96)
check memory ...FAIL (at byte 96)
check memory ...FAIL (at byte 128)
---

Does someone here experienced similar issues ?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-05-29  8:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-23 18:36 out of sync capture samples with MMAP on MIPS Daniel Danzberger
2018-05-25 12:20 ` Takashi Iwai
2018-05-25 12:24   ` Takashi Iwai
2018-05-27  9:34   ` Daniel Danzberger
2018-05-27 11:08     ` Takashi Iwai
2018-05-29  7:55       ` Daniel Danzberger
2018-05-29  8:02         ` Takashi Iwai
2018-05-27 11:17   ` Daniel Danzberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).