Skip to content

Report the Line In signal to Music Assistant - #21

Merged
Bunton33 merged 5 commits into
betafrom
claude/cast-pro1-line-sense
Nov 24, 2026
Merged

Bunton33 merged 5 commits into
betafrom
claude/cast-pro1-line-sense

Conversation

@Bunton33

@Bunton33 Bunton33 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Version: 26.11.19.1

What does this implement/fix?

Adds Line In Signal Detection (off by default), so Music Assistant's Automatically play line-in on can start Analog In when a record or TV starts and stop it after the sound ends. Today the firmware always reports a signal, so that setting never fires.

A signal counts after about half a second of sound, short enough to start quickly but long enough to ignore a needle thump. When it's on, the CAST PRO-1 listens to Analog In only while idle on Optical and during Line In streams. On Optical the DAC never needs the shared I2S port. It gives the port back as soon as anything plays, gates every ADC start on a RAM trial, and only sends changes. Analog units get autostop but not autostart. The README has the user steps.

It also adds Line In Clipping (diagnostic) and Line In Peak (disabled by default), read from the raw ADC while Line In streams. Hot sources like a turntable's built-in preamp clip at the PCM1808, which has no gain control, so this tells people to turn the source down. The README now suggests a -10 dB inline attenuator.

It costs about 900 B of static RAM, plus about 20 KB of internal RAM while listening idle. It compiles on ESPHome 2026.12-dev but isn't tested on hardware yet. A turntable test needs to confirm the -50 dBFS default threshold, the timings and the RAM. Draft so we don't forget it.

Questions for Trevor:

  • Keep it opt-in, or always on once tested?
  • Is it OK that Analog units can't autostart? That would need the idle DAC stopped.

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

🤖 Generated with Claude Code

Adds an opt-in Line In Signal Detection switch. The unit listens to Analog In
while idle on Optical and during Line In streams, and tells Music Assistant when
a signal starts and stops, so "Automatically play line-in on" works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ac8d1db-0bf0-4c1f-b65b-cf8129aae8bc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Adds a Line In Clipping diagnostic sensor and a Line In Peak sensor (disabled
by default), read from the raw ADC whenever Line In runs. A source that's too
strong for the input clips at the ADC, so this tells people to turn it down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silther

Silther commented Nov 13, 2026

Copy link
Copy Markdown

From a user perspective, I would like to see line-in sensing for analog too.

It would probably need some kind of loudness threshold so it does not activate on every noise. (Record player can create a huming if not grounded correctly, even without playing a record at the moment)

…-sense

# Conflicts:
#	Integrations/ESPHome/Core.yaml
…-sense

# Conflicts:
#	Integrations/ESPHome/Core.yaml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WestwardWinds
WestwardWinds marked this pull request as ready for review November 19, 2026 17:27
@Bunton33
Bunton33 merged commit df0229e into beta Nov 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants