You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
start playback opus media 5 seconds, then pause 1s, then use setPreferredAudioDevice(AudioDeviceInfo.TYPE_BUILTIN_SPEAKER) to switch device, then resume playback 5s, then stop.
Expected result
the media play 5s using bt-headset, pause 1s, then play 5s using speaker, then stop.
Actual result
the media play 5s using bt-headset, pause 1s, then no voice can be heard in both bt-headset and speaker for 6s(1s for pause), then stop. When disable Offload mode, the result is as expected.
And I confirm OPUS offload playback is supported on my device.
The logcat shows Audio sink error. 08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: Audio sink error
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: androidx.media3.exoplayer.audio.AudioSink$WriteException: AudioTrack write failed: -6
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.DefaultAudioSink.writeBuffer(DefaultAudioSink.java:1164)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.DefaultAudioSink.processBuffers(DefaultAudioSink.java:1056)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:978)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:712)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.bypassRender(MediaCodecRenderer.java:2246)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:811)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1047)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:522)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.Handler.dispatchMessage(Handler.java:102)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.Looper.loopOnce(Looper.java:205)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.Looper.loop(Looper.java:294)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.HandlerThread.run(HandlerThread.java:67)
I found a similar issue 627. So, I tried the latest version 1.2.0-rc01, but still AudioTrack write failed and no audio can be heard after setPreferredAudioDevice. The issue still exists.
Then I tried another way.
I added the code 3742f6b to the release branch. The log still shows AudioTrack write failed, but audio can be heard after setPreferredAudioDevice. The log shows it is using deep-buffer-playback rather than compress-offload-playback after setPreferredAudioDevice.
@microkatz I hope this can provide you with some useful information.
Version
Media3 1.1.1
More version details
No response
Devices that reproduce the issue
Android SDK33
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
Expected result
the media play 5s using bt-headset, pause 1s, then play 5s using speaker, then stop.
Actual result
the media play 5s using bt-headset, pause 1s, then no voice can be heard in both bt-headset and speaker for 6s(1s for pause), then stop.
When disable Offload mode, the result is as expected.
And I confirm OPUS offload playback is supported on my device.
The logcat shows Audio sink error.
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: Audio sink error
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: androidx.media3.exoplayer.audio.AudioSink$WriteException: AudioTrack write failed: -6
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.DefaultAudioSink.writeBuffer(DefaultAudioSink.java:1164)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.DefaultAudioSink.processBuffers(DefaultAudioSink.java:1056)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:978)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:712)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.bypassRender(MediaCodecRenderer.java:2246)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:811)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1047)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:522)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.Handler.dispatchMessage(Handler.java:102)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.Looper.loopOnce(Looper.java:205)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.Looper.loop(Looper.java:294)
08-21 18:40:26.352 7502 7547 E MediaCodecAudioRenderer: at android.os.HandlerThread.run(HandlerThread.java:67)
Media
Not applicable
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.The text was updated successfully, but these errors were encountered: