Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Music is not paused when using my earphones #256

Open
walrus543 opened this issue Aug 7, 2024 · 5 comments
Open

Music is not paused when using my earphones #256

walrus543 opened this issue Aug 7, 2024 · 5 comments

Comments

@walrus543
Copy link

walrus543 commented Aug 7, 2024

Hello,
I have Jabra earphones and sometimes pressing on them doesn't pause the music.
I don't have this issue with my other music player.
Unfortunately I didn't find any useful log related to remix.myplayer when reproducing the issue.

Android 14 - LineageOS - OnePlus 8 Pro

App info:
APPLICATION_ID: remix.myplayer
VERSION_CODE: 16400
VERSION_NAME: 1.6.4.0
FLAVOR: nonGoogleWithUpdater
BUILD_TYPE: release
GITHUB_SHA: null

System info:
DISPLAY: lineage_instantnoodlep-userdebug 14 AP2A.240705.005 8fcd721f7e
SUPPORTED_ABIS: [arm64-v8a, armeabi-v7a, armeabi]
MANUFACTURER: OnePlus
MODEL: IN2020
RELEASE: 14
SDK_INT: 34

@Henry-ZHR
Copy link
Contributor

Look for that in your log. It should appear almost immediately every time you press your earphone.

@walrus543
Copy link
Author

walrus543 commented Aug 13, 2024

I took time to be able to reproduce the issue.
Everything worked fine, I pressed on my earphones several times and it always worked. A few minutes ago, I tried again and I can no longer paused with the earphones.
I recorded a log when trying to pause 3 times.

recorded.log
device.txt

Disconnecting the earphones didn't help.
I had to force close APlayer to be able to pause with the earphones.

@Henry-ZHR
Copy link
Contributor

1723541771.230  1000  1781  2965 D MediaSessionService: Sending KeyEvent { action=ACTION_UP, keyCode=KEYCODE_MEDIA_PLAY, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=0, downTime=0, deviceId=-1, source=0x0, displayId=-1 } to de.danoeh.antennapod/PlaybackService/55 (userId=0)

Seems that de.danoeh.antennapod is capturing the key event

Try disabling (pm disable) it when you encounter the issue again

@walrus543
Copy link
Author

I disabled de.danoeh.antennapod with Termux.

It seems the device is still trying to send the KeyEvent to AntennaPod app instead of APlayer.

PendingIntentHolder: Sending KeyEvent { action=ACTION_UP, keyCode=KEYCODE_MEDIA_PLAY, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=0, downTime=0, deviceId=-1, source=0x0, displayId=-1 } to the last known PendingIntent PendingIntent{ecd98c3: PendingIntentRecord{9ce1019 de.danoeh.antennapod broadcastIntent}}

FWIW I don't have this issue with my previous music player.

recorded.log

@Henry-ZHR
Copy link
Contributor

  1. Try uninstalling that app if it's acceptable for you
  2. uid, and if possible pid of APlayer
  3. The log when APlayer started may also be useful
  4. I really suggest debugging yourself as I am currently working on some other things and don't have much time. Related code:
    mediaSession.setCallback(object : MediaSessionCompat.Callback() {
    and app/src/main/java/remix/myplayer/misc/receiver/MediaButtonReceiver.kt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants