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

PlaySound() with SOUND_STREAM crash in debug mode. #22

Open
mingwya opened this issue Oct 22, 2024 · 9 comments
Open

PlaySound() with SOUND_STREAM crash in debug mode. #22

mingwya opened this issue Oct 22, 2024 · 9 comments

Comments

@mingwya
Copy link

mingwya commented Oct 22, 2024

`If FileType( "stream/ambient_"+ambient+".ogg" )=FILETYPE_FILE

			Local sound:TSound=LoadSound( "stream/ambient_"+ambient+".ogg",SOUND_LOOP|SOUND_STREAM )

			ambChannel=PlaySound( sound,soundPlayer.channel() )

End If`

In release mode works fine.

@GWRon
Copy link
Contributor

GWRon commented Oct 22, 2024

Did you use a specific soloud audio backend?

Wonder as I am using the same flags without issues here (albeit I wrapped everything in custom classes - code from a time before soloud landed in NG).

Can you check where it crashes exactly? (build with GDB information and run within "gdb -r yourapp")

@mingwya
Copy link
Author

mingwya commented Oct 22, 2024

im use -> Import Audio.AudioMiniAudio

Maybe it's because of the platform I'm using (win32)?

There are two files in the archive - ogg and code that reproduces the crash in debug mode (everything works in release mode).
bug.zip

Ok. I haven't debugged like that for a long time... I'll try to remember...

@GWRon
Copy link
Contributor

GWRon commented Oct 22, 2024

0x0000000000802e3a in bbThreadGetData (index=2) at /home/ronny/Arbeit/Tools/BlitzMaxNG/mod/brl.mod/blitz.mod/blitz_thread.c:83
83		BBObject * data = bbThreadGetCurrent()->data[index]

There it fails for me.


Import Audio.AudioMiniAudio


Local sound:TSound=LoadSound( "ambient_0.ogg",SOUND_LOOP|SOUND_STREAM )
Print "sound loaded"
Local ch:TChannel=PlaySound( sound )
Print "play sound"
Local last:Int = MilliSecs()
Local s:Int = 0
Repeat
	Print "loop"
	If MilliSecs() > last + 1000
		last = MilliSecs()
		s :+ 1
		Print 1
	EndIf
	Delay(10)
Until s > 100
Print "end"

I see 2 loops printed in the debug build until it segfaults. As the crashing behaviour already cries out: this is most probably an error happening in "C-Land" (so in the generated C code, in wrapped library C-Code, ...)

Might be something directly in "soloud.mod/soloud/src/backend/miniaudio".

@mingwya
Copy link
Author

mingwya commented Oct 22, 2024

I get a pop-up window "EXCEPTION_ACCESS_VIOLATION" but the program continues to run - "loop" is printed all the time without stopping, after pressing the ok button - the operating system offers to terminate the program abnormally.

@GWRon
Copy link
Contributor

GWRon commented Oct 22, 2024 via email

@mingwya
Copy link
Author

mingwya commented Oct 22, 2024

Yes. 32 bit Windows 8.1.

As far as I remember... -> "bmk makemods -a -gdb brl" ?

@mingwya
Copy link
Author

mingwya commented Oct 22, 2024

I can't figure out how to rebuild modules in GDB mode...
playsound

@GWRon
Copy link
Contributor

GWRon commented Oct 25, 2024

if you enter "bt" after the crash <gdb> bt then it will show you the backtrace "how it reached there".

@mingwya
Copy link
Author

mingwya commented Oct 25, 2024

I failed to compile BRL and Audio modules in GDB mode. But there is some information...
bt

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