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

RPi + CamillaDSP Tutorial

Now that summer is over, I'm continuing test of Camilla DSP on my part. I have since acquired a Raspberry Pi Zero 2 W with an Audiophonics DAC HAT. I'm running it now as USB gadget mode as source. I have a USB power meter that reports only ~1.0 - 1.1 W consumption while playing and having one peaking biquad filter on, and that's with the HAT. Total CPU load is 25-27 %, I will need to test with additional filters. While booting up it peaks at 2.5 W, this is much better suited SBC for this purpose than the model B. I'll be using it daily for my work, Teams meetings and background music, to see how it fares.

I will be adding a display and rotary encoder(s) that I have on shelf when I get my software straight.
 
Now that summer is over, I'm continuing test of Camilla DSP on my part. I have since acquired a Raspberry Pi Zero 2 W with an Audiophonics DAC HAT. I'm running it now as USB gadget mode as source. I have a USB power meter that reports only ~1.0 - 1.1 W consumption while playing and having one peaking biquad filter on, and that's with the HAT. Total CPU load is 25-27 %, I will need to test with additional filters. While booting up it peaks at 2.5 W, this is much better suited SBC for this purpose than the model B. I'll be using it daily for my work, Teams meetings and background music, to see how it fares.

I will be adding a display and rotary encoder(s) that I have on shelf when I get my software straight.
RPi Zero 2 is indeed adequate CPU wise to run CDSP, however some have noted that stability over time is not as robust as model B models.
For reference, my RPi 4B has been running CDSP flawlessly for a couple of months, no crash whatsoever.
Hope you have a better experience!
 
Hello everyone, I have a mini computer. When installing CamillaDSP, should I choose macos or ubuntu? Which system has the smallest delay?
 
Hello everyone, I have a mini computer. When installing CamillaDSP, should I choose macos or ubuntu? Which system has the smallest delay?
I wouldn't expect much difference in latency between macos and linux, but I haven't seen any measurements and it may depend on the audio hardware - driver differences rather than audio subsystem differences. I assume your computer is some sort of Mac Mini, but the age may change the OS choice. One advantage for Ubuntu is the documentation of CamillaDSP setup - it will be near identical to the Raspberry Pi setup. I haven't seen such detailed documentation for MacOS.
 
I wouldn't expect much difference in latency between macos and linux, but I haven't seen any measurements and it may depend on the audio hardware - driver differences rather than audio subsystem differences. I assume your computer is some sort of Mac Mini, but the age may change the OS choice. One advantage for Ubuntu is the documentation of CamillaDSP setup - it will be near identical to the Raspberry Pi setup. I haven't seen such detailed documentation for MacOS.
Thanks, it's a thinkcentre m93p, i5 4590t. I have installed macos, and I'm considering whether to change to ubuntu to reduce the delay from in to out, even a little bit. My home theater is 7.1.4, the sound card is 4in4out, and I plan to use it for LRC and LFE, so I need to control the delay.
 
Thanks, it's a thinkcentre m93p, i5 4590t. I have installed macos, and I'm considering whether to change to ubuntu to reduce the delay from in to out, even a little bit. My home theater is 7.1.4, the sound card is 4in4out, and I plan to use it for LRC and LFE, so I need to control the delay.
No need to reinstall your OS, you could test Ubuntu from a live USB pen drive and see for yourself :)
 
I’m dropping the drivers into my DIY speakers this weekend and wiring everything up so it’s almost time for CDSP. Hopefully will have time next week to get things up and running. So the pressing question is pi4 vs pi5. I’m going to be running 8 channels of output. Is there any benefit to SSD or one platform vs the other in terms of ease of use or latency? Reading through the thread it seemed like pi4 had the stability/ease of implementation benefit. Is that still the case? Thanks in advance.
 
I’m dropping the drivers into my DIY speakers this weekend and wiring everything up so it’s almost time for CDSP. Hopefully will have time next week to get things up and running. So the pressing question is pi4 vs pi5. I’m going to be running 8 channels of output. Is there any benefit to SSD or one platform vs the other in terms of ease of use or latency? Reading through the thread it seemed like pi4 had the stability/ease of implementation benefit. Is that still the case? Thanks in advance.

I say RPi4 unless you need the multichannel I2S functionality of the RPi5. I've found that the RPi5 does not work with at least one USB device (hifime UR23) that works fine on the RPi4. I don't see an advantage to the additional processing power of the RPi5 for a CamillaDSP application and that performance comes at a thermal penalty.

I've tested out SSDs in the past as they were easy to use as they could be plugged in to the back of my case, whereas SD cards required removing the top of the case. I don't change things much these days, so I use SD cards as they are a more compact solution. Some will say you may have issues over time with corruption using SD cards, but I haven't seen it, and as I only run CamillaDSP on the RPi and have the configurations saved elsewhere, it wouldn't be a big deal to me if the SD card went down. I don't think there is any appreciable difference in latency for CamillaDSP applications.

Michael
 
Hello everyone, I have a mini computer. When installing CamillaDSP, should I choose macos or ubuntu? Which system has the smallest delay?
On the Raspberry Pi Ubuntu now requires an extra configuration step. That may or may not be an issue on your computer. If you run into an issue, search this thread, starting on this page and working backwards, for the additional configuration terminal commands.
 
Can anyone tell if Linux distros, specifically Raspberry Os, do any background work that uses network? Like Windows, it checks for updates and sends your photos to CIA.

I know there is some mandatory traffic to keep network alive, but anything else?

This comes basically down to system performance predictability. If I use a low power, low RAM SKU and make good use of all available CPU cycles, will it crash randomly due to background work?

When you look at embedded products, they are pretty much locked from all changes and any updates go though firmware updates. I was thinking something similar.
 
Can anyone tell if Linux distros, specifically Raspberry Os, do any background work that uses network?
Debian does not so long as automatic updates are not turned on and a desktop environment is not installed. Raspberry Pi OS is based on Debian, so probably not if you use the Raspberry Pi OS Lite version, which does not come with a desktop environment. By default automatic updates do not appear to be turned on in my installation.

If you use a desktop environment with Raspberry Pi OS, it will depend on whether the desktop environment you choose is checking for updates. If you don't want it doing so, you may be able to turn that off. If you want a desktop environment, you probably should look into it.

This comes basically down to system performance predictability. If I use a low power, low RAM SKU and make good use of all available CPU cycles, will it crash randomly due to background work?
For me, I just use Raspberry Pi OS Lite. As noted, it is based on Debian, which is rock solid. The below screenshot lists memory usage:

RPOS.png



Here is my DSP load on the CPU running CamillaDSP on a Raspberry Pi 5:

CamillaDSP_Load.png


Once you add a desktop environment, though, that is when you run into higher disk usage, higher RAM usage, higher CPU use, a bit less stability, etc.
 
Last edited:
No need to reinstall your OS, you could test Ubuntu from a live USB pen drive and see for yourself :)
@Rafaille Thanks for your advice.
On the Raspberry Pi Ubuntu now requires an extra configuration step. That may or may not be an issue on your computer. If you run into an issue, search this thread, starting on this page and working backwards, for the additional configuration terminal commands.
@terryforsythe Thanks for your guidance.

I have installed Ubuntu.
After a lot of time, camilladsp works fine, and the problem of not being able to select "hw" devices has been solved. Before, I could only use "plughw".
delay test, compared with macos, ubuntu wins.
96000Hz chunksize:256 is 3.7ms faster
96000Hz chunksize:128 is 17ms faster (may need to verify again)
 
Thanks for the new github instructions @mdsimon2 . I installed the pi os lite on my rpi5. Then I went through all the steps for installing CamillaDsp. Now I also installed nginx so I can control my ULmk5 from cuemix.. this is great!
The only thing that did not work was the display. I did not change the old wiring, so I used the GPIO in parenthesis and changed to chip = sbc.gpiochip_open(4) #use this for RPi5. After a lot of testing, I tried the chip select for rpi4 and then it worked!. On my old install with ubuntu server the instructions was correct, but with the pi os it was the opposite for some reason..
 
Thanks for the new github instructions @mdsimon2 . I installed the pi os lite on my rpi5. Then I went through all the steps for installing CamillaDsp. Now I also installed nginx so I can control my ULmk5 from cuemix.. this is great!
The only thing that did not work was the display. I did not change the old wiring, so I used the GPIO in parenthesis and changed to chip = sbc.gpiochip_open(4) #use this for RPi5. After a lot of testing, I tried the chip select for rpi4 and then it worked!. On my old install with ubuntu server the instructions was correct, but with the pi os it was the opposite for some reason..

Thanks for the info, I want to make sure I understand specifically what you are saying. Are you saying you used chip = sbc.gpiochip_open(0)?

I've been using a raspberry pi 5 for my office setup and haven't noticed this, but I haven't updated it in a while. I ran gpioinfo (install gpiod to get this) and got the following before and after updating.

Before:
Code:
gpiochip0 - 32 lines:
    line   0:          "-"       unused   input  active-high 
    line   1: "2712_BOOT_CS_N" "spi10 CS0" output active-low [used]
    line   2: "2712_BOOT_MISO" unused input active-high 
    line   3: "2712_BOOT_MOSI" unused input active-high 
    line   4: "2712_BOOT_SCLK" unused input active-high 
    line   5:          "-"       unused   input  active-high 
    line   6:          "-"       unused   input  active-high 
    line   7:          "-"       unused   input  active-high 
    line   8:          "-"       unused   input  active-high 
    line   9:          "-"       unused   input  active-high 
    line  10:          "-"       unused   input  active-high 
    line  11:          "-"       unused   input  active-high 
    line  12:          "-"       unused   input  active-high 
    line  13:          "-"       unused   input  active-high 
    line  14:   "PCIE_SDA"       unused   input  active-high 
    line  15:   "PCIE_SCL"       unused   input  active-high 
    line  16:          "-"       unused   input  active-high 
    line  17:          "-"       unused   input  active-high 
    line  18:          "-"       unused   input  active-high 
    line  19:          "-"       unused   input  active-high 
    line  20:   "PWR_GPIO" "pwr_button"   input   active-low [used]
    line  21: "2712_G21_FS" unused input active-high 
    line  22:          "-"       unused   input  active-high 
    line  23:          "-"       unused   input  active-high 
    line  24:     "BT_RTS"       unused   input  active-high 
    line  25:     "BT_CTS"       unused   input  active-high 
    line  26:     "BT_TXD"       unused   input  active-high 
    line  27:     "BT_RXD"       unused   input  active-high 
    line  28:      "WL_ON"  "wl_on_reg"  output  active-high [used]
    line  29:      "BT_ON"   "shutdown"  output  active-high [used]
    line  30: "WIFI_SDIO_CLK" unused input active-high 
    line  31: "WIFI_SDIO_CMD" unused input active-high 
gpiochip1 - 4 lines:
    line   0: "WIFI_SDIO_D0" unused input active-high 
    line   1: "WIFI_SDIO_D1" unused input active-high 
    line   2: "WIFI_SDIO_D2" unused input active-high 
    line   3: "WIFI_SDIO_D3" unused input active-high 
gpiochip2 - 17 lines:
    line   0:    "RP1_SDA"       unused   input  active-high 
    line   1:    "RP1_SCL"       unused   input  active-high 
    line   2:    "RP1_RUN" "RP1 RUN pin" output active-high [used]
    line   3: "SD_IOVDD_SEL" "vdd-sd-io" output active-high [used]
    line   4:  "SD_PWR_ON" "sd_vcc_reg"  output  active-high [used]
    line   5:  "SD_CDET_N"         "cd"   input   active-low [used]
    line   6:   "SD_FLG_N"       unused   input  active-high 
    line   7:          "-"       unused   input  active-high 
    line   8:  "2712_WAKE"       unused   input  active-high 
    line   9: "2712_STAT_LED" "ACT" output active-low [used]
    line  10:          "-"       unused   input  active-high 
    line  11:          "-"       unused   input  active-high 
    line  12:   "PMIC_INT"       unused   input  active-high 
    line  13: "UART_TX_FS"       unused   input  active-high 
    line  14: "UART_RX_FS"       unused   input  active-high 
    line  15:          "-"       unused   input  active-high 
    line  16:          "-"       unused   input  active-high 
gpiochip3 - 6 lines:
    line   0:  "HDMI0_SCL"       unused   input  active-high 
    line   1:  "HDMI0_SDA"       unused   input  active-high 
    line   2:  "HDMI1_SCL"       unused   input  active-high 
    line   3:  "HDMI1_SDA"       unused   input  active-high 
    line   4:   "PMIC_SCL"       unused   input  active-high 
    line   5:   "PMIC_SDA"       unused   input  active-high 
gpiochip4 - 54 lines:
    line   0:     "ID_SDA"       unused   input  active-high 
    line   1:     "ID_SCL"       unused   input  active-high 
    line   2:      "GPIO2"         "lg"  output  active-high [used]
    line   3:      "GPIO3"         "lg"  output  active-high [used]
    line   4:      "GPIO4"       unused   input  active-high 
    line   5:      "GPIO5"         "lg"  output  active-high [used]
    line   6:      "GPIO6"         "lg"  output  active-high [used]
    line   7:      "GPIO7"       unused   input  active-high 
    line   8:      "GPIO8"       unused   input  active-high 
    line   9:      "GPIO9"         "lg"  output  active-high [used]
    line  10:     "GPIO10"         "lg"  output  active-high [used]
    line  11:     "GPIO11"       unused   input  active-high 
    line  12:     "GPIO12"         "lg"  output  active-high [used]
    line  13:     "GPIO13"         "lg"  output  active-high [used]
    line  14:     "GPIO14"         "lg"  output  active-high [used]
    line  15:     "GPIO15"         "lg"  output  active-high [used]
    line  16:     "GPIO16"         "lg"  output  active-high [used]
    line  17:     "GPIO17"         "lg"  output  active-high [used]
    line  18:     "GPIO18"       unused   input  active-high 
    line  19:     "GPIO19"       unused   input  active-high 
    line  20:     "GPIO20"       unused   input  active-high 
    line  21:     "GPIO21"       unused   input  active-high 
    line  22:     "GPIO22"       unused   input  active-high 
    line  23:     "GPIO23"       unused   input  active-high 
    line  24:     "GPIO24"       unused   input  active-high 
    line  25:     "GPIO25"       unused   input  active-high 
    line  26:     "GPIO26"       unused   input  active-high 
    line  27:     "GPIO27"       unused   input  active-high 
    line  28: "PCIE_RP1_WAKE" unused input active-high 
    line  29:   "FAN_TACH"       unused   input  active-high 
    line  30:   "HOST_SDA"       unused   input  active-high 
    line  31:   "HOST_SCL"       unused   input  active-high 
    line  32:  "ETH_RST_N"  "phy-reset"  output   active-low [used]
    line  33:          "-"       unused   input  active-high 
    line  34: "CD0_IO0_MICCLK" "cam0_reg" output active-high [used]
    line  35: "CD0_IO0_MICDAT0" unused input active-high 
    line  36: "RP1_PCIE_CLKREQ_N" unused input active-high 
    line  37:          "-"       unused   input  active-high 
    line  38:    "CD0_SDA"       unused   input  active-high 
    line  39:    "CD0_SCL"       unused   input  active-high 
    line  40:    "CD1_SDA"       unused   input  active-high 
    line  41:    "CD1_SCL"       unused   input  active-high 
    line  42: "USB_VBUS_EN" unused output active-high 
    line  43:   "USB_OC_N"       unused   input  active-high 
    line  44: "RP1_STAT_LED" "PWR" output active-low [used]
    line  45:    "FAN_PWM"       unused  output  active-high 
    line  46: "CD1_IO0_MICCLK" "cam1_reg" output active-high [used]
    line  47:  "2712_WAKE"       unused   input  active-high 
    line  48: "CD1_IO1_MICDAT1" unused input active-high 
    line  49: "EN_MAX_USB_CUR" unused output active-high 
    line  50:          "-"       unused   input  active-high 
    line  51:          "-"       unused   input  active-high 
    line  52:          "-"       unused   input  active-high 
    line  53:          "-"       unused   input  active-high

After:
Code:
gpiochip0 - 54 lines:
    line   0:     "ID_SDA"       unused   input  active-high 
    line   1:     "ID_SCL"       unused   input  active-high 
    line   2:      "GPIO2"         "lg"  output  active-high [used]
    line   3:      "GPIO3"         "lg"  output  active-high [used]
    line   4:      "GPIO4"       unused   input  active-high 
    line   5:      "GPIO5"         "lg"  output  active-high [used]
    line   6:      "GPIO6"         "lg"  output  active-high [used]
    line   7:      "GPIO7"       unused   input  active-high 
    line   8:      "GPIO8"       unused   input  active-high 
    line   9:      "GPIO9"         "lg"  output  active-high [used]
    line  10:     "GPIO10"         "lg"  output  active-high [used]
    line  11:     "GPIO11"       unused   input  active-high 
    line  12:     "GPIO12"         "lg"  output  active-high [used]
    line  13:     "GPIO13"         "lg"  output  active-high [used]
    line  14:     "GPIO14"         "lg"  output  active-high [used]
    line  15:     "GPIO15"         "lg"  output  active-high [used]
    line  16:     "GPIO16"         "lg"  output  active-high [used]
    line  17:     "GPIO17"         "lg"  output  active-high [used]
    line  18:     "GPIO18"       unused   input  active-high 
    line  19:     "GPIO19"       unused   input  active-high 
    line  20:     "GPIO20"       unused   input  active-high 
    line  21:     "GPIO21"       unused   input  active-high 
    line  22:     "GPIO22"       unused   input  active-high 
    line  23:     "GPIO23"       unused   input  active-high 
    line  24:     "GPIO24"       unused   input  active-high 
    line  25:     "GPIO25"       unused   input  active-high 
    line  26:     "GPIO26"       unused   input  active-high 
    line  27:     "GPIO27"       unused   input  active-high 
    line  28: "PCIE_RP1_WAKE" unused input active-high 
    line  29:   "FAN_TACH"       unused   input  active-high 
    line  30:   "HOST_SDA"       unused   input  active-high 
    line  31:   "HOST_SCL"       unused   input  active-high 
    line  32:  "ETH_RST_N"  "phy-reset"  output   active-low [used]
    line  33:          "-"       unused   input  active-high 
    line  34: "CD0_IO0_MICCLK" "cam0_reg" output active-high [used]
    line  35: "CD0_IO0_MICDAT0" unused input active-high 
    line  36: "RP1_PCIE_CLKREQ_N" unused input active-high 
    line  37:          "-"       unused   input  active-high 
    line  38:    "CD0_SDA"       unused   input  active-high 
    line  39:    "CD0_SCL"       unused   input  active-high 
    line  40:    "CD1_SDA"       unused   input  active-high 
    line  41:    "CD1_SCL"       unused   input  active-high 
    line  42: "USB_VBUS_EN" unused output active-high 
    line  43:   "USB_OC_N"       unused   input  active-high 
    line  44: "RP1_STAT_LED" "PWR" output active-low [used]
    line  45:    "FAN_PWM"       unused   input  active-high 
    line  46: "CD1_IO0_MICCLK" "cam1_reg" output active-high [used]
    line  47:  "2712_WAKE"       unused   input  active-high 
    line  48: "CD1_IO1_MICDAT1" unused input active-high 
    line  49: "EN_MAX_USB_CUR" unused output active-high 
    line  50:          "-"       unused   input  active-high 
    line  51:          "-"       unused   input  active-high 
    line  52:          "-"       unused   input  active-high 
    line  53:          "-"       unused   input  active-high 
gpiochip10 - 32 lines:
    line   0:          "-"       unused   input  active-high 
    line   1: "2712_BOOT_CS_N" "spi10 CS0" output active-low [used]
    line   2: "2712_BOOT_MISO" unused input active-high 
    line   3: "2712_BOOT_MOSI" unused input active-high 
    line   4: "2712_BOOT_SCLK" unused input active-high 
    line   5:          "-"       unused   input  active-high 
    line   6:          "-"       unused   input  active-high 
    line   7:          "-"       unused   input  active-high 
    line   8:          "-"       unused   input  active-high 
    line   9:          "-"       unused   input  active-high 
    line  10:          "-"       unused   input  active-high 
    line  11:          "-"       unused   input  active-high 
    line  12:          "-"       unused   input  active-high 
    line  13:          "-"       unused   input  active-high 
    line  14:   "PCIE_SDA"       unused   input  active-high 
    line  15:   "PCIE_SCL"       unused   input  active-high 
    line  16:          "-"       unused   input  active-high 
    line  17:          "-"       unused   input  active-high 
    line  18:          "-"       unused   input  active-high 
    line  19:          "-"       unused   input  active-high 
    line  20:   "PWR_GPIO" "pwr_button"   input   active-low [used]
    line  21: "2712_G21_FS" unused input active-high 
    line  22:          "-"       unused   input  active-high 
    line  23:          "-"       unused   input  active-high 
    line  24:     "BT_RTS"       unused   input  active-high 
    line  25:     "BT_CTS"       unused   input  active-high 
    line  26:     "BT_TXD"       unused   input  active-high 
    line  27:     "BT_RXD"       unused   input  active-high 
    line  28:      "WL_ON"  "wl_on_reg"  output  active-high [used]
    line  29:      "BT_ON"   "shutdown"  output  active-high [used]
    line  30: "WIFI_SDIO_CLK" unused input active-high 
    line  31: "WIFI_SDIO_CMD" unused input active-high 
gpiochip11 - 4 lines:
    line   0: "WIFI_SDIO_D0" unused input active-high 
    line   1: "WIFI_SDIO_D1" unused input active-high 
    line   2: "WIFI_SDIO_D2" unused input active-high 
    line   3: "WIFI_SDIO_D3" unused input active-high 
gpiochip12 - 17 lines:
    line   0:    "RP1_SDA"       unused   input  active-high 
    line   1:    "RP1_SCL"       unused   input  active-high 
    line   2:    "RP1_RUN" "RP1 RUN pin" output active-high [used]
    line   3: "SD_IOVDD_SEL" "vdd-sd-io" output active-high [used]
    line   4:  "SD_PWR_ON" "sd_vcc_reg"  output  active-high [used]
    line   5:  "SD_CDET_N"         "cd"   input   active-low [used]
    line   6:   "SD_FLG_N"       unused   input  active-high 
    line   7:          "-"       unused   input  active-high 
    line   8:  "2712_WAKE"       unused   input  active-high 
    line   9: "2712_STAT_LED" "ACT" output active-low [used]
    line  10:          "-"       unused   input  active-high 
    line  11:          "-"       unused   input  active-high 
    line  12:   "PMIC_INT"       unused   input  active-high 
    line  13: "UART_TX_FS"       unused   input  active-high 
    line  14: "UART_RX_FS"       unused   input  active-high 
    line  15:          "-"       unused   input  active-high 
    line  16:          "-"       unused   input  active-high 
gpiochip13 - 6 lines:
    line   0:  "HDMI0_SCL"       unused   input  active-high 
    line   1:  "HDMI0_SDA"       unused   input  active-high 
    line   2:  "HDMI1_SCL"       unused   input  active-high 
    line   3:  "HDMI1_SDA"       unused   input  active-high 
    line   4:   "PMIC_SCL"       unused   input  active-high 
    line   5:   "PMIC_SDA"       unused   input  active-high 
gpiochip0 - 54 lines:
    line   0:     "ID_SDA"       unused   input  active-high 
    line   1:     "ID_SCL"       unused   input  active-high 
    line   2:      "GPIO2"         "lg"  output  active-high [used]
    line   3:      "GPIO3"         "lg"  output  active-high [used]
    line   4:      "GPIO4"       unused   input  active-high 
    line   5:      "GPIO5"         "lg"  output  active-high [used]
    line   6:      "GPIO6"         "lg"  output  active-high [used]
    line   7:      "GPIO7"       unused   input  active-high 
    line   8:      "GPIO8"       unused   input  active-high 
    line   9:      "GPIO9"         "lg"  output  active-high [used]
    line  10:     "GPIO10"         "lg"  output  active-high [used]
    line  11:     "GPIO11"       unused   input  active-high 
    line  12:     "GPIO12"         "lg"  output  active-high [used]
    line  13:     "GPIO13"         "lg"  output  active-high [used]
    line  14:     "GPIO14"         "lg"  output  active-high [used]
    line  15:     "GPIO15"         "lg"  output  active-high [used]
    line  16:     "GPIO16"         "lg"  output  active-high [used]
    line  17:     "GPIO17"         "lg"  output  active-high [used]
    line  18:     "GPIO18"       unused   input  active-high 
    line  19:     "GPIO19"       unused   input  active-high 
    line  20:     "GPIO20"       unused   input  active-high 
    line  21:     "GPIO21"       unused   input  active-high 
    line  22:     "GPIO22"       unused   input  active-high 
    line  23:     "GPIO23"       unused   input  active-high 
    line  24:     "GPIO24"       unused   input  active-high 
    line  25:     "GPIO25"       unused   input  active-high 
    line  26:     "GPIO26"       unused   input  active-high 
    line  27:     "GPIO27"       unused   input  active-high 
    line  28: "PCIE_RP1_WAKE" unused input active-high 
    line  29:   "FAN_TACH"       unused   input  active-high 
    line  30:   "HOST_SDA"       unused   input  active-high 
    line  31:   "HOST_SCL"       unused   input  active-high 
    line  32:  "ETH_RST_N"  "phy-reset"  output   active-low [used]
    line  33:          "-"       unused   input  active-high 
    line  34: "CD0_IO0_MICCLK" "cam0_reg" output active-high [used]
    line  35: "CD0_IO0_MICDAT0" unused input active-high 
    line  36: "RP1_PCIE_CLKREQ_N" unused input active-high 
    line  37:          "-"       unused   input  active-high 
    line  38:    "CD0_SDA"       unused   input  active-high 
    line  39:    "CD0_SCL"       unused   input  active-high 
    line  40:    "CD1_SDA"       unused   input  active-high 
    line  41:    "CD1_SCL"       unused   input  active-high 
    line  42: "USB_VBUS_EN" unused output active-high 
    line  43:   "USB_OC_N"       unused   input  active-high 
    line  44: "RP1_STAT_LED" "PWR" output active-low [used]
    line  45:    "FAN_PWM"       unused   input  active-high 
    line  46: "CD1_IO0_MICCLK" "cam1_reg" output active-high [used]
    line  47:  "2712_WAKE"       unused   input  active-high 
    line  48: "CD1_IO1_MICDAT1" unused input active-high 
    line  49: "EN_MAX_USB_CUR" unused output active-high 
    line  50:          "-"       unused   input  active-high 
    line  51:          "-"       unused   input  active-high 
    line  52:          "-"       unused   input  active-high 
    line  53:          "-"       unused   input  active-high

The odd thing is that for me it works with chip 0 OR 4. Can you run "gpioinfo" as well as "sudo rpi-eeprom-update", "cat /proc/cpuinfo" and "uname -a" and report the results. For reference here are what I get.

Code:
michael2@raspberrypi2:~ $ sudo rpi-eeprom-update
BOOTLOADER: up to date
   CURRENT: Tue 10 Sep 13:40:30 UTC 2024 (1725975630)
    LATEST: Tue 10 Sep 13:40:30 UTC 2024 (1725975630)
   RELEASE: default (/lib/firmware/raspberrypi/bootloader-2712/default)
            Use raspi-config to change the release.

Code:
michael2@raspberrypi2:~ $ cat /proc/cpuinfo
processor    : 0
BogoMIPS    : 108.00
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer    : 0x41
CPU architecture: 8
CPU variant    : 0x4
CPU part    : 0xd0b
CPU revision    : 1

processor    : 1
BogoMIPS    : 108.00
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer    : 0x41
CPU architecture: 8
CPU variant    : 0x4
CPU part    : 0xd0b
CPU revision    : 1

processor    : 2
BogoMIPS    : 108.00
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer    : 0x41
CPU architecture: 8
CPU variant    : 0x4
CPU part    : 0xd0b
CPU revision    : 1

processor    : 3
BogoMIPS    : 108.00
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer    : 0x41
CPU architecture: 8
CPU variant    : 0x4
CPU part    : 0xd0b
CPU revision    : 1

Revision    : c04170
Serial        : 032e2dbc48afc13e
Model        : Raspberry Pi 5 Model B Rev 1.0

Code:
michael2@raspberrypi2:~ $ uname -a
Linux raspberrypi2 6.6.47+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.47-1+rpt1 (2024-09-02) aarch64 GNU/Linux

Michael
 
Some more info on the gpiochip0 vs gpiochip4 situation -> https://github.com/raspberrypi/linux/pull/6144.

Short story is gpiochip0 will be used going forward, but a symbolic link has been setup between gpiochip0 and gpiochip4.

Code:
michael2@raspberrypi2:/usr/lib/udev/rules.d $ cat /usr/lib/udev/rules.d/60-gpiochip4.rules 
SUBSYSTEM=="gpio", KERNEL=="gpiochip0", PROGRAM="/usr/bin/test ! -c /dev/gpiochip4", SYMLINK+="gpiochip4"

There was a short period of time after the update had been made to the kernel but the symbolic link had not been implemented where only gpiochip0 would work. Good news is I can simplify going forward to only use gpiochip0 for both rpi4 and 5.

Michael
 
Thanks for the explanation Michael. I must have installed the system in that period of time when only gpiochip0 was working.

Paal
 
I've been running my RPi Zero 2 with Camilla DSP a couple of weeks nearly daily, continuously multiple hours. I'm regularly, one every 10-15 mins, getting short pauses and log reveals they are either buffer underrun or some sort of write errors (are they the same?):
2024-09-10 01:17:14.923587 INFO [src/bin.rs:683] CamillaDSP version 2.0.3
2024-09-10 01:17:14.923951 INFO [src/bin.rs:684] Running on linux, aarch64
2024-09-10 01:17:15.006062 WARN [src/audiodevice.rs:523] Needless 1:1 sample rate conversion active. Not needed since enable_rate_adjust=False
2024-09-10 01:17:15.026158 INFO [src/alsadevice.rs:648] Capture device supports rate adjust
2024-09-10 01:17:15.026348 WARN [src/alsadevice.rs:650] Needless 1:1 sample rate conversion active. Not needed since capture device supports rate adjust
2024-09-10 01:17:15.066506 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 08:54:34.053322 INFO [src/alsadevice.rs:142] PB: Starting playback from Prepared state
2024-09-10 08:55:01.728970 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 08:57:18.963064 WARN [src/alsadevice.rs:138] PB: Prepare playback after buffer underrun
2024-09-10 08:57:38.991190 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 09:08:51.531276 WARN [src/alsadevice.rs:138] PB: Prepare playback after buffer underrun
2024-09-10 09:09:01.436775 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 09:13:34.784152 WARN [src/alsadevice.rs:138] PB: Prepare playback after buffer underrun
2024-09-10 09:23:57.961971 WARN [src/alsadevice.rs:216] PB: write error, trying to recover. Error: ALSA function 'snd_pcm_writei' failed with error 'EPIPE: Broken pipe'
2024-09-10 09:33:56.723952 WARN [src/alsadevice.rs:216] PB: write error, trying to recover. Error: ALSA function 'snd_pcm_writei' failed with error 'EPIPE: Broken pipe'
2024-09-10 09:43:37.348041 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 09:43:37.606658 WARN [src/alsadevice.rs:138] PB: Prepare playback after buffer underrun
2024-09-10 09:43:58.648501 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 09:45:37.633829 WARN [src/alsadevice.rs:138] PB: Prepare playback after buffer underrun
2024-09-10 09:55:13.546716 WARN [src/alsadevice.rs:216] PB: write error, trying to recover. Error: ALSA function 'snd_pcm_writei' failed with error 'EPIPE: Broken pipe'
2024-09-10 09:59:34.592292 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 09:59:34.871812 WARN [src/alsadevice.rs:138] PB: Prepare playback after buffer underrun
2024-09-10 09:59:50.879046 INFO [src/alsadevice.rs:799] Capture device is stalled, processing is stalled
2024-09-10 10:45:16.132122 WARN [src/alsadevice.rs:138] PB: Prepare playback after buffer underrun
2024-09-10 10:55:53.419487 WARN [src/alsadevice.rs:216] PB: write error, trying to recover. Error: ALSA function 'snd_pcm_writei' failed with error 'EPIPE: Broken pipe'
My Zero is running stock clocks and voltages and only power management I've done to this is to turn off some features that are unrelated to headless, usb (gadget mode), network and audio use. There is the Audiophonics DAC hat. The CPU is less than 15% when playing music with a mixer and five filters per channel. Opening the GUI in web browser increases the load about 6-7 % and having it open or not doesn't affect the short pauses. So the CPU is not overloaded. RAM usage goes 114/417 MB having all left over RAM for caching things. Swap none. Virtually no disk IO.

For CamillaDSP settings I've been playing around, but don't understand all of them. Sample rate of choice is 96 kHz (DAC supports up to 192/24), buffer chuck size 1024, no resampling. I've got playback device type=Alsa, sampleformat=S32LE and using hifiberry driver as that fits the Audiophonics DAC. The sample format is 32 bits, but since it works most of the time, I presume it gets truncated to fit the DAC? The capture device is also Alsa, S32LE UAC2Gadget. The bit depth makes no difference for stereo sound in USB bandwidth, but should I set bit depth to 24 anyway? Most other settings are on their default.

Not sure if it's just a feeling, but seems like W11 doesn't suffer from this too much, but more so my W10 work computer that I mainly use. This would be the first USB audio device to have this problem on it, though. I'm using streaming app or web interface to play music. Any tips?
 
Thanks for the instructions @mdsimon2
Just found the bluez-alsa installation @#2039, thanks again for the detailed instruction.
And I just found the way to "update" the bluez-alsa by compile it from source to have the aptX. aptX-HD supported codecs.
Haven't tried LDAC yet, but lack of decode, this become useless codec for now, unless someone just share a way impelement it.

The problem is:
I found even using the aptX-HD codec, the capt. sample rate is still 44.1kHz, which should be 48kHz?
And also, I found there's no loopback signal when set the sample format to S24LE while aptX-HD should be 24-bit format codec.
 
Last edited:
Back
Top Bottom