• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM audio_create_stream broken in GMS 1.4.1804

W

Wraithious

Guest
Hello, in my ANDROID project I am getting music off the player's android device and checking if it's an .ogg file, and if so add it to a playlist and play them. This was working perfectly fine in gamemaker studio early access, but now that I've switched to the latest gamemaker studio 1.4.1804 to be able to comply with google plays new rules this broke my project! Here is the old code I was using to get .ogg files, add them to my playlist and play them, which worked flawlessly in early access:
Code:
var ext="";
global.nOfOggs= -1;//reset variable
global.audioadd="";//destroy array
for(var i=0;i<global.tracknum+1;i+=1){global.audioadd[i]="";}//recreate array with updated max size
for(var i=0;i<global.tracknum;i+=1;)
{ext=GetFileExt(TrackAdress(i));
if(ext= ".ogg" || ext= ".OGG")
{global.nOfOggs+=1;
global.audioadd[global.nOfOggs] = audio_create_stream(TrackAdress(i));}
}
newplay=1;//catch in step event to play all found .ogg sounds in game as playlist
After firing this project up in GMS 1.4.1804 to update it It crashes, so to try and debug it I added an array so I could use 2 loops, the first to get the audio tracks, find the ones with extension .ogg, and then the second loop to use audio_create_stream after the first loop finished to be sure I wasn't overloading the vm within the loop by accessing my extension and loading audio into a variables at in the same step of each loop iteration. It finds the tracks and .oggs foine and no problems in the first loop, it breaks when trying to execute audio_create_stream! new test code:
Code:
if(argument0 = 7)
{var ext="";
global.nOfOggs= -1;//reset variable
global.audioadd="";//destroy array
for(var i=0;i<global.tracknum+1;i+=1){global.audioadd[i]="";}//recreate array with updated max size
for(var i=0;i<global.tracknum;i+=1;)
{ext=GetFileExt(TrackAdress(i));
if(ext= ".ogg" || ext= ".OGG")
{global.nOfOggs+=1;
global.oggAt[global.nOfOggs]=i;
}
}
if (global.nOfOggs>0 && instance_exists(oDisplayInfo)) {
for(var i=0;i<global.nOfOggs;i+=1;) {
//global.audioadd[i] = audio_create_stream(TrackAdress(oggAt[i]));
audio_create_stream(TrackAdress(oggAt[0]));
}
newplay=1;//catch in step event to play all found .ogg sounds in game as playlist
}
}
Notice that this line (line 14)
Code:
//global.audioadd[i] = audio_create_stream(TrackAdress(oggAt[i]));
is commented out, with an additional test line below that, it's because I still got the jni app bug error in my logcat and game crash, so the line below it simply attempts to create 1 audio stream, AND STILL FAILS.
Here is my logcat:
Code:
06-29 11:17:52.157 20572 20572 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-29 11:17:52.157 20572 20572 F DEBUG   : Build fingerprint: 'samsung/marinelteuc/marinelteatt:7.0/NRD90M/G890AUCS7DRE1:user/release-keys'
06-29 11:17:52.157 20572 20572 F DEBUG   : Revision: '5'
06-29 11:17:52.157 20572 20572 F DEBUG   : ABI: 'arm'
06-29 11:17:52.158 20572 20572 F DEBUG   : pid: 18500, tid: 18523, name: GLThread 11769  >>> com.companyname.GMAudioSave <<<
06-29 11:17:52.158 20572 20572 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
06-29 11:17:52.163 20572 20572 F DEBUG   : Abort message: 'art/runtime/indirect_reference_table.cc:128] JNI ERROR (app bug): local reference table overflow (max=512)'
06-29 11:17:52.163 20572 20572 F DEBUG   :     r0 00000000  r1 0000485b  r2 00000006  r3 00000008
06-29 11:17:52.163 20572 20572 F DEBUG   :     r4 e1161978  r5 00000006  r6 e1161920  r7 0000010c
06-29 11:17:52.163 20572 20572 F DEBUG   :     r8 eac7d464  r9 00000000  sl e11604f0  fp eac6a6ac
06-29 11:17:52.163 20572 20572 F DEBUG   :     ip 0000000b  sp e1160420  lr eb9679c7  pc eb96a230  cpsr 600f0010
06-29 11:17:52.336 20572 20572 F DEBUG   :
06-29 11:17:52.336 20572 20572 F DEBUG   : backtrace:
06-29 11:17:52.337 20572 20572 F DEBUG   :     #00 pc 0004a230  /system/lib/libc.so (tgkill+12)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #01 pc 000479c3  /system/lib/libc.so (pthread_kill+34)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #02 pc 0001d9c5  /system/lib/libc.so (raise+10)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #03 pc 00019511  /system/lib/libc.so (__libc_android_abort+34)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #04 pc 00017150  /system/lib/libc.so (abort+4)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #05 pc 0031ba35  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+252)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #06 pc 000b4ccb  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+866)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #07 pc 001bd093  /system/lib/libart.so (_ZN3art22IndirectReferenceTable3AddEjPNS_6mirror6ObjectE+194)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #08 pc 002aacc7  /system/lib/libart.so (_ZN3artL29VMStack_getCallingClassLoaderEP7_JNIEnvP7_jclass+74)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #09 pc 005dec25  /system/framework/arm/boot-core-libart.oat (offset 0x47e000) (dalvik.system.VMStack.getCallingClassLoader+72)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #10 pc 005c4117  /system/framework/arm/boot.oat (offset 0x56f000) (java.lang.Class.forName+42)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #11 pc 000a9241  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #12 pc 004075e1  /system/lib/libart.so (art_quick_invoke_static_stub+228)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #13 pc 000b055f  /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+182)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #14 pc 001ed713  /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+198)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #15 pc 001e8a7b  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb1ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+334)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #16 pc 004015d7  /system/lib/libart.so (MterpInvokeStaticRange+242)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #17 pc 0009c514  /system/lib/libart.so (ExecuteMterpImpl+15380)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #18 pc 001cbacf  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+290)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #19 pc 001d04e9  /system/lib/libart.so (_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameE+92)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #20 pc 003f695d  /system/lib/libart.so (artQuickToInterpreterBridge+716)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #21 pc 000adc93  /system/lib/libart.so (art_quick_to_interpreter_bridge+34)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #22 pc 000a9241  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #23 pc 004075e1  /system/lib/libart.so (art_quick_invoke_static_stub+228)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #24 pc 000b055f  /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+182)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #25 pc 003169e3  /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+58)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #26 pc 003167f3  /system/lib/libart.so (_ZN3art17InvokeWithVarArgsERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDSt9__va_list+266)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #27 pc 0027423b  /system/lib/libart.so (_ZN3art3JNI23CallStaticObjectMethodVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+426)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #28 pc 000f2864  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_ZN7_JNIEnv22CallStaticObjectMethodEP7_jclassP10_jmethodIDz+36)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #29 pc 00214c3c  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z8Ext_CalliiP6RValueS0_+548)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #30 pc 000f63a8  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z27Extension_Call_DLL_FunctioniiP6RValueS0_+100)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #31 pc 000e8c7c  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z6DoCalljPhPKhP6VMExec+308)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #32 pc 000e4620  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_ZN2VM11ExecReleaseER6VMExecP6RValue+224)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #33 pc 000e8324  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_ZN2VM4ExecEP5CCodeP12YYObjectBaseS3_P6RValueS3_iS5_iS3_+852)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #34 pc 000cfaa8  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z9ExecuteItP9CInstanceS0_P5CCodeP6RValuei+404)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #35 pc 000cfc70  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z12Code_ExecuteP9CInstanceS0_P5CCodeP6RValuei+16)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #36 pc 000f2e6c  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_ZN6CEvent7ExecuteEP9CInstanceS1_+56)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #37 pc 000f328c  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z26Perform_Event_Object_ASyncP9CInstanceS0_iii+148)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #38 pc 000f33a4  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z13Perform_EventP9CInstanceS0_ii+36)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #39 pc 001d5fac  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z12HandleButtoni+316)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #40 pc 001db994  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z11HandleMousev+472)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #41 pc 001d346c  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z7DoAStepv+428)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #42 pc 001d4afc  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (_Z16MainLoop_Processv+900)
06-29 11:17:52.337 20572 20572 F DEBUG   :     #43 pc 00294768  /data/app/com.companyname.GMAudioSave-2/lib/arm/libyoyo.so (Java_com_yoyogames_runner_RunnerJNILib_Process+592)
06-29 11:17:52.338 20572 20572 F DEBUG   :     #44 pc 001da223  /data/app/com.companyname.GMAudioSave-2/oat/arm/base.odex (offset 0x1bb000)

Can anyone else confirm this is a bug so I can report it? thanks for your time.
Please see my last post in this thread for more info on the actual project.
 
J

Jafman

Guest
I use audio_create_stream() frequently and it works fine. I'm not doing nearly half the prep that you are, simply looking for an .ogg file and playing it. Have you tried testing separate from your project?
 

FrostyCat

Redemption Seeker
Your audio_create_stream(TrackAdress(oggAt[0])); line is still inside the for loop, that's not what "simply attempts to create 1 audio stream" looks like. At this point, this just looks like you running out of room.
 
W

Wraithious

Guest
@Jafman hang on I'll make a quick project and put an .ogg in an included file and test it
@FrostyCat Ok hang on I'll test that first and completely isolate it
I'll edit this post when done

@FrostyCat Nope, exact same issue, new code:
Code:
if(argument0 = 7)
{var ext="";
global.nOfOggs= -1;//reset variable
global.audioadd="";//destroy array
for(var i=0;i<global.tracknum+1;i+=1){global.audioadd[i]="";}//recreate array with updated max size
for(var i=0;i<global.tracknum;i+=1;)
{ext=GetFileExt(TrackAdress(i));
if(ext= ".ogg" || ext= ".OGG")
{global.nOfOggs+=1;
global.oggAt[global.nOfOggs]=i;
}
}
if (global.nOfOggs>0 && instance_exists(oDisplayInfo)) {
//for(var i=0;i<global.nOfOggs;i+=1;) {
//global.audioadd[i] = audio_create_stream(TrackAdress(oggAt[i]));
//audio_create_stream(TrackAdress(oggAt[0]));
//}
audio_create_stream(TrackAdress(oggAt[0]));
newplay=1;//catch in step event to play all found .ogg sounds in game as playlist
}
}
ACTUALLY that test line of code was wrong, I didn't put the stream into my variable to play it, just tested with the correct way and changed the line to
Code:
global.audioadd[0] = audio_create_stream(TrackAdress(oggAt[0]));
BUT, SADLY, it didn't make any difference

@Jafman Yes, my simple test project indeed plays the file, so what can I do to test why my other project is failing?
 
Last edited by a moderator:
W

Wraithious

Guest
You are setting global.oggAt, but trying to load from oggAt.
I tried hardcoding a known ogg track in there and protected it in case it was null and it still crashes, logcat:
Code:
06-29 14:17:17.604 16208 16230 I yoyo    : 323: got file: /storage/emulated/0/Ringtones/badenginesteady.ogg
06-29 14:17:17.604 16208 16230 I yoyo    : 325: File extension is: .ogg
06-29 14:17:17.604 16208 16230 I yoyo    : added to slot: 0, ogg num: 105, extension: .ogg
New code:
Code:
if(argument0 = 7)
{var ext="";
global.nOfOggs= 0;//reset variable
global.audioadd="";//destroy array
for(var i=0;i<global.tracknum+1;i+=1){global.audioadd[i]="";}//recreate array with updated max size
for(var i=0;i<global.tracknum;i+=1;)
{ext=GetFileExt(TrackAdress(i));
if(ext= ".ogg" || ext= ".OGG")
{
global.oggAt[global.nOfOggs]=i;
show_debug_message("added to slot: "+string(global.nOfOggs)+", ogg num: "+string(i)+", extension: "+GetFileExt(TrackAdress(i)));
global.nOfOggs+=1;
}
}
if (global.nOfOggs>0 && instance_exists(oDisplayInfo)) {
//for(var i=0;i<global.nOfOggs;i+=1;) {
//global.audioadd[i] = audio_create_stream(TrackAdress(oggAt[i]));
//global.audioadd[0] = audio_create_stream(TrackAdress(oggAt[0]));
//}
global.audioadd[0] = audio_create_stream(TrackAdress(105));
if audio_exists(global.audioadd[0]) audio_play_sound(global.audioadd[0],1,0);
if !audio_exists(global.audioadd[0]) show_debug_message("No audio found");
//newplay=1;//catch in step event to play all found .ogg sounds in game as playlist
}
}
 
J

Jafman

Guest
Does global.audioadd[0] get an index for the created stream? If so, and audio_exists is affirmative, then it does seem like a bug. Maybe best to put a support ticket in asap for this since gms1.4 development ends in a month.
 
W

Wraithious

Guest
Does global.audioadd[0] get an index for the created stream? If so, and audio_exists is affirmative, then it does seem like a bug. Maybe best to put a support ticket in asap for this since gms1.4 development ends in a month.
Yes it does, and it has no problems playing files found on the device that aren't .ogg, but when using audio_create_stream it breaks, as I posted above I even hardcoded it in there with a known .ogg file and position, I will file a bug report when I get home.
 
Top