OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

Ambient sound does not work after map change or audio reinitialization, but works if vid_restart

Open mheh opened this issue 3 years ago • 4 comments

Operating system and version: Windows 10 64-bit and macOS Catalina 10.15.7

Is this for single player or multiplayer? Multiplayer

Description of the bug (and if possible, steps to reproduce the bug): After a map change or after some time in-game, audio from elevators with soundSet platform or doors with soundSet impDoor1 do not play any audio. Music continues to work, footsteps continue to work, sabers and weapons continue to work, voice continues to work.

If I switch EAX on/off (no matter if it was working before or not), it ceases to work until a vid_restart is performed. It happens on both my mac and windows machine. I just downloaded the latest December 2020 build because I thought maybe my compile was bad from a while ago, but it still happens.

What did you expect to happen instead? soundSets working correctly throughout the game.

mheh avatar Dec 09 '20 03:12 mheh

Thanks for the bug report @mheh. I think I investigated this issue a few years ago but wasn't able to come up with a fix at the time. I wish I'd written down my findings somewhere 😞 From what I can remember it had something to do with ambient sounds are only started at map load - restarting the sound system, toggling EAX caused the sounds to be lost until the map is loaded again.

Thinking about it now, it seems like something that should be fixable since the sound system does keep track of what sounds are being played.

xycaleth avatar Dec 09 '20 21:12 xycaleth

I investigated and couldn't find anything either. If I have time in the future I might run Kompare on Linux cause that's helped me a lot in the past. I experienced a possibly correlated issue today. I logged into a mp/duel6 map (which had bird chirps in the background), the map changed and the next map still had the bird chirps. I'm not sure if that's a yavin soundset or something with trigger_multiple, but I was thinking it could be similar.

Do you or anyone know why a vid_restart resets the sound system, but snd_restart or map change doesn't? Does the sound not reset in the same way across map change vs a vid_restart? I looked in the MP client main.c files to see what might be different, but aside from cpp stuff I didn't see much difference. EDIT: When I say different or running Kompare, I'm meaning in comparison to the original jka source.

mheh avatar Dec 11 '20 04:12 mheh

A video restart restarts the whole thing, it has to. Reset the mod side

ensiform avatar Dec 11 '20 07:12 ensiform

Are you thinking it might be mod related? The server I experience this on is running an original source mod and openjkded. Do you think that might play a part with this?

mheh avatar Dec 14 '20 23:12 mheh