More verbose logging for sound backend info, plus spaces to tabs.
@@ -247,9 +247,16 @@ bool sound_init() {
isac_adapter = new IsacAdapter(_countof(au_active_sounds));
HRESULT hr = isac_adapter->Activate(isac_data_callback);
- if (FAILED(hr))
+ if (SUCCEEDED(hr)) {
+ log_diag("Using audio backend: ISAC");
+ return true;
+ } else if (hr == E_NOT_VALID_STATE){
+ log_info("ISAC not available, falling back to miniaudio! It's likely the device doesn't have Windows Sonic enabled, which can be found under Settings->Sound->Device Properties->Spatial Sound.");
+ } else {
+ log_warnf("ISAC failed 0x%X, falling back to miniaudio!", hr);
+ }
#endif
- {
+
au_config = ma_device_config_init(ma_device_type_playback);
au_config.playback.format = SAMPLE_FORMAT;
au_config.playback.channels = CHANNEL_COUNT;
@@ -258,16 +265,17 @@ bool sound_init() {
au_config.pUserData = nullptr;
if (ma_device_init(NULL, &au_config, &au_device) != MA_SUCCESS) {
- log_err("Failed to open playback device.");
+ log_err("miniaudio: Failed to open playback device.");
return false;
}
if (ma_device_start(&au_device) != MA_SUCCESS) {
- log_err("Failed to start playback device.\n");
+ log_err("miniaudio: Failed to start playback device.");
ma_device_uninit(&au_device);
return false;
}
- }
+
+ log_diagf("miniaudio: using backend %s", ma_get_backend_name(au_device.pContext->backend));
return true;
}
