https://bugs.winehq.org/show_bug.cgi?id=52592
Bug ID: 52592 Summary: MilkyTracker does not work: no valid waveout devices. Product: Wine Version: unspecified Hardware: aarch64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winmm&mci Assignee: wine-bugs@winehq.org Reporter: carlo.bramix@libero.it Distribution: ---
MilkyTracker is an multi-platform music application for creating .MOD and .XM module files.
https://github.com/milkytracker/MilkyTracker
Unfortunately, it doesn't work on WINE because it cannot open any waveout device. Sources of MilkyTracker do these actions:
1) waveOutOpen(&hwo, WAVE_MAPPER, &format, 0, 0, CALLBACK_NULL);
This call is a success and it returns a valid handle.
2) waveOutGetID(hwo,(LPUINT)&waveOutID);
This call also returns success and it returns a value of 63 into "waveOutID". BUT THIS IS WRONG. "waveOutID" should be equal to WAVE_MAPPER, which equal to -1, as you can see in point (1).
3) waveOutGetDevCaps((UINT)waveOutID, &waveoutcaps, sizeof(waveoutcaps));
As result, this call to waveOutGetDevCaps() fails with return value of MMSYSERR_BADDEVICEID.
Here there is the point where there is the code that I'm talking about:
https://github.com/milkytracker/MilkyTracker/blob/4f97b7011b20519890e30368e2...
The cause of the trouble is the way the function waveOutGetID() is implemented. waveOutGetID() calls WINMM_GetDeviceFromHWAVE(). And WINMM_GetDeviceFromHWAVE() calls WINMM_DecomposeHWAVE() Into WINMM_DecomposeHWAVE(), there are these lines:
ULONG32 l = HandleToULong(hwave); *device_index = l & 0xFF;
But this is wrong, because *device_index will be never able to return -1 that is the value for WAVE_MAPPER.