• 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

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
it is possible than squeezelite service is not enable:

sudo systemctl enable squeezelite
sudo systemctl start squeezelite
sudo reboot now

I found out that if i start squeezelite with sudo rights i get this error:


frunse@Camilla:~$ sudo squeezelite
[11:43:18.823094] test_open:281 playback open error: Host is down
[11:43:18.823167] output_init_common:401 unable to open output device: default

and without sudo it runs! May be that is the Problem behind but why....

How i can start it as user frunse at boot time and not as sudo?

sudo squeezelite -o hw:CARD=Loopback,DEV=1

Works by the way \o/

Still not starting at boot, but i go it running if i type that after Boot now

sudo service squeezelite restart

still not running after boot directly

But the Player now called camilla instead of squeezelite ??? but worked

Now i typed youre orders in:

sudo systemctl enable squeezelite
sudo systemctl start squeezelite
sudo reboot now

and it works after boot.....yeah made my day Dude!!!!!

I guess Problem would be, an wrong Soundcard in:
/etc/default/squeezelite

and not knowing that after change in /etc/init.d/squeezelite
you need to do
sudo update-rc.d squeezelite defaults

Only one problem i have after boot, Camilla starts with 0 Volume and i need to change to 100 manually but i guess there is an config file to setup this.

got it

sudo nano /lib/systemd/system/camilladsp.service

removed this -g-100 \o/ yeah and works

I am now happy like an little Child on Christmass :)
It sounds so great with that Camilla DSP instead of my najda DSP setup i had before, never goes back again!!!


If i need more Channels let say for 7.1 full aktiv setup, is it possible to use: 6 channel (Front 2x 3way) + 5x 2Channel (5x 2 way) no extra sub or may be with an additional DAC and Toslink

MOTU 16A or
MOTU 24Ao (also USB 2.0 class compilant) 24 Analogue Outs ;)

Guys have a nice week and drink a beer for me ;)
 
Last edited:

danhilu

Member
Joined
Jan 7, 2023
Messages
7
Likes
0
Location
Switzerland
Hello Michael & all,
My name is Daniel, I am delighted by camilladsp & the work of Henrik, and by the community around e.g. Michael & all the other here. Thank you all, great initiative.

I am failing to get camilladsp to run on a RPI3B with Ubuntu Server.
On RPI3B I have a systematic "Capture device is stalled, processing is stalled" error with a simple config with Ubuntu Server 22.04, 23.04 and 23.10. Details below.
Same config & audio interface (Behringer UMC1820) on another "Intel" machine (with Ubuntu Server 22.04) works.
I've been trying quite a lot of things since quite a few weeks; I'd be glad for suggestion.
Thank you in advance for hints where I should investigate futher,
Daniel.

***************
Here first the setup which works: system "gbaudio":
***************
daniel@gbaudio:~/camilladsp/configs$ hostnamectl
Static hostname: gbaudio
[..]
Operating System: Ubuntu 22.04.4 LTS
Kernel: Linux 6.5.0-21-generic
Architecture: x86-64
Hardware Vendor: GIGABYTE
Hardware Model: GB-BSi5A-6200

CamillaDSP Log:
***************************
2024-02-28 22:12:41.236660 INFO [src/bin.rs:683] CamillaDSP version 2.0.0
2024-02-28 22:12:41.236686 INFO [src/bin.rs:684] Running on linux, x86_64
2024-02-28 22:12:41.336491 INFO [src/alsadevice.rs:142] PB: Starting playback from Prepared state


***************
Then the system which fails "rpi3Bcamilla":
***************
daniel@rpi3Bcamilla:~/camilladsp/configs$ hostnamectl
Static hostname: rpi3Bcamilla
[..]
Operating System: Ubuntu 23.10
Kernel: Linux 6.5.0-1011-raspi
Architecture: arm64
(I have the same "Stalled" issue with Ubuntu Server 22.04 & 22.10. And with another M-Audio Eight audio interface. Sometimes it seems the loopback option works; not sure)


CamillaDSP Log on rpi3Bcamilla:
*******************************
2024-02-28 21:51:43.800758 INFO [src/bin.rs:683] CamillaDSP version 2.0.3
2024-02-28 21:51:43.800848 INFO [src/bin.rs:684] Running on linux, aarch64
2024-02-28 21:51:44.092891 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-02-28 21:56:30.080702 INFO [src/alsadevice.rs:142] PB: Starting playback from Prepared state
2024-02-28 21:56:30.257649 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-02-28 22:01:16.042629 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled

*********************
Attached the yml config file "xover-UMC1820_SPDIFIn-Minimal.yml" (stripped down version of my intended config, identical on both systems above)
 

Attachments

  • xover-UMC1820_SPDIFIn-Minimal.yml.txt
    1.2 KB · Views: 19
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,378
Location
Detroit, MI
Can you please share the results of "cat /proc/asound/UMC1820/stream0"?

There are a few things that look a bit odd in the configuration, you have different formats for capture / playback on the same device, you shouldn't need any resampling or rate adjust if using the capture and playback device are using the same clock.

That being said, I've typically seen the STALLED state when dealing with SPDIF inputs where there is no input signal present. Is there any option in alsamixer to select a clock source? I don't see anything in the UMC1820 about clocking the interface from a SPDIF input which is a bit odd.

Michael
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,378
Location
Detroit, MI
The RPi2 and 3 have issues with usb. There are lots of reports of sound glitches when using them with usb dacs. The RPi4 and 5 have superior usb implementations and are much better choices.

Good point. It has been a while since I tried, but I don't think I ever got my MOTU Ultralite Mk5 to work on a RPi3.

Michael
 

danhilu

Member
Joined
Jan 7, 2023
Messages
7
Likes
0
Location
Switzerland
Can you please share the results of "cat /proc/asound/UMC1820/stream0"?

There are a few things that look a bit odd in the configuration, you have different formats for capture / playback on the same device, you shouldn't need any resampling or rate adjust if using the capture and playback device are using the same clock.

That being said, I've typically seen the STALLED state when dealing with SPDIF inputs where there is no input signal present. Is there any option in alsamixer to select a clock source? I don't see anything in the UMC1820 about clocking the interface from a SPDIF input which is a bit odd.

Michael
Thank you Michael.
daniel@rpi3Bcamilla:~$ cat /proc/asound/UMC1820/stream0
BEHRINGER UMC1820 at usb-3f980000.usb-1.5, high speed : USB Audio

Playback:
Status: Stop
Interface 1
Altset 1
Format: S24_3LE
Channels: 12
Endpoint: 0x01 (1 OUT) (ASYNC)
Rates: 44100, 48000, 88200, 96000
Data packet interval: 125 us
Bits: 24
Channel map: FL FR FC LFE RL RR FLC FRC RC SL SR TC
Sync Endpoint: 0x81 (1 IN)
Sync EP Interface: 1
Sync EP Altset: 1
Implicit Feedback Mode: No

Capture:
Status: Running
Interface = 2
Altset = 1
Packet Size = 520
Momentary freq = 88200 Hz (0xb.0666)
Interface 2
Altset 1
Format: S32_LE
Channels: 10
Endpoint: 0x82 (2 IN) (ASYNC)
Rates: 44100, 48000, 88200, 96000
Data packet interval: 125 us
Bits: 24
Channel map: FL FR FC LFE RL RR FLC FRC RC SL

>> you have different formats for capture / playback on the same device,
Yes; BEHRINGER UMC1820 may be particular here - see above.
>> you shouldn't need any resampling or rate adjust if using the capture and playback device are using the same clock.
Yes you're right. I think I've tried about any combination of all of those within the supported range of the audio interface - with the same "stalled" effect. Attached another config file "Minimal2" of this morning without resampling nor rate adjust & 44.1kHz sampling. Same result "2024-02-29 06:30:39.865566 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled"
>> SPDIF inputs where there is no input signal present
SPDIF input is present and audio is playing at the output on my reference non RPI config presented above.
 

Attachments

  • xover-UMC1820_SPDIFIn-Minimal2.yml.txt
    1.1 KB · Views: 10

danhilu

Member
Joined
Jan 7, 2023
Messages
7
Likes
0
Location
Switzerland
Good point. It has been a while since I tried, but I don't think I ever got my MOTU Ultralite Mk5 to work on a RPi3.

Michael
Indeed I've allowed myself to report the issue because [same config; same OS; same USB interface; same context; only difference RPI3B vs x86-64].
It seems I have a specific pb with RPI3B & USB.
When I remove the USB interface on RPI3B, capture device "hw:Loopback,1"; playback device "hw:Headphones,0", 44100Hz -> just tried; working, see screenshot:
1709185887893.png
 
Last edited:

Nisse10000

Member
Joined
Nov 14, 2022
Messages
30
Likes
15
Indeed I've allowed myself to report the issue because [same config; same OS; same USB interface; same context; only difference RPI3B vs x86-64].
It seems I have a specific pb with RPI3B & USB.
When I remove the USB interface on RPI3B, capture device "hw:Loopback,1"; playback device "hw:Headphones,0", 44100Hz -> just tried; working, see screenshot:
View attachment 353123
Have you tried if you get sound through the command speaker-test?
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
503
Likes
328
This does look like a USB issue. The interface is quite loaded with all the channels. Testing separately from CDSP is a very good idea. Simultaneous capture by arecord and playback by aplay or speaker-test, directly to the hw device, ideally with the same period sizes as CDSP uses in this case.
 

danhilu

Member
Joined
Jan 7, 2023
Messages
7
Likes
0
Location
Switzerland
Have you tried if you get sound through the command speaker-test?
Yes loopback screenshot above is with speaker test. I've seen the bar graph moving and did not listen in the headphone output but I would not see a reason it would not work.
Oups, now I think Iget it, same as phofman's proposal above, you suggest to test the usb interface without camilladsp. Good idea, I'll have to try this out
 
Last edited:

Nisse10000

Member
Joined
Nov 14, 2022
Messages
30
Likes
15
Yes loopback screenshot above is with speaker test. I've seen the bar graph moving and did not listen in the headphone output but I would not see a reason it would not work.
I was thinking about testing the only the output of the Behringer outside of CamillaDSP.
 

PeetSahat

Member
Joined
Dec 28, 2023
Messages
15
Likes
5
Sorry for intruding this thread. But I thought this might be the right place for asking a few questions.
I want to build a preamp that includes the entire music database, an AUX input, and a digital crossover with 4 audio outputs. I have realized such a project using a miniDSP and an RPi as a source player. Unfortunately, the miniDSP does not boot correctly when running as an I2S slave. Therefore, only the analog inputs can be used, requiring an additional DAC between the RPi and DSP. Hence, I wanted to replace the DSP with another solution.

I have a few general questions about this:

  • Can the RPi process and pass on an external audio signal via Camilla DSP?
  • Should Camilla perhaps run on a separate instance, like an RPi Zero?
  • Which DACs or audio interfaces should be used in this scenario (I'm looking for an integrated solution but I can't find any 4 channel DAC boards)
Are there any known similar projects I can use for reference?

Thanks in advance
 
OP
M

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,515
Likes
3,378
Location
Detroit, MI
Sorry for intruding this thread. But I thought this might be the right place for asking a few questions.
I want to build a preamp that includes the entire music database, an AUX input, and a digital crossover with 4 audio outputs. I have realized such a project using a miniDSP and an RPi as a source player. Unfortunately, the miniDSP does not boot correctly when running as an I2S slave. Therefore, only the analog inputs can be used, requiring an additional DAC between the RPi and DSP. Hence, I wanted to replace the DSP with another solution.

I have a few general questions about this:

  • Can the RPi process and pass on an external audio signal via Camilla DSP?
  • Should Camilla perhaps run on a separate instance, like an RPi Zero?
  • Which DACs or audio interfaces should be used in this scenario (I'm looking for an integrated solution but I can't find any 4 channel DAC boards)
Are there any known similar projects I can use for reference?

Thanks in advance

Please read the first few posts of this tutorial, they detail a project which can accomplish all of your goals and including specific DAC recommendations.

Michael
 

danhilu

Member
Joined
Jan 7, 2023
Messages
7
Likes
0
Location
Switzerland
This does look like a USB issue. The interface is quite loaded with all the channels. Testing separately from CDSP is a very good idea. Simultaneous capture by arecord and playback by aplay or speaker-test, directly to the hw device, ideally with the same period sizes as CDSP uses in this case.
Following Nisse & phofman suggestions above, I have attempted to play & record audio on the USB interface connected to the RPI3B with camilladsp deactivated (sudo systemctl stop camilladsp). speaker-test fails after a few seconds, before even starting arecord. Here the output:
daniel@rpi3Bcamilla:~$ speaker-test -Dfront:UMC1820 -FS24_3LE -c12
speaker-test 1.2.9
Playback device is front:UMC1820
Stream parameters are 48000Hz, S24_3LE, 12 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 12 to 96000
Period size range from 6 to 48000
Using max buffer size 96000
Periods = 4
was set period_size = 24000
was set buffer_size = 96000
0 - Front Left
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error


Same test (and same exact command which is what this interface wants) on my reference x86-64 system works (I hear the pink noise on the headphones).
daniel@gbaudio:~$ speaker-test -Dfront:UMC1820 -FS24_3LE -c12
speaker-test 1.2.6
Playback device is front:UMC1820
Stream parameters are 48000Hz, S24_3LE, 12 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 12 to 96000
Period size range from 6 to 48000
Using max buffer size 96000
Periods = 4
was set period_size = 24000
was set buffer_size = 96000
0 - Front Left
6 - Front Left Center
2 - Front Center
[etc, cycling through the channels]


"arecord" alone also fails on RPI3B after less than one second
daniel@rpi3Bcamilla:~$ arecord -Dhw:UMC1820 -fS32_LE testrecord.wav -Vstereo -c10
Warning: rate is not accurate (requested = 8000Hz, got = 44100Hz)
please, try the plug plugin
Recording WAVE 'testrecord.wav' : Signed 32 bit Little Endian, Rate 44100 Hz, Channels 10
arecord: pcm_read:2240: read error: Input/output error


Same "arecord" command works on the reference "gbaudio" x86-64 system simultaneously with "speaker-test".
 

danhilu

Member
Joined
Jan 7, 2023
Messages
7
Likes
0
Location
Switzerland
Following Nisse & phofman suggestions above, I have attempted to play & record audio on the USB interface connected to the RPI3B with camilladsp deactivated (sudo systemctl stop camilladsp). speaker-test fails after a few seconds, before even starting arecord.
[..]
I now see various posts warning against USB audio with RPI2 or 3 (e.g. post from @EdW on this very thread in summer 2022) .
I also now realize that Michael concistently mentions the RPI4 in his tutorial, which I had optimistically overlooked.
Michael, maybe you would want to add a short warning in your tutorial pages for future optimistic fools like me ?
 

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,762
Likes
3,070
The usual problem with USB audio on Pi 3 and earlier is audio glitches that don't show at the linux end, not failure with an IO error. This looks like something different.
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
503
Likes
328
The io error typically occurs when the device hits a problem and stops consuming/providing samples. That could be e.g. a stuck USB controller.
 

PO3c

Member
Joined
Apr 27, 2021
Messages
67
Likes
123
As far as I understand RPi3 can be locked to USB1.1. This supposedly help avoid buffer underrun and audio glitches. As there is no such thing as free lunch at the same time networking on the RPi will suffer.
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
As far as I understand RPi3 can be locked to USB1.1. This supposedly help avoid buffer underrun and audio glitches. As there is no such thing as free lunch at the same time networking on the RPi will suffer.
Hi i have used the last days 2 RPI to play Music thrue HDMI and got also Strange Problems.
The Chain:

RPI4 with Moode using HDMI Out 1 (Upsampling all to 96kHz) --> HDMI 8K Switch --> HDMI Input Board to I2S (HDMI1.4) --> RPI5 with CamillaDSP syncronised to 96kHz --> MOTU UL mk5

After playing some Minutes off Musik, Sometimes skipping 2 or 3 Ttiel and after playing a Minute, i get an anoyng High Tone and the Sync is gone, no Musik anymore.
Then i need to reboot RPI4 and after it Reboot, the High Tone is gone but still no Musik playable, i also need to Fiddle around with CamillDSP switching between the Setups and Refreshing the GUI and than i can Play again Musik withou need of Reboot the RPI5 (CamillaDSP)

If i Play Musik on the RPI5 with Squeezelite thats not happen, it seems something todo with that HDMI Chain.
This day i will test it without the HDMI Switch in between may be that makes the Problem.


Not Sure why

First Step this Day.
Did an Update for CamillaDSP
CamillaDSP 2.0.3
pyCamillaDSP 2.0.2
Backend 2.1.0

And removing the HDMI Switch dosen't Help got again the Same Problem after 5 Minutes or so
Must be an Problem at RPI4 with Moode and HDMI Out.
Need again to Reboot the RPI4, Restarting MPD on Moode didn't help.
RPI4 was an clean moode Image install and only changing the Audio to HDMI 1 Out and SOX Resempler on MPD.

How can i switch the Audio Device Formats from U8,S16_LE to an 32_LE Format like on SOX???
Or at least 24 Bit Format, HDMI is 24Bit capabel, right?
Robert
 

Attachments

  • Audio Settup moode.jpg
    Audio Settup moode.jpg
    259.2 KB · Views: 26
  • SOX Resempling moode.jpg
    SOX Resempling moode.jpg
    94.5 KB · Views: 19
  • Audio Info moode.jpg
    Audio Info moode.jpg
    159.7 KB · Views: 23
Last edited:
Top Bottom