On 22 July 2014 11:32, Bo Shen voice.shen@atmel.com wrote:
Hi Akshay,
On 07/22/2014 10:38 AM, Akshay Mishra wrote:
On 22 July 2014 07:57, Bo Shen <voice.shen@atmel.com mailto:voice.shen@atmel.com> wrote:
Hi Akshay, On 07/17/2014 08:54 PM, Akshay Mishra wrote: Hello, I am trying a simple alsa capture on the Atmel ARM9 (SAM9G45). While only capture runs fine, putting any os call on the same thread gives XRUNs. Even a innocent usleep(1) seems to lead to regular XRUNs. Eventually I want to dump this capture on the serial port and I am not able to get past this. Do you test with alsa utils. If yes, where you add the usleep(1) in code? I have tried on AT91 linux as well as on kernel 3.10.10-rt7 with no success. I try both kernel and don't reproduce this issue with alsa utils.
Bo, I put usleep(x) after the snd_pcm_readi. I also tried with this code (attached). usleep at Line 88 gives the error.
Another observation is, disabling HRTimer the -EPIPE error was not seen but I need further tests to be sure about this behaviour.
In contrast, I enable HRTimer, the -EPIPE error is gone. I briefly go through the code: usleep --> .. --> nanosleep (define in <kernel/hrtime.c>)
do you mean, disabling HRTimer you had -EPIPE ? I am positive on disabling the HRTimer, CPU Freeze which made the -EPIPE vanish and the moment I enable it, I again get -EPIPE. :-(
Actually, I can not understand why you add a usleep(1) in this piece of code. :(
Bo, as I mentioned earlier -- the usleep is only a placeholder. Any system call (like write to serial port) also gives same result but since I cannot ask you to do serial transmit - you may not have it setup I asked you to do a usleep since it gives me the same result.
I have requested for a SAM9G45-EK from the local Atmel office and once I get it I shall inform you further on this on the same platform.
-Akshay
The code is from here (http://www.linuxjournal.com/node/6735/print).
Please advice, Akshay
Best Regards, Bo Shen