Skip to content

Spectrogram painting parallelization #9977

Description

@saintmatthieu

At first sight, the calculation of a spectrogram is something with a high potential for parallelization, since in theory the calculation of a given spectrum does not depend on that of others.

In our case, two difficulties have already been identified that disqualify straightforward parallelization:

  1. Our track-sample reading uses a caching mechanism that assumes contiguous read of samples. For example, used this way, reading one minute of audio requires only 6 fetches to the database. Contrastingly, random reads can lead to as many fetches as there are reads (e.g. up to 1,500 reads for a 1,500 pixel-wide spectrogram)
  2. The method CalculateOneSpectrogram is const, yet its cache holder is mutable. Calling the method concurrently can lead to undefined behavior.

Goal of this ticket is to parallelize spectrum calculations meanwhile keeping the database fetches to a minimum. This could lead to a dramatic acceleration of the spectrogram painting.

If this ticket is successful and reduces the spectrogram computation time to something almost imperceptible, beside a notable improvement in the fluidity of the spectrogram updates during playback, changing spectrogram settings could also be applied instantly, without having to press "Apply".

Activity

  1. self-assigned this
    on Dec 2, 2025
  2. added
    Enhancement Request
    spectral tools
    on Dec 2, 2025
  3. added
    P1
    on Dec 5, 2025
  4. moved this from Design - Todo to Ready for Dev in [AU4] Main Board(archive)on Dec 5, 2025
  5. moved this from Ready for Dev to Code Review in [AU4] Main Board(archive)on Dec 17, 2025
  6. moved this from Code Review to Ready for QA in [AU4] Main Board(archive)on Dec 19, 2025
  7. moved this from Ready for QA to In QA in [AU4] Main Board(archive)on Dec 19, 2025
  8. moved this from In QA to Ready for Merge in [AU4] Main Board(archive)on Dec 22, 2025
  9. chinakov commented on Dec 22, 2025

    @chinakov
    Contributor

    Tested, thanks!

  10. added a commit that references this issue on Dec 22, 2025
    4ee602e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Enhancement RequestP1spectral tools

Type

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions