Majestic: SIP is not G.711-only any more, and the mic can be processed - #505
Conversation
Two audio changes landed in majestic and the wiki still described the world before them, in the one place readers go to set a doorbell up. SIP no longer advertises G.711 alone. It offers Opus and G.711 in a single m=audio line and takes whichever the far end picks, so calls are wideband when the other side can manage it. The doorbell how-to said "two-way G.711 audio" in three places. More importantly it told readers to set `audio.codec: ulaw` and `audio.srate: 8000`, and the troubleshooting section repeated the advice for a 488. Neither was ever a SIP setting and both are now actively harmful: the SIP stack builds its own offer and never reads `audio.codec`, so setting it only narrows RTSP, the /audio.* endpoints and recordings. `audio.srate` was a real constraint once, but G.711 encoding resamples to 8 kHz from whatever the microphone captures, so a camera at 48 kHz makes correct calls and keeps full-bandwidth recordings at the same time. That was exactly the tradeoff a user reported having to make, and the page still asked for it. The same stale 8 kHz requirement was repeated for A-law and mu-law RTMP push, and is corrected there too. Voice quality enhancement is new and was documented nowhere. It gets the config keys, a row in the flavour table and a section of its own, because two things about it will otherwise generate questions. It is Ultimate-only *and* SoC-gated, which works out to two of the five chips Ultimate is published for -- Hi3516EV200 and GK7205V200 -- so a reader on an Ultimate camera may still find no keys. And the DSP stages are shared libraries the SDK loads on demand, absent from older firmware images, so the keys can be present and the feature still do nothing; the log line that says so is quoted, with the answer being a firmware update rather than anything in majestic. Adding the three undocumented audio keys (device, dual, extern) is left out deliberately and is worth a separate pass.
PR Summary by QodoCorrect Majestic SIP audio guidance and document microphone VQE
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
Review caught a claim I introduced: rewriting the prerequisite check I said /audio.ulaw "is codec-free, so it needs nothing installed to play". It is not. The endpoint emits raw headerless mu-law, so a browser plays nothing and a reader following the step concludes the microphone is broken when it is fine. The check now points at /audio.html, the built-in player page, which genuinely needs nothing installed -- it is an <audio> element with the container-wrapped sources. The raw endpoint is still mentioned, with the ffplay invocation that works. Chasing the right rate for that invocation turned up the same stale fact this branch already corrects elsewhere. G.711 encoding resamples to 8 kHz now, so /audio.alaw and /audio.ulaw are always 8 kHz whatever the microphone captures at, and the ffplay examples on the streamer page still passed -ar 48000 for them. Copying those lines gets audio at six times the speed. Corrected, with a note on which endpoints follow audio.srate and which do not.
An audit of the wiki's Majestic SIP and audio coverage turned up three things that are wrong against merged behaviour, plus a feature documented nowhere. All four are fixed here.
SIP is not G.711-only any more
majesticoffers Opus and G.711 in onem=audioline and uses whichever the far end picks. The doorbell how-to said "two-way G.711 audio" in the intro, the call-flow walkthrough, and the/audio.ulawaside.The how-to asked readers to break their own camera
This is the one worth reading carefully. Step 3 said:
and the
488 Not Acceptable Hereentry repeated it ("changeaudio.codecaccordingly").Neither key has ever been a SIP setting, and following that advice costs you real quality:
audio.codecselects the codec for RTSP, the/audio.*endpoints and recordings. The SIP stack builds its own SDP offer and never reads it. Setting it toulawfor the doorbell's benefit only makes everything else on the camera narrowband.audio.sratewas a genuine constraint once. It is not now: G.711 encoding resamples to 8 kHz from whatever the microphone captures (the fix patched the encoders, not the callers), so a camera at 48 kHz makes correct calls and keeps full-bandwidth recordings.That second one is exactly the tradeoff a user reported having to make — good recordings or working calls, pick one — and the page was still asking for it after the fix landed.
Both are replaced with a short note explaining why there is no codec or rate line in the SIP config, and the 488 entry now points at the PBX's codec list, which is where the actual mismatch is.
The same stale 8 kHz requirement was repeated for A-law/µ-law RTMP push in
majestic-streamer.mdand is corrected there too.VQE was documented nowhere
New in majestic — noise reduction, AGC and a high-pass filter on the microphone capture channel. It gets the config keys, a row in the flavour table, and a section of its own.
Two things about it will generate questions otherwise, so both are stated plainly:
It is Ultimate and SoC-gated, which works out to two of the five chips Ultimate is published for:
(Majestic also builds it for 3516C500, but no Ultimate image is published for that family, so it does not reach anyone today.)
The keys can exist and the feature still do nothing. The DSP stages are shared libraries the SDK
dlopens on demand, and images built before OpenIPC/firmware#2361 do not carry them. The section quotes the log line that says so and points at a firmware update rather than at any majestic setting.Deliberately not included
The three genuinely undocumented
audio.*keys —device,dual,extern— are unconditional in the schema but absent frommajestic-config.md, which bills itself as "a reference of what exists". Left for a separate pass so this PR stays about the stale SIP advice and the new feature.Also noted while auditing, well out of scope here:
ru/has no Majestic documentation at all.