xtensa / PodEmu

Android application that emulates iPod to use together with old 30-pins iPod serial interface.
GNU General Public License v3.0
88 stars 14 forks source link

Play/Pause issues (BMW) #10

Closed icstyle closed 5 years ago

icstyle commented 5 years ago

Hi!

Don't know if you remember me, I was the first one replying to your XDA thread :-) I never went to use your app back then because I sold my car. Now I got a 2006 BMW with iDrive and I'm finally using PodEmu with Spotify through Bluetooth HC-05 + AptX-Receiver, which works pretty nice! Some problems/feature requests I have:

  1. On the very first connect, when I select iPod in my iDrive, it starts with a "Now Playing" screen (which seems to be some sort of playlist, because it's a sub of "playlists"). This is the perfect screen for me, because it shows only the actual playing track. The problem is, as soon as i press Back and go into another submenu (i.e. Songs), I can't go back to Now Playing, because this playlist/menu is missing. The only way to go back to this screen is actually doing a factory reset of the USB/BT control module of the car. Can this "playlist" somehow be implemented?

  2. When i press play/pause in my car, the music app correctly pauses. But I'm unable to make it play again with this button. If I press forward/back it starts to play again, but the track info/time is frozen until I reconnect Bluetooth or restart PodEmu app. Also when I shutdown the car, it doesn't pause and keeps playing. With a regular iPod it does pause though. Anyway to improve this?

  3. This is probably a bit out of scope. To have all fully automated (when getting into car), I need 2 more apps: Bluetooth Auto Connect and Bluetooth connect & play. The first one auto-connects to the AptX-Receiver as soon as HC-05 is connected (because my AptX-Rcv doesn't auto-connect unfortunately), and the second one maxes out Bluetooth Volume (very important, because it never ever sticks to max otherwise) and start playing Spotify. Would be really great if this could be implemented in PodEmu, so I don't need those 2 apps.

Let me know if you're interested in all of this and if I could help with testing or sending debugs or anything helps.

Thanks!

xtensa commented 5 years ago

Hi icstyle, sure I remember you :)

It's great you are using PodEmu again and thanks for reporting your issues - lets see if I can fix them... First of all I will open a separate ticket for each described problem so that we can track them easily. It will also help future users.

Replying to your requests:

  1. Ticket #11 created.
  2. This point we will track here even though there is more then one problem described here. It looks like a bug. Can you please collect separate logs for each case and attach them here. It will help me to understand what commands are sent by the car and why they are not interpreted correctly.
  3. Ticket #12 created.
icstyle commented 5 years ago

That's really great to hear :-)

I made a log (all in one for the frist try), just let me know if you need more. What I did while logging:

  1. Turn on the car/radio (connection ok)
  2. Let it play music (music plays ok)
  3. Press next in car (skips to next track ok)
  4. Press pause in car (pauses music ok)
  5. Press play in car (it doesn't start playing)
  6. Press next in car (music starts playing, but text is frozen)
  7. Turn off the car/radio (music doesn't pause)

BTW: It seems that PodEmu somehow is logging even when logging is turned off.

PodEmu_debug.txt

xtensa commented 5 years ago

I analyzed the logs and PodEmu behaves correctly. After pressing PAUSE, your car is asking what mode iPod is in, keeps asking it several times. Apparently it doesn't like the response:

2019-03-28 13:17:46 (080) : PodEmu - OAPM: MSG IN | 00 | 03 |
2019-03-28 13:17:46 (081) : PodEmu - OAPM: received current mode request 2019-03-28 13:17:46 (084) : PodEmu - OAPM: MSG OUT | 00 | 04 04 |
2019-03-28 13:17:46 (085) : PodEmu - OAPM: sent current mode 2019-03-28 13:17:48 (533) : PodEmu - OAPM: Line 4: MSG LEN: 2 TOTAL LEN: 6 2019-03-28 13:17:48 (535) : PodEmu - OAPM: Line 4: RAW MSG IN: FF 55 02 00 03 FB 2019-03-28 13:17:48 (536) : PodEmu - OAPM: MSG IN | 00 | 03 |
2019-03-28 13:17:48 (538) : PodEmu - OAPM: received current mode request 2019-03-28 13:17:48 (540) : PodEmu - OAPM: MSG OUT | 00 | 04 04 |
2019-03-28 13:17:48 (542) : PodEmu - OAPM: sent current mode

Anyway, I modified the response a bit, I hope it will help. Please try release 3.0-64. Please let me know if anything changed.

https://github.com/xtensa/PodEmu/releases/download/R-3.0-64/app-release-3.0-64.apk

icstyle commented 5 years ago

Thanks. I tried it, but unfortunately no change. Attached new debug log.

PodEmu_debug.txt

xtensa commented 5 years ago

Heh, behaviour is the same :(. Your car is expecting sth but PodEmu works "by the book" in this case. Now I need to think/read...

Btw, didn't mention, but when you press PLAY in the car, this information is not sent to PodEmu. This is why I think that the car is "confused" somehow.

icstyle commented 5 years ago

That's sad. Somehow I could help to find out what the car wants to receive? I have an old iPod lying around, is there a easy way to intercept/log communication between iPod and car?

xtensa commented 5 years ago

Actually there is a way. You can use my command line tool for that: https://github.com/xtensa/oap You will need to connect both iPod and the car through USB-serial dongle to computer (so you need 2 dongles). It would be great if you will manage to do it! Please ping me on email if you need support assembling additional cable or using the tool.

xtensa commented 5 years ago

@icstyle, can you please test version 3.0-66 and let me know if there are any changes? https://github.com/xtensa/PodEmu/releases/tag/R-3.0-66-RC

icstyle commented 5 years ago

It fixed it :D Play Pause now works as expected.

Though when shutting down the radio it doesn't pause, and when turning on again it doesn't show text or reacting on buttons till the next reconnect. Maybe the car sends some sort of "sleep" action which PodEmu doesn't understand yet?

I attached the log PodEmu_debug.txt (pressing pause, pressing play, turn off radio, turn on again).

xtensa commented 5 years ago

Play/pause issue was caused by the fact, that every time when playback was paused, PodEmu was reporting "playback stopped". Apparently your BMW didn't like it.

Second issue was caused by sth different: when any other BT device was disconnected PodEmu was loosing information about currently playing app... I hope I fixed it. Please try out version 3.0-67: https://github.com/xtensa/PodEmu/releases/tag/R-3.0-67-RC

icstyle commented 5 years ago

You're awesome, it works perfectly :-)

xtensa commented 5 years ago

Thanks :) Closing this issue then and rolling out this version to Google Play.