xemu-project / xemu

Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
https://xemu.app
Other
2.79k stars 280 forks source link

Add menu setting to choose the audio backend #371

Open abouvier opened 3 years ago

abouvier commented 3 years ago

Feature Request

The preferred audio backend should be an option in a new audio setting menu in xemu interface. QEMU supports many audio backends, like PulseAudio or ALSA on Linux. They can be enabled at compile time with:

./configure (...) --audio-drv-list="pa alsa sdl jack"

Alternatives

One can launch xemu with additional arguments. For example to use the PulseAudio backend:

$ xemu -audiodev pa,id=snd0

Additional Context

Example of Dolphin Emulator audio settings: Screenshot_20210625_004910

mborgerson commented 3 years ago

@abouvier xemu currently uses the SDL backend for primary audio output. You can specify which driver is used by setting the SDL_AUDIODRIVER environment variable. See https://wiki.libsdl.org/FAQUsingSDL

Most people do not need to configure this, so it is not exposed now

abouvier commented 3 years ago

Then maybe you should force the value of the audio_drv_list variable in the configure script. Currently on Linux the default value try-pa oss is used. So the SDL backend is not even compiled, and PulseAudio is used.

Also the man page of QEMU say this about the SDL backend:

  -audiodev sdl,id=id[,prop[=value][,...]]
              Creates a backend using SDL. This backend is available on most systems, but you should use your platform's native backend if possible.
mborgerson commented 3 years ago

audio_drv_list will control which audio backend is used for the QEMU audio subsystem, which is used but is not the primary output path today. xemu audio device will always use SDL for now, but the QEMU audio subsystem is free to use a different backend. These two paths will be unified in the future, but this is how it works today.

I don't see a good reason to force QEMU audio subsystem to only use SDL, however I do agree it should probably be the preferred default for consistency. In any case, people building from source can specify what they want to use by passing the configuration option along when they run ./build.sh, which is the preferred method over running ./configure directly. You are welcome to send me a PR for this