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

[Users help needed] Backups of PineBuds Pro's pre-installed firmware for research #31

Open
lizz-34 opened this issue Jan 30, 2023 · 27 comments

Comments

@lizz-34
Copy link

lizz-34 commented Jan 30, 2023

The developers are trying to get ANC work, and it would be useful to get backups of the closed firmware pre-installed in PineBuds Pro with a large sampling. Of course, the pre-installed firmware binary is shared here, but Pine Store calibrates the ANC individually for each device. Developers are interested of this calibration.

Share the backup of pre-installed firmware in your both buds here in @Ralim's Google Drive: https://drive.google.com/drive/folders/1Ufo-ovEmK3cEiX5hJfNgJgkyBKkfru-F

@Ralim
Copy link
Collaborator

Ralim commented Feb 1, 2023

Every single earbud Pine makes is individually run through the calibration machine and the values are stored into the device.

While the equipment can do a lot of measurements we don't know exactly what it is calibrating.

The settings area definitely changes more than just the MAC address across buds. So the idea here is to figure out the flash format and parse the diffs to find out how much of a change the calibration is.

We hope that either it's near enough that per device calibration isn't required. Or if it is different we will need to make tooling to convert it for the open source firmware.

@gamelaster
Copy link
Member

Also note, as far as I know, there is also automatic calibration option, which will factory firmware do, if "external factory calibration" is not preset, and it should have good results.

@lizz-34
Copy link
Author

lizz-34 commented Feb 1, 2023

@WebWire-NL

Are you sure about the statement that every earbud is calibrated per device?

Tbh no info, but Ralim and others told me about the calibration in the Matrix room and I believe them.

the device is calibrated on the hardware and the original software is just calibrated on the hardware of the earbuds

?

we only need to find the right calibration values and binary's for the specific hardware which is used in the original firmware

?

Seems there's a specific piece of proprietary firmware we are missing to control the ANC chip.

What piece missing from the backup?


@Ralim

While the equipment can do a lot of measurements we don't know exactly what it is calibrating.

Are you still talking about the calibration machine at the Pine factory?

The settings area definitely changes more than just the MAC address across buds. So the idea here is to figure out the flash format and parse the diffs to find out how much of a change the calibration is.

Is MAC address stored into Flash memory? Isn't it stored into ROM?

We hope that either it's near enough that per device calibration isn't required.

You assume that the average of all calibrations is enough good?


@gamelaster

Also note, as far as I know, there is also automatic calibration option

Like this?

which will factory firmware do, if "external factory calibration" is not preset, and it should have good results.

Source for this?

@gamelaster
Copy link
Member

@lizz-34 no idea how it works, but I think it is fully automatical process. Source for all this information are info provided to me by Pine Store folks. I'm 100% sure that every bud is separately calibrated at factory.

@lizz-34 lizz-34 mentioned this issue Feb 4, 2023
6 tasks
@JF002
Copy link

JF002 commented Feb 6, 2023

I've just added my contribution to the drive :)

@ThatcherC
Copy link
Contributor

One interesting thing to note - @JF002 and I have similar firmwares, but @Ralim's is pretty different. We both have a build date of November 2, 2022 whereas @Ralim has a build date of October 2022. I found the build dates with xxd and grep like this:

xxd thatcherc-firmware-0-1672681053.bin.bkp | grep CHIP -A20
...
0013fc40: e11c 0b0c f5f6 050c 0a43 4849 503d 6265  .........CHIP=be
0013fc50: 7374 3233 3030 700a 4b45 524e 454c 3d52  st2300p.KERNEL=R
0013fc60: 5458 0a43 5241 5348 5f44 554d 505f 5349  TX.CRASH_DUMP_SI
0013fc70: 5a45 3d30 0a41 5544 5f53 4543 5f53 495a  ZE=0.AUD_SEC_SIZ
0013fc80: 453d 3078 3130 3030 300a 5553 4552 5f53  E=0x10000.USER_S
0013fc90: 4543 5f53 495a 453d 3078 3130 3030 0a46  EC_SIZE=0x1000.F
0013fca0: 4143 545f 5345 435f 5349 5a45 3d30 7831  ACT_SEC_SIZE=0x1
0013fcb0: 3030 300a 4e56 5f52 4543 5f44 4556 5f56  000.NV_REC_DEV_V
0013fcc0: 4552 3d32 0a46 4c41 5348 5f42 4153 453d  ER=2.FLASH_BASE=
0013fcd0: 3078 3338 3030 3030 3030 0a46 4c41 5348  0x38000000.FLASH
0013fce0: 5f53 495a 453d 3078 3430 3030 3030 0a4f  _SIZE=0x400000.O
0013fcf0: 5441 5f43 4f44 455f 4f46 4653 4554 3d30  TA_CODE_OFFSET=0
0013fd00: 7831 3830 3030 0a43 5243 3332 5f4f 465f  x18000.CRC32_OF_
0013fd10: 494d 4147 453d 3078 3030 3030 3030 3030  IMAGE=0x00000000
0013fd20: 0a42 5549 4c44 5f44 4154 453d 4e6f 7620  .BUILD_DATE=Nov 
0013fd30: 2032 2032 3032 3220 3038 3a32 353a 3035   2 2022 08:25:05
0013fd40: 0a52 4556 5f49 4e46 4f3d 3a41 4330 380a  .REV_INFO=:AC08.
$ xxd jf002-firmware-1675719248-0.bin.bkp | grep CHIP -A20
...
0013fc40: e11c 0b0c f5f6 050c 0a43 4849 503d 6265  .........CHIP=be
0013fc50: 7374 3233 3030 700a 4b45 524e 454c 3d52  st2300p.KERNEL=R
0013fc60: 5458 0a43 5241 5348 5f44 554d 505f 5349  TX.CRASH_DUMP_SI
0013fc70: 5a45 3d30 0a41 5544 5f53 4543 5f53 495a  ZE=0.AUD_SEC_SIZ
0013fc80: 453d 3078 3130 3030 300a 5553 4552 5f53  E=0x10000.USER_S
0013fc90: 4543 5f53 495a 453d 3078 3130 3030 0a46  EC_SIZE=0x1000.F
0013fca0: 4143 545f 5345 435f 5349 5a45 3d30 7831  ACT_SEC_SIZE=0x1
0013fcb0: 3030 300a 4e56 5f52 4543 5f44 4556 5f56  000.NV_REC_DEV_V
0013fcc0: 4552 3d32 0a46 4c41 5348 5f42 4153 453d  ER=2.FLASH_BASE=
0013fcd0: 3078 3338 3030 3030 3030 0a46 4c41 5348  0x38000000.FLASH
0013fce0: 5f53 495a 453d 3078 3430 3030 3030 0a4f  _SIZE=0x400000.O
0013fcf0: 5441 5f43 4f44 455f 4f46 4653 4554 3d30  TA_CODE_OFFSET=0
0013fd00: 7831 3830 3030 0a43 5243 3332 5f4f 465f  x18000.CRC32_OF_
0013fd10: 494d 4147 453d 3078 3030 3030 3030 3030  IMAGE=0x00000000
0013fd20: 0a42 5549 4c44 5f44 4154 453d 4e6f 7620  .BUILD_DATE=Nov 
0013fd30: 2032 2032 3032 3220 3038 3a32 353a 3035   2 2022 08:25:05
0013fd40: 0a52 4556 5f49 4e46 4f3d 3a41 4330 380a  .REV_INFO=:AC08.
$ xxd PineBudLeftMaster.bin | grep CHIP -A20
...
0013fa00: 0a43 4849 503d 6265 7374 3233 3030 700a  .CHIP=best2300p.
0013fa10: 4b45 524e 454c 3d52 5458 0a43 5241 5348  KERNEL=RTX.CRASH
0013fa20: 5f44 554d 505f 5349 5a45 3d30 0a41 5544  _DUMP_SIZE=0.AUD
0013fa30: 5f53 4543 5f53 495a 453d 3078 3130 3030  _SEC_SIZE=0x1000
0013fa40: 300a 5553 4552 5f53 4543 5f53 495a 453d  0.USER_SEC_SIZE=
0013fa50: 3078 3130 3030 0a46 4143 545f 5345 435f  0x1000.FACT_SEC_
0013fa60: 5349 5a45 3d30 7831 3030 300a 4e56 5f52  SIZE=0x1000.NV_R
0013fa70: 4543 5f44 4556 5f56 4552 3d32 0a46 4c41  EC_DEV_VER=2.FLA
0013fa80: 5348 5f42 4153 453d 3078 3338 3030 3030  SH_BASE=0x380000
0013fa90: 3030 0a46 4c41 5348 5f53 495a 453d 3078  00.FLASH_SIZE=0x
0013faa0: 3430 3030 3030 0a4f 5441 5f43 4f44 455f  400000.OTA_CODE_
0013fab0: 4f46 4653 4554 3d30 7831 3830 3030 0a43  OFFSET=0x18000.C
0013fac0: 5243 3332 5f4f 465f 494d 4147 453d 3078  RC32_OF_IMAGE=0x
0013fad0: 3030 3030 3030 3030 0a42 5549 4c44 5f44  00000000.BUILD_D
0013fae0: 4154 453d 4f63 7420 3230 2032 3032 3220  ATE=Oct 20 2022 
0013faf0: 3139 3a30 393a 3038 0a52 4556 5f49 4e46  19:09:08.REV_INF
0013fb00: 4f3d 3a41 4330 380a 0000 0000 0000 0000  O=:AC08.........

@gamelaster
Copy link
Member

@ThatcherC it is very possible that @Ralim have first batch device.

@ThatcherC
Copy link
Contributor

Using binwalk to run a diff on the binaries, my image and @JF002's only differ on 40 or so lines (16 bytes per line) of the binwalk output, which is pretty small considing the 4MB image size. Here's the command I used to get the binwalk diff:

$ binwalk -Wi user-fws/thatcherc-firmware-0-1672681053.bin.bkp user-fws/thatcherc-firmware-1-1672681053.bin.bkp

@Ralim
Copy link
Collaborator

Ralim commented Feb 8, 2023

Yeah my buds is an earlier batch so not surprised its different tbqh.
Was hoping otherse had a matching batch to make it easier to figure out :)

@JF002
Copy link

JF002 commented Feb 9, 2023

I noticed that each time I run the backup script, the backup files are a bit different (a few lines are different at the end of the file). Is this expected?

@ThatcherC
Copy link
Contributor

@JF002 I noticed the same thing - a handful of bytes are different at the end of the file. It came up on the Discord too and the conclusion is that it's probably some state or connection information that the Buds store, like Bluetooth info about the phone/computer they're connected to.

@zjstraus
Copy link

I just added another dump from a pair with Nov 2nd build dates; taken straight out of the package.

@futurl
Copy link

futurl commented Mar 4, 2023

I would love to contribute a firmware backup.
How do I upload it to Ralims Google Drive (user rights needed)?

@FintasticMan
Copy link
Contributor

Just added mine myself, I didn't need any permissions, just a Google account.

@futurl
Copy link

futurl commented Mar 4, 2023

I do not have google. Anybody willing to upload my files?

@FintasticMan
Copy link
Contributor

No problem! Done.

@jdc-cunningham
Copy link

Added (jcun4128)

Got my Pinebuds Pro on Apr 10, 2023

@grouNDfx
Copy link

Added (grouNDfx)

Pinebuds Pro purchased May 11, 2023

@daygr
Copy link

daygr commented May 31, 2023

Added, purchased April 28, 2023

@nik012003
Copy link
Contributor

Added, purchased May 24. 2023

@shymega
Copy link
Collaborator

shymega commented Jun 26, 2023

I'm wondering if it's best, to avoid cluttering notifications, for when people upload their device info to the GDrive, they react to this comment with :+1:, and this way we don't get bombarded with notifications.

This should have been done from the beginning, to be honest, but it's something I've noticed.

@julianfairfax
Copy link

I also don't have a Google account. Here are my files:
firmware-1687865339-.zip

@gkaklas
Copy link

gkaklas commented Jul 3, 2023

Hello and thank you for your work! Sorry for the clutter, I just wanted to note something for my uploaded files.

I went to use them one day and they started showing as two separate devices, but both discoverable, ANC working, audio working (don't recall testing how stereo worked). I wish I had backed up the firmware earlier :P.

I don't have a spare Windows installation to use the recommended flashing utility, so I just used bestool write-image: reflashing the backed up firmware and the provided one (+boot as the utility manual notes) didn't solve the issue, however I flashed the current main and anc-testing and they work great.

BTW I searched and found another user posting about the same issue on Reddit, and they said flashing with the recommended utility fixed the issue for them (unfortunately I can't find the link to the post now).

Just wanted to note this in case there is any difference in the configuration section etc. I probably have an early batch, since I received them in December 2022.

@Yotson
Copy link

Yotson commented Jul 16, 2023

I also don't have a Google account. Here are mine.
firmware-1689501067.zip

@hamblingreen
Copy link

Here are the firmware backups for PineBuds that I purchased on November 9, 2023. I purchased only the buds as replacement parts, as I already had the case. I'm not sure whether that'll be relevant, but I thought I'd include it anyway.
firmware-1700097469.zip

@nrbuster
Copy link

Attaching my buds default firmware.
Received these on 2/18/2024, only just now changing my firmware out.
firmware-backups.tar.gz

@austingarrigus
Copy link

Here is my factory firmware.
firmware-backups.tar.gz

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