libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.93k stars 1.84k forks source link

SDL2 Android, can't get list of audio driver? #10472

Closed ikhoeyZX closed 3 months ago

ikhoeyZX commented 3 months ago

idk if this is bug or not

when trying to list of android supported audio driver (by calling SDL_GetAudioDriver) it only give 4 total of "dummy" list but when call SDL_GetCurrentAudioDriver it give me correct audio driver name (openslES)

output when logging using fmt

[05:01:15.189] |I| [SDL_main]: Audio driver: openslES
[05:01:15.189] |I| [SDL_main]: Total supported audio driver: 4
[05:01:15.189] |I| [SDL_main]: index 0 : dummy
[05:01:15.189] |I| [SDL_main]: index 1 : dummy
[05:01:15.190] |I| [SDL_main]: index 2 : dummy
[05:01:15.190] |I| [SDL_main]: index 3 : dummy
madebr commented 3 months ago

Can you please try testaudioinfo, and check what it prints to stdout?

icculus commented 3 months ago

Can you post the code that's printing this? It seems unlikely we're actually giving you the string "dummy" 4 times.

ikhoeyZX commented 3 months ago

Can you please try testaudioinfo, and check what it prints to stdout?

terminal mode? anyway i can't build sdl2 example from builtin sdl source also sdl3 android app crashed in current build it's already fixed

ikhoeyZX commented 3 months ago

Can you post the code that's printing this? It seems unlikely we're actually giving you the string "dummy" 4 times.

https://github.com/ikhoeyZX/Vita3K-Android/blob/v12.5_prev/vita3k/main.cpp

at line 305

sezero commented 3 months ago

Can you post the code that's printing this? It seems unlikely we're actually giving you the string "dummy" 4 times.

https://github.com/ikhoeyZX/Vita3K-Android/blob/v12.5_prev/vita3k/main.cpp

at line 305

Here is your fix to that:

-        LOG_INFO("index {} : {}", list, SDL_GetAudioDriver(numbersdrv));
+        LOG_INFO("index {} : {}", list, SDL_GetAudioDriver(list));
ikhoeyZX commented 3 months ago

Can you post the code that's printing this? It seems unlikely we're actually giving you the string "dummy" 4 times.

https://github.com/ikhoeyZX/Vita3K-Android/blob/v12.5_prev/vita3k/main.cpp

at line 305

Here is your fix to that:

-        LOG_INFO("index {} : {}", list, SDL_GetAudioDriver(numbersdrv));
+        LOG_INFO("index {} : {}", list, SDL_GetAudioDriver(list));

thanks, i'm gonna test it

ikhoeyZX commented 3 months ago

thanks, it's worked now 👌

[03:45:33.054] |I| [SDL_main]: Total supported audio driver: 4
[03:45:33.054] |I| [SDL_main]: index 0 : AAudio
[03:45:33.054] |I| [SDL_main]: index 1 : openslES
[03:45:33.054] |I| [SDL_main]: index 2 : android
[03:45:33.054] |I| [SDL_main]: index 3 : disk