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