Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcm: snd_pcm_readi - plugin type multi, the overun appears when read #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ouwenchen
Copy link

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.

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.
@perexg
Copy link
Member

perexg commented Apr 13, 2021

Could you elaborate a bit more what does not work? The snd_pcm_mmap_begin() also limits the number of frames.

@ouwenchen
Copy link
Author

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.

@perexg
Copy link
Member

perexg commented Apr 15, 2021

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.

@ouwenchen
Copy link
Author

So it needs to be update snd_pcm_multi_hwptr_update function to solve this problem?

@perexg
Copy link
Member

perexg commented Apr 16, 2021

Yes, I'd prefer a fix in pcm_multi.c .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants