Repository navigation
Conversation
The Shimmer3R firmware adds channel 0x38, SOUND_LEVEL: the A-weighted level at the microphone as an int16, little-endian, in 0.01 dB(A). -32768 means no level. Until now the API took it as an unnamed two-byte channel, so packets stayed aligned but the level was dropped. - InterpretDataPacketFormat names it "Sound Level" (i16) on a Shimmer3R. Other hardware still treats 0x38 as an unknown two-byte channel. - BuildMsg adds RAW and CAL. CAL is raw / 100 in dB(A), or NaN for -32768, so every packet carries the same signals. The channel has no enabled-sensors bit, so BuildMsg finds it in the signal list instead. - CalibrateSoundLevel() and SOUND_LEVEL_NO_LEVEL are public, and ChannelContentsShimmer3.SoundLevel names the ID. - ShimmerSDLog gets it for free: a Shimmer3R file's header carries the channel list. ShimmerSoundLevelDecodeTest covers the scaling, NaN, the channel after it, three real packets from a Shimmer3R around its first level, a Shimmer3, and an SD log. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…evel Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
The Shimmer3R firmware in ShimmerResearch/log-and-stream-common#230 and ShimmerResearch/shimmer3r-firmware#324 adds channel
0x38,SOUND_LEVEL. It carries the A-weighted level at the microphone as an int16, little-endian, in 0.01 dB(A), and-32768means no level. The format is in log-and-stream-common'sSHIMMER3_STREAMING_DATA_FORMAT.md§5.7. That firmware is merged, and LogAndStream_Shimmer3R v1.01.026 will be the first release with the channel. The doc comment names it. Until now this API took0x38as an unknown two-byte channel, so packets stayed aligned but the level was dropped.InterpretDataPacketFormatnames itSound Level(i16) on a Shimmer3R. Other hardware still treats0x38as an unknown two-byte channel.BuildMsgadds RAW and CAL. CAL is raw / 100 indB(A), or NaN for-32768, so every packet carries the same signals. The channel has no enabled-sensors bit, soBuildMsgfinds it in the signal list.getSignalIndex()can't do that, because it returns 0 for a missing name.CalibrateSoundLevel(),SOUND_LEVEL_NO_LEVEL,SignalUnits.DecibelsA,Shimmer3RConfiguration.SignalNames.SOUND_LEVELandChannelContentsShimmer3.SoundLevel.ShimmerSDLoggets it with no change of its own, because a Shimmer3R file's header carries the channel list (count at 314, IDs from 315).Tested
ShimmerBluetoothTests, built with MSBuild and run with VSTest as CI does: 130/130. That is 124 from master plus 6 new inShimmerSoundLevelDecodeTest, which covers:InterpretDataPacketFormatandBuildMsg, packet by packet, and the SD file throughShimmerSDLog. I compared each level, RAW and CAL, with the firmware test rig's decode of the same bytes (log-and-stream-common's HIL harness):0x3821st0x3810th0x3810thShimmerSDLogread all 30,719 records and rejected none.Not done
ShimmerCaptureXamarin's copy ofShimmerBluetoothhas no Shimmer3R support at all, so I left it alone.Siblings
This is the C# port of DEV-1413's channel decode. The Swift port is ShimmerResearch/SwiftAPI#29. The pyshimmer change is on a fork branch; its upstream PR is not open yet.
🤖 Generated with Claude Code