User avatar
elParaguayo
Posts: 1941
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

ALSA: chaining slaves. Need both softvol and plugequal

Sun May 13, 2018 1:08 pm

I'm having issues configuring ALSA to work with my needs.

I have a HiFiberry miniamp and need to configure alsa to work with it. I need software volume control because I'm controlling volume through my code. However, I also need to use ALSA's plugequal equaliser as the sound sounds better that way.

Unfortunately, i can't get them to work at the same time.

My asound.conf looks like this:

Code: Select all

pcm.!default {
  type plug
  slave.pcm "hifiberry";
}

ctl.!default {
  type hw card 0
}

ctl.equal {
  type equal;
}

pcm.plugequal {
  type equal;
  slave.pcm "plughw:0,0";
}

pcm.equal {
  type plug;
  slave.pcm plugequal;
}

pcm.hifiberry {
    type softvol
    slave.pcm "plughw:0,0";
    control.name "Master"
    control.card 0
}
I've tried changing hifiberry's slave to "equal" or "plugequal" but with no joy.

Is someone familiar with ALSA able to help me out here?

Thanks.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

epoch1970
Posts: 1940
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: ALSA: chaining slaves. Need both softvol and plugequal

Sun May 13, 2018 3:18 pm

It's a bit more convoluted than what you want but perhaps this will help: https://forums.slimdevices.com/showthre ... post886538

Consider the Alsa device used by the audio app is "pcm.equal" (default name in the application, didn't want to change that) and walk your way down from there.
(!default is not used at all, pcm.gong is for another app, with a single app you could remove the mixer and hit hw:x,y directly.)
HTH
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
elParaguayo
Posts: 1941
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: ALSA: chaining slaves. Need both softvol and plugequal

Sun May 13, 2018 3:35 pm

Thanks. I'll take a look.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

YouKnow
Posts: 3
Joined: Fri Aug 10, 2018 8:18 pm

Re: ALSA: chaining slaves. Need both softvol and plugequal

Sat Aug 11, 2018 8:40 pm

My current status (Hifiberry on hw 2). Next allow using the equalizer, allows multiapps/services to play sound using various users/groups.
Still to need to figure out how an input (mic) should be routed to the hifiberry....

Code: Select all

$ cat /etc/asound.conf

pcm.hifiberry {
  type hw
  card 2
} 

pcm.dmixer {
  type dmix
  ipc_key 321456 # any unique value
  ipc_key_add_uid false # let multiple users share
  ipc_perm 0666 # mixing for all users
  slave {
    pcm "hifiberry"
    channels 2
    period_time 0
    period_size 1024
    rate 44100
    #buffer_size 4096 # needs to be set!
    buffer_size 16384
  }
  bindings {
    0 0
    1 1
  }
}

pcm.equalizer {
  type equal
  slave.pcm "plug:dmixer"
}

pcm.!default {
  type plug
  #slave.pcm "dmixer"
  slave.pcm equalizer
}

ctl.!default {
  type hw
  card 2
}

ctl.dmixer {
  type hw
  card 2
}

ctl.equal {
  type equal;
}

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 5 guests