Repository navigation
Clink: trace the audio path so a silent head unit can be read - #36
Merged
Merged
Conversation
An audio path that dies and a head unit that stays silent while audio keeps arriving look identical in a trace: it carried no audio events at all. Every rejected packet, every audio format and a once-a-second counter of the slot and its backlog now land in the trace, so the next silent car can be read instead of guessed at. opensVoiceChannel moves to core/audio so the format gate and VoiceDelivery cannot drift apart; both now answer the same question.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A trace cannot currently explain "the car is silent but the phone plays fine".
ClinkTraceEventcarries Rtsp, Frame, Socket, Negotiation, Media, Video, Input, Error and Link — nothing about audio. Three different faults look identical: an audio path that died, a stream the head unit refused, and a head unit that stays silent while audio keeps arriving. On a 203 s session I could see audio frames climbing at a constant 46.9/s with zero drops and still had no way to tell which stream went where, or whether a packet was rejected before it ever reached the encoder.audioRejectalready rate-limits itself to one line a second, but it onlyprintlns, so the reason never reaches the trace file.What
Audiotrace event in three shapes:format— stream, role, codec, sample rate, channels,voiced, and the stream the head unit is currently fed as media;reject— which stream was refused and why (session mismatch, inactive, bad size, unknown stream);stats, once a second — the media slot, its queued frames, the open voice streams, and the packet counter.audioRejectrecords into the trace as well as logging.VoiceDeliverynow shareopensVoiceChannel(role)fromcore/audio/VoiceChannel.kt. Both carried their own copy of the role check, so a change to one silently left the other behind.audio_in stream=… role=… codec=… rate=… ch=… voiced=…line in the debug panel, so a phone-side report can be read without adb.Behaviour
Unchanged. The same roles open the voice channel, the same packets are delivered, and the recording is the only difference — plus the predicate now has one definition instead of two.
No growth concern:
rejectinherits the existing once-a-second limiter, so a fully rejected stream adds at most one line a second.Tests
ClinkAudioLoopbackTest: a guidance prompt that arrives on another slot does not open the voice channel.:core:testand:clink:testpass.Drafted while chasing a head-unit-side silence on a 小鹏 G6 over ICCOA; the audio-side fix for that car is a separate change and not part of this PR.