• 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

Red@

Active Member
Joined
Mar 20, 2021
Messages
140
Likes
79
I provide below the starter for the gaudio_ctl daemon required to launch the script mentioned in my previous post (file set_samplerate.service under /usr/lib/systemd/system):
Code:
[Unit]
Description=Sample Rate Changer Daemon
After=multi-user.target

[Service]
ExecStart=gaudio_ctl --gadget-name "UAC2Gadget" --ccmd  "/usr/bin/python3 /home/pi/set_samplerate.py {R}"
Restart=always
RestartSec=1
StandardOutput=journal
StandardError=journal
SyslogIdentifier=set_samplerate
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=10
User=pi
Group=pi

[Install]
WantedBy=usb-gadget.target multi-user.target

Note the "WantedBy" option in the [Install] section ensuring that the sample rate change daemon is started when the usb-gadget.target is reached, indicating the aviailability of a usb gadget device (this was suggested by @phofman elsewhere).
Hello @stemag,
I am not a dev per say, and would like to use this solution. since the infomation is quite scattered between posts, I am a little at lost.
Would it be possible for you to describe the steps including you're latest additions ?
It would he very much appreciate, thank you very much in advance
 

stemag

Member
Joined
Nov 1, 2022
Messages
32
Likes
24
Hello @stemag,
I am not a dev per say, and would like to use this solution. since the infomation is quite scattered between posts, I am a little at lost.
Would it be possible for you to describe the steps including you're latest additions ?
It would he very much appreciate, thank you very much in advance
I had the same difficulty in putting all the information together. Now everything is working as expected.
I will try to write a small guide. Please allow me a few days.
 

stemag

Member
Joined
Nov 1, 2022
Messages
32
Likes
24
Please find attached a small guide to set up a DSP box based on Raspberry Pi 4 hardware and CamillaDSP software.
I am not a native English speaker, so I apologise for any imperfect use of the English language.
Please inform me of any errors or omissions.
 

Attachments

  • HowToSetupCamillaDSPBox.pdf
    95.8 KB · Views: 163

melomane13

Member
Joined
Jul 24, 2023
Messages
99
Likes
70
Location
France
is this adapter ok for gadget?

Convertisseur-de-Type-C-OTG-adaptateur-de-c-ble-de-Charge-rapide-USB-C-USB-3.jpg_.webp


 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
503
Likes
327
That USB3 (i.e. data) connector is female (i.e. host side). You need a device side connector, to be plugged into a host.
 

melomane13

Member
Joined
Jul 24, 2023
Messages
99
Likes
70
Location
France
That USB3 (i.e. data) connector is female (i.e. host side). You need a device side connector, to be plugged into a host.

Do you want to go deeper? I'm not sure I understand
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
503
Likes
327
IIUC you are looking for a splitter to power your RPi while using the USB-C as a gadget (that's the subject of this topic). If so, the splitter would have to present the device side of the USB connection.
 

Music1969

Major Contributor
Joined
Feb 19, 2018
Messages
4,676
Likes
2,850
Hi @phofman , so do you have automatic sample rate switching working with your Pi4?

So if Apple Music Hi-Res changes sample rates, you can feed it bitperfectly into Pi4, without any manual changing of sample rate?

What are the key code lines required for this to work ?

Or is it now part of some mainline kernel for RPi4?
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
503
Likes
327

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
503
Likes
327
Thanks! Looking at the thread, seems only the OP was able to get it to work, and nobody else.
IIUC there was only one follower who really tried and did not know how to compile C code in linux. Another guy did not use the USB gaget device.

I have not tested the project but it looks nice and the author is clearly very competent.
 

melomane13

Member
Joined
Jul 24, 2023
Messages
99
Likes
70
Location
France
Gadget setup as explained here work with Raspberry zero w 2: i have relied pc to raspberry with direct câble.
BUT , because i have USB sound card, i have add standard USB hub and now gadget is not show.
Some USB hub are sell as OTG ( not mine) , do you think can be work?
Édit: not possible to have on the same port, slave and master.
 
Last edited:

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
503
Likes
327
The dwc2 device on RPi can be either host or gadget/device, not both at the same time. If you need both, you need two USB controllers, such as dwc2 and VL805 on RPi4.
 

melomane13

Member
Joined
Jul 24, 2023
Messages
99
Likes
70
Location
France
The dwc2 device on RPi can be either host or gadget/device, not both at the same time. If you need both, you need two USB controllers, such as dwc2 and VL805 on RPi4.
Ok, thanks . The question is: It Is possible add a second USB controller on ZERO?
 

IAtaman

Major Contributor
Forum Donor
Joined
Mar 29, 2021
Messages
2,409
Likes
4,165
Ok, thanks . The question is: It Is possible add a second USB controller on ZERO?
I did not fully understand what is it that you are trying to acheive, so if question is stupid, you know why :

Zero W has 2 USB Ports, OTG/Power port and the host port. Why don't you connect the USB hub and sound card to the host port, and leave the OTG/Power port connected to the PC?
 

IAtaman

Major Contributor
Forum Donor
Joined
Mar 29, 2021
Messages
2,409
Likes
4,165
As there is no PCI-e port available on the Zero, there is no interface to hook a USB controller to.

Either a standard-format RPi, or almost all other non-RPIs - e.g. most Radxa boards have 2x USB controllers with 1x OTG capability https://radxa.com/products
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.
 
Top Bottom