1) when a custom equalizer is installed, the sound disappears when listening to tracks/switching tracks. If you adjust the volume on the device, the sound is restored.
2) If I add exoplayer::release and create a new ExoPlayer object for each new track, then, judging by messages from users, the sound does not disappear (there is no bug).
3) If the custom equalizer is turned off, the sound does not disappear (there is no bug)
The logs for all three cases contain the same errors.
private fun createExoplayer() {
player = ExoPlayer.Builder(applicationContext).build()
val audioSessionId = player.audioSessionId
initEqualizer(audioSessionId)
}
@Synchronized
private fun initEqualizer(audioSessionId: Int?) {
if (audioSessionId == null) {
stopEqualizer()
return
}
equalizer = Equalizer(150, audioSessionId)
val shorts = listOf<Short>(0, 0, 0, 0, 0)
applyBandLevels4AudioSession(shorts)
}
private fun applyBandLevels4AudioSession(bandLevels: List<Short>) {
val eq = equalizer ?: return
val minLevel = eq.bandLevelRange[0]
val maxLevel = eq.bandLevelRange[1]
val numberOfBands = eq.numberOfBands.toInt()
if (numberOfBands == 0 || numberOfBands != bandLevels.size) return
try {
bandLevels.forEachIndexed { band, level ->
if (level in (minLevel)..maxLevel) {
eq.setBandLevel(band.toShort(), level)
}
}
eq.enabled = true
} catch (e: RuntimeException) {
}
}
@Synchronized
private fun stopEqualizer() {
equalizer?.enabled = false
equalizer?.release()
equalizer = null
}
//method for playing Track
private fun play(uri: Uri) {
/* If you uncomment this the error will go away. But the same errors are written to the logs*/
// exoplayerRelease()
// createExoplayer()
player.setMediaItem(MediaItem.fromUri(uri))
player.prepare()
player.playWhenReady = true
}
private fun exoplayerRelease() {
player.release()
initEqualizer(null)
}
Devices that reproduce the issue
Poco x5 5g 22111317 Android 14 Xiaomi HyperOS 1.0.1.0
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
1) Install a custom equalizer
2) Launch tracks
3) Switch tracks
Expected result
Sound is heard
Actual result
No sound is heard
Media
In All mp3 files
Bug Report
[X] You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.
Version
Media3 main branch
More version details
Good afternoon!
On a number of devices with HyperOS,
1) when a custom equalizer is installed, the sound disappears when listening to tracks/switching tracks. If you adjust the volume on the device, the sound is restored.
2) If I add exoplayer::release and create a new ExoPlayer object for each new track, then, judging by messages from users, the sound does not disappear (there is no bug).
3) If the custom equalizer is turned off, the sound does not disappear (there is no bug)
The logs for all three cases contain the same errors.
Sample errors
"W libc : Access denied finding property "ro.vendor.df.effect.conflict" sample_logs.txt "
I give errors for the device in attachment
OS: Android 14
Xiaomi HyperOS 1.0.1.0 Poco x5 5g 22111317 Resolution: 2176x1080 DensityDpi:440
i give dependencies
implementation("androidx.media3:media3-exoplayer:1.3.1") implementation("androidx.media3:media3-ui:1.3.1")
I give code:
Devices that reproduce the issue
Poco x5 5g 22111317 Android 14 Xiaomi HyperOS 1.0.1.0
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
1) Install a custom equalizer
2) Launch tracks 3) Switch tracks
Expected result
Sound is heard
Actual result
No sound is heard
Media
In All mp3 files
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.