Crash upon restarting the sound system
I originally reproduced this while using automatically loaded OGG-formatted tracks.
To attempt reproducing this from the menu, toggle OPL3 stereo playback on/off and then confirm. This might take more than one attempt. Here's my back trace:
#0 ov_pcm_total(OggVorbis_File*, int) (vf=0x200001c0a20, i=0) at source/audiolib/src/minivorbis.h:20041
#1 0x00005555559a3361 in ov_pcm_total(OggVorbis_File*, int) (vf=0x200001c0a20, i=-1) at source/audiolib/src/minivorbis.h:20038
#2 0x00005555559a3c1c in ov_pcm_seek_page(OggVorbis_File*, ogg_int64_t) (vf=0x200001c0a20, pos=66048) at source/audiolib/src/minivorbis.h:20245
#3 0x00005555559a476c in ov_pcm_seek(OggVorbis_File*, ogg_int64_t) (vf=0x200001c0a20, pos=66048) at source/audiolib/src/minivorbis.h:20515
#4 0x00005555559a7172 in MV_SetVorbisPosition(VoiceNode*, int) (voice=0x20001a08068, position=66048) at source/audiolib/src/vorbis.cpp:204
#5 0x000055555596f09e in MV_SetPosition(int, int) (handle=4, position=66048) at source/audiolib/src/multivoc.cpp:666
#6 0x0000555555711b92 in FX_SetPosition (position=66048, handle=4) at source/audiolib/include/fx_man.h:124
#7 Menu_EntryLinkActivate(MenuEntry_t*) (entry=0x555555b24500 <ME_SOUND_RESTART>) at source/duke3d/src/menus.cpp:3812
#8 0x000055555571baee in Menu_RunInput_EntryLink_Activate(MenuEntry_t*) (entry=0x555555b24500 <ME_SOUND_RESTART>) at source/duke3d/src/menus.cpp:6685
#9 0x000055555571d33c in Menu_RunInput(Menu_t*) (cm=0x555555b25e08 <Menus+936>) at source/duke3d/src/menus.cpp:7405
#10 0x000055555571e0e1 in M_DisplayMenus() () at source/duke3d/src/menus.cpp:7835
#11 0x000055555568235f in G_PlaybackDemo() () at source/duke3d/src/demo.cpp:907
#12 0x00005555556b0851 in app_main(int, char const* const*) (argc=1, argv=0x7fffffffe018) at source/duke3d/src/game.cpp:6845
#13 0x000055555595297e in main(int, char**) (argc=1, argv=0x7fffffffe018) at source/build/src/sdlayer.cpp:560
A crash may also occur if restartsound
is used from the console. At least two attempts might be required, and I got a different back trace:
#0 OPL3_ChannelSetupAlg(opl3_channel*) (channel=0x555556f7ae90 <chip+528>) at source/audiolib/src/opl3.cpp:934
#1 0x0000555555971b3b in OPL3_ChannelUpdateRhythm(opl3_chip*, uint8_t) (chip=0x555556f7ac80 <chip>, data=0 '\000') at source/audiolib/src/opl3.cpp:803
#2 0x0000555555973984 in OPL3_WriteReg(opl3_chip*, uint16_t, uint8_t) (chip=0x555556f7ac80 <chip>, reg=189, v=0 '\000') at source/audiolib/src/opl3.cpp:1404
#3 0x0000555555973ba3 in OPL3_WriteRegBuffered(opl3_chip*, uint16_t, uint8_t) (chip=0x555556f7ac80 <chip>, reg=481, v=0 '\000') at source/audiolib/src/opl3.cpp:1447
#4 0x000055555595b5d8 in AL_SendOutputToPort(int, int, int) (port=906, reg=225, data=0) at source/audiolib/src/driver_adlib.cpp:273
#5 0x000055555595c68c in AL_FlushCard(int) (port=906) at source/audiolib/src/driver_adlib.cpp:548
#6 0x000055555595c7b1 in AL_Reset() () at source/audiolib/src/driver_adlib.cpp:575
#7 0x000055555595d0bb in AL_Shutdown() () at source/audiolib/src/driver_adlib.cpp:754
#8 0x000055555595b124 in AdLibDrv_MIDI_Shutdown() () at source/audiolib/src/driver_adlib.cpp:91
#9 0x0000555555965bac in SoundDriver_MIDI_Shutdown() () at source/audiolib/src/drivers.cpp:259
#10 0x00005555559706f9 in MUSIC_Shutdown() () at source/audiolib/src/music.cpp:107
#11 0x00005555557a576b in S_MusicShutdown() () at source/duke3d/src/sounds.cpp:169
#12 0x0000555555730a9c in osdcmd_restartsound(osdcmdptr_t) (UNUSED_parm=0x7fffffffd1f0) at source/duke3d/src/osdcmds.cpp:388
#13 0x00005555558c140c in OSD_Dispatch(char const*) (cmd=0x20000030f00 "restartsound") at source/build/src/osd.cpp:2049
#14 0x00005555558c0e5c in OSD_DispatchQueued() () at source/build/src/osd.cpp:1891
#15 0x0000555555683f9e in G_HandleSpecialKeys() () at source/duke3d/src/game.cpp:233
#16 0x0000555555683e1e in gameTimerHandler() () at source/duke3d/src/game.cpp:192
#17 0x0000555555914c9e in timerUpdateClock() () at source/build/src/timer.cpp:141
#18 0x0000555555957081 in handleevents() () at source/build/src/sdlayer.cpp:2582
#19 0x000055555567f1b1 in gameHandleEvents() () at source/duke3d/src/game.h:416
#20 0x0000555555682571 in G_PlaybackDemo() () at source/duke3d/src/demo.cpp:941
#21 0x00005555556b0851 in app_main(int, char const* const*) (argc=1, argv=0x7fffffffe018) at source/duke3d/src/game.cpp:6845
#22 0x000055555595297e in main(int, char**) (argc=1, argv=0x7fffffffe018) at source/build/src/sdlayer.cpp:560