libretro / dosbox-svn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enabling SDL_sound (support for audio disc emulation)

niclashoyer opened this issue · comments

Coming from this issue at dosbox-libretro.

Is it possible to enable SDL_audio when not using the fake SDL wrapper? I briefly had a look into this. The basic setting is enabled here: https://github.com/libretro/dosbox-svn/blob/libretro/include/config.h#L53

After that the compile fails, because SDL_sound.h is missing:

g++ -D__LIBRETRO__ -fPIC  -I../src -I../libretro -I../libretro/deps/libco -I../libretro/deps/common/include -I../include -I../src/midi/munt -DC_HAVE_MPROTECT="1" -DLIBCO_MPROTECT=1 -DUNIX_PORTABLE -O3 -DNDEBUG -DGIT_VERSION=\"" 07af328f"\" -DSVN_VERSION=\"" r4293"\" -DC_IPX -c ../src/dos/cdrom_image.cpp -o ../src/dos/cdrom_image.o
In file included from ../src/dos/cdrom_image.cpp:30:
../src/dos/cdrom.h:42:10: fatal error: SDL_sound.h: No such file or directory
 #include "SDL_sound.h"
          ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile.libretro:293: ../src/dos/cdrom_image.o] Error 1

I do have SDL_sound installed on my system, so the header files are there in /usr/include/SDL/SDL_sound.h, but I don't know what I need to modify in the build flags to load this correctly.

I managed to compile it somehow and SDL_sound is now included. Unfortunately when mounting cue files with audio tracks I still get this error:

C:\>IMGMOUNT D dummy.cue -t iso
Could not load image file: dummy.cue
MSCDEX: Failure: Invalid file or unable to open

Where dummy.cue is just

FILE "silence.wav" WAVE
  TRACK 01 AUDIO
  INDEX 01 00:00:00

And silence.wav is just silence.

This is needed for some games which usually pull audio from their own disc and don't start properly if there is no audio disc mounted.

Is there something more missing to let IMGMOUNT successfully mount an audio cue file? It is working in vanilla dosbox.

Finally found some time to look into this. I tested it and it won't work at runtime because SDL_sound links against SDL1 while RetroArch links against SDL2. This results in SDL_sound not being able to load audio files.

Not sure what to do about it yet.