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

burgerspace: sound clips are loud and have a lot of noise #228

Closed
smcv opened this issue Oct 3, 2022 · 10 comments
Closed

burgerspace: sound clips are loud and have a lot of noise #228

smcv opened this issue Oct 3, 2022 · 10 comments
Assignees
Milestone

Comments

@smcv
Copy link
Contributor

smcv commented Oct 3, 2022

Prerequisites:

  • Debian testing (Debian 12 alpha)
  • apt install burgerspace (Debian package version 1.9.4-1)
  • Relevant libraries:
    • libsdl1.2debian version 1.2.15+dfsg2-8 (real SDL 1.2)
    • libsdl1.2-compat version 1.2.56-2 from Debian
    • libsdl1.2-compat version 1.2.58 locally-built during Steam Runtime development
    • libsdl2-2.0-0 version 2.24.0+dfsg-1
    • libsdl-image1.2 version 1.2.12-13+b1

To reproduce:

  • Turn volume down a bit to protect your ears
  • Run burgerspace (using the real SDL 1.2)
  • Play for a few seconds: press Space to start, arrow keys to walk around, Esc Y to exit
  • Run LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/sdl12-compat burgerspace (using 1.2.56-2 from Debian)
  • Play the game for a few seconds as before
  • Run with 1.2.58 in the LD_LIBRARY_PATH
  • Play the game for a few seconds as before

Expected result: in all three cases, sound effects are a bit retro but basically sound good.

Actual result: with real SDL 1.2 the sound plays cleanly. With 1.2.56 or 1.2.58, there's loud static mixed into each sound clip: it's particularly noticeable with the bell that rings when you press Space (which is /usr/share/burgerspace/sounds/new-game-starts.wav, 8-bit 11025 Hz mono).

burgerspace implements audio itself, rather than using SDL_mixer. I haven't investigated its source code.

@slouken slouken added this to the 1.2.60 milestone Oct 3, 2022
@smcv
Copy link
Contributor Author

smcv commented Oct 3, 2022

Debian package amphetamine version 0.8.10-21 seems to have a similar issue.

@smcv
Copy link
Contributor Author

smcv commented Oct 3, 2022

Also etw.

@icculus
Copy link
Collaborator

icculus commented Oct 3, 2022

This looks like it's opening an audio device with AUDIO_U8, mono, 11025Hz (through SDL_mixer), and then giving us bad data in the audio callback...maybe SDL_mixer didn't expect to actually get an AUDIO_U8 device!?!

Digging in.

@icculus
Copy link
Collaborator

icculus commented Oct 3, 2022

Ahh, I bet it's SDL_MixAudio, which we passthrough to SDL2, but mixes in the device format...but we fake the device format at the sdl12-compat level.

@slouken
Copy link
Collaborator

slouken commented Oct 3, 2022

Oh yeah, that totally makes sense. We have to do the conversion in sdl12-compat. Good find!

@icculus
Copy link
Collaborator

icculus commented Oct 4, 2022

This game has fixed a bunch of little incompatibilities! Commits incoming!

icculus added a commit that referenced this issue Oct 4, 2022
1.2 (on many video backends) would allow smaller surfaces that it would
center in a larger mode, so emulate that here.

Reference Issue #228.
icculus added a commit that referenced this issue Oct 4, 2022
@icculus icculus closed this as completed in 3c80688 Oct 4, 2022
@icculus
Copy link
Collaborator

icculus commented Oct 4, 2022

Okay, this fixes the audio, and F11 not toggling the game to fullscreen mode.

@smcv
Copy link
Contributor Author

smcv commented Oct 24, 2022

Confirmed fixed as of 67f8b3a (1.2.58 + 29 commits)

@icculus
Copy link
Collaborator

icculus commented Oct 24, 2022

(I'm currently assuming amphetamine and etw were also fixed by this, but I never checked.)

@smcv
Copy link
Contributor Author

smcv commented Jun 2, 2023

I re-tested amphetamine and etw with 1.2.64 and they seem fine.

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

3 participants