media icon indicating copy to clipboard operation
media copied to clipboard

Looping AudioMediaPlayerWrapper Metadata Timeout Errors with Bluetooth

Open buggily opened this issue 3 years ago • 3 comments

Question

I am filing this issue as a question because the error is ambiguous to me despite research. I would rather document this as a question and refile as a bug report later if needed. I followed the template for a bug report to best provide information, but I am wondering whether or not this issue is specific to Media3. I am filing because the observed behavior is concerning to me and is reproducible in both my app and the demo-session app.

Media3 Version

1.0.0-beta02

Devices that reproduce the issue

  • Emulated Pixel 2 running Android 12, API 32
  • Physical Pixel 4a running Android 12, API 32

Devices that do not reproduce the issue

None

Reproducible in the demo app?

Yes

Reproduction steps

  1. Ensure Bluetooth is enabled on the device
  2. Launch the demo-session app
  3. Play any media file

Expected Result

The app syncs metadata successfully or fails definitely.

Actual result

The app generates an indefinite looping of metadata sync timeout errors, regardless of whether or not a Bluetooth device is connected. I have been able to reproduce with and without a Bluetooth device connected. I have not been able to reproduce with Bluetooth disabled. The following will repeat for as long as the media is playing:

2022-08-13 21:20:32.173 28661-28661/? E/AudioMediaPlayerWrapper: Timeout while waiting for metadata to sync for androidx.media3.demo.session
2022-08-13 21:20:32.174 28661-28661/? E/AudioMediaPlayerWrapper:   └ Current Metadata: { mediaId="currsong" title="Geisha" artist="The Kyoto Connection" album="Wake Up" duration=267650 trackPosition=1/1 image=null }
2022-08-13 21:20:32.174 28661-28661/? E/AudioMediaPlayerWrapper:   └ Current Playstate: PlaybackState {state=3, position=6827, buffered position=74866, speed=1.0, updated=504620259, actions=3670015, custom actions=[Action:mName='Disable shuffle mode, mIcon=2131230853, mExtras=Bundle[EMPTY_PARCEL]], active item id=1, error=null}
2022-08-13 21:20:32.175 28661-28661/? E/AudioMediaPlayerWrapper:   └ QueueItem(0): { mediaId="NowPlayingId0" title="Intro - The Way Of Waking Up (feat. Alan Watts)" artist="" album="" duration=0 trackPosition=1/13 image=null }

...

2022-08-13 21:20:32.175 28661-28661/? E/AudioMediaPlayerWrapper:   └ QueueItem(12): { mediaId="NowPlayingId12" title="Outro - Totally Here and Now (feat. Alan Watts)" artist="" album="" duration=0 trackPosition=13/13 image=null }

Media

Not applicable

Bug Report

  • [x] You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

buggily avatar Aug 14 '22 02:08 buggily

@buggily I have tried playing media in the demo-session app both when BlueTooth is enabled and when it is enabled and connected to a device.

Media files are played successfully in both the cases without any errors.

rohitjoins avatar Aug 16 '22 19:08 rohitjoins

@rohitjoins Thank you for the response. The proposed bug does not concern functional issues with playback, and I am able to facilitate playback through media3 as well. Rather, the prosed bug concerns the observed looping of Logcat errors originating from the MediaPlayerWrapper throughout metadata syncing. I am wondering whether or not the observed output could or should be addressed within the scope of media3.

buggily avatar Aug 17 '22 01:08 buggily

@buggily Thanks for reporting this. It seems this is a known issue (internal reference b/223612058). I agree that this is within the scope of media3.

rohitjoins avatar Aug 17 '22 10:08 rohitjoins