hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
832 stars 202 forks source link

ALSA mixer volume control #208

Closed hifiberry closed 4 years ago

hifiberry commented 4 years ago

Just had a look at the documentation, but couldn't find anything. Is there a way to define an ALSA volume control used to control the output volume or is volume control only handled internally in software?

Thanks

mill1000 commented 4 years ago

Volume is set via gstreamer's playbin here: https://github.com/hzeller/gmrender-resurrect/blob/26d8f7edf5336bc30f7334c6ad459bf7f4f90ff2/src/output_gstreamer.c#L455-L459

I believe it is a software volume control. The default flags show soft-volume enabled.

hifiberry commented 4 years ago

Ok, I guess, I have to overwrite this to use an ALSA mixer instead. value is in the range 0-1?

hifiberry commented 4 years ago

Thanks, got my patch working.

mill1000 commented 4 years ago

I would recommend against integrating ALSA volume control into gmrender-resurrect. Instead you should investigate gstreamer's playbin & alsasink as the correct location to implement this mixer control.

hifiberry commented 4 years ago

According to the documentation, alsasink doesn't have any awareness of ALSA mixer controls: https://gstreamer.freedesktop.org/documentation/alsa/alsasink.html?gi-language=c

mill1000 commented 4 years ago

It seems there was an alsamixer plugin in gstreamer-0.10 but it's not present in gstreamer-1.0 releases. Likely in favor of the volume element.