I'm hunting for subtle bug, happened under certain conditions:
-- if application is LATE to feed alsa through snd_pcm_writei, the driver spits "DAC Underflow" .
after several underflows, entire sound subsystem stops working. alsa snd_pcm_writei returns -EAGAIN even after relaunching application. The only remedy is reboot.
I suspect that either AUDIOOUT fifo or DMA is stuck in error condition, and there is no code to recover from it.
Has anyone experienced this issue?
LTIB kernel 2.6.31. all default parameters for imx233evk
Attached is sample program to recreate the issue. To compile you will need to change your ltib location and compiler names.
In this program i'm opening alsa device, with stream parameters of 44100, 16bit stereo. I'm feeding the driver with 100mS packets, but i'm waiting 105mS between them, so every 5 mS there will be pause and DMA will underflow. The program runs fine for 10-15 seconds (you hear 100mS beeps), and then sound stops. Relaunching program doesn't solve the issue. Only rebooting helps.
Same program runs fine on linux pc.