https://bugs.winehq.org/show_bug.cgi?id=55688
Bug ID: 55688 Summary: dmusic:dmusic - test_default_gm_collection() crashes on macOS Product: Wine Version: unspecified Hardware: x86-64 OS: Mac OS X Status: NEW Severity: normal Priority: P2 Component: dmusic Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
dmusic:dmusic - test_default_gm_collection() crashes on macOS:
dmusic.c:1611: Test failed: got 0x88781186 dmusic.c:1621: Test failed: got 0x88781186 dmusic.c:1622: Test failed: got 0 dmusic.c:1623: Test marked todo: got 0 Unhandled exception: page fault on read access to 0x0000000000000000 in 64-bit code (0x000001400024b7).
See https://test.winehq.org/data/patterns.html#dmusic:dmusic
The crashes started on 2023-09-29 which is when test_default_gm_collection() was added.
commit 767c5ddbf9bd2dc50442c5ba9e7eceffcd28c2fd Author: Rémi Bernon rbernon@codeweavers.com AuthorDate: Wed Sep 20 10:32:33 2023 +0200
dmusic/tests: Test default gm.dls sound font instruments.
https://bugs.winehq.org/show_bug.cgi?id=55688
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |767c5ddbf9bd2dc50442c5ba9e7 | |eceffcd28c2fd CC| |rbernon@codeweavers.com Keywords| |regression, source, | |testcase
https://bugs.winehq.org/show_bug.cgi?id=55688
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@winehq.org
--- Comment #1 from Michael Stefaniuc mstefani@winehq.org --- The fix is to add the path to the GM / default soundfont on MacOSX to dlls/dmloader/loader.c to the system_default_gm_paths[] array.
I don't have a Mac so no clue where that would be. This are the paths we have atm:
static const WCHAR *system_default_gm_paths[] = { L"/usr/share/sounds/sf2/default-GM.sf2", L"/usr/share/soundfonts/default.sf2", };
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #2 from François Gouget fgouget@codeweavers.com --- On my Debian machine default-GM.sf2 is provided by timgm6mb-soundfont. I'm kind of amazed that it got installed at all. As far as I can tell it's a dependency of a dependency of some GStreamer plugins.
Anyway. On macOS it seems like .sf2 files should be in Library/Audio/Sounds/Banks. The per-user copy (in ~/Library/Audio/Sounds/Banks) would certainly be empty on a cloud machine. And the system-wide copy (in /Library/Audio/Sounds/Banks) turned up empty on two machines I checked.
Furthermore a find / -name "*.sf2" turned up empty on Monterey (21.6.0) and Mojave (18.7.0). So to get sf2 files we will need to install them ourselves. But I did not see any Homebrew package that would be an obvious match.
Hopefully someone knows more about how Midi support works on macOS.
Is there a way to detect whether Midi is supported and to skip if not?
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #3 from Rémi Bernon rbernon@codeweavers.com --- I think we should be able to check in the tests whether the default "C:\windows\system32\gm.dls" has been found and successfully loaded, although it should always be there on Windows, it could be at least a todo_wine.
Another option I imagined was to have a dummy builtin, always present, "gm.dls", which we would detect somehow and still override with system-provided SF2, but I'm not completely sure how to do that yet.
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #4 from Michael Stefaniuc mstefani@winehq.org --- Remi, I know you didn't like that option but I'm documenting it here for completeness: We could generate gm.dls: - Either at build time - Or provide it like winegecko / winemono
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #5 from Rémi Bernon rbernon@codeweavers.com --- Sure, for the record my arguments are that:
1) SoundFonts files are often large (~hundred MB), and often made up of uncompressed samples of the same size, which makes them impractical for building. The higher the quality the larger the files are of course.
2) Linux systems at least, seem to already have GM compatible SoundFonts, easily installable, which can be found in some more or less standard places.
3) There's probably some licensing details to take care of, I'm not sure we have any alternative source of freely licensed samples other than re-using the SoundFonts from third party software which are most often already packaged and installable.
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #6 from François Gouget fgouget@codeweavers.com --- (In reply to Rémi Bernon from comment #3)
I think we should be able to check in the tests whether the default "C:\windows\system32\gm.dls" has been found and successfully loaded,
As far as I can tell Wine does not have a gm.dls file. So wouldn't that cause the test to be systematically skipped in Wine, including on Linux when the sf2 files are available? To avoid that it seems like we would need the dummy gm.dls builtin you mentioned.
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #7 from Hans Leidekker hans@meelstraat.net --- (In reply to François Gouget from comment #6)
(In reply to Rémi Bernon from comment #3)
I think we should be able to check in the tests whether the default "C:\windows\system32\gm.dls" has been found and successfully loaded,
As far as I can tell Wine does not have a gm.dls file. So wouldn't that cause the test to be systematically skipped in Wine, including on Linux when the sf2 files are available? To avoid that it seems like we would need the dummy gm.dls builtin you mentioned.
You could adopt the same strategy as winemono/winegecko: check standard Unix paths first and if not found there, install it (on demand) in c:\windows\system32.
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #8 from Rémi Bernon rbernon@codeweavers.com --- (In reply to François Gouget from comment #6)
(In reply to Rémi Bernon from comment #3)
I think we should be able to check in the tests whether the default "C:\windows\system32\gm.dls" has been found and successfully loaded,
As far as I can tell Wine does not have a gm.dls file. So wouldn't that cause the test to be systematically skipped in Wine, including on Linux when the sf2 files are available? To avoid that it seems like we would need the dummy gm.dls builtin you mentioned.
DMusic now has a fallback to load system SF2 in place of this file. The gm.dls file may not be there in the prefix but the "GUID_DefaultGMCollection" would still be loaded if that succeeds - or not if the system doesn't provide a SF2.
https://bugs.winehq.org/show_bug.cgi?id=55688
--- Comment #9 from Michael Stefaniuc mstefani@winehq.org --- Well, we can use something like https://documentation.help/DirectMusic/loadinganddownloadingcollections.htm to check if the GUID_DefaultGMCollection is loadable. And skip if not.
https://bugs.winehq.org/show_bug.cgi?id=55688
Rémi Bernon rbernon@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |c8b9a2dcfdb7edde41d8cd0e6e3 | |917a72ece9c99 Resolution|--- |FIXED
--- Comment #10 from Rémi Bernon rbernon@codeweavers.com --- Fixed with c8b9a2dcfdb7edde41d8cd0e6e3917a72ece9c99.
https://bugs.winehq.org/show_bug.cgi?id=55688
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.19.