• 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!

RPi4 + CamillaDSP Tutorial

jdubs

Member
Forum Donor
Joined
Mar 12, 2018
Messages
97
Likes
19
As mentioned above switching between sources is as easy as switching between a configuration using the M4 as input (for analog input from the turntable) and an ALSA loopback (for streaming), very easy to do in the CamillaDSP GUI. If you end up implementing a display it would also be very easy to add source indication to the display and the ability to change sources via an IR remote.

I do not personally use Spotify or Tidal but it seems that they work on LMS 8 -> https://forums.slimdevices.com/showthread.php?112130-How-do-i-use-Tidal-on-LMS-8 which means you can use squeezelite as player as mentioned in the tutorial. I personally wouldn't worry about running CamillaDSP at native resolution as the resampler is excellent and your JBL 708Ps are going to resample all inputs to 192 kHz anyways. If you did want to retain full frequency response of hi-res files just change the 44100-44100 in SB_EXTRA_ARGS to 192000-192000 which will convert all files that are not natively 192 kHz to 192 kHz. Of course if you did want to run CamillaDSP at the native sample rate you could use the ALSA CDSP plugin -> https://github.com/scripple/alsa_cdsp although that would require quite a few setup differences than what is currently shown in the tutorial.

Michael
Much appreciated, Michael. I'm pulling together the other hardware pieces to do exactly what you describe!

-Jim
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
The moOde upgrade from a kernel 5.4 .x to 5.15.x enables a lot more USB multi output channel device and also input devices. Still waiting for 5.18.x kernel to fully support USB gadget mode.
Indeed moOde has current no facilities in the graphical user interface for selecting the input.

Fortunately, you can manually make a configuration for the input. For example, as mentioned a few posts above, if the expert mode for camilladsp is enabled the input device can be specified. Only then you will loose the alsa-cdsp functionality for rate switching, normally used by moOde.


Your are correct. One of the big changes is that all moOde used software pieces are now build and installed as deb files. But it is still intendent as dedicated moOde image/system.
See https://github.com/moode-player/pkgbuild for an overview of all used software packages and versions.

I'm probably missing something simple here but I loaded a known good configuration using a TOSLINK input for my MOTU Ultralite Mk5 and wasn't able to get it to work with moOde. I'm getting a clock lock on the Mk5 so clearly it is receiving a signal, but it is almost like CamillaDSP doesn't start because it does not recognize an input.

Is there something special that needs to be done to use an external input with moOde when using CamillaDSP?

Michael
 
Last edited:
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
Much appreciated, Michael. I'm pulling together the other hardware pieces to do exactly what you describe!

-Jim

Great to hear, I'll make a new configuration for the MOTU M4 which allows it to switch inputs and update the FLIRC and OLED python scripts to allow for IR remote source selection / indication, will be a fun project for this weekend.

Michael
 

jdubs

Member
Forum Donor
Joined
Mar 12, 2018
Messages
97
Likes
19
Great to hear, I'll make a new configuration for the MOTU M4 which allows it to switch inputs and update the FLIRC and OLED python scripts to allow for IR remote source selection / indication, will be a fun project for this weekend.

Michael

AWESOME!!
 

georgew2

Member
Joined
Jan 21, 2022
Messages
24
Likes
10
I'm probably missing something simple here but I loaded a known good configuration using a TOSLINK input for my MOTU Ultralite Mk5 and wasn't able to get it to work with moOde. I'm getting a clock lock on the Mk5 so clearly it is receiving a signal, but it is almost like CamillaDSP doesn't start because it does not recognize an input.

Is there something special that needs to be done to use an external input with moOde when using CamillaDSP?

Michael
I found a motu m4 and I am trying to figure out the problem:

this command has this result:
cat /proc/asound/card2/stream0 MOTU M4 at usb-0000:01:00.0-1.4, high speed : USB Audio Playback: Status: Stop Interface 1 Altset 1 Format: S32_LE Channels: 4 Endpoint: 0x01 (1 OUT) (ASYNC) Rates: 44100, 48000, 88200, 96000, 176400, 192000 Data packet interval: 125 us Bits: 24 Channel map: FL FR FC LFE Sync Endpoint: 0x81 (1 IN) Sync EP Interface: 2 Sync EP Altset: 1 Implicit Feedback Mode: Yes Capture: Status: Stop Interface 2 Altset 1 Format: S32_LE Channels: 4 Endpoint: 0x81 (1 IN) (ASYNC) Rates: 44100, 48000, 88200, 96000, 176400, 192000 Data packet interval: 125 us Bits: 24 Channel map: FL FR FC LFE

In comparison with the guide of "Budget Standalone "Toslink > DSP > Toslink" with Camilladsp" the difference that I see is that the status of capture is "Stop" instead of "Running".

So we need a way to activate the capture but I don't have any idea how this could be.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
I found a motu m4 and I am trying to figure out the problem:

this command has this result:
cat /proc/asound/card2/stream0 MOTU M4 at usb-0000:01:00.0-1.4, high speed : USB Audio Playback: Status: Stop Interface 1 Altset 1 Format: S32_LE Channels: 4 Endpoint: 0x01 (1 OUT) (ASYNC) Rates: 44100, 48000, 88200, 96000, 176400, 192000 Data packet interval: 125 us Bits: 24 Channel map: FL FR FC LFE Sync Endpoint: 0x81 (1 IN) Sync EP Interface: 2 Sync EP Altset: 1 Implicit Feedback Mode: Yes Capture: Status: Stop Interface 2 Altset 1 Format: S32_LE Channels: 4 Endpoint: 0x81 (1 IN) (ASYNC) Rates: 44100, 48000, 88200, 96000, 176400, 192000 Data packet interval: 125 us Bits: 24 Channel map: FL FR FC LFE

In comparison with the guide of "Budget Standalone "Toslink > DSP > Toslink" with Camilladsp" the difference that I see is that the status of capture is "Stop" instead of "Running".

So we need a way to activate the capture but I don't have any idea how this could be.

Are you trying to use the analog input? Capture here refers to the M4 analog input.

If you follow the tutorial in the beginning of this thread and use the M4 analog input configuration Capture will show as "Running" once CamillaDSP starts.

Code:
michael3@raspberrypi3:~/camilladsp/configs$ cat /proc/asound/M4/stream0
MOTU M4 at usb-0000:01:00.0-1.4, high speed : USB Audio

Playback:
  Status: Stop
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 4
    Endpoint: 0x01 (1 OUT) (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR FC LFE
    Sync Endpoint: 0x81 (1 IN)
    Sync EP Interface: 2
    Sync EP Altset: 1
    Implicit Feedback Mode: Yes

Capture:
  Status: Running
    Interface = 2
    Altset = 1
    Packet Size = 288
    Momentary freq = 96000 Hz (0xc.0000)
  Interface 2
    Altset 1
    Format: S32_LE
    Channels: 4
    Endpoint: 0x81 (1 IN) (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR FC LFE

Michael
 

georgew2

Member
Joined
Jan 21, 2022
Messages
24
Likes
10
Are you trying to use the analog input? Capture here refers to the M4 analog input.

If you follow the tutorial in the beginning of this thread and use the M4 analog input configuration Capture will show as "Running" once CamillaDSP starts.

Code:
michael3@raspberrypi3:~/camilladsp/configs$ cat /proc/asound/M4/stream0
MOTU M4 at usb-0000:01:00.0-1.4, high speed : USB Audio

Playback:
  Status: Stop
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 4
    Endpoint: 0x01 (1 OUT) (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR FC LFE
    Sync Endpoint: 0x81 (1 IN)
    Sync EP Interface: 2
    Sync EP Altset: 1
    Implicit Feedback Mode: Yes

Capture:
  Status: Running
    Interface = 2
    Altset = 1
    Packet Size = 288
    Momentary freq = 96000 Hz (0xc.0000)
  Interface 2
    Altset 1
    Format: S32_LE
    Channels: 4
    Endpoint: 0x81 (1 IN) (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR FC LFE

Michael
Yes I am trying to use analog input while it's active.

Note: I am reffering to moode 8 that's why I replied to a previous post of you which you say that you can't use your input with moode.

I wonder why for moode the capture is "stop" and not running as for ubuntu server.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
Ah got it, seems like you are seeing the same issue that I was on moOde, it doesn’t work with an external input because nothing is triggering CamillaDSP to start.

Michael
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
Was talking a bit about external inputs for moOde with @georgew2 and came up with a hacky solution, see below.

I was able to start camilladsp manually via the terminal on mOode and the analog inputs work fine.

For reference camilladsp configuration files are stored at /usr/share/camilladsp/ and the camilladsp binary is located at /usr/local/bin/camilladsp, so for example if you had a configuration called m4_analog.yml uploaded via the web GUI you could start CamillaDSP with the command:

/usr/local/bin/camilladsp -p 1234 /usr/share/camilladsp/m4_analog.yml

As a very hacky interim solution you could have two configurations, a streamer based configuration (m4_streamer.yml) and an analog input based configuration (m4_analog.yml). Set m4_streamer.yml as your default configuration so when you play digital files from moOde it plays using that configuration. When you want to use the analog input make sure no digital files are playing in moOde and enter the line below in terminal.

/usr/local/bin/camilladsp -p 1234 /usr/share/camilladsp/m4_analog.yml

When you are done with the analog input enter crtl+c to stop camilladsp from running in the terminal. It will take a few seconds but if you then try to play a digital file in moOde it will work using the m4_streamer.yml configuration. The only thing to be careful of is to make sure you are not attempting to run two instances of camilladsp at one time, so always make sure no digital files are playing when using the analog input and that the analog input configuration is not in use when attempting to play digital files.

Another solution that might be a bit more elegant would be to setup a camilladsp service completely separate from moOde as described in my tutorial. Then use an ALSA loopback as your output device in moOde. You can then use the camilladsp web GUI to switch between streamer and analog configurations and you wouldn't need to worry about starting camilladsp in the terminal.

Hope this helps!

Michael
 
Last edited:

georgew2

Member
Joined
Jan 21, 2022
Messages
24
Likes
10
thank you for your help! I just note that for convience we could use a simple app on phone which create a button which will send the above via ssh. In this way we avoid the process of connecting each time to web ssh, writing commands etc and we can with one-tap achieve the result.
 

jdubs

Member
Forum Donor
Joined
Mar 12, 2018
Messages
97
Likes
19
thank you for your help! I just note that for convience we could use a simple app on phone which create a button which will send the above via ssh. In this way we avoid the process of connecting each time to web ssh, writing commands etc and we can with one-tap achieve the result.

Thanks for posting on that thread I started on the Moode forum. Hopefully we get a response!

That said, I'm still going to head down the ubuntu path (too).

-Jim
 

Arco76

Member
Joined
Mar 16, 2022
Messages
20
Likes
1
Good day to everyone :) - and thank you for this great discussion.
Forgive me my ignorance but I need to ask this question: I have Soekris DAM 1021 DAC and its using I2S input - It's using a standard rpi snd interface config to get the audio signal that feeds the DAC - as I understand this tutorial is set specifically for a USB Dacs - is there any chance that this will also work for my setup? if yes what I need to modify / change in order to make it working?
I'm not linux enthusiast but can follow the guide to set this up - just need some help / explanation.
Thank you!!
Alex
 

Petr66

Member
Joined
Mar 8, 2022
Messages
6
Likes
0
Hi everyone, I run Volumio and I'm learning CamillaDSP.
I would like to make and adjust Volume and Loudness according to my terms.
That doesn't work out at all. Everything works, but just switch the radio station and the volume jumps to 100% = 0dB. /Lib/systemd/system/camilladsp.service does not work either
Was not found. Is there any way for the DSP to remember the volume?
Thank you very much for your feedback.
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
Good day to everyone :) - and thank you for this great discussion.
Forgive me my ignorance but I need to ask this question: I have Soekris DAM 1021 DAC and its using I2S input - It's using a standard rpi snd interface config to get the audio signal that feeds the DAC - as I understand this tutorial is set specifically for a USB Dacs - is there any chance that this will also work for my setup? if yes what I need to modify / change in order to make it working?
I'm not linux enthusiast but can follow the guide to set this up - just need some help / explanation.
Thank you!!
Alex

If you are using a 2 channel DAC with no external inputs I would probably just go with moOde. If you do want to use the approach in this tutorial you just need to use a slightly different configuration.

I've attached a simple configuration with an ALSA Loopback as capture device with a stereo DAC output with only volume control filters. You will need to change your playback device to whatever the ALSA name of the Soekris is (run aplay -l to find out). Also, S32LE may not be the correct format for your DAC so you can either experiment (try S24LE, S24LE3 or S32LE as they are the most common) or run aplay -D hw:YOURDACNAME--dump-hw-params /dev/zero to see the supported formats.

Michael
 

Attachments

  • stereo_03142022.txt
    912 bytes · Views: 88
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
Hi everyone, I run Volumio and I'm learning CamillaDSP.
I would like to make and adjust Volume and Loudness according to my terms.
That doesn't work out at all. Everything works, but just switch the radio station and the volume jumps to 100% = 0dB. /Lib/systemd/system/camilladsp.service does not work either
Was not found. Is there any way for the DSP to remember the volume?
Thank you very much for your feedback.

Are you running CamillaDSP integrated in Volumio? Or running standalone like in this tutorial?

In terms of volume where are you doing volume control? Volumio? CamillaDSP?

If you are running Volumio it will be a different setup than what is described in this tutorial with its own quirks. Obviously the service in this tutorial will require modification based on the path to camilladsp and your configuration files but there may be other issues as well.

Michael
 

Petr66

Member
Joined
Mar 8, 2022
Messages
6
Likes
0
I use CamillaDSP, which is part of the Fusion DSP plugin.
The volume in Volumio works. But I'm trying to use Volume in CamillaDSP including Loudness, it's configurable here.
I can try to implement CamillaDSP into moOde, but I'm afraid it's beyond my knowledge ...
Thanks for the quick reply, great
 

Arco76

Member
Joined
Mar 16, 2022
Messages
20
Likes
1
If you are using a 2 channel DAC with no external inputs I would probably just go with moOde. If you do want to use the approach in this tutorial you just need to use a slightly different configuration.

I've attached a simple configuration with an ALSA Loopback as capture device with a stereo DAC output with only volume control filters. You will need to change your playback device to whatever the ALSA name of the Soekris is (run aplay -l to find out). Also, S32LE may not be the correct format for your DAC so you can either experiment (try S24LE, S24LE3 or S32LE as they are the most common) or run aplay -D hw:YOURDACNAME--dump-hw-params /dev/zero to see the supported formats.

Michael
Thank you for your response.
When running aplay -l got this: card 0: sndrpirpidac [snd_rpi_rpi_dac], device 0:RPi-DAC HiFi pcm1794a-hifi-0
Then running: aplay -D hw:sndrpirpidac [snd_rpi_rpi_dac]--dump-hw-params /dev/zero
response: aplay: main:722: audio open error: Device or resource busy
Not sure what that means...
OK moreover - I stopped squeezelite - and now when running sndrpirpidac [snd_rpi_rpi_dac] got response: no such file or directory
But I checked ad the folder /dev/zero exists....
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
Thank you for your response.
When running aplay -l got this: card 0: sndrpirpidac [snd_rpi_rpi_dac], device 0:RPi-DAC HiFi pcm1794a-hifi-0
Then running: aplay -D hw:sndrpirpidac [snd_rpi_rpi_dac]--dump-hw-params /dev/zero
response: aplay: main:722: audio open error: Device or resource busy
Not sure what that means...

It means that something else is using the card at the moment. What OS are you using?

Michael
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,371
Location
Detroit, MI
I use CamillaDSP, which is part of the Fusion DSP plugin.
The volume in Volumio works. But I'm trying to use Volume in CamillaDSP including Loudness, it's configurable here.
I can try to implement CamillaDSP into moOde, but I'm afraid it's beyond my knowledge ...
Thanks for the quick reply, great

Not going to be able to help much as I have not idea how Volumio is implementing CamillaDSP, probably best to ask the Volumio folks. It sounds to me like CamillaDSP may restarting each time the station is changed.

Michael
 

Arco76

Member
Joined
Mar 16, 2022
Messages
20
Likes
1
It means that something else is using the card at the moment. What OS are you using?

Michael
Yes - I killed the squeezelite - edited my previous post
I'm using Max2play which is in essence Raspbian
 
Top Bottom