cnlohr / rawdrawandroid

Build android apps without any java, entirely in C and Make
MIT License
3.55k stars 226 forks source link

Sound currently not working #66

Open cnlohr opened 1 year ago

cnlohr commented 1 year ago

@DavidVentura, for some reason apps crash when trying to initialize the sound under the current setup. I spent a bit trying to debug it, but I don't understand the code very well. Can you pull the latest everything then uncomment the call here, and see if it crashes for you?

//InitCNFAAndroid( Callback, "A Name", SAMPLE_RATE, 0, 1, 0, SAMPLE_COUNT, 0, 0, 0 );
cnlohr commented 1 year ago

Also, it's currently breaking CI. See this: https://github.com/cnlohr/rawdrawandroid/actions/runs/5626850417/job/15248435884

DavidVentura commented 1 year ago

Interesting, with the current code base, when I re-enable audio, this loop is infinite:

while( !MyWebView.WebViewObject ) usleep(1);

though it's not easy for me to debug, as current master crashes within ~5 seconds on my phone.

Just messing with the code, moving the line

      InitCNFAAndroid( AudioCallback, "A Name", SAMPLE_RATE, 0, 1, 0, SAMPLE_COUNT, 0, 0, 0 );

after

      while( !MyWebView.WebViewObject ) usleep(1);

makes the audio work again. Though, I still crash within 5 seconds.

The failure on the build seems unrelated though, as it's still present when audio is disabled:

https://github.com/cnlohr/rawdrawandroid/actions/runs/5659840530/job/15441189400

cnlohr commented 1 year ago

Ah, I should not rely on webview being a thing. What is your SDK version and what version of Android are you running on?

DavidVentura commented 1 year ago

ndk is 21.3.6528147 and android version is 11

cnlohr commented 1 year ago

Do you know which SDK version you're on?

DavidVentura commented 1 year ago

SDK version is 30