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

sarieri

Active Member
Forum Donor
Joined
Mar 1, 2023
Messages
231
Likes
139
If you use complete path to the binary, it can be anywhere the executing user as access to.

First your gaudio_ctl command must work correctly from a terminal, under the user you want to use in your systemd unit. Only then focus on solving the systemd unit pecularities, it's the last step.
I input the command into the terminal and it shows this:
Code:
root@DietPi:~# gaudio_ctl -y "/root/camilladsp/camilladsp -o /root/camilladsp/camilladsp.log -p 1234 /root/camilladsp/camilladsp-48000.yml"
Ctl 'Playback Rate' not found, will not start playback exec
I can confirm that this pops up when camilladsp is running and music is playing, so the source should be feeding a signal.
 
Last edited:

sarieri

Active Member
Forum Donor
Joined
Mar 1, 2023
Messages
231
Likes
139
Oh, I see you are using a MOTU Ultralite Mk5, that may make things more complicated as the channel counts change with sample rate. With the configuration you shared you have 18 playback channels at 44.1 kHz, it should be 22. For reference here are the output channel counts by sample rate.

44/48 - 22
88/96 - 18
176/192 - 10

You will need to change the channel counts in your configurations to reflect.

Michael
Just swap back to my D90SE for less hassle...I think the UltraLite mk5 is indeed too complicated to config.
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,440
Likes
3,275
Location
Detroit, MI
Just swap back to my D90SE for less hassle...I think the UltraLite mk5 is indeed too complicated to config.

If you only need 2 channels then the D90SE will be a better choice.

If you need more than 2 channels the UL Mk5 is a great way to go and many people use it with CamillaDSP.

Let’s take a step back.

Can you successfully run CamillaDSP using the USB gadget as your capture device from the command line NOT using gaudio_ctl? If so at what sample rates? If not please share your configuration and a CamillaDSP log showing the errors. Once you have it working like this we can move to gaudio_ctl.

Michael
 

sarieri

Active Member
Forum Donor
Joined
Mar 1, 2023
Messages
231
Likes
139
If you only need 2 channels then the D90SE will be a better choice.

If you need more than 2 channels the UL Mk5 is a great way to go and many people use it with CamillaDSP.

Let’s take a step back.

Can you successfully run CamillaDSP using the USB gadget as your capture device from the command line NOT using gaudio_ctl? If so at what sample rates? If not please share your configuration and a CamillaDSP log showing the errors. Once you have it working like this we can move to gaudio_ctl.

Michael
I can confirm that without gaudio_ct, I can run camilladsp at 96k, 48k, and 44.1k. I will also include a zip file of configs...including /etc/modprobe.d/usb_g_audio.conf and /lib/systemd/system/camilladsp.service.

 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,440
Likes
3,275
Location
Detroit, MI
That's right. I just uploaded the files to onedrive. Thank you so much for the patience here.

It looks like your camilladsp-41000.yml, camilladsp-48000.yml and camilladsp-96000.yml configurations are all for your D90SE.

I have a hard time believing your UltraLitemk5-IN8V2PEQ.yml configuration works correctly as your usb_g_audio.conf is using c_ssize=4 which is for S32LE but your configuration is using S24LE3 as a capture format. You should either switch your capture format to S32LE or change to c_ssize=3 for S24LE3.

I am on a Mac so this might be different for a PC but it is important to note you can only use a capture sample rate for the gadget that matches the sample rate set by your host. For example if I set the gadget sample rate to 44.1 kHz on my Mac I get the following output from arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero:

Rich (BB code):
michael5@raspberrypi5:~$ arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero
Warning: Some sources (like microphones) may produce inaudiable results
         with 8-bit sampling. Use '-f' argument to increase resolution
         e.g. '-f S16_LE'.
Recording WAVE '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:UAC2Gadget":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: 32
FRAME_BITS: 64
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (1111 11610)
PERIOD_SIZE: [49 512]
PERIOD_BYTES: [392 4096]
PERIODS: [4 16]
BUFFER_TIME: (4444 185760)
BUFFER_SIZE: [196 8192]
BUFFER_BYTES: [1568 65536]
TICK_TIME: ALL
--------------------
arecord: set_params:1352: Sample format non available
Available formats:
- S32_LE

And attempting to run your configuration with /home/michael5/camilladsp/camilladsp -g-40 -p 1234 /home/michael5/camilladsp/configs/UltraLitemk5-IN8V2PEQ.yml -v gives the following error.

Rich (BB code):
2023-03-07 01:21:39.190104 DEBUG [src/alsadevice.rs:413] Capture: supported channels, min: 2, max: 2, list: [2]
2023-03-07 01:21:39.190237 DEBUG [src/alsadevice.rs:414] Capture: setting channels to 2
2023-03-07 01:21:39.190342 DEBUG [src/alsadevice.rs:418] Capture: supported samplerates: Discrete([44100])
2023-03-07 01:21:39.190438 DEBUG [src/alsadevice.rs:419] Capture: setting rate to 96000
2023-03-07 01:21:39.190630 ERROR [src/bin.rs:362] Capture error: ALSA function 'snd_pcm_hw_params_set_rate' failed with error 'EINVAL: Invalid argument'
2023-03-07 01:21:39.190718 DEBUG [src/bin.rs:364] Error while starting, release barrier
2023-03-07 01:21:39.190847 DEBUG [src/bin.rs:367] Wait for playback thread to exit..
2023-03-07 01:21:39.190891 DEBUG [src/alsadevice.rs:863] Starting playback loop
2023-03-07 01:21:39.190948 DEBUG [src/processing.rs:21] Processing loop starts now!
2023-03-07 01:21:39.191257 ERROR [src/processing.rs:50] Message channel error: receiving on a closed channel
2023-03-07 01:21:39.200114 DEBUG [src/bin.rs:915] Restarting with new config
2023-03-07 01:21:39.200236 DEBUG [src/bin.rs:857] Wait for config
2023-03-07 01:21:39.200349 DEBUG [src/bin.rs:860] No config and not in wait mode, exiting!

If I change your configuration to use S32LE and set the gadget to 96 kHz on my Mac then arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero gives:

Rich (BB code):
michael5@raspberrypi5:~$ arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero
Warning: Some sources (like microphones) may produce inaudiable results
         with 8-bit sampling. Use '-f' argument to increase resolution
         e.g. '-f S16_LE'.
Recording WAVE '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:UAC2Gadget":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: 32
FRAME_BITS: 64
CHANNELS: 2
RATE: 96000
PERIOD_TIME: (510 5334)
PERIOD_SIZE: [49 512]
PERIOD_BYTES: [392 4096]
PERIODS: [4 16]
BUFFER_TIME: (2041 85334)
BUFFER_SIZE: [196 8192]
BUFFER_BYTES: [1568 65536]
TICK_TIME: ALL
--------------------
arecord: set_params:1352: Sample format non available
Available formats:
- S32_LE

And CamillaDSP will also run correctly.

Code:
2023-03-07 01:25:02.246532 DEBUG [src/alsadevice.rs:413] Capture: supported channels, min: 2, max: 2, list: [2]
2023-03-07 01:25:02.246665 DEBUG [src/alsadevice.rs:414] Capture: setting channels to 2
2023-03-07 01:25:02.246760 DEBUG [src/alsadevice.rs:418] Capture: supported samplerates: Discrete([96000])
2023-03-07 01:25:02.246867 DEBUG [src/alsadevice.rs:419] Capture: setting rate to 96000
2023-03-07 01:25:02.246967 DEBUG [src/alsadevice.rs:423] Capture: supported sample formats: [S32LE]
2023-03-07 01:25:02.247058 DEBUG [src/alsadevice.rs:424] Capture: setting format to S32LE
2023-03-07 01:25:02.247307 DEBUG [src/alsadevice.rs:455] Opening audio device "hw:UAC2Gadget" with parameters: HwParams { channels: Ok(2), rate: "Ok(96000) Hz", format: Ok(S32LE), access: Ok(RWInterleaved), period_size: "Ok(512) frames", buffer_size: "Ok(8192) frames" }, SwParams(avail_min: Ok(2048) frames, start_threshold: Ok(0) frames, stop_threshold: Ok(8192) frames)
2023-03-07 01:25:02.247428 DEBUG [src/alsadevice.rs:460] Audio device "hw:UAC2Gadget" successfully opened
2023-03-07 01:25:02.247582 DEBUG [src/bin.rs:333] Capture thread ready to start
2023-03-07 01:25:02.247675 DEBUG [src/bin.rs:336] Both capture and playback ready, release barrier

I created a few configurations for 44.1 kHz, 48 kHz, 88.2 kHz and 96 kHz that will work with your usb_g_audio.conf (see attached). When I tried running gaudio_ctl from the command line it works as expected. I can switch sample rates on my Mac and CamillaDSP restarts as expected and although I get the playback warning you mentioned it doesn't affect anything as mentioned by @phofman.

Code:
michael5@raspberrypi5:~/camilladsp/configs$ gaudio_ctl -y "/home/michael5/camilladsp/camilladsp --loglevel error --port 1234 /home/michael5/camilladsp/configs/UltraLitemk5-IN8V2PEQ-{R}.yml"
Ctl 'Playback Rate' not found, will not start playback exec

Michael
 

Attachments

  • configs-2.zip
    4.1 KB · Views: 42

sarieri

Active Member
Forum Donor
Joined
Mar 1, 2023
Messages
231
Likes
139
It looks like your camilladsp-41000.yml, camilladsp-48000.yml and camilladsp-96000.yml configurations are all for your D90SE.

I have a hard time believing your UltraLitemk5-IN8V2PEQ.yml configuration works correctly as your usb_g_audio.conf is using c_ssize=4 which is for S32LE but your configuration is using S24LE3 as a capture format. You should either switch your capture format to S32LE or change to c_ssize=3 for S24LE3.

I am on a Mac so this might be different for a PC but it is important to note you can only use a capture sample rate for the gadget that matches the sample rate set by your host. For example if I set the gadget sample rate to 44.1 kHz on my Mac I get the following output from arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero:

Rich (BB code):
michael5@raspberrypi5:~$ arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero
Warning: Some sources (like microphones) may produce inaudiable results
         with 8-bit sampling. Use '-f' argument to increase resolution
         e.g. '-f S16_LE'.
Recording WAVE '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:UAC2Gadget":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: 32
FRAME_BITS: 64
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (1111 11610)
PERIOD_SIZE: [49 512]
PERIOD_BYTES: [392 4096]
PERIODS: [4 16]
BUFFER_TIME: (4444 185760)
BUFFER_SIZE: [196 8192]
BUFFER_BYTES: [1568 65536]
TICK_TIME: ALL
--------------------
arecord: set_params:1352: Sample format non available
Available formats:
- S32_LE

And attempting to run your configuration with /home/michael5/camilladsp/camilladsp -g-40 -p 1234 /home/michael5/camilladsp/configs/UltraLitemk5-IN8V2PEQ.yml -v gives the following error.

Rich (BB code):
2023-03-07 01:21:39.190104 DEBUG [src/alsadevice.rs:413] Capture: supported channels, min: 2, max: 2, list: [2]
2023-03-07 01:21:39.190237 DEBUG [src/alsadevice.rs:414] Capture: setting channels to 2
2023-03-07 01:21:39.190342 DEBUG [src/alsadevice.rs:418] Capture: supported samplerates: Discrete([44100])
2023-03-07 01:21:39.190438 DEBUG [src/alsadevice.rs:419] Capture: setting rate to 96000
2023-03-07 01:21:39.190630 ERROR [src/bin.rs:362] Capture error: ALSA function 'snd_pcm_hw_params_set_rate' failed with error 'EINVAL: Invalid argument'
2023-03-07 01:21:39.190718 DEBUG [src/bin.rs:364] Error while starting, release barrier
2023-03-07 01:21:39.190847 DEBUG [src/bin.rs:367] Wait for playback thread to exit..
2023-03-07 01:21:39.190891 DEBUG [src/alsadevice.rs:863] Starting playback loop
2023-03-07 01:21:39.190948 DEBUG [src/processing.rs:21] Processing loop starts now!
2023-03-07 01:21:39.191257 ERROR [src/processing.rs:50] Message channel error: receiving on a closed channel
2023-03-07 01:21:39.200114 DEBUG [src/bin.rs:915] Restarting with new config
2023-03-07 01:21:39.200236 DEBUG [src/bin.rs:857] Wait for config
2023-03-07 01:21:39.200349 DEBUG [src/bin.rs:860] No config and not in wait mode, exiting!

If I change your configuration to use S32LE and set the gadget to 96 kHz on my Mac then arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero gives:

Rich (BB code):
michael5@raspberrypi5:~$ arecord -D hw:UAC2Gadget --dump-hw-params /dev/zero
Warning: Some sources (like microphones) may produce inaudiable results
         with 8-bit sampling. Use '-f' argument to increase resolution
         e.g. '-f S16_LE'.
Recording WAVE '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:UAC2Gadget":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: 32
FRAME_BITS: 64
CHANNELS: 2
RATE: 96000
PERIOD_TIME: (510 5334)
PERIOD_SIZE: [49 512]
PERIOD_BYTES: [392 4096]
PERIODS: [4 16]
BUFFER_TIME: (2041 85334)
BUFFER_SIZE: [196 8192]
BUFFER_BYTES: [1568 65536]
TICK_TIME: ALL
--------------------
arecord: set_params:1352: Sample format non available
Available formats:
- S32_LE

And CamillaDSP will also run correctly.

Code:
2023-03-07 01:25:02.246532 DEBUG [src/alsadevice.rs:413] Capture: supported channels, min: 2, max: 2, list: [2]
2023-03-07 01:25:02.246665 DEBUG [src/alsadevice.rs:414] Capture: setting channels to 2
2023-03-07 01:25:02.246760 DEBUG [src/alsadevice.rs:418] Capture: supported samplerates: Discrete([96000])
2023-03-07 01:25:02.246867 DEBUG [src/alsadevice.rs:419] Capture: setting rate to 96000
2023-03-07 01:25:02.246967 DEBUG [src/alsadevice.rs:423] Capture: supported sample formats: [S32LE]
2023-03-07 01:25:02.247058 DEBUG [src/alsadevice.rs:424] Capture: setting format to S32LE
2023-03-07 01:25:02.247307 DEBUG [src/alsadevice.rs:455] Opening audio device "hw:UAC2Gadget" with parameters: HwParams { channels: Ok(2), rate: "Ok(96000) Hz", format: Ok(S32LE), access: Ok(RWInterleaved), period_size: "Ok(512) frames", buffer_size: "Ok(8192) frames" }, SwParams(avail_min: Ok(2048) frames, start_threshold: Ok(0) frames, stop_threshold: Ok(8192) frames)
2023-03-07 01:25:02.247428 DEBUG [src/alsadevice.rs:460] Audio device "hw:UAC2Gadget" successfully opened
2023-03-07 01:25:02.247582 DEBUG [src/bin.rs:333] Capture thread ready to start
2023-03-07 01:25:02.247675 DEBUG [src/bin.rs:336] Both capture and playback ready, release barrier

I created a few configurations for 44.1 kHz, 48 kHz, 88.2 kHz and 96 kHz that will work with your usb_g_audio.conf (see attached). When I tried running gaudio_ctl from the command line it works as expected. I can switch sample rates on my Mac and CamillaDSP restarts as expected and although I get the playback warning you mentioned it doesn't affect anything as mentioned by @phofman.

Code:
michael5@raspberrypi5:~/camilladsp/configs$ gaudio_ctl -y "/home/michael5/camilladsp/camilladsp --loglevel error --port 1234 /home/michael5/camilladsp/configs/UltraLitemk5-IN8V2PEQ-{R}.yml"
Ctl 'Playback Rate' not found, will not start playback exec

Michael
Thank you so much I got it resolved with D90SE. It actually just because in the ExecStart line I put "camilladsp-96000.yml". Should have put camilladsp-{R}.yml...
I had no idea how many i/o that ultralite mk5 config should have but I got it worked before with 2 input and 18 output at 96khz, not sure why 44.1 and 48khz should have different numbers of output.
Anyway...Thank you so much, you guys are awesome.
 

sarieri

Active Member
Forum Donor
Joined
Mar 1, 2023
Messages
231
Likes
139
Does anyone know if orange pi5 supports USB gadget input?
 

IAtaman

Major Contributor
Joined
Mar 29, 2021
Messages
2,198
Likes
3,661
Is there another, maybe less capable but easier to use interface to control CamillaDSP as an EQ, or is everyone using the camillagui?
 

IAtaman

Major Contributor
Joined
Mar 29, 2021
Messages
2,198
Likes
3,661
Does anyone know if orange pi5 supports USB gadget input?
I am not sure but I suspect not. Earlier models that do support OTG mention it in their specs page. Neither 5 nor 5B makes any reference to OTG. I have a 3LTS, it does not support OTG either.
 

IAtaman

Major Contributor
Joined
Mar 29, 2021
Messages
2,198
Likes
3,661
Got the delivery of a pair of tiny Rock Pi S SBCs this morning. I have ordered them from AliExpress here for Set 5 option that comes with 512MB RAM, WiFi and Bluetooth.

Original image comes striped down so you need to install tools like wget, curl, alsa etc which is simple enough, and once you are done with it, it works like a charm! I am currently listening to music EQed to my headphones by this little tiny machine on Mac as I am writing this.

It has the following advantages currently over Raspberry Pi 4 in my opinion:
- It is available. You can order it now. It gets delivered in a sensible time ( got mine in 10 days delivered from China).
- It is cheap and it is not too over priced like RPI4 (supposed to be $20, available for $29 at the time of the post)
- It is tiny. Roughly 50mm x 45mm tiny.
- I can be powered by the same cable that carries the audio data and requires no additional hardware. Mac > Rock PI S > DAC each connected to each other with a single USB cable.

It works for PC too. I am trying to put together a simple EQ interface for CamillaDSP and once that is done, this little device and the wonderful CamillaDSP will replace all other EQ solutions for me I think.
 

Blew

Active Member
Joined
Jul 24, 2020
Messages
178
Likes
61
Location
Sydney, Australia
- I can be powered by the same cable that carries the audio data and requires no additional hardware. Mac > Rock PI S > DAC each connected to each other with a single USB cable.
Wow, interesting! How much power does it draw on its own then?
Many DACs that can be powered via the USB data cable need to use the full 500mA that the USB standard specifies as a minimum.
What does System Information say about USB power draw when you're powering both the Rock Pi and DAC on your Mac this way?
Are there any warnings in syslog on the Rock Pi regarding power?
 

IAtaman

Major Contributor
Joined
Mar 29, 2021
Messages
2,198
Likes
3,661
Wow, interesting! How much power does it draw on its own then?
Many DACs that can be powered via the USB data cable need to use the full 500mA that the USB standard specifies as a minimum.
What does System Information say about USB power draw when you're powering both the Rock Pi and DAC on your Mac this way?
Are there any warnings in syslog on the Rock Pi regarding power?
My apologies, I think my wording has been ambigious and somewhat misleading. The DAC is not powered via USB, only Rock Pi S is. DAC has its own power supply and so does the HPA. Mac (or the PC) power the SBC only.
 

stemag

Member
Joined
Nov 1, 2022
Messages
32
Likes
23
I have a question concerning the splitter. As I understand it, the cable that connects to the data source should only have the data lines and ground, and the one that connects to the power supply should only have the +5V line and ground. It seems that the splitters I found (see the one below) have a power-only connector (and that's fine), but the other has the data lines and also the power supply. Is this splitter OK?

 

stemag

Member
Joined
Nov 1, 2022
Messages
32
Likes
23
I have a question concerning the splitter. As I understand it, the cable that connects to the data source should only have the data lines and ground, and the one that connects to the power supply should only have the +5V line and ground. It seems that the splitters I found (see the one below) have a power-only connector (and that's fine), but the other has the data lines and also the power supply. Is this splitter OK?

I ended up buying the splitter described here:
 

stemag

Member
Joined
Nov 1, 2022
Messages
32
Likes
23
I set up a DSP box based on Raspberry Pi 4 and CamillaDSP. This box is configured in gadget mode and It's USB-C port is connected to one USB port of my streamer. My digital chain is as follows: Picoreplayer streamer --> CamillaDSP box --> USB DAC.
To handle the sample rate change, I looked with interest at the tool gaudio_ctl from @phofman and the python scripts described by @DeLub and @audiofun in posts #54 and #55 respectively.
@DeLub's script works well, survives a reboot of the DSP box, but forces a configuration to be defined for each sample rate to be managed.
@audiofun's script also works fine, only requiring a single configuration file. Unfortunately, it does not survive the restart of the DSP box if the signal being captured has a different sample rate from the one indicated in that configuration file.
I changed a single instruction in @audiofun's script and now it survives the reboot of the DSP box. Camilladsp must be started in wait mode (--wait option). The script file is named set_samplerate.py.
Thanks a lot to @phofman, @DeLub, @audiofun and to all the contributors of this great thread.

Python:
#!/usr/bin/python3

# This script must be launched at each sample rate change
# (a gaudio_ctl daemon will do the trick).
# To this end, it updates the samplerate parameter of the current configuration
# according to the sample rate of the signal being captured. Then it
# sends the updated parameter to camilladsp via a websocket.
# If camilladsp has not a current valid configuration, a standard
# configuration is loaded from file.
# Note 1: camilladsp must be launched in wait mode.
# Note 2: the parameter samplerate in the standard configuration is not relevant,
#             as it will be changed right after the file is loaded anyway.
#
# This script derives from the work of @audiofun on ASR forum.

import sys
import camilladsp

c = camilladsp.CamillaConnection("127.0.0.1", 1234)

msg = ""

try:
    c.connect()
    rate = int(sys.argv[1])

    config = c.get_config()

    if config is None:
        config = c.read_config_file("/home/pi/_camilladsp/configs/CDSP_Config.yml")

    config['devices']['samplerate'] = rate
    c.set_config(config)
    msg = "Sample Rate successfully set to {}".format(rate)

except ConnectionRefusedError as e:
    msg = "Can't connect to CamillaDSP, is it running? Error:" + str(e)
    retry = True

except camilladsp.CamillaError as e:
    msg = "CamillaDSP replied with error:" + str(e)
    retry = True

except IOError as e:
    msg = "Websocket is not connected:" + str(e)
    retry = True

finally:
    print(msg)
 
Last edited:

stemag

Member
Joined
Nov 1, 2022
Messages
32
Likes
23
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).
 
Last edited:
Top Bottom