Repository navigation
test(moq-gst): moqsrc plays every channel of surround Opus - #7228
Conversation
Quest-Claim: 22f27718be50c599
|
Closing this stale claim at the maintainer's request: it has held only the empty claim commit since 2026-10-29, with no work pushed. Closing it and deleting the branch frees the quest for a later (Written by Claude Opus 5.5) |
The session that claimed this quest stopped before committing. This preserves its uncommitted changes as found on 2026-11-02; they are unfinished and unreviewed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reopened: the claim looked empty on GitHub, but its local worktree held uncommitted work from the 2026-10-29 session. That work is now pushed as checkpoint 6bf9df1 and marked unfinished under (Written by Claude Opus 5.5) |
# Conflicts: # quest/m2/moqsrc-opus-surround.md # rs/moq-gst/src/source/imp.rs
A tone shared by every channel can't tell a dropped, duplicated, or swapped channel from a correct mapping. Feed six distinct tones through appsrc and check each decoded channel carries only its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 3122c4a
No actionable bugs found. The test-only direction is appropriate: table-driven 3–8-channel caps checks cover mapping metadata, while distinct per-channel tones through the existing relay harness detect dropped, duplicated, or permuted 5.1 channels. This adds useful coverage without changing library behavior or introducing dependencies. No public API or wire changes.
Verification limits: static source review only. I did not run builds, GStreamer playback tests, or the reported mutation/repeatability checks.
(Written by OpenAI)
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Surround caps unit test:
surround_opus_caps_carry_the_family_1_mappingbuilds a family-1 OpusHead for channel counts 3 through 8 (RFC 7845 Vorbis order), runsaudio_caps, and assertschannels,channel-mapping-family,stream-count,coupled-count,channel-mapping, and that the firststreamheaderbuffer is the encoded head. This fills the previously untestedSome(mapping)branch ofopus_caps, since the existing caps test only covered family 0. - End-to-end surround playback test:
surround_opus_plays_every_channel_through_a_relaypushes per-channel tones throughappsrc ! identity sync=true ! opusenc ! moqsink, a loopback relay,moqsrc ! opusdec ! appsink, then uses a Goertzel measure per channel to require its own tone above half amplitude and every other tone below a twentieth. That catches a dropped, duplicated, or swapped channel, not just silence. - Session test harness:
register()is extracted and now also registersmoqsink, andpipeline()routes through it. No other test registersmoqsink, so there is no double registration. - Quest housekeeping: deletes
quest/m2/moqsrc-opus-surround.mdand removes itsm2/README.mdentry.
The mapping tables in the unit test match both moq_mux::codec::opus::mapping::VORBIS and RFC 7845 §5.1.1, and the Goertzel normalization (2*sqrt(power)/N) yields the peak amplitude, so the A/2 and A/20 thresholds are the intended margins. The 30s deadline reads kio::clock::now(), and the test runs on real GStreamer threads, consistent with the other relay tests. opusdec's src template in the pinned GStreamer is S16LE only, so the AudioFormat::S16le assertion holds.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Finishes quest/m2/moqsrc-opus-surround.md and deletes it.
Summary
moq-dev/moq#6284 taught
moqsrcto carry surround Opus caps but tested only mono and stereo. This PR adds the tests that prove surround playback. No library code changes.surround_opus_caps_carry_the_family_1_mapping(unit): for every channel count from 3 to 8,audio_capsturns a family-1 OpusHead intochannel-mapping-family,stream-count,coupled-count, andchannel-mappingmatching RFC 7845's Vorbis-order table. It also checks that the head is the firststreamheaderbuffer.surround_opus_plays_every_channel_through_a_relay(end to end): 5.1 S16 audio goes throughappsrc ! identity sync=true ! opusenc ! moqsink, a loopback relay,moqsrc ! opusdec ! appsink. Each channel carries its own tone (440, 660, 880, 60 for the LFE, 1100, 1320 Hz). A Goertzel measurement checks that each decoded channel carries its own tone at more than half amplitude and every other tone at less than a twentieth. So a mapping that drops, duplicates, or swaps a channel fails the test, not just one that silences a channel.register()helper that also registersmoqsink.The 2026-10-29 session's checkpoint fed one shared
audiotestsrctone to every channel. That version can't tell a correct mapping from a permuted one, so I replaced it with the per-channel tones above.Verification
just checkpasses (moq-gst: 228 tests passed). The end-to-end test passed 8 runs in a row on a loaded host (~1 s each).channel-mappingentries inopus_capsfails the unit test. The end-to-end test still passes, becauseopusdecreads the mapping from thestreamheaderOpusHead when one is present.streamheader(soopusdecfalls back to the caps) fails the end-to-end test:channel 0 lost its 440 Hz tone: [0.0, 0.0, 7985.0, 0.0, 1.0, 0.0].Choices made without asking
appsrc, not the checkpoint's sharedaudiotestsrctone, and needed no new dependencies (appsrcandidentitycome from core/base plugins).opusenc bitrate=256000keeps libopus from using intensity stereo, which would leak a tone between the channels of a coupled pair.Review
quest review), gpt-6.1-sol, medium effort(Written by Claude Opus 5.5)
🤖 Generated with Claude Code