Skip to content

Android Auto Brightness — verify mic envelope follows audio under field conditions #820

@SlyWombat

Description

@SlyWombat

Symptom

Operator reports Android Auto Brightness (#804) is not modulating brightness in the field even with audible music playing. Reported against app v1.7.53; not yet reproduced/disproven on v1.7.59.

What's known

  • App build v1.7.59 (dist/slyled-android.apk, 2026-05-05) installs cleanly on Pixel 4 XL, RECORD_AUDIO permission grants OK via pm grant.
  • Code path on Stage screen: LiveStageViewModel.setAutoBrightnessEnabled(true)MicAutoBrightness.start() (8 kHz mono PCM, 50 ms hop, EnvelopeFollower) → on each hop repository.setMasterBrightness(master)POST /api/brightness {value: 0..255} (parent_server.py:14550).
  • Server endpoint just sets _settings["globalBrightness"]. Whether the running timeline/Track-action pipeline actually consumes globalBrightness at refresh tick was not verified in this session.
  • Live test on 2026-05-05 was blocked before reaching the mic UI: parent server failed to bind 5600 on the dev box (PyInstaller .exe processes spun up but never listened; running parent_server.py via Python 3.14 also exited silently after the UDP-4210 retry log). Separate orchestrator port-bind issue, but it prevented the Android side from connecting.

To investigate next session

  1. Get an orchestrator running and reachable from the test phone (LAN, not just WSL host). Confirm POST /api/brightness {value:N} actually changes lit-fixture brightness end-to-end.
  2. With Auto Brightness enabled on the Stage screen, watch:
    • adb logcat -s MicAutoBrightness:V LiveStageVM:VMode.Listening vs Mode.PermissionDenied/NoMic/Clipping.
    • Stage card's envelope % readout — does it move with music?
    • Server-side globalBrightness — does it change at ~20 Hz while envelope is non-zero?
  3. If envelope moves but light doesn't: bug is in the server consumer side (timeline/runtime not honouring globalBrightness updates mid-play).
  4. If envelope stays at 0: AudioRecord is reading silence — possible causes: MediaRecorder.AudioSource.UNPROCESSED returning silent buffers on this Pixel, mic routed to call audio, sensitivity too low (default 1.5), floor too high.
  5. If Mode.PermissionDenied despite the manifest grant: foreground-service requirement on Android 14+ for RECORD_AUDIO while screen is off — verify behaviour matches Android version of test device.

Files

  • android/app/src/main/java/com/slywombat/slyled/audio/MicAutoBrightness.kt
  • android/app/src/main/java/com/slywombat/slyled/audio/EnvelopeFollower.kt
  • android/app/src/main/java/com/slywombat/slyled/viewmodel/LiveStageViewModel.kt:178 (setAutoBrightnessEnabled)
  • desktop/shared/parent_server.py:14550 (/api/brightness)
  • Stage UI: LiveStageScreen.kt:920 (AutoBrightnessButton)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions