Skip to content

DEV-1459: Shimmer3R audio mode, audio status and GET_AUDIO_STATUS in the Java driver - #353

Merged
JongChern merged 11 commits into
masterfrom
DEV-1459
Nov 16, 2026
Merged

JongChern merged 11 commits into
masterfrom
DEV-1459

Conversation

@JongChern

@JongChern JongChern commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

DEV-1459, part 2: the Java driver models what a Shimmer3R records from its microphone. Master already has the sound level (#346) and the byte 233 rule (#351). This adds the audio mode, the audio status, and the check for whether a unit records audio at all. 9 files, driver and tests only.

What it adds

  • Audio mode. Configuration byte 233 bits 0-1: Off, Fingerprint only, Fingerprint and raw audio, Raw audio only. It is a config option (Audio Mode) for LogAndStream_Shimmer3R v1.01.025 or later, and is saved to the database as Audio_Mode.
  • One owner for byte 233. SensorSoundLevel writes the audio mode with the sound level bit. Bits 2-3, the gain preset, go back as read.
  • Raw audio is off unless allowed. A raw mode is written as Fingerprint only or Off unless the app calls ShimmerObject.setRawAudioAllowed(true).
  • Audio status. On v1.01.026 or later, status byte 1 bits 1-2 give isAudioRecording() and isAudioFault().
  • Does this unit record audio? v1.01.026 or later does, by its version. A v1.01.025 build is asked with GET_AUDIO_STATUS (0xBC, answered by 0xBD and 32 bytes). No answer means no audio, and the connection is kept. Any other unanswered command still drops it.
  • An audio mode set before a read is written. Master leaves byte 233 out of a configuration written before it is read. A mode set here before a read now counts as known, by the same comparison configBytesGenerate() uses. Off set before a read still leaves the Shimmer's own.

Tests

The PC driver rows ran on the head. The other rows name their commit.

Suite Result
ShimmerPCBasicExamples: compile, and CaptureRulesTest Compiles, 15/15, on 215a56db
ShimmerDriver test 219/219, on ebeaa454
ShimmerDriverPC clean build 174/174, on the head
API_00047_AudioConfigWriteTest 9/9, on the head. anAudioModeSetBeforeAReadIsWritten fails without the fix
API_00048_Shimmer3rAudioStatusTest, API_00029_Shimmer3rAudioModeConfigByteTest 5/5, 4/4, on ebeaa454

After ebeaa454 come two merges that add only the Capture app from master (#350), which touches neither driver module, and one commit that adds two tests to API_00047.

Not done

  • Not run on a unit. No HIL result, and the mode has not been read back from sdlog.cfg or SD header byte 226.
  • Raw mode before a read. With raw audio not allowed, a raw mode set before a read writes byte 233 as 0 or Fingerprint only, over the Shimmer's own. It matches the rule after a read, and API_00047 now tests it.
  • Android. ShimmerAndroidAPI's Shimmer.java has its own in-stream and timeout handling, so the status bits and the unanswered GET_AUDIO_STATUS rule do not reach it through a driver bump. Not ported.
  • Other host APIs. Of the local checkouts, only shimmer-host-core has the audio status command. The C#, web, Swift and Python APIs do not model the audio mode.
  • The rest of DEV-1459. The Consensys tile, import, sync and Clear SD are in the Advance API and ConsensysApps branches.

🤖 Generated with Claude Code

harithjamadi and others added 11 commits November 13, 2026 11:56
…de with the sound level bit

A mode read from the unit goes back as read; the raw audio rule applies only to a mode changed here.
…ords audio; no answer means no audio, and keeps the connection
Conflicts, all resolved by keeping both sides:
- ShimmerBluetooth: the command and response maps (GET_AUDIO_STATUS and
  GET_EVENT_CHANNEL_STATUS), and the in-stream response branches.
- ShimmerObject: the 0xB9-0xBB and 0xBC-0xBD command constants.
- Configuration: the AUDIO_MODE and BUTTON_MODE/LOG_TRIGGERS/TTL_INPUT labels.
- ConfigByteLayoutShimmer3: byte 232's index beside the audio layout.
- SensorSoundLevel: the parse sets the audio mode and marks byte 233 read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Master's byte 233 rule (#351) leaves the byte out of a configuration
  written before it is read, unless it was read or the sound level is on.
  An audio mode set here before a read was therefore not written.
  SensorSoundLevel.isAudioConfigKnown() now takes the device and also
  counts an audio mode that differs from the one read, the same test
  configBytesGenerate() uses to write it. Off set before a read still
  leaves the Shimmer's own. API_00047 gains two tests; the first failed
  on the merged code.
- API_00042_Shimmer3rAudioStatusTest is now API_00048: master's
  API_00042_EventRecordFileTest has that number.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s as no audio; any other unanswered command still drops it
…TATUS test

Harith's 2610c37 added its test to API_00042_Shimmer3rAudioStatusTest,
which this branch renamed to API_00048. Git carried the addition across the
rename, so nothing needed resolving by hand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
DEV-1459: merge master (#343) into DEV-1459, and write an audio mode set before a read
Master gained only the Capture app in ShimmerPCBasicExamples. No conflicts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…the raw audio

Fingerprint and raw audio drops to Fingerprint only. Raw audio only drops to
Off, and byte 233 is still written, over the Shimmer's own mode. Where raw
audio is allowed, the mode is written as set. The same rule as after a read.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@JongChern
JongChern merged commit 792f912 into master Nov 16, 2026
2 checks passed
JongChern added a commit that referenced this pull request Nov 16, 2026
…, audio status (#354)

The Java Shimmer Capture app gets the microphone half of shimmer-host-core's
CAPTURE.md "Event markers and audio recording", on the driver calls DEV-1459
brought to master (#353) and the sound level channel from DEV-1413 (#346).

- EventMarkersFrame, now "Event markers and audio": configuration byte 233's
  audio recording mode (Off, Fingerprint only, Fingerprint and raw audio, Raw
  audio only) and Sound Level, written with the whole configuration and read
  back, then an inquiry for the channel list; Read audio status from READY.
- Raw audio records speech: Write asks first where the new mode keeps raw
  audio and the unit's own does not, and writes nothing on No. The driver's
  raw audio switch is set for that one write and put back.
- MicrophoneSettings: byte 233's rules without Swing, so they are tested.
- Device tab: the status's Recording audio and Audio fault flags where the
  unit records audio, and whether the firmware has the event markers and
  audio recording.
- CaptureRulesTest: 11 tests, byte 233 as written checked on a ShimmerPC.
- README.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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