-
Notifications
You must be signed in to change notification settings - Fork 194
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
Aplay resampler #750
base: master
Are you sure you want to change the base?
Aplay resampler #750
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #750 +/- ##
==========================================
- Coverage 70.54% 70.53% -0.02%
==========================================
Files 99 99
Lines 16181 16217 +36
Branches 2527 2531 +4
==========================================
+ Hits 11415 11438 +23
- Misses 4647 4660 +13
Partials 119 119 ☔ View full report in Codecov by Sentry. |
I'm currently in the review process. If you agree, I will push the refactoring bits to the master branch and keep only the resampling-related changes here. Please give me a day or two to examine the refactoring, then I will look at the resampler. Thank you very very much for this piece of work! |
Yes, please just take any pieces you feel would be useful. |
I've already took first 4 commits. I've applied some polishing to them, so unfortunately, your other commits will not apply cleanly on master. But please, do not worry, I will rebase this PR on top of master once I will review the "aplay: improve overrun/underrun handling" commit. I've updated the delay report API a little bit. Now, it gets all delay components internally (ALSA PCM delay as well). I'm not sure whether it will be OK with the rest of your work, but from this single commit point of view it is cleaner that way. The rest is not changed other than some comments updates or code style updates. |
I just reviewed the "improve overrun/underrun handling" commit and it also looks OK. I've made some minor changes, though:
Other than that, I've just rebased it on top of master. I will test it tomorrow and if everything is OK I will push that to master (if you do not have any objections/remarks). |
yes, not good from the client view. The same is also true of the reset after an ALSA underrun. When I put those lines in I was thinking only of the resampler, needing some way to indicate that the delay report needed time to settle on a new average before using to calculate a rate adjustment. I agree that clients will benefit by removing the reset() calls, and the resampler management needs a bit more work. |
I've rebased the resampler on top of master. However, I'm not sure whether I have not broken anything along the way... Also, I have not reviewed changes yet, it's only a bling rebase attempt. Over the weekend I will try to do some preliminary review of all these changes. |
This is my attempt to address the topics previously discussed in PR #459
The io_worker_routine() function is already quite complex and can be difficult to read, so before adding more complexity, the first three commits simply factor out some of the code into new files.
The commit "aplay: improve overrun/underrun handling" uses a different approach, but addresses the same problem, as #459 and therefore if merged it closes #459
The libsamplerate resampler causes high CPU usage. Its not so bad on x86_64, but really very high on armhf. I have not tried with arm64. Having said that, I have tested on an old pi zero W (32bit armv6) with the "SINC_FASTEST" converter and got very stable audio with accurate delay reporting watching a 4 hour video stream.
top
showed bluealsa-aplay consuming 28% of the (single core) CPU but the pi continued to run smoothly. So anyway this is left as an option and not included in the build by default.