SuperPlayer - The DSP_Engine (CamillaDSP) samplerate switching & ESP32 remote control

Hi Jesper,
I tried setting the device to 1 in asound.conf. No success.

Please note the following tests made with python scripts using pycamilladsp:
1) cdsp.get_config() --> config is None ; cdsp.get_previous_config() --> config seems good
2) cdsp.get_config_name() --> pathname is correct
3) config = cdsp.get_previous_config() --> config is good ; cdsp.set_config(config) --> no error ; config = cdsp.get_config() --> config is None!
4) cdsp.set_config_name(correct-pathname) --> no error ; cdsp.reload() --> no error ; config = cdsp.get_config() --> config is None!
5) config = cdsp.read_config_file(correct-pathname) --> no error ; config = cdsp.get_config() --> config is None!
 
Sample rate of the source signal accords with sample rate specified in the config file.
Source is Qobuz plugin. Format is S32LE. The very same source (and same track) and the very same config file work perfectly with SuperPlayer on a RPi4 and an external USB DAC.
But the problem in your log is playback error, not capture error. IIUC on your RPi3 you are using the internal I2S audio device which may have a different sample format than your USB DAC.

When troubleshooting layered projects like this it's always good to test from the inner layer:
1. Make your output soundcard work standalone, with aplay to learn the soundcard parameters for CDSP.
2. Make CDSP run standalone first, without any GUI wrappers.
3. GUI layer
 
But the problem in your log is playback error, not capture error.
I got "StopReason.PLAYBACKERROR" from the interface get_stop_reason() of pycamilldsp. In Jesper's Superplayer, camilladsp starts with logging disabled.
Is there a way to enable logging in camilladsp?

IIUC on your RPi3 you are using the internal I2S audio device which may have a different sample format than your USB DAC.
In the .yml configuration file I tried all the playback formats supported by camilladsp. No success.


Thank you for your interest.
 
I got "StopReason.PLAYBACKERROR" from the interface get_stop_reason() of pycamilldsp. In Jesper's Superplayer, camilladsp starts with logging disabled.
Is there a way to enable logging in camilladsp?
If you got the Stop.Reason.PLAYBACKERROR, then the problem is most likely on the playback side, not the capture one. Especially when playback side is what changed between your RPi3 and RPi4 setups.

In the .yml configuration file I tried all the playback formats supported by camilladsp. No success.
As I said - you need to learn your soundcard params first, e.g. using aplay - e.g. https://unix.stackexchange.com/ques...ion-is-required-to-make-a-rodecaster-pro-work look at aplay --dump-hw-params discussion
 
As I said - you need to learn your soundcard params first, e.g. using aplay - e.g. https://unix.stackexchange.com/ques...ion-is-required-to-make-a-rodecaster-pro-work look at aplay --dump-hw-params discussion
This is the output of aplay --dump-hw-params
Code:
tc@pCP-AK4493:~$ aplay --dump-hw-params -D  hw:sndrpirpidac -t raw /dev/zero
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:sndrpirpidac":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S24_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [32 64]
CHANNELS: 2
RATE: [8000 192000]
PERIOD_TIME: (166 8192000]
PERIOD_SIZE: [32 65536]
PERIOD_BYTES: [256 524288]
PERIODS: [2 4096]
BUFFER_TIME: (333 16384000]
BUFFER_SIZE: [64 131072]
BUFFER_BYTES: [256 524288]
TICK_TIME: ALL
--------------------
aplay: set_params:1343: Sample format non available
Available formats:
- S16_LE
- S24_LE

I see that the DAC hat supports S16LE and S24LE only. However, I tried both those formats in the playback section of the .yml config file, without success.
Unfortunately, I am not familiar with the alsa sound system and I am unable to deduce any other useful information from the output of aplay --dump-hw-params.
 
Specifically look at option -v (verbosity level) -
Ok. I killed the camilladsp process started automatically, and launched camilladsp with the -v option. Below is a trace of the operations immediately after the filter coefficients have been loaded:
Code:
2023-07-14 14:56:37.274978 DEBUG [src/processing.rs:19] build filters, waiting to start processing loop
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
2023-07-14 14:56:37.283379 ERROR [src/bin.rs:344] Playback error: ALSA function 'snd_pcm_open' failed with error 'ENODEV: No such device'
2023-07-14 14:56:37.283591 DEBUG [src/bin.rs:349] Error while starting, release barrier
2023-07-14 14:56:37.284011 DEBUG [src/processing.rs:21] Processing loop starts now!
2023-07-14 14:56:37.284128 DEBUG [src/bin.rs:352] Wait for capture thread to exit..
2023-07-14 14:56:37.284042 DEBUG [src/filedevice.rs:617] starting captureloop
2023-07-14 14:56:37.285318 DEBUG [src/filedevice.rs:260] starting captureloop
2023-07-14 14:56:37.286230 DEBUG [src/filedevice.rs:293] Exit message received, sending EndOfStream
2023-07-14 14:56:37.286729 INFO [src/processing.rs:37] Playback thread has already stopped.
2023-07-14 14:56:37.286930 DEBUG [src/bin.rs:915] Restarting with new config
2023-07-14 14:56:37.287531 DEBUG [src/bin.rs:857] Wait for config

Though aplay -l reports the presence of the soundcard, camilladsp can't see it!

Thank you for your patience.
 
I can't find such string. I suspect that alsa can't find the device "sound_out". This is what I obtain from aplay for sound_out (as I said, I am not familiar with alsa)
Code:
tc@pCP-AK4493:~$ aplay --dump-hw-params -D  hw:sound_out -t raw /dev/zero
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
aplay: main:830: audio open error: No such device

Please find attached the log file and the config file. Thank you.

I apologise for hogging this thread.
 

Attachments

  • camilladsp_log.txt
    7.1 KB · Views: 35
  • cdsp_template_active.yml.txt
    1.4 KB · Views: 40
BREAKING NEWS:
Changing "sound_out" to "hw:sndrpirpidac" in the .yml config file, everything works like a charm, including sample rate changer.
The format is S24LE, as the formerly used S32LE is not supported by the DAC hat.

Now I wonder why sound_out does not work.

Thanks everybody for support and patience.
 
tc@pCP-AK4493:~$ aplay --dump-hw-params -D hw:sound_out -t raw /dev/zero
The device name is either hw:CARD_NAME, or device name, in your case sound_out.

If "sound_out" is unknown to alsa, it's not configured correctly. You should see it in list of aplay -L (capital -L) running under the same user as CDSP (as sometimes devices are configured also in /home/USER/.asoundrc.

But you do not need sound_out as in your post it's configured to be equivalent to hw:sndrpirpidac.
 
  • Like
Reactions: 1 user
Hello,
In cdsp_template.yml I've defined a "blank" configuration (no filters, no mixers, no pipelines).
In CamillaGUI I've also defined a .yml configuration file to equalise my Sennheiser HD414 headphone, with sample rate set to 44100.
Once the file for equalisation has been saved, loaded and applied to the DSP, everything works well with 44100 Hz tracks. When I switch to, say, a 96 KHz or a 192 KHz track, the capture sample rate switches accordingly, but the DSP reloads the config in cdsp_template.yml, so no more equalization.
Is this the expected behaviour? And if it is, is there a way to keep the equalisation config after a sample rate change?