Skip to content
/ wiki Public

Majestic: SIP is not G.711-only any more, and the mic can be processed - #505

Merged
openipc-ai merged 2 commits into
masterfrom
majestic-sip-audio-and-vqe
Sep 4, 2026
Merged

Majestic: SIP is not G.711-only any more, and the mic can be processed#505
openipc-ai merged 2 commits into
masterfrom
majestic-sip-audio-and-vqe

Conversation

@openipc-ai

@openipc-ai openipc-ai commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

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

majestic offers Opus and G.711 in one m=audio line 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.ulaw aside.

The how-to asked readers to break their own camera

This is the one worth reading carefully. Step 3 said:

audio:
  codec: ulaw              # PCMU — also try alaw if your PBX prefers
  srate: 8000

and the 488 Not Acceptable Here entry repeated it ("change audio.codec accordingly").

Neither key has ever been a SIP setting, and following that advice costs you real quality:

  • audio.codec selects the codec for RTSP, the /audio.* endpoints and recordings. The SIP stack builds its own SDP offer and never reads it. Setting it to ulaw for the doorbell's benefit only makes everything else on the camera narrowband.
  • audio.srate was 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.md and 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:

chip SoC code VQE
Hi3516EV200 3516E200
GK7205V200 7205200
GK7205V500 7205500
Hi3516CV200 3518E200
Hi3516CV300 3516C300

(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 from majestic-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.

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.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Correct Majestic SIP audio guidance and document microphone VQE

🐞 Bug fix 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Correct SIP guidance to describe Opus/G.711 negotiation without changing global audio settings.
• Remove obsolete 8 kHz requirements from SIP and RTMP instructions.
• Document VQE controls, processing stages, hardware eligibility, and firmware dependencies.
Diagram

graph TD
  CFG["Audio config"] --> MIC["Mic capture"] --> VQE{"VQE enabled?"} -->|Yes| DSP["DSP stages"] --> ENC["Audio encoders"] --> SIP["SIP audio"] --> PBX["Remote PBX"]
  VQE -->|No| ENC
  ENC --> MEDIA["RTSP and media"]
Loading
High-Level Assessment

The current approach is appropriate: correct protocol-specific advice in the doorbell guide, list configuration keys in the reference, and explain VQE behavior and constraints in the streamer guide. A dedicated VQE page was considered but would fragment closely related audio documentation without reducing duplication meaningfully.

Files changed (3) +132 / -14

Bug fix (1) +35 / -12
howto-doorbell-from-camera.mdCorrect SIP codec and sample-rate guidance +35/-12

Correct SIP codec and sample-rate guidance

• Updates the doorbell guide to describe Opus/G.711 negotiation and removes harmful recommendations to force global µ-law and 8 kHz settings. Adds Asterisk Opus guidance and redirects codec mismatch troubleshooting to the PBX codec list.

en/howto-doorbell-from-camera.md

Documentation (2) +97 / -2
majestic-config.mdAdd the VQE configuration reference +15/-0

Add the VQE configuration reference

• Documents the master VQE switch and ANR, AGC, and high-pass filter tuning keys. Notes that availability depends on the Ultimate build and supported SoC.

en/majestic-config.md

majestic-streamer.mdDocument resampling and microphone VQE behavior +82/-2

Document resampling and microphone VQE behavior

• Removes the obsolete 8 kHz RTMP requirement and explains encoder resampling. Adds comprehensive VQE documentation covering capture-wide effects, sample-rate capabilities, supported SoCs, configuration defaults, and missing firmware libraries.

en/majestic-streamer.md

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 4, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Raw audio cannot autoplay ✓ Resolved 🐞 Bug ≡ Correctness
Description
The guide says opening /audio.ulaw needs nothing installed to play, but this endpoint emits raw
headerless µ-law that requires a player to be given its format, channel count, and capture sample
rate. Users following the prerequisite check in a normal browser may hear nothing and incorrectly
conclude that microphone capture is broken.
Code

en/howto-doorbell-from-camera.md[R26-27]

+  is codec-free, so it needs nothing installed to play), and POST a
+  short raw-audio payload to
Evidence
The repository's audio playback instructions explicitly require the ffmpeg-provided ffplay utility
and invoke /audio.ulaw with -f mulaw, -ar 48000, and -ac 1. They separately identify
/audio.html as the browser-oriented player page, contradicting the added claim that opening the
raw endpoint requires nothing installed.

en/majestic-streamer.md[799-810]
en/howto-doorbell-from-camera.md[23-28]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The microphone verification step claims that `/audio.ulaw` plays without installed tooling, although it is a raw stream requiring explicit playback parameters.
## Issue Context
The streamer guide uses `ffplay` with the µ-law format, sample rate, and channel count. Either direct readers to `/audio.html`, which is the provided player page, or include an appropriate `ffplay` command using the configured `audio.srate`.
## Fix Focus Areas
- en/howto-doorbell-from-camera.md[23-28]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can route each action level your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread en/howto-doorbell-from-camera.md Outdated
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.
@openipc-ai
openipc-ai merged commit 3389d11 into master Sep 4, 2026
@openipc-ai
openipc-ai deleted the majestic-sip-audio-and-vqe branch September 4, 2026 17:44
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

Successfully merging this pull request may close these issues.

1 participant