-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
replaygain: Assorted refactoring #4851
Conversation
635ac2f
to
9742f11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good from here! I just encountered a couple of extremely tiny suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much to add to @sampsyo's comments in terms of the refactor itself.
Ran beet replaygain
with the command
, ffmpeg
and gstreamer
backends (I could not get audiotools
installed for some reason)
Confirmed that all of the track/album gain calculations and write operations remain identical compared to the master
branch.
Found a tiny typo with album gain in ffmpeg
, see below.
d2c90d9
to
fd770ae
Compare
to check for an optional ThreadPool. Seems more idiomatic and readable.
doesn't seem to be very useful to log the _list of items_ here
...album gains. This is in preparation for parallelizing the track analysis, and computing the album values in the plugin's "main thread" once all items are done.
now that we have the `track_results` upfront, some simplifications are possible
This is a preparation for moving the Gst calculation to multiprocessing worker threads. Passing only the file paths to the worker threads instead of synchronizing the entire `Item`s (i.e. minimizing the data that is shared between the processes) hopefully helps to prevent any issues with this approach.
…ests by adding files which are not completely silent, thus hitting a different code path in some calculations The sample files were generated using > sox -n whitenoise.flac synth 00:00:02 whitenoise > ffmpeg -i whitenoise.flac whitenoise.opus > ffmpeg -i whitenoise.flac whitenoise.mp3
fd770ae
to
3965858
Compare
Thanks for the feedback! This should be good to go now: I've added a version of the ffmpeg tests with non-silent files (turns out there's SoX which makes it really easy to generate audio files with some synthesized sounds) and addressed all of your comments. |
I'm trying to revive my work on improved parallelization (in particular for replaygain, cf. #3893). A while ago, I've been exploring an alternative approach to the the elaborate async approach of #3893 using beets's pipeline threads + an additional pool of worker threads for CPU intense computation. In this way, no intrusive refactoring of beets' pipeline is required and the resulting code feels easier to understand.
This PR is preparatory work for the new approach, which is however quite independent from the actual rewrite of parallelization; and could be merged already.