Skip to content

Add support for external volume scripts with -w#258

Open
mr-manuel wants to merge 1 commit intoralph-irving:masterfrom
mr-manuel:master
Open

Add support for external volume scripts with -w#258
mr-manuel wants to merge 1 commit intoralph-irving:masterfrom
mr-manuel:master

Conversation

@mr-manuel
Copy link

@mr-manuel mr-manuel commented Jan 16, 2026

This is useful, if the client should have a fixed volume and an external amplifier should be controlled. This helps to prevent clipping and big volume differences when changing channel on the external amplifier.

Here a few cases:

  • You have connected a Raspberry Pi via HDMI to an AV receiver. The volume between Raspberry Pi and AV receiver should be fixed at an optimum that prevents clipping. The volume is changed directly on the AV receiver via CEC or HTTP API.
  • A Raspberry Pi is connected to an external custom made amplifier that can be controlled via Modbus.

Fixes #257

@mr-manuel mr-manuel force-pushed the master branch 2 times, most recently from 1c93147 to be96915 Compare January 23, 2026 14:43
@allmazz
Copy link

allmazz commented Feb 24, 2026

It's great, thank you very much!
As suggestion, I would throw an error if -w used with -U as you done it with -V

This is useful, if the client should have a fixed volume and an external
amplifier should be controlled.
@mr-manuel
Copy link
Author

@allmazz thanks for the suggestion. I added it.

@allmazz
Copy link

allmazz commented Feb 24, 2026

I have troubles with volume level < 25%, could you please take a look?

Volume level is 25% or higher, works as expected:

[19:59:04.846944] process_audg:445 audg gainL: 926 gainR: 926 adjust: 1
[19:59:04.846992] set_volume:260 left: 926, ldB:-36.997379 vol: 25

Then I set 24%, but in logs we can see 22%:

[20:00:13.475070] process_audg:445 audg gainL: 781 gainR: 781 adjust: 1
[20:00:13.475115] set_volume:260 left: 781, ldB:-38.476578 vol: 22

17%:

[20:02:44.284952] process_audg:445 audg gainL: 237 gainR: 237 adjust: 1
[20:02:44.285009] set_volume:260 left: 237, ldB:-48.834633 vol: 1

16% or lower:

[20:01:53.131445] process_audg:445 audg gainL: 200 gainR: 200 adjust: 1
[20:01:53.131488] set_volume:260 left: 200, ldB:-50.308998 vol: 0

I use latest LMS as the server

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.

Volume control with script

2 participants