Skip to content

Min max volume#211

Open
fletsche wants to merge 3 commits intoEdzelf:masterfrom
fletsche:minMaxVolume
Open

Min max volume#211
fletsche wants to merge 3 commits intoEdzelf:masterfrom
fletsche:minMaxVolume

Conversation

@fletsche
Copy link
Copy Markdown

@fletsche fletsche commented Jan 3, 2019

This implements two new commands: vol_min and vol_max
(fixes #210)

Usage:
Leave the values at their default. Find the minimum volume setting where you can still hear something from your speakers. Then find the maximum volume until you get distortion.
If your minimum volume is higher than 1 you can limit it by adding the line vol_min=YOUR_MIN_VOL to your config. Likewise if you can limit the maximum volume by adding vol_max=YOUR_MAX_VOL.
After a reload of the config you can use the volume setting as before. Volumes from 0-100 will be mapped to volumes from vol_min to vol_max from that point on.
Note that if you want to change these values later it is necessary to reset these values to 0/100 before you can experimentally find new useful values.

@t-c-o-d-e
Copy link
Copy Markdown

Is this working? Added 'vol_min= 50' in config, no effect at all :(.

@fletsche
Copy link
Copy Markdown
Author

fletsche commented May 2, 2019

I think Ed never merged this into his main branch. You would have to fork Ed's project and then try to merge my pull request or take a look at the changes I made and copy them over one by one. It definitely worked when I made the pull request but since then Ed's code has changed and I do not currently have the hardware for testing.
If you need this function and you should have problems merging it don't hesitate to contact me. Also you could ask Ed if he doesn't want to merge this.

@t-c-o-d-e
Copy link
Copy Markdown

Can I just put/add value '+50' as a volume starting point, don't need to read it from config file, it can be hard coded. Probably line with 'map' command?

Thank you!

@Edzelf
Copy link
Copy Markdown
Owner

Edzelf commented May 2, 2019

I would try:
value = map ( vol, 0, 100, 0xA0, 0x00 ) ; // 0..100% to one channel
The result is:
vol = 00, setting will be 160 (A0)
vol = 05, setting will be 152 (98)
vol = 10, setting will be 144 (90)
vol = 15, setting will be 136 (88)
vol = 20, setting will be 128 (80)
vol = 25, setting will be 120 (78)
vol = 30, setting will be 112 (70)
vol = 35, setting will be 104 (68)
vol = 40, setting will be 96 (60)
vol = 45, setting will be 88 (58)
vol = 50, setting will be 80 (50)
vol = 55, setting will be 72 (48)
vol = 60, setting will be 64 (40)
vol = 65, setting will be 56 (38)
vol = 70, setting will be 48 (30)
vol = 75, setting will be 40 (28)
vol = 80, setting will be 32 (20)
vol = 85, setting will be 24 (18)
vol = 90, setting will be 16 (10)
vol = 95, setting will be 8 (08)
vol = 100, setting will be 0 (00)

You may try other values instead of "0xA0".
The last parameter of the map() function may be manipulated to limit the max volume.

@t-c-o-d-e
Copy link
Copy Markdown

Yea, it works in my case with hex value 70.
Thank you guys!

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 range problems

3 participants