• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Using a Raspberry Pi as equaliser in between an USB source (iPad) and USB DAC

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
The USB audio gadget controller gaudio_ctl gets all configuration through its parameters only, no config file.

That info message (not an error) says that your gadget has no playback configured which is fine - you want to capture from the gadget, using the capture exec (parameter -y). No playback to the gadget (i.e. capture on the USB host) in your case.
 

sarieri

Senior Member
Forum Donor
Joined
Mar 1, 2023
Messages
331
Likes
213
The USB audio gadget controller gaudio_ctl gets all configuration through its parameters only, no config file.

That info message (not an error) says that your gadget has no playback configured which is fine - you want to capture from the gadget, using the capture exec (parameter -y). No playback to the gadget (i.e. capture on the USB host) in your case.
May be I have understood the function of gaudio_ctl wrongly. By auto switch sample rate, does it mean when the sample rate of the PC changes, the camilladsp’s capture rate will change automatically?

Just tried to add gaudio_ctl -y. But camilladsp failed to launch after reboot. Do I have to rename the config file into something like camilladsp-{R}.yml?
 
Last edited:

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
The gadget controller just monitors the capture/playback rate alsa control provided by the gadget alsa device, so that a capture/playback (with regard to the gadget) process can be started at correct rate when the USB host starts playback/capture, and killed when the USB host stops the operation (the alsa control value will drop to 0 and notify subscribed clients - i.e. the controller).

It's up to you what config for CDSP you use. IIRC it must specify the capture rate. Therefore, if you want to run at multiple rates, you can provide several appropriate configs for each samplerate, name them e.g. camilladsp-44100.yml, camilladsp-48000.yml, and use the camilladsp-{R}.yml config parameter in the ctl_gaudio -y parameter.
 

sarieri

Senior Member
Forum Donor
Joined
Mar 1, 2023
Messages
331
Likes
213
The gadget controller just monitors the capture/playback rate alsa control provided by the gadget alsa device, so that a capture/playback (with regard to the gadget) process can be started at correct rate when the USB host starts playback/capture, and killed when the USB host stops the operation (the alsa control value will drop to 0 and notify subscribed clients - i.e. the controller).

It's up to you what config for CDSP you use. IIRC it must specify the capture rate. Therefore, if you want to run at multiple rates, you can provide several appropriate configs for each samplerate, name them e.g. camilladsp-44100.yml, camilladsp-48000.yml, and use the camilladsp-{R}.yml config parameter in the ctl_gaudio -y parameter.
I changed the file names and this time camilladsp does launch after reboot but rate still won't change. I followed the guide in another thread so the config directory is in /root/camilladsp. Will that make a difference? I uploaded the files as txt files since this forum do not allow yml format.
It does kills camilladsp if I stop the music this time.
 

Attachments

  • camilladsp-44100.txt
    6.5 KB · Views: 42
  • camilladspservice.txt
    437 bytes · Views: 47

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
If unsure about working directory (as is the case with systemd files), just use full paths in file names.

First make ctrl_gaudio run from the command line. After having a working command, put it into the systemd unit.
 

sarieri

Senior Member
Forum Donor
Joined
Mar 1, 2023
Messages
331
Likes
213
I change the sample rate of my PC from 96000 to 48000 and then run
Code:
gaudio_ctl -y "/root/camilladsp/camilladsp -o /root/camilladsp/camilladsp.log -p 1234 /root/camilladsp/camilladsp-48000.yml"
in the command line, but it still says playback rate not found
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
I change the sample rate of my PC from 96000 to 48000 and then run
Code:
gaudio_ctl -y "/root/camilladsp/camilladsp -o /root/camilladsp/camilladsp.log -p 1234 /root/camilladsp/camilladsp-48000.yml"
in the command line, but it still says playback rate not found
see
That info message (not an error) says that your gadget has no playback configured which is fine - you want to capture from the gadget, using the capture exec (parameter -y). No playback to the gadget (i.e. capture on the USB host) in your case.
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
"player -> USB host -> USB gadget -> CDSP -> output" means CDSP is capturing from the gadget. Playback to the gadget would be "input -> CDSP -> USB gadget -> USB Host -> recording SW".
 

sarieri

Senior Member
Forum Donor
Joined
Mar 1, 2023
Messages
331
Likes
213
"player -> USB host -> USB gadget -> CDSP -> output" means CDSP is capturing from the gadget. Playback to the gadget would be "input -> CDSP -> USB gadget -> USB Host -> recording SW".
Maybe I'm missing something here. Still very confused about where should I provide the playback rate.
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,357
Location
Detroit, MI
Maybe I'm missing something here. Still very confused about where should I provide the playback rate.

I don't think I can explain it better than the tutorial in this thread or what @phofman has just walked you through but I will give it a shot.

From the tutorial, this is where you specify the playback rates that you want to use.

1678113241195.png


You need to create a configuration for every sample rate you wish to use with nomenclature matching what you specify in your service. These configurations need to be in the directory you specify in your service.

1678113422992.png


In your service you need to point gaudio_ctl to a configuration containing {R} where is your sample rate in Hz. gaudio_ctl will switch between your different sample rate configurations assuming that they exist.

1678113466071.png


Maybe a wildcard here is that your USB host needs to be capable of dynamically switching sample rates. I use Amazon Music on a Mac and it will NOT switch the sample automatically, the sample rate needs to be manually changed in Audio MIDI Settings. However if I switch the sample rate gaudio_ctl responds appropriately.

Michael
 

sarieri

Senior Member
Forum Donor
Joined
Mar 1, 2023
Messages
331
Likes
213
I don't think I can explain it better than the tutorial in this thread or what @phofman has just walked you through but I will give it a shot.

From the tutorial, this is where you specify the playback rates that you want to use.

View attachment 269870

You need to create a configuration for every sample rate you wish to use with nomenclature matching what you specify in your service. These configurations need to be in the directory you specify in your service.

View attachment 269871

In your service you need to point gaudio_ctl to a configuration containing {R} where is your sample rate in Hz. gaudio_ctl will switch between your different sample rate configurations assuming that they exist.

View attachment 269872

Maybe a wildcard here is that your USB host needs to be capable of dynamically switching sample rates. I use Amazon Music on a Mac and it will NOT switch the sample automatically, the sample rate needs to be manually changed in Audio MIDI Settings. However if I switch the sample rate gaudio_ctl responds appropriately.

Michael
I think I did just about everything as guided but whenever I add gaudio_ctl in the ExecStart line, camilladsp will not longer be able to lunch after reboot.
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,357
Location
Detroit, MI
I think I did just about everything as guided but whenever I add gaudio_ctl in the ExecStart line, camilladsp will not longer be able to lunch after reboot.

Oh, I see you are using a MOTU Ultralite Mk5, that may make things more complicated as the channel counts change with sample rate. With the configuration you shared you have 18 playback channels at 44.1 kHz, it should be 22. For reference here are the output channel counts by sample rate.

44/48 - 22
88/96 - 18
176/192 - 10

You will need to change the channel counts in your configurations to reflect.

Michael
 
  • Like
Reactions: MCH

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,357
Location
Detroit, MI
@mdsimon2 Any insight about whether camila DSP can do bass management without much of a hassle?

Anything in particular you are looking for?

It has routing, delay, polarity, level adjustment and can implement pretty much any FIR / IIR filter you can think of for every output channel.

It has BW and LR crossovers built in where you specify order and frequency and also has generic 1st / 2nd order crossovers where you specify the frequency and Q (for 2nd order). It also has a built in Linkwitz Transform where you specify starting Q / frequency and target Q / frequency.

So overall I would say it works very well for bass management.

Michael
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,511
Likes
3,357
Location
Detroit, MI
Can you apply a crossover specifically to an input routed to a particular output? (and other crossovers for inputs on the same output).

The Mixers are very flexible in CamillaDSP and you can have multiple of them. I assume you want to accomplish something like this:

1678128745459.png


There is probably more than one way to do this in CamillaDSP but I would use two Mixers, one for input and one for output.

The Input mixer takes 8 input channels and duplicates the first 7 channels, one set for HPF and one set for LPF and the LFE is routed straight through. The Output mixer takes the 7 LPF channels, level adjustments and sums them with the LFE channel while also routing the HPF channels to the first 7 output channels. In between the two mixers we can apply the necessary LPF / HPF. This will be difficult to read (please maximize) but the end result looks something like this.

1678129308436.png


Michael
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
Maybe some confusion may be arising from the fact, that what commonly is called "playback rate" in this discussion is "capture rate" in the gaudio_ctl beause the gadget is on the capture side of the DSP chain. As I said, that "missing playback rate" is just an info, irrelevant to the capture direction usage.
 

sarieri

Senior Member
Forum Donor
Joined
Mar 1, 2023
Messages
331
Likes
213
Maybe some confusion may be arising from the fact, that what commonly is called "playback rate" in this discussion is "capture rate" in the gaudio_ctl beause the gadget is on the capture side of the DSP chain. As I said, that "missing playback rate" is just an info, irrelevant to the capture direction usage.
I understand the idea of playback rate now but still whenever I add gaudio_ctl -y in the start of the line ExecStart, camilladsp will not launch after reboot anymore. I placed the executable gaudio_ctl to /usr/local/bin/, does it matter where I place it?
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
If you use complete path to the binary, it can be anywhere the executing user as access to.

First your gaudio_ctl command must work correctly from a terminal, under the user you want to use in your systemd unit. Only then focus on solving the systemd unit pecularities, it's the last step.
 
Top Bottom