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