mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
set audio to aaudio
This commit is contained in:
@@ -188,7 +188,7 @@ static std::string ToLowerAscii(std::string value) {
|
||||
}
|
||||
|
||||
static std::string ResolveAndroidAudioDriverHint() {
|
||||
constexpr const char* kDefaultAudioDriverHint = "openslES,aaudio,android";
|
||||
constexpr const char* kDefaultAudioDriverHint = "aaudio,android";
|
||||
const char* value = SDL_getenv("XEMU_ANDROID_AUDIO_DRIVER");
|
||||
if (!value || value[0] == '\0') {
|
||||
return kDefaultAudioDriverHint;
|
||||
@@ -200,13 +200,13 @@ static std::string ResolveAndroidAudioDriverHint() {
|
||||
return kDefaultAudioDriverHint;
|
||||
}
|
||||
if (normalized == "opensl" || normalized == "opensles") {
|
||||
return "openslES,aaudio,android";
|
||||
return "openslES,android";
|
||||
}
|
||||
if (normalized == "aaudio") {
|
||||
return "aaudio,openslES,android";
|
||||
return "aaudio,android";
|
||||
}
|
||||
if (normalized == "android" || normalized == "audiotrack") {
|
||||
return "android,openslES,aaudio";
|
||||
return "android";
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
@@ -662,7 +662,7 @@ static bool WriteConfigToml(const std::string& config_path,
|
||||
android->insert_or_assign("tcg_tb_size", 128);
|
||||
}
|
||||
if (!android->contains("audio_driver")) {
|
||||
android->insert_or_assign("audio_driver", "auto");
|
||||
android->insert_or_assign("audio_driver", "aaudio");
|
||||
}
|
||||
|
||||
files->insert_or_assign("bootrom_path", mcpx);
|
||||
|
||||
@@ -380,8 +380,11 @@ bool xemu_settings_load(void)
|
||||
std::string normalized = to_lower_ascii(driver);
|
||||
if (normalized == "audiotrack") {
|
||||
setenv("XEMU_ANDROID_AUDIO_DRIVER", "android", 1);
|
||||
} else if (normalized == "opensl") {
|
||||
} else if (normalized == "opensl" || normalized == "opensles") {
|
||||
setenv("XEMU_ANDROID_AUDIO_DRIVER", "opensles", 1);
|
||||
} else if (normalized == "auto" || normalized == "default") {
|
||||
// "auto" used to be the default; treat it as aaudio now
|
||||
setenv("XEMU_ANDROID_AUDIO_DRIVER", "aaudio", 1);
|
||||
} else if (!driver.empty()) {
|
||||
setenv("XEMU_ANDROID_AUDIO_DRIVER", driver.c_str(), 1);
|
||||
}
|
||||
|
||||
@@ -1637,6 +1637,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
};
|
||||
|
||||
public void onSystemUiVisibilityChange(int visibility) {
|
||||
// On Android 11+ (API 30+), WindowInsetsController handles system UI hiding,
|
||||
// so this legacy rehide loop is not needed and causes focus flicker noise.
|
||||
if (Build.VERSION.SDK_INT >= 30) return;
|
||||
|
||||
if (SDLActivity.mFullscreenModeActive && ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 || (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0)) {
|
||||
|
||||
Handler handler = getWindow().getDecorView().getHandler();
|
||||
|
||||
Reference in New Issue
Block a user