ALSA: usb-audio: Reduce latency at playback start, take#2
This is another attempt for the reduction of the latency at the start of a USB audio playback stream. The first attempt in the commit 9ce650a7 caused an unexpected regression (a deadlock with pipewire usage) and was later reverted by the commit 4b820e16. The devils are always living in details, of course; the cause of the deadlock was the call of snd_pcm_period_elapsed() inside prepare_playback_urb() callback. In the original code, this callback is never called from the stream lock context as it's driven solely from the URB complete callback. Along with the movement of the URB submission into the trigger START, this prepare call may be also executed in the stream lock context, hence it deadlocked with the another lock in snd_pcm_period_elapsed(). (Note that this happens only conditionally with a small period size that matches with the URB buffer length, which was a reason I overlooked during my tests. Also, the problem wasn't seen in ...
parent
31028cbe
Please register or sign in to comment