Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Alsa: Softvol slave not working

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
elysium
Posts: 2
Joined: 2016-08-06 14:04

Alsa: Softvol slave not working

#1 Post by elysium »

Hi!

Edit due to arochester's reply below: Based on all I've read about Alsa and the forums I've used to work up to this point, I do believe my question is related to Alsa itself and not specific to the Raspbian OS I am running. If I am wrong I will remove this thread. Thanks!

I have a Raspberry 2 running Raspbian which is playing sound through an external 7.1 sound card connected via USB. My goal is to use Alsa as a digital crossover, and then passing the audio signals into different amplifiers that power speaker elements within distinct frequency ranges, ie one amplifier for the tweeter, another for the treble etc.

This works! Except it is somehow already quite loud with the alsamixer volume of the channels set to 0, which means it's not possible to offset the midbass playing louder than the tweeter. To solve this, a master volume is needed, but the existing one does not work. So I looked into using a softvol slave in asound.conf. And I can't get it to work..

I fear (and hope) it's all down to a stupid and embarrassing error, but I cannot see it. Would be very grateful for any help :)

In the code below, setting the slave.pcm of pcm.!default to "filter" instead of "softvol" makes everything else work. If I run it as given below, I get the following error:

Code: Select all

pi@raspberrypi:~/Music $ aplay Dave_Thomas_-_Our_Story.wav
Playing WAVE 'Dave_Thomas_-_Our_Story.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
ALSA lib pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
aplay: set_params:1204: Broken configuration for this PCM: no configurations available
Asound.conf file

Code: Select all

pi@raspberrypi:~/Music $ cat /etc/asound.conf
pcm.!default {
     type plug
     slave.pcm softvol
}

pcm.kodiDefault {
	type plug
	slave.pcm softvol
}

pcm.softvol {
	type softvol
	slave.pcm filter
	control {
		name "SoftMaster"
		card 1
	}
}

pcm.filter {
     type ladspa
     slave.pcm eq
     path "/usr/local/lib/ladspa"
     channels 8
     plugins
     {
          0 {
	       label RTlr4hipass
               policy none
               input.bindings.0 "Input"
               output.bindings.0 "Output"
               input { controls [ 4500 ] }   # low left [ frequency (-6 dB XO point)]
          }
          1 {
	       label RTlr4hipass
               policy none
               input.bindings.1 "Input"
               output.bindings.1 "Output"
               input { controls [ 4500 ] }   # high left (match freq above)
          }

	2 {
               label RTlr4lowpass
               policy none
               input.bindings.0 "Input"
               output.bindings.2 "Output"
               input { controls [ 4500 ] }   # low left [ frequency (-6 dB XO point)]
          }
        3 {
               label RTlr4lowpass
               policy none
               input.bindings.1 "Input"
               output.bindings.3 "Output"
               input { controls [ 4500 ] }   # high left (match freq above)
          }
	4 {
               label RTlr4lowpass
               policy none
               input.bindings.0 "Input"
               output.bindings.6 "Output"
               input { controls [ 300 ] }   # Subwoofer (match freq above)
          }
	}
}

pcm.eq {
     type ladspa
     #slave.pcm  delay
	slave.pcm speaker
     path "/usr/local/lib/ladspa"
     channels 8
     plugins
     {
        0 {
               label RTparaeq
               policy none
               input.bindings.0 "Input"
               output.bindings.0 "Output"
               input { controls [ 0 4800 2.0 ] }   # high left [ delta dB, frequency, Q ]
          }
        1 {
               label RTparaeq
               policy none
               input.bindings.1 "Input"
               output.bindings.1 "Output"
               input { controls [ 0 4800 2.0 ] }   # high right
          }
	2 {
               label RTparaeq
               policy none
               input.bindings.2 "Input"
               output.bindings.2 "Output"
               input { controls [ 0 4800 2.0 ] }   # high left [ delta dB, frequency, Q ]
          }
        3 {
               label RTparaeq
               policy none
               input.bindings.3 "Input"
               output.bindings.3 "Output"
               input { controls [ 0 4800 2.0 ] }   # high right
          }
	4 {
               label RTparaeq
               policy none
               input.bindings.6 "Input"
               output.bindings.6 "Output"
               input { controls [ 0 4800 2.0 ] }   # Subwoofer
          }
    }
}

pcm.delay {
     type ladspa
     slave.pcm  speaker
     path "/usr/local/lib/ladspa"
     channels 8
     plugins
     {
        0 {
               label delay_5s
               policy none
               input.bindings.0 "Input"
               output.bindings.0 "Output"
               input { controls [ 0.0 0 ] }    # high left [delay in seconds, wet/dry (0=all input, 1=all output)]
          }
        1 {
               label delay_5s
               policy none
               input.bindings.1 "Input"
               output.bindings.1 "Output"
               input { controls [ 0.0 0 ] }    # high right
          }
	2 {
               label delay_5s
               policy none
               input.bindings.2 "Input"
               output.bindings.2 "Output"
               input { controls [ 0.0 0 ] }    # high left [delay in seconds, wet/dry (0=all input, 1=all output)]
          }
        3 {
               label delay_5s
               policy none
               input.bindings.3 "Input"
               output.bindings.3 "Output"
               input { controls [ 0.0 0 ] }    # high right
          }
	4 {
               label delay_5s
               policy none
               input.bindings.6 "Input"
               output.bindings.6 "Output"
               input { controls [ 0.0 0 ] }    # Subwoofer
          }

     }
}

 pcm.speaker {
    type plug
    slave {
     pcm "t-table"
     channels 8
     rate "unchanged"
    }
}
pcm.t-table  {
    type route
    slave {
#     pcm "hw:1,0"
	pcm {
		type hw
		card 1
	}
     channels 8
    }
    ttable {
      0.0   1
      1.1   1
	2.6 	1
	3.7	1
	6.2	1
    }
}

pcm.plughw.slave.rate = "unchanged";
Last edited by elysium on 2016-08-06 15:00, edited 1 time in total.

arochester
Emeritus
Emeritus
Posts: 2435
Joined: 2010-12-07 19:55
Has thanked: 14 times
Been thanked: 54 times

Re: Alsa: Softvol slave not working

#2 Post by arochester »

This is Debian User Forums for people who use Debian, and not Debian derivations.

Please use the Raspberry Pi Forum >>> https://www.raspberrypi.org/forums/viewforum.php?f=66

There are about 150 derivations and we cannot deal with them all!

elysium
Posts: 2
Joined: 2016-08-06 14:04

Re: Alsa: Softvol slave not working

#3 Post by elysium »

arochester wrote:This is Debian User Forums for people who use Debian, and not Debian derivations.

Please use the Raspberry Pi Forum >>> https://www.raspberrypi.org/forums/viewforum.php?f=66

There are about 150 derivations and we cannot deal with them all!
Hi arochester.

Based on what I've read about Alsa and the forums I've used to work up to this point, I believe my question is related to Alsa itself and not specific to the Raspbian OS I am running. If I am wrong I will remove this thread.

It might very well still be wrong forum if it is Alsa related, but there were numerous results for both "alsa" and "softvol" when I tried searching it, so hopefully someone knows something :)

User avatar
sunrat
Administrator
Administrator
Posts: 6457
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: Alsa: Softvol slave not working

#4 Post by sunrat »

While I agree this is not the forum for this, I would suggest that what you are trying to do would be much more easily achieved with a dedicated external hardware crossover.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Post Reply