Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Min max volume #211

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Min max volume #211

wants to merge 3 commits into from

Conversation

fletsche
Copy link

@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

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

@fletsche
Copy link
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

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

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