• 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

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,658
Likes
2,264
My favourite is Rock Pi S. It is smaller and has a convenient form factor, comes with a USB-C OTG /power port, ethernet port and a USB A host. One of these little guys is running CamillaDSP successfully for months now for me. You can get the one with Wifi and BT for ca $25 on aliexpress.
Are you by chance doing multichannel over i2s with it?
 

godmax

Member
Joined
Jul 31, 2020
Messages
59
Likes
67
Location
Germany
I am very much interested in such a convenient DSP solution for EQ as well for upsampling use-case.
Has the Rock PI S sufficient computing power for upsampling to 705kHz or 768kHz without EQ applied?
What about the delay of the processing?
Is there a step-b-step guide available for the Rock PI S specifically?
 

IAtaman

Major Contributor
Forum Donor
Joined
Mar 29, 2021
Messages
2,409
Likes
4,165
I am very much interested in such a convenient DSP solution for EQ as well for upsampling use-case.
Has the Rock PI S sufficient computing power for upsampling to 705kHz or 768kHz without EQ applied?
What about the delay of the processing?
Is there a step-b-step guide available for the Rock PI S specifically?
I don't know if Rock PI S has sufficuent compute power for upsampling to 705K or 768K. I am not producing any music, just consuming so never needed anything above 48K. It is USB-2 though so it might have enough output bandwith to support such high sampling rates even beyond computing power.

There is no step by step guide as far as I am aware, but I have my notes which I can convert into a guide at some point.
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
502
Likes
326
@IAtaman : Please can you take a look at my report to the radxa forum above? Do you use Pi S gadget feature with f_uac2 successfully?
 

IAtaman

Major Contributor
Forum Donor
Joined
Mar 29, 2021
Messages
2,409
Likes
4,165
@IAtaman : Please can you take a look at my report to the radxa forum above? Do you use Pi S gadget feature with f_uac2 successfully?
I am using the ancient 4.4 indeed and there it works fine. Do you have a link to the compiled 6.6 kernel - I can download and test on the second Rock Pi S I have if you like.

On a related note, just ordered a few Zero 3Ws. Hardware looks interesting but software seems to be a bit problematic based on forum posts. Any experience with that?
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
502
Likes
326
I am using the ancient 4.4 indeed and there it works fine.
That's interesting, UAC2 (f_uac2) with async feedback? Backporting all the changes from 5.18 to 4.4 would seem quite a project.

Do you have a link to the compiled 6.6 kernel - I can download and test on the second Rock Pi S I have if you like.

I will upload the debs to filesharing and send the link, thanks.
On a related note, just ordered a few Zero 3Ws. Hardware looks interesting but software seems to be a bit problematic based on forum posts. Any experience with that?
No I don't. I have CM3 and CM5 with their respective IO boards, for testing.
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
502
Likes
326
Actually how do you power your Pi S with the USB-C gadget working? Thanks.
 

IAtaman

Major Contributor
Forum Donor
Joined
Mar 29, 2021
Messages
2,409
Likes
4,165
Actually how do you power your Pi S with the USB-C gadget working? Thanks.
Normally through a KVM switch powered separately that connects to a PC and a Mac. I switch between them with no issues. After reading your post I tried powering them directly from the USB port on the PC and it worked fine too.
 
Last edited:

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
502
Likes
326
BTW this just shows why it's so important to be able to use the latest mainline kernel on SBCs, not only some ancient hacked android kernel.
 

Nicosea

Member
Joined
Sep 30, 2019
Messages
19
Likes
7
I don't know if Rock PI S has sufficuent compute power for upsampling to 705K or 768K. I am not producing any music, just consuming so never needed anything above 48K. It is USB-2 though so it might have enough output bandwith to support such high sampling rates even beyond computing power.

There is no step by step guide as far as I am aware, but I have my notes which I can convert into a guide at some point.
Can you share your notes?
How can I activate usb gadget audio in the Rock Pi S and define also parameters?
I would espect something similar to instructions for the PI 4:

Make the Pi function as an USB audio gadget
  1. Add the line dtoverlay=dwc2 to /boot/config.txt.
  2. Add two lines to /etc/modules:
    Code:
    dwc2
    g_audio
  3. Create file /etc/modprobe.d/usb_g_audio.conf:
    Code:
    #load the USB audio gadget module with the following options
    options g_audio c_srate=44100,48000,88200,96000,176400,192000,352800,384000,705600,768000 c_ssize=4 p_chmask=0
  4. Reboot.
 

godmax

Member
Joined
Jul 31, 2020
Messages
59
Likes
67
Location
Germany
@IAtaman it would really be nice if you could post some details of your Rock Pi S installation, configuration and setup :rolleyes:
I tried latest Armbian and was able to activate USB OTG with g_audio, but even it was correctly showing up when plugged in PC,
it was not working (also CamillaDSP setup seemed to be OK, but was not correctly starting with "Capture device is stalled, processing is stalled")
What image you are using on your Rock Pi S?
 

IAtaman

Major Contributor
Forum Donor
Joined
Mar 29, 2021
Messages
2,409
Likes
4,165
@IAtaman it would really be nice if you could post some details of your Rock Pi S installation, configuration and setup :rolleyes:
I tried latest Armbian and was able to activate USB OTG with g_audio, but even it was correctly showing up when plugged in PC,
it was not working (also CamillaDSP setup seemed to be OK, but was not correctly starting with "Capture device is stalled, processing is stalled")
What image you are using on your Rock Pi S?
Can you share your notes?
How can I activate usb gadget audio in the Rock Pi S and define also parameters?
Yes, of course. Sorry for not reverting on this earlier.

Before I do so, please note that I don't know much about Linux, so the way I did it might not be the optimal or smart way of going about it. Nonetheless, it has been working for quite a long time with no issues.

I am using the official Debian image from Radxa. Here is the link to the downloads page. As explained by phofman, it is an old version of Debian using an old Linux kernel so there is that.

I simply disabled the Android Debug Brige which runs over USB normally, added g_audio to /etc/modules/ and all worked fine. It has been a while so there might be some details I missed - let me know if you run into any issues please, and I can try and help.

Disabling adb:
sudo systemctl stop rockchip-adbd sudo systemctl disable rockchip-adbd
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
502
Likes
326
, but even it was correctly showing up when plugged in PC,
it was not working (also CamillaDSP setup seemed to be OK, but was not correctly starting with "Capture device is stalled, processing is stalled")
That's correct behavior - the gadget alsa device provides data only when the USB host plays some audio. If not, the device is stalled. CDSP handles the stall gracefully. Or you can start CDSP with projects like https://github.com/pavhofman/gaudio_ctl or https://github.com/marcoevang/camilladsp-setrate
 

godmax

Member
Joined
Jul 31, 2020
Messages
59
Likes
67
Location
Germany
am using the official Debian image from Radxa. Here is the link to the downloads page. As explained by phofman, it is an old version of Debian using an old Linux kernel so there is that.

I simply disabled the Android Debug Brige which runs over USB normally, added g_audio to /etc/modules/ and all worked fine. It has been a while so there might be some details I missed - let me know if you run into any issues please, and I can try and help.

Disabling adb:
sudo systemctl stop rockchip-adbd sudo systemctl disable rockchip-adbd
thanks for your response! It actually works, but only in UAC1 mode without further configuration, right? I am actually able to playback sound from PC, process it with CamillaDSP and forward it on external USB DAC.
That's correct behavior - the gadget alsa device provides data only when the USB host plays some audio. If not, the device is stalled. CDSP handles the stall gracefully. Or you can start CDSP with projects like https://github.com/pavhofman/gaudio_ctl or https://github.com/marcoevang/camilladsp-setrate
thanks for your reply! yea, I should have added to this that the Rock Pi S crashes when I actually try to playback sound through it using the Armbian 24.2.1 Bookworm image
:rolleyes: To use the CDSPs mentioned would have been the next step if it would have worked at all.
 

IAtaman

Major Contributor
Forum Donor
Joined
Mar 29, 2021
Messages
2,409
Likes
4,165
thanks for your response! It actually works, but only in UAC1 mode without further configuration, right? I am actually able to playback sound from PC, process it with CamillaDSP and forward it on external USB DAC.
Correct. I have it connected to a KVM at one and, and to the DAC at the other hand, and it works perfectly fine as I switch between a Mac and a PC.
 
Top Bottom