1

I am using the tinyalsa library to implement audio capturing using mmap. But at the beginning of the program itself I am getting Xrun error ,i.e. overrun in pcm_wait(). I tried varying the buffer size and period, but i think its not able to read from the sound card buffer.

Is there any tutorial on how to use tinyalsa's mmap functions properly. Or even Alsa pcm mmap tutorial?

j29392
  • 13
  • 3
  • Why do you think you need to use mmap? – CL. Aug 10 '15 at 20:24
  • @CL I need to access the same sound card twice in a program to capture certain audio. So basically i need to use the captured samples from the sound card buffer and pass it into two threads performing some computation. The pcm_read and pcm_write uses the ioctl() to read and write from the sound card, but i need the memory instead. – j29392 Aug 11 '15 at 22:25
  • Nothing what you said implies that you need to use mmap. – CL. Aug 12 '15 at 07:36
  • @CL then what should be used? – j29392 Aug 12 '15 at 14:01
  • Plain `snd_pcm_writei()`. – CL. Aug 12 '15 at 14:13
  • @anyways irrespective of my requirements, can you help me with pcm_mmap ? – j29392 Aug 12 '15 at 17:51
  • 2
    I won't help you to do something that I know is wrong. Anyway, mmap, when used correctly, has the same timing as `snd_pcm_readi()`, so this would not fix your overrun problem. The error is in your code or in the driver, both of which you have kept secret. – CL. Aug 12 '15 at 18:49

0 Answers0