Adarsh wrote:
- However to disable the underruns, the
snd_pcm_sw_params_set_stop_threshold is set to 0x7fffffff
This does not disable underruns; it just disables stopping the device when an underrun happens.
which is greater than boundary value.
Guess what happens on a 64-bit machine.
3.Period size is 1024 and buffer size is 2048.
Do you actually need that low a latency?
- gdb is attached to the process and continued inside gdb.
This will result in an underrun.
When an underrun happens, the buffer is reported to contain less than zero frames (i.e., the "avail" value is larger than the buffer size).
The program has to write samples _faster_ than normally to catch up. Alternately, it could advance the pointer by calling snd_pcm_forward (which might be a better idea because those samples won't be played at the correct time anyway.)
You should reconsider setting the stop threshold.
- At this point, the thread went into a tight loop taking >100% cpu
This is probably because of all the 'catch-up' samples that are being mixed.
Stack trace shows that 'snd_pcm_dmix_sync_area' in pcm_dmix.c is taking a very long time to return because the 'size' is a large unsinged interger and mix_areas is getting called with 'transfer' value of <=2048.
Hmmm, this might be a bug in the dmix plugin.
Regards, Clemens