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

Selecting the audio device to play sound through #1656

Closed
moll opened this issue Apr 6, 2024 · 5 comments
Closed

Selecting the audio device to play sound through #1656

moll opened this issue Apr 6, 2024 · 5 comments

Comments

@moll
Copy link

moll commented Apr 6, 2024

Hey,

Thank you for your continued maintenance and development of Shattered Pixel Dungeon!

@00-Evan mentioned the following in #1605 (comment):

In general the game does not handle switching audio devices well right now though, and this is already planned to be improved in a patch for v2.3 as I will be updating the game's internal game library, which handles audio.

Has there been any progress on being able to select the audio device to play sound through? Looking at v2.3.2 on Arch Linux I don't immediately spot a way to do so. Problem being, I've got both two audio devices in my computer (one built-in, one external) and Shattered Pixel Dungeon seems to pick the.. wrong one. :)

Is there perhaps a way to choose the audio device somewhere? Even if it's just a command line parameter to start off, that'd be great. If I'm not mistaken, SPD doesn't also have any command line options — at least it doesn't respond to --help.

Thanks!

@00-Evan
Copy link
Owner

00-Evan commented Apr 6, 2024

You're misinterpreting that comment, which was about the game responding to when Windows switches audio devices (e.g. when headphones are unplugged), not about adding a selector in the game for choosing an audio device. I'm afraid I don't have any plans for such functionality.

Shattered's game library is responsible for that layer of audio output, I'm unfortunately not familiar with audio on linux, but there must be some reason why Shattered thinks one of the devices is your default one when it is in fact the other.

@00-Evan 00-Evan closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2024
@moll
Copy link
Author

moll commented Apr 6, 2024

Got it. Thanks for the quick response!

Shattered's game library is responsible for that layer of audio output, I'm unfortunately not familiar with audio on linux, but there must be some reason why Shattered thinks one of the devices is your default one when it is in fact the other.

Fair enough. I can take a look sometime when I get a chance. By "game library" you mean some game engine lib? I noticed references to https://libgdx.com, e.g. in https://github.com/00-Evan/shattered-pixel-dungeon/blob/425c90135d7d666dd1f4715f165dca91a7fb449e/SPD-classes/src/main/java/com/watabou/noosa/audio/Sample.java. Thanks!

@00-Evan
Copy link
Owner

00-Evan commented Apr 6, 2024

Thanks for understanding, and I hope you're able to figure your issue out.

Shattered uses libGDX, which in turn uses LWJGL3/OpenAL for audio.

@moll
Copy link
Author

moll commented Apr 6, 2024

Thanks for the hint! For the record, I eventually tracked this down to OpenAL, which for some reason chose the wrong default device. Running openal-info confirmed this. This led me to re-discover that my Arch Linux installation was running both PulseAudio and the newer PipeWire. How those both played with each other, I do not know. I think they've been side by side for a year+ now and while everything else didn't mind, I assume OpenAL was the first to default to PipeWire, which for whatever reason defaulted to the other audio device I had. I followed the instructions on https://wiki.archlinux.org/title/PipeWire to remove PulseAudio entirely. Then picked my primary sound device from the GNOME sound picker and problem solved. SPD's sounds now come out from the correct speaker.

@00-Evan
Copy link
Owner

00-Evan commented Apr 6, 2024

Glad to hear that you got it working!

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

No branches or pull requests

2 participants