-
Notifications
You must be signed in to change notification settings - Fork 172
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
snd_pcm_drain() infinite loop #41
Comments
ALSA:HW_PARAMS START------------------------------------------------------------ |
in the function pcm_rate.c:snd_pcm_rate_drain, the while loop which is supposed to write the remaining audio data to the slave using snd_pcm_rate_commit_area function, does not seem to update rate->last_commit_ptr, which is then "stuck", hence the never ending writting of data to the slave. |
I wrote a quick and dirty patch which updates last_commit_ptr: it seems it fixes the issues. |
The drain is not supposed to update last_commit_ptr. Also, unless the drain is not called multiple times, the while loop takes last_commit_ptr only once. Do you call drain in the non-block mode? |
Sorry, I did not insist enough: yes, in non-block mode.
I was looking at how to update consistently the rate plugin state using some
already coded functions but as far I could understand the code, I found none.
Then I tried to modify the plugin state with the least amount of consistent
modifications, but I could not be so sure.
|
did you see my patch on the mailing list?
|
https://mailman.alsa-project.org/pipermail/alsa-devel/2020-April/165848.html The patch looks basically good (we can fix it later if we encounter any issues). Create PR or resend with proper description and signed-off-by line. Thanks. |
This is an on-the-spot patch, only tested with the software showing the issue.
If you don't see any obvious issues with it, I'll engage in some broader
testing on top of "now-git" alsa-lib.
If I am not able to break it after some time, I'll post it properly formated on
the mailing list.
|
Could not break it in my usage. I posted the patch on the mailing-list. |
Applied in 29041c5 . Thank you. |
In a non-blocking dmix-ed plugin pipeline (see below), playing audio from a 44100Hz source to a running 48000Hz hardware pcm, will go into an -EAGAIN infinite loop in snd_pcm_drain().
I did a bit of tracing and it seems snd_pcm_drain() will always return -EAGAIN because in pcm_dmix.c:snd_pcm_dmix_sync_ptr0, avail is never >= pcm->stop_threshold
The text was updated successfully, but these errors were encountered: