Closed schoetty closed 10 months ago
thats confusing... I dont have the dev setup on hand, will look over the weekend.
does android studio logcat emit Timber.tag("GVA-RNTP").d("RNTP received loadChildren req: %s", parentMediaId) for the first two tabs? I want to say podverse was fine, this is the demo I did and the podcast tab content update is done via RemoteBrowse
where it was still updating after the podcasts were played
Sadly, loadChildren
is not executed in said cases, so "RNTP received loadChildren req: %s", parentMediaId
is not logged either.
It is interesting that it seems to work in podverse.
You're using slightly different versions of KotlinAudio and Trackplayer in podverse, right? Maybe one of the differences is causing this side effect.
I noticed the problem when I refactored our app. I wanted, similar to podverse, that initially only the basic navigation (the tabs) for android auto would be set in trackplayer and then the data would be updated on each RemoteBrowse
event. Unfortunately, this does not work properly when the events are missing.
i wasnt able to reproduce this with the example app:( I did synced up to RNTP's main again, as well as KA. maybe this did the trick? podverse's KA is a bit customized mostly because podverse is staying at RNTP v4 rc04, though KA did have a few quite big metadata handling changes since... pardon the poor quality rntp.webm
Hey @lovegaoshi! To further isolate the problem I tested the current develop
branch of podverse on my system. Here the problem also occurs. It shows the same wrong behavior as in my project and the example project. Since we are using the same Android Auto emulator, the problem could be due to the mobile device or the android version used. I am using a Pixel 5 and a Pixel 7a, both with the latest Android 14 for testing. Which Android version is running on your test device/emulator?
it was samsung S21 + android 13, here's pixel 7 + android 14 (UI1A.231005.007), still seems normal to me:( am I not reproducing it right?
it was samsung S21 + android 13, here's pixel 7 + android 14 (UI1A.231005.007), still seems normal to me:( am I not reproducing it right?
In your screencasts everything works normally. This is really confusing.
from the podverse feedbacks so far i dont think this has been reported yet:( i will ask podverse to keep an eye out too
I did another test today just to make sure it wasn't my development setup. I deployed the app to my phone via the Play store and tried it with a real Android Auto device. Unfortunately, the issue occurs in this case as well :man_shrugging:.
hmm... I watched the videos again and I saw in your env when RemotePlay triggered, RemoteBrowse on the first two tabs also fired. On mine they didnt.
I'm not sure why though... arent we both using the latest commit from the example app?
I noticed there can be an infinite loop scenario in RemoteBrowse when calling TP.setBrowseTree within it. For podverse this was at the History tab and I ended up using a simple debounce https://github.com/podverse/podverse-rn/pull/1928/files#diff-2dcab85da4f5a4f80b50152ec9193f717dbb38244509d742c2ee65cb3f444661R65 still doesnt explain why the example app behaves differently on our setups... Or it could be I needed to be on tab3 and playback? I can try later today
just tried, tab location is not it:S still all seems normal
In my testing today, I found the following: When an audio is loaded from the rntp app, I get the "wrong" event behavior. When an audio is loaded from another app (e.g. Google podcasts), the events behave correctly with onClick
. I made a screencast of this for clarification:
P.S. Sorry, i just saw that the mouse cursor is not visible on the screencast. i hope it is still clear.
oh ok! i did reproduce with https://github.com/schoetty/react-native-track-player/tree/dev-android-auto. still no idea why yet, but could you update/test RNTP dependency to https://github.com/lovegaoshi/react-native-track-player/tree/dev-android-auto ? that recently synced fork works fine on my end.
The tests today were at commit 34e5d259be518a55bf9909aaeb582cd1237ac61a. I have retested the current state (31170ae) but come to the same conclusion. I even cleared the gradle cache. But without success.
might be my gradle cache then, i'll load up on another computer later today
@schoetty I have bad and even worse news :( The bad news is I did reproduce this issue, but couldnt get it "working" again on my samsung phone. my pixel is still fine. And yes the issue is exactly as you described: when mediaSession is currently playing, the first 2 browsable items in root are automatically fired and the results are "cached," preventing further onloadchildren calls. when mediaSession is not playing anymore this is "released" and onLoadChildren is called again. The even worse news is this is NOT specific to RN; I forked google's media player example repo UAMP and it's behaving the same. bad on samsung, good on pixel. Now i'm believed this is some very obscure phone setting i'm not aware of... before i magically figure out the solution, the best workaround I can think of is to sacrifice a tab slot and use the first two MediaItem in / to be playable items; this makes them hidden in the "More" menu and you get 3 good tabs at least (which for podverse it will do for now...).
after sacrificing my car data I found out my samsung "works" again now by uninstalling and reinstalling android auto the app:/ win some lose some.
So, today I installed the latest beta version of the Android Auto app (10.7.134154) on my Pixel 5 and that has solved the problem with the events.
:/I'm fairly sure this is an android auto bug/hidden configuration.
Screencast_TrackPlayer_AndroidAuto_RemoteBrowse.webm
Describe the Bug The RemoteBrowse event doesn't fire for the first two elements (tabs in the example project, but also applies to list items) after an audio has played.
Steps To Reproduce
Replicable on Example App? Yes