project-owner / Peppy

Peppy Player Repository
GNU General Public License v3.0
72 stars 14 forks source link

Maximum Volume user can set #54

Closed maltejahn closed 4 months ago

maltejahn commented 4 months ago

Hi,

probably I´m to dumb to find this: I would like to set a maximum volume level a user can set using the UI

I use a Hifiberry miniamp which volume cant be adjusted via hardware. I use vlc as player.

Here https://github.com/project-owner/Peppy.doc/wiki/Volume-Control it says

Player - the audio player's (e.g. vlc) volume control functionality will be in use. The ALSA volume level (80% by default) will limit the maximum player volume level. The player's range 0-100% will be changing volume inside of the ALSA range 0-80%

So, where can i find the default 80% i would lower to e.g. 30%?

project-owner commented 4 months ago

Hi,

You can try to select 'amixer' type first and adjust a volume in the player to the value which you need (e.g. 30%). Then change the type to the 'player'.

Another way - use 'player' type, open terminal and run command 'alsamixer', adjust the level to the value which you need.

Hopefully it helps.

Best regards

maltejahn commented 4 months ago

Hi,

The first idea doenst help. I still an adjust to max volume.. Btw, when changing to "amixer", the volume goes up to max.. grrr :-)

I already tried alsamixer, but it says "This sound device does not have any controls". Thats because there is no HW volume control. But, i can adjust the volume. The "only" thing I cant do is to set a maximum for the volume.

I searched for a VLC parameter for something like that, but wasnt lucky

Here they use mpd: https://github.com/MiczFlor/RPi-Jukebox-RFID/discussions/1073 But "my" /etc/mpd.conf seems to be a template. Dont want to edit it directly. Dont know if its a good idea if I have a frontend like Peppy which maybe handles that.

Thanks for the help!

project-owner commented 4 months ago

Hi,

So, you can adjust volume using 'player' type but you want to limit it to some level, right? For example you want to have the range 0-60 but show 60 as 100. Is it what you need? I can implement this kind of functionality in the next release.

BTW, you can switch from VLC to MPD in the Peppy player. The mpd.conf file is located in the folder /home/pi/.config/mpd Though more likely MPD doesn't provide the same player functionality which VLC can provide.

Best regards

maltejahn commented 4 months ago

Hi,

yes, a reduced "real" volume range - but still shown as a 0..100% range would be perfect.

The aim is to restrict the loudness my daughter can adjust. Also going 100% with a miniAMP from Hifiberry doesnt sound that good.

Not that convinient, but would be also ok. If Level is allowed to go from 0..60%, if pressed above that level, it jumps back to 60%

Would be great if you could implement that. Thx

project-owner commented 4 months ago

Hi,

OK, I'll try to fit it into the next release. There will be a new configuration parameter 'maximum.level' in the 'volume.control' section. It will be impossible to set level above that value.

Best regards

project-owner commented 4 months ago

Hi,

I've just released the new player version: https://forums.raspberrypi.com/viewtopic.php?p=2226392#p2226392

Here is the new configuration property: https://github.com/project-owner/Peppy/blob/287e16d8489c1d9f19340459c14438b908209ddf/configuration/config.txt#L179

Best regards

maltejahn commented 4 months ago

Hi,

Thanks for the Quick Integration! Till now it works great.

Thanks ahain.