alsa-lib
alsa-lib copied to clipboard
pcm: snd_pcm_readi - plugin type multi, the overun appears when read
After type route use type multi, merge the two input streams.There was PCM error due to insufficient readable data.Cause the underlying read pointer cannot be updated, and then it will be overrun.
Could you elaborate a bit more what does not work? The snd_pcm_mmap_begin() also limits the number of frames.
When I use plugin type multi. Like this: pcm.multi_plan_c0 { type multi slaves.a.pcm "hw:0,0" slaves.a.channels 2 slaves.b.pcm "hw:0,2" slaves.b.channels 8 bindings.0.slave b bindings.0.channel 0 bindings.1.slave b bindings.1.channel 1 bindings.2.slave b bindings.2.channel 7 bindings.3.slave b bindings.3.channel 3 bindings.4.slave b bindings.4.channel 2 bindings.5.slave b bindings.5.channel 4 bindings.6.slave b bindings.6.channel 5 bindings.7.slave a bindings.7.channel 0 } avail = snd_pcm_mmap_avail(pcm); //This is not the minimum avail value of the two HW PCM's snd_pcm_mmap_commit(); //Error due to lack of readable data. Causes the underlying read pointer to be unable to be updated, and then it will overrun.
avail = snd_pcm_mmap_avail(pcm); //This is not the minimum avail value of the two HW PCM's
The hw_ptr in the pcm multi plugin should track the minimal hw_ptr updates from slave PCMs (see snd_pcm_multi_hwptr_update function). If snd_pcm_mmap_avail for the multi PCM is not returning the right values, this update failed somewhere.
So it needs to be update snd_pcm_multi_hwptr_update function to solve this problem?
Yes, I'd prefer a fix in pcm_multi.c .