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!
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!
THe aplay -l output lists device 0, IMO it's corect.Try setting the device to 1.
Maybe incorrect sample format or sample rate?
Sample rate of the source signal accords with sample rate specified in the config file.Maybe incorrect sample format or sample rate?
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.
Yes ofcause...THe aplay -l output lists device 0, IMO it's corect.
Maybe incorrect sample format or sample rate?
Sry. for the confusion.
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.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.
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
Try setting card to 1. (I thought that's what Jesper was saying. 🙂 )THe aplay -l output lists device 0, IMO it's corect.
Maybe incorrect sample format or sample rate?
Code:
pcm.sound_out {
type hw
card 1
device 0
}
ctl.sound_out {
type hw
card 1
}
I got "StopReason.PLAYBACKERROR" from the interface get_stop_reason() of pycamilldsp. In Jesper's Superplayer, camilladsp starts with logging disabled.But the problem in your log is playback error, not capture error.
Is there a way to enable logging in camilladsp?
In the .yml configuration file I tried all the playback formats supported by camilladsp. No success.IIUC on your RPi3 you are using the internal I2S audio device which may have a different sample format than your USB DAC.
Thank you for your interest.
I tried this. No success.Try setting card to 1. (I thought that's what Jesper was saying. 🙂 )
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.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?
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 discussionIn the .yml configuration file I tried all the playback formats supported by camilladsp. No success.
This is the output of aplay --dump-hw-paramsAs 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
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.
Very good. Now you might want to run CDSP standalone, just with the yml config. Specifically look at option -v (verbosity level) - for details see https://github.com/HEnquist/camilladsp/blob/master/README.md#logging
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:Specifically look at option -v (verbosity level) -
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.
Apparently camilladsp is being told to use a device string which does not exist - ALSA function 'snd_pcm_open' failed with error 'ENODEV: No such device'
The playback device name should be in the debug log, above the snippet you posted.
The playback device name should be in the debug log, above the snippet you posted.
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)
Please find attached the log file and the config file. Thank you.
I apologise for hogging this thread.
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
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.
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.
The device name is either hw:CARD_NAME, or device name, in your case sound_out.tc@pCP-AK4493:~$ aplay --dump-hw-params -D hw:sound_out -t raw /dev/zero
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.
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?
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?
- Home
- Source & Line
- PC Based
- SuperPlayer - The DSP_Engine (CamillaDSP) samplerate switching & ESP32 remote control