Fixing a couple of flaky tests, a missed change for MIDI time adjustment, as well fixing voice looping that causes notes to end too early.
From: Rémi Bernon rbernon@codeweavers.com
This fails regularly on Win7. --- dlls/dmime/tests/dmime.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 6dc9d8e0f5e..151dbead3c1 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -3971,11 +3971,6 @@ static void test_segment_state(void) ok(hr == S_OK, "got %#lx\n", hr);
- /* This might be timing dependent and if PlaySegment is already - * late, the tracks are played synchronously and right away. - */ - todo_wine check_track_state(track, playing, FALSE); - ret = test_track_wait_playing(track, 50); ok(ret == 0, "got %#lx\n", ret);
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55722 --- dlls/dmime/tests/dmime.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 151dbead3c1..a5c3fb51bf6 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -3722,7 +3722,10 @@ static void test_band_track_play(void) &IID_IDirectMusicLoader8, (void **)&loader); ok(hr == S_OK, "got %#lx\n", hr); hr = IDirectMusicLoader_SetObject(loader, &desc); - ok(hr == S_OK, "got %#lx\n", hr); + if (hr == DMUS_E_LOADER_FAILEDOPEN) + skip("Failed to open gm.dls, missing system SoundFont?\n"); + else + ok(hr == S_OK, "got %#lx\n", hr);
hr = test_loader_stream_create(stream, loader, &loader_stream); ok(hr == S_OK, "got %#lx\n", hr);
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55688 --- dlls/dmusic/tests/dmusic.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index 51a6b0d8774..f71c0600366 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -1608,6 +1608,11 @@ static void test_default_gm_collection(void) ok(hr == S_OK, "got %#lx\n", hr);
hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicCollection, (void **)&collection); + if (hr == DMUS_E_LOADER_NOFILENAME) + { + skip("Failed to open default GM collection, skipping tests. Missing system SoundFont?\n"); + goto skip_tests; + } ok(hr == S_OK, "got %#lx\n", hr);
for (i = 0; hr == S_OK && i < ARRAY_SIZE(results); i++) @@ -1635,6 +1640,8 @@ static void test_default_gm_collection(void) }
IDirectMusicCollection_Release(collection); + +skip_tests: IDirectMusicLoader_Release(loader); }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synth.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 2e9b6b48245..e96e08f741e 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -1747,11 +1747,6 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui
fluid_sample_set_sound_data(fluid_sample, wave->samples, NULL, wave->sample_count, wave->format.nSamplesPerSec, TRUE); - if (region->wave_sample.cSampleLoops) - { - WLOOP *loop = region->wave_loops; - fluid_sample_set_loop(fluid_sample, loop->ulStart, loop->ulStart + loop->ulLength); - } fluid_sample_set_pitch(fluid_sample, region->wave_sample.usUnityNote, region->wave_sample.sFineTune);
if (!(fluid_voice = fluid_synth_alloc_voice(synth->fluid_synth, fluid_sample, chan, key, vel))) @@ -1762,6 +1757,13 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui }
set_default_voice_connections(fluid_voice); + if (region->wave_sample.cSampleLoops) + { + WLOOP *loop = region->wave_loops; + fluid_voice_gen_set(fluid_voice, GEN_SAMPLEMODE, 3); + fluid_voice_gen_set(fluid_voice, GEN_STARTLOOPADDROFS, loop->ulStart); + fluid_voice_gen_set(fluid_voice, GEN_ENDLOOPADDROFS, loop->ulStart + loop->ulLength); + } LIST_FOR_EACH_ENTRY(articulation, &instrument->articulations, struct articulation, entry) add_voice_connections(fluid_voice, &articulation->list, articulation->connections); LIST_FOR_EACH_ENTRY(articulation, ®ion->articulations, struct articulation, entry)
From: Rémi Bernon rbernon@codeweavers.com
Fixes 65e388137c6117aaf8f99cef808d32afa29c7639, which is otherwise no-op without this change. --- dlls/dmime/performance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index a8fcd869331..cd057c71d80 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -1706,7 +1706,7 @@ static HRESULT WINAPI performance_tool_ProcessPMsg(IDirectMusicTool *iface, DMUS_NOTE_PMSG *note = (DMUS_NOTE_PMSG *)msg;
msg->mtTime += note->nOffset; - if (FAILED(hr = performance_send_midi_pmsg(This, msg, DMUS_PMSGF_REFTIME | DMUS_PMSGF_MUSICTIME | DMUS_PMSGF_TOOL_IMMEDIATE, + if (FAILED(hr = performance_send_midi_pmsg(This, msg, DMUS_PMSGF_MUSICTIME | DMUS_PMSGF_TOOL_IMMEDIATE, MIDI_NOTE_ON, note->bMidiValue, note->bVelocity))) WARN("Failed to translate message to MIDI, hr %#lx\n", hr);
Anton Baskanov (@baskanov) commented about dlls/dmsynth/synth.c:
} set_default_voice_connections(fluid_voice);
if (region->wave_sample.cSampleLoops)
{
WLOOP *loop = region->wave_loops;
fluid_voice_gen_set(fluid_voice, GEN_SAMPLEMODE, 3);
Shouldn't the mode depend on loop->ulType?
On Wed Oct 25 11:19:45 2023 +0000, Anton Baskanov wrote:
Shouldn't the mode depend on loop->ulType?
I couldn't figure what ulType is, and as far as I could see in DLS files which are supposed to be looping, it is 0, so it doesn't seem to match FluidSynth constants (where 0 means no looping).
On Wed Oct 25 11:29:32 2023 +0000, Rémi Bernon wrote:
I couldn't figure what ulType is, and as far as I could see in DLS files which are supposed to be looping, it is 0, so it doesn't seem to match FluidSynth constants (where 0 means no looping).
There is WLOOP_TYPE_FORWARD in dls1.h and WLOOP_TYPE_RELEASE in dls2.h, looks like these should be mapped to mode 1 and 3 respectively.
On Wed Oct 25 11:38:17 2023 +0000, Anton Baskanov wrote:
There is WLOOP_TYPE_FORWARD in dls1.h and WLOOP_TYPE_RELEASE in dls2.h, looks like these should be mapped to mode 1 and 3 respectively.
Nice find, indeed, I'll update that.