SDL2 Under Wine and under OSX

Hi! I’m game developer and I use OSX, yet my game is for Windows, so thought it would be convenient to test it in Wine:

The game runs okay on real hardware and in emulator (although there is a problem with cursor movement, when no hardware 3d acceleration available), but fails in wine-3.21 (started using “wine explorer cmd”), while trying to init SDL2, with following errors:

0031:fixme:win:EnumDisplayDevicesW ((null),0,0x21b3ed80,0x00000000), stub! 0031:fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",0,0x21b3ed80,0x00000000), stub! 0031:fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",0,0x21b3e8a0,0x00000000), stub! 0031:fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",1,0x21b3ed80,0x00000000), stub! 0031:fixme:win:EnumDisplayDevicesW ((null),1,0x21b3ed80,0x00000000), stub! 0031:fixme:win:EnumDisplayDevicesW ((null),0,0x21b3ed80,0x00000000), stub! 0031:fixme:win:EnumDisplayDevicesW ((null),1,0x21b3ed80,0x00000000), stub! 0009:fixme:shell:IShellBrowser_fnOnViewWindowActive stub, 0x14a3f0 (0x618ae8) 0009:fixme:shell:IShellBrowser_fnOnViewWindowActive stub, 0x14a3f0 (0x618ae8) 0009:fixme:exec:SHELL_execute flags ignored: 0x0000000c 003a:fixme:win:EnumDisplayDevicesW ((null),0,0x21b3ed80,0x00000000), stub! 003a:fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",0,0x21b3ed80,0x00000000), stub! 003a:fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",0,0x21b3e8a0,0x00000000), stub! 003a:fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",1,0x21b3ed80,0x00000000), stub! 003a:fixme:win:EnumDisplayDevicesW ((null),1,0x21b3ed80,0x00000000), stub! 003a:fixme:win:EnumDisplayDevicesW ((null),0,0x21b3ed80,0x00000000), stub! 003a:fixme:win:EnumDisplayDevicesW ((null),1,0x21b3ed80,0x00000000), stub! 003a:fixme:seh:call_stack_handlers calling personality routine in system library not supported yet 003a:fixme:seh:call_stack_handlers calling personality routine in system library not supported yet 003a:fixme:seh:call_stack_handlers calling personality routine in system library not supported yet

Is it just me or SDL2 isn’t supposed to work in Wine? There were no such problems with SDL1, but SDL2 is just a mess.

Also, there is a trouble running SDL2, when sound is disabled in OS or there is no audio driver. SDL2 crashes with “XAudio2: Couldn’t create mastering voice”. Maybe it would be more robust to still allow SDL running? Not everyone has sound enabled.

Thanks!!!

What is the arch of your program (32bit or 64bit) and to which Windows is your Wine set?
Try experimenting with setting it to a newer Windows if it is set to XP.

I’ve had SDL2 programs run fine in Wine…

winecfg says it is Windows 7. The emulator runs Windows 7 too. The program is 64bit only. I’ve also tested it with Windows 10 running on real hardware, not problems either. But Wine just doesn’t want to run SDL games. I remember having troubles running SDL games by other people too under Wine in Linux.

Before crashing, it also produces a nasty sound, like if you cat some random file to /dev/snd
And sometimes also gives errors like
mastery.exe(10573,0xb0004000) malloc: *** error for object 0x40513e18: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
on the SDL init stage.

Not sure if this is still the case, but I think wine for 32bit windows binaries is more mature

But is your Windows 7 a 64bit bottle?

How do I check it? I downloaded a 64bit build of Wine, it runs other 64bit programs without nuances and the OSX itself is 64bit itself. In fact, my game is written in 64bit only language, Symta, that uses all 64bit of addresses to store type tags and cant be run on 32bit machines at all, it preloads all sprites and config files successfully, then tries to init SDL and crashes. Although there maybe a problem with Wine’s support of OSX, because it doesn’t even support virtual desktop and always decorates windows. Dunno if SDL handles that properly. As I mentioned before, Wine also has problems recognizing when user has sound turned off, leading to games crashing. That is not unique to Wine, I remember some games accessing DirectX directly crashing too if machine has no soundcard, or no headphones connected. But I hoped SDL would have some workaround to avoid such pitfalls, because these bugs wont get exposed until somebody actually tries to run the game without sound.

You could try disabling SDL sound and see if that changes anything, setting an environment variable SDL_AUDIODRIVER=dummy should do the trick.