Skip to content

Fix interruptions of real-time playback#1494

Merged
derselbst merged 28 commits intomasterfrom
cpu-opt
Mar 15, 2025
Merged

Fix interruptions of real-time playback#1494
derselbst merged 28 commits intomasterfrom
cpu-opt

Conversation

@derselbst
Copy link
Copy Markdown
Member

@derselbst derselbst commented Mar 1, 2025

PR #1432 introduced an on-the-fly recalculation of the filter coefficients, whenever the filter parameters change. It turns out this consumes too much CPU for voices that heavily depend on e.g. modulating the IIR filter.

This PR addresses this problem by avoiding direct calls to sin() and cos() and instead using a lookup table for calculating the filter coefficients.

TODO:

  • Eliminate the dependency on the sample rate in fluid_iir_filter_init_table()

Fixes #1481

@derselbst derselbst added the bug label Mar 1, 2025
@derselbst derselbst added this to the 2.4 milestone Mar 1, 2025
@derselbst derselbst marked this pull request as ready for review March 9, 2025 13:48
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 9, 2025

@derselbst derselbst merged commit 6f9d603 into master Mar 15, 2025
75 of 79 checks passed
@derselbst derselbst deleted the cpu-opt branch March 15, 2025 17:26
DominusExult added a commit to DominusExult/fluidsynth-sans-glib that referenced this pull request Apr 7, 2025
* master: (51 commits)
  Put fluidsynth.lock in its own directory (FluidSynth#1528)
  Fix XG Drum bank selection (FluidSynth#1514)
  Stop SDL3 intercepting signals (FluidSynth#1520)
  Fix MSVC type truncation warnings (FluidSynth#1515)
  Fix SDL3.dll not included in prebuilt Windows Binaries (FluidSynth#1518)
  Fix Altitude test case
  Update testcases for FluidSynth#1508
  Apply *_FOR_BUILD environment variables to gentables (FluidSynth#1501)
  Add testfiles for FluidSynth#1496 and FluidSynth#1505
  Remove unused enum
  Bump to 2.4.4
  Fix ordering and dependencies in fluidsynth.service file (FluidSynth#1500)
  fluidsynth.1: Some remarks and a patch with editorial changes for this man page (FluidSynth#1499)
  Add support for SDL3 (FluidSynth#1485)
  Fix interruptions of real-time playback (FluidSynth#1494)
  Add two more test cases
  Log SysEX System ON Messages
  Return error code on server failure
  Rephrase error messages for clarity
  Only run one FluidSynth service at a time
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

High CPU usage may impair real-time playback

2 participants