Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apu.c: Kill audio subsystem if there are no playback devices #1623

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MasonT8198
Copy link
Contributor

fixes issue #354

@GXTX 's initial hypothesis was correct, simply killing the audio subsystem if there are no available audio devices does work...

in the event the dummy audio device does fail to load, assert and kill the program, however in my testing this shouldn't occur

@antangelo
Copy link
Contributor

I tried testing this on linux by stopping pipewire, but the assertion still trips. SDL_GetNumAudioDevices(0) reports value 2.

As an aside, what happens if there is no audio device on loading xemu, but then one is connected after the fact? Is xemu able to output to the newly connected device?

@MasonT8198
Copy link
Contributor Author

I tried testing this on linux by stopping pipewire, but the assertion still trips. SDL_GetNumAudioDevices(0) reports value 2.

As an aside, what happens if there is no audio device on loading xemu, but then one is connected after the fact? Is xemu able to output to the newly connected device?

I've been unable to repro on my machine as to that specific assertion, even so, I'm not sure why'd it report 2... unless it was grabbing input devices that it couldn't access.

I'm unsure as to how SDL handles that, in most games that use SDL for audio, basically always has to restart to detect new devices.. could be wrong.

As an aside, it's been a minute since I looked at the xemu UI, Using SDL for an audio device selector would be nice.

@mborgerson
Copy link
Member

mborgerson commented Jun 17, 2024

I tried testing this on linux by stopping pipewire, but the assertion still trips. SDL_GetNumAudioDevices(0) reports value 2.

In this case, how about we detect the failed open, then fall back to re-open on the dummy driver

As an aside, what happens if there is no audio device on loading xemu, but then one is connected after the fact? Is xemu able to output to the newly connected device?

This would be nice to have, but not necessarily in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants