Skip to content

fix(call): bind group streams to relay answer and packetize EAS2 audio - #242

Merged
EdamAme-x merged 2 commits into
evex-dev:mainfrom
dryob:fix/group-audio-eas2
Oct 10, 2026
Merged

EdamAme-x merged 2 commits into
evex-dev:mainfrom
dryob:fix/group-audio-eas2

Conversation

@dryob

@dryob dryob commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Description

Fix two independent causes of silent or distorted PLANET group audio: registration used locally invented stream IDs instead of the final relay allocation, and CELT group payloads omitted the EAS2 activity bitmap.

  • Wait for a successful final PARTICIPATE answer with a media channel and valid AUDIO/VIDEO/DATA source IDs. Register receive IDs from answer field 11 and transmit IDs from field 61; use the allocated AUDIO/DATA IDs on outgoing SRTP. Never fall back to the CC channel or register on a provisional response.
  • Correct the existing group-only packetizeNativeGroupOpusPairs() helper: CELT EAS2 activity bitmap after TOC/count and before VBR lengths/data, MSB-first non-silence flags (including unvoiced audio), and correct two-byte VBR sizes.
  • Reject unsupported packet layouts instead of silently truncating/dropping them. Update the actual command example with 20 ms paired frames, last-pair silence padding, and explicit per-frame PCM non-silence activity.
  • Document the group payload/API contract and add synthetic wire and codec regressions.

This is based directly on main, independent of #241. No incoming-call implementation, auto-join policy, crypto changes, dependency changes, or account/capture artifacts.

Compatibility and limitations

  • frameActivity is required for CELT inputs. Only complete pairs of matching mono 20 ms code-0 inputs are supported; invalid layouts throw. SILK/hybrid keep their in-band activity.
  • groupDataSessionAfterProvisional remains accepted for source compatibility but is deprecated and ignored.
  • EAS2 is group-specific, not standard Opus. Generic codec and 1:1 semantics are unchanged. The example's PCM meter is not the native encoder's VAD.
  • This TypeScript port has automated validation only; it has not been exercised in a live LINE call. No live calls or deployment were performed for this PR.

Testing

  • Reproduced missing bitmap, wrong long VBR length, unsupported-input acceptance, random registration IDs, rejected/incomplete-answer acceptance, and premature provisional registration on pre-fix behavior; focused tests pass with the fix.
  • deno test -A: 357 passed, 7 steps, 0 failed.
  • node scripts/test_node_transport.mts: 2 passed.
  • deno check example/call/call_on_command.ts: passed.
  • deno publish --dry-run --allow-dirty in both packages/linejs and packages/types: passed.
  • deno fmt --check for changed TypeScript files and git diff --check: passed.
  • Synthetic relay test authenticates/decrypts produced control and AUDIO/DATA SRTP wire, checks stream allocation and timestamp progression. Synthetic PCM tests depacketize EAS2 before stock Opus decoding and compare against separately decoded original frames for CBR/VBR.

Checklist

  • Run tests
  • Add jsdoc and usage documentation
  • Test local automated runtime paths
  • Live LINE validation of this TypeScript port

dryob and others added 2 commits October 4, 2026 14:37
# Conflicts:
#	packages/linejs/client/features/call/opus.test.ts
#	packages/linejs/client/features/call/planet/transport.test.ts
@EdamAme-x
EdamAme-x merged commit 5c07e35 into evex-dev:main Oct 10, 2026
4 checks passed
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.

2 participants