shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
513 stars 43 forks source link

ogg tracks play, but can't hear any sfx or cutscene audio #203

Closed awe444 closed 1 year ago

awe444 commented 1 year ago

First of all, thank you for this amazing project. It's such a joy playing this game again without the hassle of having to deal with compatibility layers.

I'm building and running the latest source as of today on Linux ubuntu 22.04. Using Steam game files. Everything works great in terms of graphics and input, but for some reason I can't hear any audio EXCEPT for the ogg track background music. e.g., if I run the executable and start a new game, I hear no sound of any kind until exiting the cantina in the first level, at which point the Track12.ogg music can be heard. No SFX can be heard including weapon fire, enemies, etc. Cutscene videos also are silent. I checked the volume sliders in settings and they're all turned up.

I'm certain this is an issue specific to my build and/or setup since no one else seems to have reported this problem. Here's the log output from booting the game through to exiting the cantina in level 1, at which point the log shows the volume turning up from 0 to 1.00.

Recreating SDL2 Window!

Running from current working directory.
Loaded GOB file `resource/Res1hi.gob`...
Loaded GOB file `resource/Res2.gob`...
Premature 'END' found after only 787 lines in 'ui\jkstrings.uni'.  Check number in 'MSG xxx' header.
Premature 'END' found after only 25 lines in 'misc\sithStrings.uni'.  Check number in 'MSG xxx' header.
Failed to dlopen libGameNetworkingSockets.so.  libGameNetworkingSockets.so: cannot open shared object file: No such file or directory
Using OpenAL+ALUT as audio backend
ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
unable to open default device
SDL has 1 joysticks.
SDL Joystick 0: Xbox 360 Controller, 6 axes 11 buttons 1 hats
Premature 'END' found after only 187 lines in 'ui\cutStrings.uni'.  Check number in 'MSG xxx' header.
Premature 'END' found after only 451 lines in 'ui\credits.uni'.  Check number in 'MSG xxx' header.
Recreating SDL2 Window!
lwm: protocol request X_ConfigureWindow on resource 0x60000b failed: BadWindow (invalid Window parameter)
lwm: protocol request X_SendEvent on resource 0x60000b failed: BadWindow (invalid Window parameter)
stdMci: stop music
libsmush: Invalid magic! SMK2
Opened file ./Resource/./VIDEO/01-02A.SMK as SMK
Width: 640
Height: 300
Frames: 3446
FPS: 15.001500
SDL has 1 joysticks.
SDL Joystick 0: Xbox 360 Controller, 6 axes 11 buttons 1 hats
OpenGL init...
Parse shader `resource/shaders/default_v.glsl`
Parse shader `resource/shaders/default_f.glsl`
Parse shader `resource/shaders/menu_v.glsl`
Parse shader `resource/shaders/menu_f.glsl`
Parse shader `resource/shaders/ui_v.glsl`
Parse shader `resource/shaders/ui_f.glsl`
Could not bind uniform iResolution!
Could not bind uniform tex2!
Could not bind uniform tex3!
Could not bind uniform param2!
Parse shader `resource/shaders/texfbo_v.glsl`
Parse shader `resource/shaders/texfbo_f.glsl`
Could not bind uniform iResolution!
Could not bind uniform tex2!
Could not bind uniform tex3!
Parse shader `resource/shaders/blur_v.glsl`
Parse shader `resource/shaders/blur_f.glsl`
Could not bind attribute v_color!
Could not bind uniform tex2!
Could not bind uniform tex3!
Parse shader `resource/shaders/ssao_v.glsl`
Parse shader `resource/shaders/ssao_f.glsl`
Could not bind attribute v_color!
Could not bind uniform param2!
Could not bind uniform param3!
Parse shader `resource/shaders/ssao_mix_v.glsl`
Parse shader `resource/shaders/ssao_mix_f.glsl`
Could not bind attribute v_color!
Could not bind uniform iResolution!
Could not bind uniform tex3!
Could not bind uniform param1!
Could not bind uniform param2!
Purging texture cache...
0.000000 seconds to parse section copyright.
0.000000 seconds to parse section header.
0.000000 seconds to parse section sounds.
0.016000 seconds to parse section materials.
0.000000 seconds to parse section soundclass.
0.084000 seconds to parse section models.
0.003000 seconds to parse section sprites.
0.000000 seconds to parse section keyframes.
0.044000 seconds to parse section animclass.
0.000000 seconds to parse section cogscripts.
0.019000 seconds to parse section cogs.
 Updating texture cache...
Updating texture cache...
Loaded GOB file `episode/JK1.gob`...
Loaded GOB file `episode/JK1CTF.gob`...
Loaded GOB file `episode/JK1MP.gob`...
Loaded GOB file `episode/JK1.gob`...
Premature 'END' found after only 140 lines in 'misc\cogStrings.uni'.  Check number in 'MSG xxx' header.
Updating texture cache...
stdMci: stop music
libsmush: Invalid magic! SMK2
Opened file ./Resource/VIDEO/03-04A.SMK as SMK
Width: 640
Height: 300
Frames: 2500
FPS: 15.001500
Purging texture cache...
0.000000 seconds to parse section jk.
0.000000 seconds to parse section copyright.
0.000000 seconds to parse section header.
0.014000 seconds to parse section sounds.
0.150000 seconds to parse section materials.
0.031000 seconds to parse section georesource.
0.004000 seconds to parse section sectors.
0.002000 seconds to parse section aiclass.
0.058000 seconds to parse section models.
0.001000 seconds to parse section sprites.
0.045000 seconds to parse section keyframes.
0.001000 seconds to parse section animclass.
0.003000 seconds to parse section soundclass.
0.009000 seconds to parse section cogscripts.
0.035000 seconds to parse section cogs.
0.001000 seconds to parse section templates.
0.001000 seconds to parse section things.
 Updating texture cache...
Set vol 1.000000
stdMci: play track 12 to 13
Mix_LoadMUS: Couldn't open 'MUSIC/1/Track12.ogg'
INFO: Playing music `MUSIC/Track12.ogg'
Set vol 0.000000
Stormtrooper Rifle
Set vol 0.050000
Set vol 0.100000
Set vol 0.150000
Set vol 0.200000
Set vol 0.250000
Set vol 0.300000
Set vol 0.350000
Set vol 0.400000
Set vol 0.450000
Set vol 0.500000
Set vol 0.550000
Set vol 0.600000
Set vol 0.650000
Set vol 0.700000
Set vol 0.750000
Set vol 0.800000
Set vol 0.850000
Set vol 0.900000
Set vol 0.950000
Set vol 1.000000
shinyquagsire23 commented 1 year ago
ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory

seems kinda pertinent, the last line shows a few forum posts when I google for it

awe444 commented 1 year ago

OK, I discovered and resolved the issue with my setup and will share here in case anyone has the same problem.

I was lacking a .asoundrc config file in my home directory. A barebones one that worked for my setup is:

defaults.pcm.!card 1
defaults.pcm.!device 0
defaults.ctl.!card 1

but your own card and device numbers will vary.

For most other programs I use in Linux (the majority of which I think use SDL for audio in my case) I've been able to get by with an environment variable like export AUDIODEV="hw:CARD=1,DEV=0" but for whatever reason the audio backend in OpenJKDF2 doesn't detect that variable and instead seems to want the .asoundrc file (or possible a similar file in /etc/ would work, I haven't tried that.