Add a preference option to disable hardware audio offloading (#1564)
## Description By default, Wholphin plays music with hardware audio offloading enabled. This delegates audio decoding to the device's hardware DSP, making playback stability highly dependent on the manufacturer's system audio implementation. On certain hardware (such as my TCL TVs, e.g., the Chinese Model Q9L Pro), this implementation causes music playback to hang indefinitely at 0 seconds. ### Related issues #1372 ### Testing Tested on a TCL TV (Q9L Pro): - Some musics playback hangs at 0s with offloading enabled. - Disabling audio offloading fixes the issues for all medias. ## Screenshots <!-- Please include screenshots if the PR alters any UI elements --> <img width="4284" height="5712" alt="IMG_9486" src="https://github.com/user-attachments/assets/ddf95e68-6ebd-42f9-9565-568de4fbfc42" /> ## AI or LLM usage Developed in pair with Gemini and human-reviewed, tested. --------- Co-authored-by: Damontecres <damontecres@gmail.com>
This commit is contained in:
parent
de30c2ccac
commit
1c0e9a5853
6 changed files with 61 additions and 18 deletions
|
|
@ -182,6 +182,8 @@ class AppPreferencesSerializer
|
|||
.apply {
|
||||
enabled = false
|
||||
videoTunnelingEnabled = false
|
||||
preferAc3Surround = ExperimentalPreference.PreferAc3ForSurround.defaultValue
|
||||
disableAudioOffload = ExperimentalPreference.DisableAudioOffload.defaultValue
|
||||
}.build()
|
||||
}.build()
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,17 @@ object ExperimentalPreference {
|
|||
}
|
||||
},
|
||||
)
|
||||
|
||||
val DisableAudioOffload =
|
||||
AppSwitchPreference<AppPreferences>(
|
||||
title = R.string.disable_audio_offload,
|
||||
defaultValue = false,
|
||||
getter = { it.experimentalPreferences.disableAudioOffload },
|
||||
setter = { prefs, value ->
|
||||
prefs.updateExperimentalPreferences { disableAudioOffload = value }
|
||||
},
|
||||
summary = R.string.disable_audio_offload_summary,
|
||||
)
|
||||
}
|
||||
|
||||
val experimentalPreferences =
|
||||
|
|
@ -71,6 +82,7 @@ val experimentalPreferences =
|
|||
listOf(
|
||||
ExperimentalPreference.VideoTunneling,
|
||||
ExperimentalPreference.PreferAc3ForSurround,
|
||||
ExperimentalPreference.DisableAudioOffload,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue