Repository navigation
Conversation
|
Thanks for this. It's the right place for the switch (sitd's
Smaller: Two things I need to decide, and your view helps:
Since |
|
Derek asked on #374 that the two of us compare this with #374's earpiece route and tell him which design should carry on. I have the other 9a here (the palmtop), so here is my reading, and what I'd like to try with your branch. The two side by side:
I think yours is the design to carry on. A switch during the call is what the Phone app's Speaker button needs, and #374's route can't give it. It is also smaller and leaves the PCMs and the modem alone. Two things from my side that bear on it:
What I'll do, unless you'd rather I didn't: run your branch as it is on the palmtop and post here the echo the far end gets in each output. I can measure that with nobody listening (a call to a talking clock, with the uplink's samples from the AoC's log; If the numbers agree with your ears, I'll tell Derek this one carries the earpiece, and I'll take the earpiece route out of #374 so the two don't collide. |
|
Thank you both. @W4HO-ham, thank you for reading this next to your own #374 and saying plainly that you'd carry this design on; a switch during the call is what the Speaker button needs, and your AoC-log results are a good reason to drop the "earpiece needs the tuning" rule. I agree with the direction: one earpiece for the 9a, this one, with #374 giving up its route once this is ready. @den-kloot, the branch hasn't changed since my comment of 11 November, so the five points there are all still open, and so are my two questions: how did 180 sound at your ear in a quiet room, and did the far end hear itself in either output? Are you still on this? If you'd rather hand it over, say so and W4HO can open a pull request that keeps your commit and adds the fixes; if I don't hear from you in a few days I'll ask him to do that. One more point I found on this read:
W4HO, yes to trying it on your 9a, with these conditions:
That run would also be point 5 of my list (the code itself on a call), so it's worth having whoever finishes the branch. The version is mine to set at merge; 0.3.35 has shipped, and 0.3.36 and 0.3.37 are spoken for. Before this merges I'll still make the call on my 7 Pro that I promised: the earpiece as today, the status reading |
|
Thanks @derekross, and sorry for the silence. I'll be honest about what I can still add here: not much. What I can report is only what my 9a does as it is set up now (
I can't answer your two questions properly: I don't have a build of this branch on the phone, and I can't judge earpiece levels like 180 well enough for it to count as a measurement. So yes, please hand it over. @W4HO-ham, it's yours if you want it: keep my commit or rewrite it, whatever works with your #374 results and Derek's six points. I'm glad to run a build on my 9a and tell you what I hear, and what the other person hears. It would also help if other 9a owners could try it and say how calls sound at the ear and on speaker, and whether the far end hears an echo. My ears shouldn't be the only data point. |
… earpiece
On the Pixel 9a (tegu) the TAS2572 call route always ran as speakerphone and
the audio "speaker" command was unimplemented ("not configured yet"), so the
shell's speaker toggle could not move a call off the loudspeaker.
Add VoiceAudio.set_output("speaker"|"earpiece"): the top amplifier is the
earpiece and the bottom the loudspeaker (this module's docstring), so earpiece
mutes the bottom's Speaker Digital Volume and speaker runs both at the
conservative gain. The Incall sink is muted across the gain change, and the
pre-call gains return from `saved` when the call ends, so a switch is a plain,
reversible volume change that never touches the PCM or modem state. Wire the
{"action":"audio","what":"speaker","value":"on"|"off"} command to it, start a
call on [audio] output (default "speaker", so unchanged behaviour), and report
the live output and whether switching is available (tegu) in the status.
Switching on other routes (the 7 Pro's CS35L41 earpiece mode) is left as is;
set_output is refused there for now.
Tested on a Pixel 9a during a live call: the exact mixer sequence set_output
performs (Bottom Speaker Digital Volume 0 for earpiece vs 180 for speaker)
moved the audio between the earpiece (top amplifier only) and the loudspeaker,
confirmed by ear, and back. Unit tests cover set_output, the configured
earpiece start, the reported status fields and the speaker command; the
package's test/all passes bar one pre-existing failure unrelated to this
change (test_attach_bearer, which reads the live phone's data configuration).
Not yet exercised: set_output running inside sitd during a call rather than
the identical sequence by hand (needs a fresh CP, i.e. a reboot, to load).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ck (review point 3)
…eaker command (points 6 and smaller)
0a573c5 to
df2bb83
Compare
|
@W4HO-ham, @derekross: so you don't start from zero, I've pushed what I had locally, and I've now measured the echo question from Derek's review instead of guessing. The branchRebuilt on today's main (
All 299 unit tests and Does the far end hear itself? (measured, 2026-11-17)An automated call instead of my ears: the 9a calls a landline whose SIP account a PC answers (baresip, G.711 A-law). For each phase the PC plays German test speech (Piper, 6.8 s) into the call at three levels, and records what the phone sends back while only the PC talks. Anything correlated with the PC's speech is echo. The phone lay flat on a table in a quiet room.
"floor" is what the phone sends during 4 s of silence from the PC. "back" is the level of the return while the PC talks, aligned to the speech. What I read from it:
The noise floor on the loudspeaker is 16 dB higher than on the earpiece. That's probably the AoC's processing for speakerphone, but I haven't checked. The test is a script pair (phone + PC), about 4 minutes per run. I can run it again on any build, for example W4HO's with 160 and the handset tuning. Still open
|
|
Thank you, @den-kloot, both for saying plainly where you stand and for not leaving it at that: the rebuilt branch answers all six points, and the echo measurement is better evidence than anyone's ears. I read the new code: the status is a 9a fact again, a switch unmutes only after both gains read back, a configured earpiece starts on the earpiece, and a mistyped Yes to the hand-over. @W4HO-ham, it's yours if you'll take it: open a pull request that keeps den-kloot's commits and adds what's below, and I'll close this one in its favour. #374 then gives up its earpiece route, as you offered. Before it leaves draft:
One question, den-kloot: after copying the two files, did you reboot, or restart the phone service? On the 9a it should be a reboot. The measurement scripts would be welcome under |
What and why
On the Pixel 9a (tegu) the TAS2572 call route always ran as speakerphone, and sitd's
{"action":"audio","what":"speaker"}command was a stub ("Speakerphone routing is not configured yet"). So the shell's Speaker toggle (omatelSetRoute→ callaudiodEnableSpeaker) had nothing to act on: a call could not be moved off the loudspeaker.This implements the switch in the one place that actually routes this hardware — sitd's
voice_audio.VoiceAudio.set_output("speaker"|"earpiece"): the top amplifier is the earpiece and the bottom the loudspeaker (the module's own docstring).earpiecemutes the bottom's Speaker Digital Volume;speakerruns both at the conservative gain. The Incall sink is muted across the gain change, and the pre-call gains return fromsavedwhen the call ends — so a switch is a plain, reversible volume change that never touches the PCM or modem state.service.py: wires theaudio/speakercommand toset_output, starts a call on[audio] output(defaultspeaker, so behaviour is unchanged until asked), and reports the live output (speaker) and whether switching is available (speaker_available, true on the tegu route) in the status.Switching on the 7 Pro's CS35L41 earpiece-mode route is left as it is;
set_outputis refused there for now (tegu only).Device and build
google,tegu-aoc-snd-card, kernel7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78.Tested
set_outputperforms (Bottom Speaker Digital Volume0for earpiece vs180for speaker, around an Incall-sink mute) was applied during an active VoLTE call on the 9a. The audio moved from the loudspeaker (top+bottom) to the earpiece (top amplifier only, localised to the top of the phone and quieter at the ear) and back, confirmed by ear, switched several times.set_output(switch + restore), a configured earpiece start, the reported status fields and thespeakercommand.packages/omamobile-modem-sit/test/allpasses bar one pre-existing failure unrelated to this change (test_attach_bearer, which reads the live phone's data configuration when run on the device; it fails identically onmainwithout this change).set_outputrunning inside sitd during a call, rather than the identical mixer sequence applied by hand — that needs a fresh CP (a reboot) to load the new module. The code paths are covered by the unit tests; only the in-situ run is pending.Notes
org.mobian_project.CallAudio, but callaudiod isn't present on these phones and the AoC voice path isn't UCM-routable, so the button currently no-ops. This PR gives the daemon side the capability; wiring omatel/the button to sitd (or a small callaudiod stand-in) is a follow-up for the maintainer to decide.🤖 Generated with Claude Code