fluid_list_remove() should receive the beginning of a list, so it can adjust the predecessor of the element to be removed. Otherwise the element would remain in the list, which in this case led to a use-after-free afterwards.
These two files are not ordinary C files, and are being compiled
through #include's in other C source files, not through invoking
compiler on generated files. This might confuse both developers and
automated systems.
For longer explanation see discussion in #800.
Remove the global nodes list with separate host and audio nodes. Instead
use completely separate lists and search through both lists in the only
place where that is required: getting a node by name.
As effect control nodes are private to the effect and only ever
accessed via the effect and port name, they don't need to be added
to the global node list and can be cleaned up in the effect
destructor.
This driver is currently tested and verified to work on:
- Windows Vista x64 VM
- Windows 7 x64 VM
- Windows 10 1909 x64 (VM and Laptop)
- Windows 10 21296 x64 on a ThinkPad X1 Yoga 1st Gen with 3 different sound cards (Conexant CX20753/4, Scarlett Solo Gen 2, Aureon 7.1 USB)
This driver is capable of reaching very low latency in exclusive mode (~6ms on Scarlett Solo with 48kHz).
This PR addresses issue https://github.com/FluidSynth/fluidsynth/issues/758.
It ensures that the `internal buffer size` used by waveout device driver and the `extra buffers size` required by fluid_synth_process() are both coherent (i.e they should be of same size). To ensure this, both kind of buffers are now dependent of`audio.period` and `audio.period-size settings`.
Resets the default sample timer properly, allowing the internal
MIDI file player to restart its playlist on any other time but
the initial first.
Lets Qsynth play any MIDI files that are drag-n-dropped, anytime
after the first, following synth engine initialization.
In `fluid_rvoice_mixer.c`:`fluid_rvoice_mixer_process_fx()`:
If an audio processing callback is used, `mix_fx_to_out` would be `FALSE`. As a result, `in_ch` and `out_ch_l` points to the same buffer.
In `fluid_chorus.c`:`fluid_chorus_processreplace()`:
```C
/* process stereo unit */
/* store the chorus stereo unit d_out to left and right output */
left_out[sample_index] = d_out[0] * chorus->wet1 + d_out[1] * chorus->wet2;
right_out[sample_index] = d_out[1] * chorus->wet1 + d_out[0] * chorus->wet2;
/* Write the current input sample into the circular buffer */
push_in_delay_line(chorus, in[sample_index]);
```
Here the chorus processing code writes to the left output buffer (which will overwrite the input buffer in this case) before the sample from the input buffer is stored into the delay buffer, making the chorus output all zeros. If no audio processing callback is used, `mix_fx_to_out` would be `TRUE` and `in` and `left_out` will not point to the same buffer, therefore the order doesn't matter.
Simply swapping the two steps should be a sufficient fix. This patch also apply the same change to `fluid_chorus_processmix` only for the sake of consistency (since they are almost exact copies of each other).
Resolves#751.
When fluid_shell is called from fluid_source(), is is currently
printing this message:
Received EOF while reading commands, exiting the shell.
Suppress it.
If polyphony is exceeded and FluidSynth has to allocate a voice by
calling fluid_synth_free_voice_by_kill_LOCAL(), two problems occur:
1)The value returned by fluid_synth_get_active_voice_count() never
returns back to 0.
2)SoundFont samples are not unref'd properly, and therefore if an attempt is
made to unload the SoundFont, the deferred unload timer is started, and
fluid_synth_sfunload_callback() unsuccessfully tries to unload the SoundFont forever.
These 2 issues are fixed by this commit.