rhysmorgan134 / node-CarPlay

MIT License
131 stars 23 forks source link

Navigation Audio issues #71

Closed rhysmorgan134 closed 8 months ago

rhysmorgan134 commented 8 months ago

I've only just picked up on this as I tend to use the navigation without audio directions. However it seems when navigation audio plays it is feeding into the same audio player, but with a different initial frequency. I have added a prompt whenever a new audio format is found, and music is playing at 48khz 2 channel. When a navigation direction begins, I get a new audio player, at 44.1khz 2 channels.

All seems fine.

However when the audio packets are received for nav, they have the decode type set to 4. As audio is already playing at 48khz it creates mass distortion.

I am wondering whether my dongle version contains a bug or does anyone else see this?

Secondly, I wonder whether we should create a second set of audio players to cover the case of when nav sample rate is the same as music? I am happy to take this on, but just want to ensure it's not a bug on my firmware, as regardless the decodeType received on the first packet does not match the following packets. (I have verified and audio is slowed down when the nav is forced to play at 44.1khz, its not a huge amount, so not easily discernable)

@gozmanyoni @steelbrain

rhysmorgan134 commented 8 months ago

Audio as nav sends the audio command

Screenshot 2023-10-25 at 17 42 41

Audio once nav actually start playing, notice the audio type of 2, but sample rate still 48khz

Screenshot 2023-10-25 at 17 43 52
gozmanyoni commented 8 months ago

@rhysmorgan134 I will do some testing with nav and report back

gozmanyoni commented 8 months ago

Hmm, for me i observe the same, nav audio starts with 44.1 and then sends more data thats indicated to be 48

format - Frequency_Channels_audioType

First event - 44100_2_2

Following - 48000_2_2

I'd bet its a bug in the dongle and we can force it.

Meanwhile i opened a PR addressing the other issues you found!