0

Is there a way to control Alsa volume through software if I2S Dac (e.g. old Hifiberry) doesn't support software volume control (amixer is empty and if you add mixer it won't affect anything)?

While with MPD 5 can control volume for what is played within MPD but it doesn't affect volume if its played outside it, from other sources, such as spotify-connect lib, which uses Alsa mixer to control volume. Is there a way to it (or direct audio signal to MPD)?

4
  • Look up the softvol plugin.
    – CL.
    Jun 6, 2017 at 14:11
  • Well I tried my luck adding lines to asound.conf, but nothing happened. (or maybe there should be something different done?) my dac is mamboberry. And according to hifiberry team such dacs have no alsa control (source support.hifiberry.com/hc/en-us/community/posts/…) is there some workaround? Deamon somehow manages the volume
    – Darius
    Jun 6, 2017 at 16:27
  • I use mpc commands to control audio from an mpd server and I am also pretty sure that when I do 'mpc volume 100' the volume increases for all other pi audio too.
    – paj
    Jun 6, 2017 at 20:12
  • thanks for the answer, i tried it, it controls volume level of what is played on MPD, but had no affect on spotify app. I believe its because signal is passed through alsa, without going through MPD at all. Can it be the case?
    – Darius
    Jun 7, 2017 at 6:34

3 Answers 3

1

The solution to this problem is to use the softvol plugin. From the Audio Injector forum topic "Output RCA volume control" the solution is like this:

To use softvol, add the following to your ~/.asoundrc file :

pcm.SoftVolume {
    type            softvol
    slave.pcm       "default"
    control.name    "Master"
    control.card    0
}

You can now play using the softvol control like so :

aplay -DSoftVolume awesome.track.wav

The volume control would be like this :

amixer set Master 60%
1
  • Thanks I will give a try again in the evening, but so far these attempts didn't work, nothing even appears in alsa mixer after im adding the code lines. That's why i'm wondering what could be workaround (source support.hifiberry.com/hc/en-us/community/posts/…)
    – Darius
    Jun 7, 2017 at 6:43
0

If you happen to run a GUI on your pi, this tool might help you configure the previously mentioned softvol: https://github.com/sezanzeb/alsa-control

-1

Use the softvol plugin to resolve this issue, you have to put some code snippet pcm.SoftVolume to get it fixed.

1
  • 1
    Hello. Can you expand a little on how you'd add the softvol plugin & where you need to add the pcm.SoftVolume snippet? This will improve your anser. Mar 27, 2019 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.