>> 'Twas brillig, and David Henningsson at 09/01/10 09:00 did gyre and >> gimble: >>> The pulse ALSA plugin has been known, for a while, to not work >>> properly, >>> causing underruns, hangs etc. I sat down yesterday trying to figure it >>> out, and I'm pretty certain this patch improves the situation, but I >>> don't mind getting some help testing it before it is committed >>> upstream. >>> >>> Related bug: https://bugs.launchpad.net/bugs/485488 >>> >>> The patch is for the alsa-plugins tree at git.alsa-projects.org. >> >> I applied this to 1.0.22 (cleanly) and sadly it's not helping my test >> case using mpg123. > > I've tried to debug the mpg123 issue a little further. > > Assuming my analysis is correct, what happens is that pa_stream_cork() is > called just after the first 623 samples have been written, I'll have to correct myself. Not only does it uncork the stream, it also calls pa_stream_trigger right after the first write. So this behavior is obviously on purpose, which probably means that changing the behavior is not unlikely to cause regressions somewhere else. :-( What about the underruns then? I guess we also have a problem in that they are delivered asynchronously, i e there are buffers in queue from ALSA to PA which are about to end the underrun, at the same time as the underrun is delivered back to ALSA. Can we call pa_update/get_timing_info from the underrun callback to determine whether that is the case, and if so, just ignore the underrun? // David