beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.74k stars 1.82k forks source link

replaygain: Analyze in parallel #2224

Open pablocouto opened 7 years ago

pablocouto commented 7 years ago

Problem

The replaygain plugin doesn’t appear to make use of multicore capacities. On my machine, I see increased activity on only one core out of four.

In my opinion, it would be useful to be able to configure the plugin to analyze different albums or tracks at the same time.

Setup

My configuration (output of beet config) is:

replaygain:
    backend: gstreamer
    auto: yes
    targetlevel: 89
    overwrite: no
embedart:
    remove_art_file: no
    compare_threshold: 0
    auto: yes
    ifempty: no
    maxwidth: 0

plugins: fromfilename embedart fetchart mbsync replaygain scrub duplicates missing random
directory: ~/Media/music

import:
    copy: no
    write: no
library: ~/Media/musiclibrary.blb
scrub:
    auto: yes
missing:
    count: no
    total: no
fetchart:
    auto: yes
    minwidth: 0
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_engine: 001442825323518660753:hrh5ch1gjzm
    enforce_ratio: no
    cautious: no
    maxwidth: 0
    store_source: no
    google_key: REDACTED
    fanarttv_key: REDACTED
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
duplicates:
    count: no
    full: no
    format: ''
    keys: []
    move: ''
    tag: ''
    path: no
    copy: ''
    tiebreak: {}
    album: no
    strict: no
    checksum: ''
    merge: no
    delete: no
sampsyo commented 7 years ago

Good call. See also #673 and #663.

ybnd commented 4 years ago

Do you think it makes sense to have this be specific to the replaygain plugin, without going further into https://github.com/beetbox/beets/pull/673 and https://github.com/beetbox/beets/pull/663?

sampsyo commented 4 years ago

Sure, at least as a first step! We can always generalize it later.

nagisa commented 2 years ago

I've been trying to call beet replaygain --threads=32 but only one core is being used, still.

ybnd commented 2 years ago

Which backend are you using? We don't support parallel processing for gstreamer and audiotools currently.

nagisa commented 2 years ago

I tried gstreamer and then ffmpeg. Both had the same problem. I was running

beet replaygain --threads=32 -a -w -f

The relevant section from beet config output:

replaygain:
    backend: ffmpeg
    threads: 16
    overwrite: no
    auto: yes
    parallel_on_import: no
    per_disc: no
    peak: 'true'
    targetlevel: 89
    r128: [Opus]
    r128_targetlevel: 84

EDIT: nevermind, started the command again and it started spawning more ffmpeg processes than before. It still spawns fewer than 32 and takes a while to ramp up from 0 to more than 1, but it eventually does get there.