Repository navigation
Nils's (dwaris) S9+ speaker fixes: the first sound, and the MAX98512's enable - #295
Merged
Merged
Conversation
During early boot, ABOX's UAIF1 stream can start before the speaker amplifier driver completes its identify/probe and registers via hakios_abox_set_amp(). Poll with a bounded retry (up to 1 s) in amps_start() before giving up on the speaker amplifiers. (cherry picked from commit 761450a)
… GLOBAL_SHDN Waking the MAX98512 amplifiers out of global shutdown (GLOBAL_SHDN = 1) powers up internal charge pumps and analog stages, during which immediate I2C reads NACK (bus 0x400) and abort the driver. Add a 2 ms wake delay after writing GLOBAL_SHDN = 1 (matching vendor driver usleep_range), and add a 1 ms interval between raw_read and raw_write retries. (cherry picked from commit 6892d35)
… at every sound 06edb8d (dwaris) lets amps_start() wait up to a second (100 x 10 ms) for the amplifiers' driver to register, which cures the first sound being lost on the S9+ when the stream starts before the MAX98512 driver has registered. amps_start() is called again at every sound while no amplifier runs, and neither amp_given_up nor amp_none_said stops that, so on a machine or a configuration where no amplifiers' driver ever registers each of those calls held the stream's thread for the full second. The wait is now taken once (amp_waited); after it a driver that registers later is still picked up at the next sound, as before his change, without waiting.
…ads (Anan Jaser's device commits) scion-starlte 87be95cc (pull request 60) and scion-star2lte ee5bfa36 (pull request 3): the S9+'s device.conf as seen running, its own firmware lists and fetch script (no vendor file), which build.sh DEVICE=star2lte of this repository looks for, and the S9's Bluetooth page. The pins were at the commits before those.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@dwaris, thank you for this. You found these on your own S9+ at the same time as Anan Jaser was working through the same phone, and two of your four commits fix things his did not.
These are commits of dwaris/scion-kernel
bringup-star2lte, cherry-picked onto main with their authorship kept (git cherry-pick -x).Taken (2 of 4)
761450a5abox: await amp_hook registration in amps_start (here 06edb8d). The first sound is no longer lost when the stream starts before the amplifiers' driver has registered. One follow-up commit of ours (3041290): the wait of up to a second is taken once in a run, not at every sound.amps_start()is called again at each sound while no amplifier runs, so where no amplifiers' driver ever registers every one of those calls would have held the stream's thread for a second.6892d353max98512: wake delay and retry backoff for GLOBAL_SHDN (here 798a759). Kept as it is. It sits well beside Anan Jaser's bac1971 (the enable read back for up to 50 ms, with a bus reset): the 2 ms before the first read makes that first read less likely to fail at all, and the 1 ms between a transfer's three tries only costs time when a transfer has already failed. Harmless on both phones by reading; whether Samsung's driver waits the same 2 ms I have not checked against its source.Not taken (2 of 4), and why
21f1cb07ssp: shub_rot boot-arg. Superseded by bbbca06 (Anan Jaser), which is on main: the S9+ now sends Samsung's own mounting position (7; the S9 sends 4) to the sensor hub in its formation, and the hub turns the accelerometer's and the gyroscope's axes itself.shub_acc_pos=<0-7>is the manual override. A second rotation in the driver after the hub's would turn the S9+'s axes twice, and two switches for one thing would fight. Whatshub_rotdid that the position does not: it also turned the magnetometer. The magnetometer's position is still the fixed 5 for both phones; if the S9+'s compass turns out wrong, that wants ashub_mag_pos=besideshub_acc_pos=, which is not in this pull request.e7f0ab53configs: document shub_rot (generated catalogue lines for the argument above).Also here
devices/manifest.conf: the S9 and S9+ device repositories at their heads (Anan Jaser's device commits: the S9+'sdevice.confas seen running, its firmware lists and fetch script), whichbuild.sh DEVICE=star2ltelooks for; the device pages made again.Checked (build machine, no phone)
npm run preflightdoes not apply (no Node project).🤖 Generated with Claude Code