tfabris / BlueGigaEmpeg

Arduino module and daughter board to convert the empeg Car MP3 player to Bluetooth output.
GNU General Public License v3.0
0 stars 0 forks source link

Track Titles Break when reshuffling whole player #8

Closed tfabris closed 6 years ago

tfabris commented 6 years ago

When I perform a full player reshuffle on the empeg (down down down), frequently the track titles are messed up as if there was a serial port buffer overflow. Repro is frequent but not 100 percent.

tfabris commented 6 years ago

This seems to occur because the player seems to like to send three copies of the track titles to the serial port in quick sequence all at once when reshuffling.

Each of the three is correct but it's a lot of data all at once and does indeed seem to overflow my serial buffer. Example output with all the debugging turned on, note how the last one gets the artist wrong.

  @@ #6940  0:00:06
  @@ #6940  0:00:07
  @@ #6940  0:00:08
  @@ #6940  0:00:09
  @@ #6940  0:00:10
  @@ #6940  0:00:11
  @@ #6940  0:00:12
  @@ #6940  0:00:13
  @@ N0
  ---------------------------------------------------
    1
  @@ F0x1080
  @@ ZMortal City
    Mortal City
  @@ D238031
    238031
  @@ TThis Was Pompeii
    This Was Pompeii
  @@ ADar Williams
    Dar Williams
  @@ GFolk
    Folk
  ---------------------------------------------------
  Empeg state...................................PLAYING  >
  @@ N0
  ---------------------------------------------------
    1
  @@ F0x1080
  @@ ZMortal City
    Mortal City
  @@ D238031
    238031
  @@ TThis Was Pompeii
    This Was Pompeii
  @@ ADar Williams
    Dar Williams
  @@ GFolk
    Folk
  ---------------------------------------------------
  Empeg state...................................PLAYING  >
  @@ N0
  ---------------------------------------------------
    1
  @@ F0x1080
  @@ ZMortal City
    Mortal City
  @@ D238031
    238031
  @@ TThis Was Pompeii
    This Was Pompeii
  @@ ADarlliams
    Darlliams
  @@ GFolk
    Folk
  ---------------------------------------------------
  Empeg state...................................PLAYING  >
  @@ NMortal City
  ---------------------------------------------------
    1
  @@ D2as Pompeii@@ #1080  0:00:01
    2as Pompeii@@ #1080  0:00:01
  @@ #1080  0:00:02
  @@ #1080  0:00:03
  @@ #1080  0:00:04
  @@ #1080  0:00:05
  @@ #1080  0:00:06
  @@ #1080  0:00:07
  @@ #1080  0:00:08
  @@ #1080  0:00:09
  @@ #1080  0:00:10
  @@ #1080  0:00:11
  @@ #1080  0:00:12
tfabris commented 6 years ago

Fixed by Mark Lord in the latest experimental build of Hijack. Mark deduplicates all changes on the serial port. Required changes to my code to compensate.

tfabris commented 6 years ago

Reopening issue. Mark's deduplication feature fixed this issue, but it caused more problems than it solved. Hijack V524 and later no longer deduplicates, and so this issue now recurs.

Note that this issue is not a giant problem because of the following:

Still want to fix it though. Fixing it will likely involve:

tfabris commented 6 years ago

Attaching a full log with profiling turned on.

Bug repro - full player shuffle with profiling.txt

tfabris commented 6 years ago

Increased RX buffer to 256 and it still doesn't fix the problem entirely. Helps a little though.

tfabris commented 6 years ago

Actually the RX 256 buffer seems to fix the problem well enough that, as long as I'm not in debug mode hooked up to the Arduino USB port (with extra serial messages) then I can't repro the issue any more.

Closing this issue.