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

Stuttering audio #6

Open
xddxd opened this issue Feb 3, 2025 · 13 comments
Open

Stuttering audio #6

xddxd opened this issue Feb 3, 2025 · 13 comments

Comments

@xddxd
Copy link

xddxd commented Feb 3, 2025

Hi,

So I’m having the same issue as the person on #1 , the audio on an iPhone 15 Pro running iOS 18.3 is crackling, stuttering and jumping. Meanwhile a Nokia 8 on Android 12 (PixelExperience 12.1) is playing almost flawlessly (have to keep audio down on the phone down otherwise clipping happens). I don’t know what codec or sampling rate the iPhone is using, but the Android connects using SBC and 48KHz.

Forgot to add: car is a Signum with a DVD90 + CID (both Siemens/VDO)

@PNKP237
Copy link
Owner

PNKP237 commented Feb 3, 2025

I used an iPhone 15 (non-Pro) in my vehicle with EHU32 and tested it extensively since I knew that the underlying library for handling A2DP audio has had problems with iOS devices in the past but never had any issues. Found something else here with a suggested fix: SOLVED Poor quality audio from IOS devices. #582
Certain ESP32 boards seem to be an issue here.

Made a build of EHU32 v0.9.3 with the data out pin changed for you to test (also compiled with updated libraries). Can't really test it on my hardware.
Before you flash your board please remember to connect the DIN pin on PCM5102 to D19 (instead of D22).

EHU32_093_DOUT_19.zip

Also please describe your board, is it the type-C version? What's written on the metal shielding? What USB-UART chip is on the board, is it the CP2102 or WCH something or other?

@xddxd
Copy link
Author

xddxd commented Feb 3, 2025

I’ll try out this version and report back, I can’t tell what is written anymore because the esp32 is glued into a box and is upside down. I do remember the UART chip being an obvious clone though. Safe to say the rest of the board is likely chinesium.

I have to say though, amazing work, I hate aftermarket radios and this is just perfect, almost jumped out of my chair when I found this.

@PNKP237
Copy link
Owner

PNKP237 commented Feb 3, 2025

Got myself an older iPhone for testing but I would appreciate it very much if you could take the time to describe/photograph the board in detail, I've got many variants in my collection but testing each one of them is not feasible, so I want to narrow it down to the problematic ones and work out a fix (mainly for other people attempting to put this together).

I'm in similar boat here since this project is partially a product of my disdain for aftermarket headunits which look out of place and don't integrate with the car like the stock headunits do. Also, how often do you see Aux displayed? I'm still in the process of refining the display blocking/overwriting logic but you're the first person with anything other than CD30 sharing feedback so I'd like to ask. I do most of the development on CD30MP3 with GID and EHU32 works seamlessly with that but each time I test new code with CD70 there's always something that doesn't work exactly right, still getting Aux to show up here and there (probably RDS and navi data getting through and messing with my logic). Not to mention that debugging is difficult when you've got to focus on driving. Hope you understand my frustration here.

@xddxd
Copy link
Author

xddxd commented Feb 3, 2025

Aux does randomly pop up yeah, I haven’t noticed a pattern though. Sometimes it doesn’t pop up for a long time, sometimes the text goes blank for half a second and goes back to normal.
There’s some character limit too it seems, if the first and second lines are really long the 3rd line gets cut off and ends with a "ÿ”.
Also voltage display is incorrect, shows anywhere between 18-24V, sometimes 4V and doesn’t react to actual voltage changes so it probably is reading bogus data. Likely a difference between Astra H/Zafira B and Vectra C/Signum ECC units. Coolant and RPM was okay though, the car has a Z19DTH.

Aside from that, having steering wheel control on bluetooth is amazing, I should be able to provide you with pictures of the ESP tomorrow. I also tried an iPhone 11 but it exhibited the same audio issue. Looked 100% like a Bluetooth issue, I muted the iPhone but audio was still playing.

@xddxd
Copy link
Author

xddxd commented Feb 4, 2025

Here are some board pictures.

Image
Image
Image

@PNKP237
Copy link
Owner

PNKP237 commented Feb 4, 2025

There’s some character limit too it seems, if the first and second lines are really long the 3rd line gets cut off and ends with a "ÿ”.

I might try to extend the buffer data to support up to 512 chars in some later versions. As for ÿ showing up that's rather strange, unfortunately I don't have a CID on hand to investigate.

Also voltage display is incorrect, shows anywhere between 18-24V, sometimes 4V and doesn’t react to actual voltage changes so it probably is reading bogus data.

In the next release I'll be moving away from reading data from ECC and read all the data (including voltage) from the display. Hopefully that will work better across different models

I muted the iPhone but audio was still playing.

That's actually proper behavior since I have forced the audio receiver to NOT apply any volume control and iOS respects that, unfortunately android's behavior varies with manufacturer and once it detects no volume control it applies the volume correction locally before sending the data off to the bluetooth receiver. Not only does that reduce the audio quality (lower dynamic range) but also can result in clipping (as you have observed with your Nokia smartphone). Not much to be done about that other than setting the volume to 50% and hope no correction is applied.

@xddxd
Copy link
Author

xddxd commented Feb 4, 2025

Images of the “ÿ” bug.

Image
Image

@PNKP237
Copy link
Owner

PNKP237 commented Feb 4, 2025

Thanks for the photos, tried the same album/title/artist (from apple music) with GID but it works fine here but gets cut off earlier. Can you tell me what's the GM part number for that display? I vaguely remember that some vectras and signums had an early CID model (siemens vdo too) that only has two lines of data on the vehicle tab (the rightmost one), is it that one?
Have you been able to check whether moving the I2S data out pin to D19 changed anything in terms of audio playback from iOS?

@xddxd
Copy link
Author

xddxd commented Feb 4, 2025

Hi, swapped the pin and flashed the software, no change in iOS but Android now plays fine upto like 80% volume. Display is 24461297.

EDIT: not sure if it’s due to the source volume change, but the dynamic range? (idk how to call it, the quality is much better when there is a lot of different sounds going on) is much better on the software you sent.

@PNKP237
Copy link
Owner

PNKP237 commented Feb 4, 2025

Right, thanks for trying it out and all the feedback, I'll do some testing with the iPhone and different ESP32 boards over the upcoming weekend. Also, if you have some spare time and any other ESP32 boards at your disposal you might wanna try testing with them.

@xddxd
Copy link
Author

xddxd commented Feb 6, 2025

I do have more boards, unfortunately they’re from the same batch and identical to the one I’m using, doubt they’re going to make a difference.

@PNKP237
Copy link
Owner

PNKP237 commented Feb 9, 2025

Do you happen to have an aliexpress listing for that board? The exact one you got these ESPs from.
I have tested 5 different ESP32 boards today and couldn't replicate the issue, audio is fine with an iPhone X running iOS 16.7.10 playing music from Spotify.

Click here for a photo of the tested boards

Image

One of the boards is from WeAct, others are random (ESP-WROOM-32, ESP32-WROOM-32D, ESP32-WROOM-32UE, ESP32-WROOM-32U). Note that your ESP32-WROOM-32D module visually differs from mine, it's likely that one of them is a clone (or both are clones).

@xddxd
Copy link
Author

xddxd commented Feb 10, 2025

I do not have a listing anymore, the boards were boght over a year ago.

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