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

Pi4 + CamillaDSP + Audio Interface (Motu M4) = Phenomal DSP streamer

Honken

Senior Member
Joined
Mar 10, 2020
Messages
342
Likes
606
Location
Scania
Thanks! Right, I guess that works. I've got something similiar going at the moment - a shellscript that redecorates the config and restarts CamillaDSP based on the status of other programs. Except for a short delay at the start it works fine for me.
 

bmc0

Member
Joined
Dec 23, 2020
Messages
11
Likes
42
I wasn't satisfied with the sound my old DSP solution produced when applying the resulting convolution filters. It ringed like I was hitting my speakers with a tuning fork, and after testing various settings to no avail I realized that it was probably the dsp engine itself that produced the ringing. This ringing wasn't there with my old IIR filters.

Hi, would you mind providing some more information about your configuration (either here or in a GitHub issue). What you're describing should not happen. Either there's a bug or something was misconfigured.
 

Honken

Senior Member
Joined
Mar 10, 2020
Messages
342
Likes
606
Location
Scania
Hi, would you mind providing some more information about your configuration (either here or in a GitHub issue). What you're describing should not happen. Either there's a bug or something was misconfigured.
Hey, first of all - big thanks for the software. I've used your program for over a year and a half now and I really enjoyed it in IIR duties, especially the scripts to import the output from REW.

I was using the below config to do a crossover with filters created in rePhase (LR4), but I've also used much steeper IIR filters with your built in filters. The filters are saved in 64bit float, 44.1KHz format. I used a plug device + the LADSPA plugin in ALSA apply the filters.
Code:
input_channels=8
output_channels=4
LC_NUMERIC=C
effects_chain=remix 0 1 0 1 :0 fir /etc/ladspa_dsp/speaker_left.wav :1 fir /etc/ladspa_dsp/speaker_right.wav :2 delay 12m fir /etc/ladspa_dsp/sub_left.wav :3 delay 12m fir /etc/ladspa_dsp/sub_right.wav :

Hit me up in PM if you want me to help debug this, I'd be more than happy to and I feel it is the least I could do in return. But I feel like this thread isn't the best place to do so.
 

Honken

Senior Member
Joined
Mar 10, 2020
Messages
342
Likes
606
Location
Scania
I recently started toying with using rePhase for taming the phase of my filters but I wasn't satisfied with the sound my old DSP solution produced when applying the resulting convolution filters. It ringed like I was hitting my speakers with a tuning fork, and after testing various settings to no avail I realized that it was probably the dsp engine itself that produced the ringing. This ringing wasn't there with my old IIR filters.
This was due to an error on my part, DSP sounds identical to Camilla (which is a relief as it made no sense that they would sound different). I tried out too many new things at once and drew the wrong conclusions.
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
255
Likes
258
Hello @mdsimon2 did you have to do anything special to get S/PDIF in to capture correctly? I have added it to boot /boot/config.txt and I see it when I do arecord -L but when I try to capture something, I just get silence (I have input to it from my tv playing something which I verified with another DAC).
Did you have to mess with dsptoolkit and profiles? I have no idea what it does, but I did run the ASRC script mentioned here https://www.hifiberry.com/docs/software/using-the-dac-dsp-to-record-audio-from-s-pdif/ and nothing.

Code:
pi@mypi:~ $ arecord -L|grep -P hifi
default:CARD=sndrpihifiberry
    snd_rpi_hifiberrydacplusdsp_sou, Hifiberry DAC+DSP SoundCard HiFi dacplusdsp-codec-0
sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberrydacplusdsp_sou, Hifiberry DAC+DSP SoundCard HiFi dacplusdsp-codec-0
dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberrydacplusdsp_sou, Hifiberry DAC+DSP SoundCard HiFi dacplusdsp-codec-0
dsnoop:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberrydacplusdsp_sou, Hifiberry DAC+DSP SoundCard HiFi dacplusdsp-codec-0
hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberrydacplusdsp_sou, Hifiberry DAC+DSP SoundCard HiFi dacplusdsp-codec-0
plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberrydacplusdsp_sou, Hifiberry DAC+DSP SoundCard HiFi dacplusdsp-codec-0
pi@mypi:~ $ arecord -v -D hw:CARD=sndrpihifiberry,DEV=0 --dump-hw-params
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:CARD=sndrpihifiberry,DEV=0":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S24_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [32 64]
CHANNELS: 2
RATE: [8000 384000]
PERIOD_TIME: (83 8192000]
PERIOD_SIZE: [32 65536]
PERIOD_BYTES: [256 524288]
PERIODS: [2 4096]
BUFFER_TIME: (166 16384000]
BUFFER_SIZE: [64 131072]
BUFFER_BYTES: [256 524288]
TICK_TIME: ALL
--------------------
arecord: set_params:1339: Sample format non available
Available formats:
- S16_LE
- S24_LE
- S32_LE
pi@mypi:~ $ arecord -D hw:CARD=sndrpihifiberry,DEV=0 -d 10 -f S24_LE -r 44100 -c 2 sample.wav
Recording WAVE 'sample.wav' : Signed 24 bit Little Endian, Rate 44100 Hz, Stereo
pi@mypi:~ $ file sample.wav
sample.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 24 bit, stereo 44100 Hz
pi@mypi:~ $ ls -l sample.wav
-rw-r--r-- 1 pi pi 3528044 Sep  9 20:05 sample.wav
pi@mypi:~ $

Thanks
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,536
Likes
3,413
Location
Detroit, MI
I didn't need to do anything special but you might try replacing S24_LE with S32_LE. I think I needed to do that to get it to work but don't exactly remember. I'll dig out the RPi3 and check my configuration if that doesn't work.

Michael
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
255
Likes
258
I didn't need to do anything special but you might try replacing S24_LE with S32_LE. I think I needed to do that to get it to work but don't exactly remember. I'll dig out the RPi3 and check my configuration if that doesn't work.

Michael

It doesn't appear to make a difference, still silence. I do wonder if that dump-hw-params showing RATE: [8000 384000] means anything though. I am trying to capture 44100 out of the TV. Does it mean that it can't capture at that rate for some reason? Or is it capable of capturing at rates in that range?
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
255
Likes
258
I was able to capture 44.1 kHz, it is showing the range not specific rates. Just checking that you did install dsptoolkit and activate the server (and enable SPI) per the instructions in the link below?

https://github.com/hifiberry/hifiberry-dsp

Michael

I did install it, but I am not sure if it installed and running properly. It did spit out some errors during installation, but I don't know what's considered "benign." For what's it worth I do see something running on port 8086 which it specifies as its DEFAULT_PORT, and dsptoolkit check-eeprom does produce something.

pi@mypi:~ $ netstat -an|grep 8086
tcp 0 0 0.0.0.0:8086 0.0.0.0:* LISTEN
pi@mypi:~ $ dsptoolkit check-eeprom
EEPROM content matches running profile, checksum A864F3AC2C7B30085E10DBECB145EE2D
pi@mypi:~ $ cat /boot/config.txt
disable_splash=1
disable_overscan=1
hdmi_drive=2
hdmi_blanking=1
hdmi_force_edid_audio=1
hdmi_force_hotplug=1
hdmi_group=0
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=on
#dtoverlay=disable-wifi
#dtoverlay=disable-bt
dtoverlay=hifiberry-dacplusdsp
dtparam=spi=on
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,536
Likes
3,413
Location
Detroit, MI
Would be interesting to see what errors you got when installing dsptoolkit (I don't remember any). What RPi and OS are you using?

I fired up the RPi3 and looked at my CamillaDSP configuration, I was able to use both S24LE and S32LE at 44100 Hz and 96000 Hz sample rates without issue.

I also tried arecord which worked at both 44100 Hz and 96000 Hz but I needed to use S32_LE, S24_LE did not work.

One more dumb question, you are using the left TOSLINK port?

I have a free microSD card so I can do a fresh install tomorrow and document all the steps needed.

Michael
 

Ata

Senior Member
Forum Donor
Joined
May 6, 2021
Messages
388
Likes
334
Location
Adelaide, Australia
Sorry for the newbie question, but what can CamillaDSP reliably support on RPi4 in terms of total FIR taps for all channel audio at 192/24 sample rate? Is it using any acceleration, ARM NEON, GPU, external DSP add-on? Thanks!
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,536
Likes
3,413
Location
Detroit, MI
All answered in the link below...

https://github.com/HEnquist/camilladsp

Specifically under System Requirements:

  • A Raspberry Pi 4 doing FIR filtering of 8 channels, with 262k taps per channel, at 192 kHz. CPU usage about 55%.

It does use ARM NEON. I've personally done 8 channels of 16K taps per channel at 96 kHz / 24 bit without issue.

Michael
 
  • Like
Reactions: Ata

dc655321

Major Contributor
Joined
Mar 4, 2018
Messages
1,597
Likes
2,236
Sorry for the newbie question, but what can CamillaDSP reliably support on RPi4 in terms of total FIR taps for all channel audio at 192/24 sample rate? Is it using any acceleration, ARM NEON, GPU, external DSP add-on? Thanks!

In addition to Michael's good response, the following post may also be of interest in gauging DSP engine performance. It looks at latency, rather than cpu usage.

https://www.audiosciencereview.com/...-enough-for-fir-crossover-eq.9700/post-260970
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,536
Likes
3,413
Location
Detroit, MI
Would be interesting to see what errors you got when installing dsptoolkit (I don't remember any). What RPi and OS are you using?

I fired up the RPi3 and looked at my CamillaDSP configuration, I was able to use both S24LE and S32LE at 44100 Hz and 96000 Hz sample rates without issue.

I also tried arecord which worked at both 44100 Hz and 96000 Hz but I needed to use S32_LE, S24_LE did not work.

One more dumb question, you are using the left TOSLINK port?

I have a free microSD card so I can do a fresh install tomorrow and document all the steps needed.

Michael

Started over with a fresh Raspberry Pi OS install on a RPi3. Everything worked as expected and I was able to record without installing anything additional. I did need to restart after setting up dsptoolkit and I did install Audacity so I had a way to view the recording without having any audio output setup. See below for all my input / outputs (after updating / upgrading the RPi).

Code:
michael3@raspberrypi3:~ $ sudo pip3 install --upgrade hifiberrydsp
[sudo] password for michael3:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting hifiberrydsp
  Downloading https://files.pythonhosted.org/packages/c0/99/ba0701ce76d28b7a57e700fe05dcdf12b600e0c9d4f586a3d4b1f4071d95/hifiberrydsp-0.20-py3-none-any.whl (55kB)
    100% |████████████████████████████████| 61kB 1.3MB/s
Requirement already satisfied, skipping upgrade: RPi.GPIO in /usr/lib/python3/dist-packages (from hifiberrydsp) (0.7.0)
Requirement already satisfied, skipping upgrade: lxml in /usr/lib/python3/dist-packages (from hifiberrydsp) (4.3.2)
Requirement already satisfied, skipping upgrade: spidev in /usr/lib/python3/dist-packages (from hifiberrydsp) (3.5)
Collecting xmltodict (from hifiberrydsp)
  Downloading https://files.pythonhosted.org/packages/28/fd/30d5c1d3ac29ce229f6bdc40bbc20b28f716e8b363140c26eff19122d8a5/xmltodict-0.12.0-py2.py3-none-any.whl
Collecting pyalsaaudio (from hifiberrydsp)
  Downloading https://www.piwheels.org/simple/pyalsaaudio/pyalsaaudio-0.9.0-cp37-cp37m-linux_armv7l.whl (65kB)
    100% |████████████████████████████████| 71kB 282kB/s
Collecting zeroconf (from hifiberrydsp)
  Downloading https://files.pythonhosted.org/packages/73/34/474853be969f18ac30a8b212f8665cb0460946788cd61647747a634eaf36/zeroconf-0.36.2-py3-none-any.whl (93kB)
    100% |████████████████████████████████| 102kB 2.1MB/s
Collecting ifaddr>=0.1.7 (from zeroconf->hifiberrydsp)
  Downloading https://files.pythonhosted.org/packages/92/0f/a577a724c03982b800232713874e805c8fcc14f4a2c3060902ed20b50da8/ifaddr-0.1.7-py2.py3-none-any.whl
Installing collected packages: xmltodict, pyalsaaudio, ifaddr, zeroconf, hifiberrydsp
Successfully installed hifiberrydsp-0.20 ifaddr-0.1.7 pyalsaaudio-0.9.0 xmltodict-0.12.0 zeroconf-0.36.2
michael3@raspberrypi3:~ $ bash <(curl https://raw.githubusercontent.com/hifiberry/hifiberry-dsp/master/install-dsptoolkit)

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1026  100  1026    0     0   4684      0 --:--:-- --:--:-- --:--:--  4684
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
python-dev is already the newest version (2.7.16-1).
python-dev set to manually installed.
python3-lxml is already the newest version (4.3.2-1+deb10u3).
python3-lxml set to manually installed.
zlib1g-dev is already the newest version (1:1.2.11.dfsg-1).
zlib1g-dev set to manually installed.
python3-pip is already the newest version (18.1-5+rpt1).
The following package was automatically installed and is no longer required:
  python-colorzero
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  icu-devtools libicu-dev python-backports.functools-lru-cache python-bs4 python-html5lib python-soupsieve python-webencodings
Suggested packages:
  icu-doc python-genshi python-lxml-dbg python-lxml-doc
The following NEW packages will be installed:
  icu-devtools libicu-dev libxml2-dev libxslt1-dev python-backports.functools-lru-cache python-bs4 python-html5lib python-lxml
  python-soupsieve python-webencodings
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.4 MB of archives.
After this operation, 50.6 MB of additional disk space will be used.
Get:1 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf icu-devtools armhf 63.1-6+deb10u1 [163 kB]
Get:2 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libicu-dev armhf 63.1-6+deb10u1 [8,841 kB]
Get:3 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libxml2-dev armhf 2.9.4+dfsg1-7+deb10u2 [641 kB]
Get:4 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libxslt1-dev armhf 1.1.32-2.2~deb10u1 [491 kB]
Get:5 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf python-backports.functools-lru-cache all 1.5-3 [6,704 B]
Get:6 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf python-soupsieve all 1.8+dfsg-1 [27.6 kB]
Get:7 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf python-bs4 all 4.7.1-1 [94.2 kB]
Get:8 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf python-webencodings all 0.5.1-1 [10.7 kB]
Get:9 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf python-html5lib all 1.0.1-1 [89.8 kB]
Get:10 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf python-lxml armhf 4.3.2-1+deb10u3 [1,021 kB]
Fetched 11.4 MB in 4s (3,111 kB/s) 
Selecting previously unselected package icu-devtools.
(Reading database ... 98830 files and directories currently installed.)
Preparing to unpack .../0-icu-devtools_63.1-6+deb10u1_armhf.deb ...
Unpacking icu-devtools (63.1-6+deb10u1) ...
Selecting previously unselected package libicu-dev:armhf.
Preparing to unpack .../1-libicu-dev_63.1-6+deb10u1_armhf.deb ...
Unpacking libicu-dev:armhf (63.1-6+deb10u1) ...
Selecting previously unselected package libxml2-dev:armhf.
Preparing to unpack .../2-libxml2-dev_2.9.4+dfsg1-7+deb10u2_armhf.deb ...
Unpacking libxml2-dev:armhf (2.9.4+dfsg1-7+deb10u2) ...
Selecting previously unselected package libxslt1-dev:armhf.
Preparing to unpack .../3-libxslt1-dev_1.1.32-2.2~deb10u1_armhf.deb ...
Unpacking libxslt1-dev:armhf (1.1.32-2.2~deb10u1) ...
Selecting previously unselected package python-backports.functools-lru-cache.
Preparing to unpack .../4-python-backports.functools-lru-cache_1.5-3_all.deb ...
Unpacking python-backports.functools-lru-cache (1.5-3) ...
Selecting previously unselected package python-soupsieve.
Preparing to unpack .../5-python-soupsieve_1.8+dfsg-1_all.deb ...
Unpacking python-soupsieve (1.8+dfsg-1) ...
Selecting previously unselected package python-bs4.
Preparing to unpack .../6-python-bs4_4.7.1-1_all.deb ...
Unpacking python-bs4 (4.7.1-1) ...
Selecting previously unselected package python-webencodings.
Preparing to unpack .../7-python-webencodings_0.5.1-1_all.deb ...
Unpacking python-webencodings (0.5.1-1) ...
Selecting previously unselected package python-html5lib.
Preparing to unpack .../8-python-html5lib_1.0.1-1_all.deb ...
Unpacking python-html5lib (1.0.1-1) ...
Selecting previously unselected package python-lxml:armhf.
Preparing to unpack .../9-python-lxml_4.3.2-1+deb10u3_armhf.deb ...
Unpacking python-lxml:armhf (4.3.2-1+deb10u3) ...
Setting up icu-devtools (63.1-6+deb10u1) ...
Setting up python-backports.functools-lru-cache (1.5-3) ...
Setting up python-webencodings (0.5.1-1) ...
Setting up libicu-dev:armhf (63.1-6+deb10u1) ...
Setting up python-lxml:armhf (4.3.2-1+deb10u3) ...
Setting up python-html5lib (1.0.1-1) ...
Setting up python-soupsieve (1.8+dfsg-1) ...
Setting up libxml2-dev:armhf (2.9.4+dfsg1-7+deb10u2) ...
Setting up libxslt1-dev:armhf (1.1.32-2.2~deb10u1) ...
Setting up python-bs4 (4.7.1-1) ...
Processing triggers for man-db (2.8.5-2) ...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: hifiberrydsp in /usr/local/lib/python3.7/dist-packages (0.20)
Requirement already satisfied, skipping upgrade: pyalsaaudio in /usr/local/lib/python3.7/dist-packages (from hifiberrydsp) (0.9.0)
Requirement already satisfied, skipping upgrade: RPi.GPIO in /usr/lib/python3/dist-packages (from hifiberrydsp) (0.7.0)
Requirement already satisfied, skipping upgrade: zeroconf in /usr/local/lib/python3.7/dist-packages (from hifiberrydsp) (0.36.2)
Requirement already satisfied, skipping upgrade: spidev in /usr/lib/python3/dist-packages (from hifiberrydsp) (3.5)
Requirement already satisfied, skipping upgrade: lxml in /usr/lib/python3/dist-packages (from hifiberrydsp) (4.3.2)
Requirement already satisfied, skipping upgrade: xmltodict in /usr/local/lib/python3.7/dist-packages (from hifiberrydsp) (0.12.0)
Requirement already satisfied, skipping upgrade: ifaddr>=0.1.7 in /usr/local/lib/python3.7/dist-packages (from zeroconf->hifiberrydsp) (0.1.7)
Failed to stop sigmatcp.service: Unit sigmatcp.service not loaded.
Failed to disable unit: Unit file sigmatcp.service does not exist.
Created symlink /etc/systemd/system/multi-user.target.wants/sigmatcp.service → /lib/systemd/system/sigmatcp.service.
mv: failed to preserve ownership for '/boot/config.txt': Operation not permitted
michael3@raspberrypi3:~ $ dsptoolkit write-reg 0xF106 0x0003
michael3@raspberrypi3:~ $ dsptoolkit write-reg 0xF146 0x0004
michael3@raspberrypi3:~ $ dsptoolkit write-reg 0xF195 0x0000
michael3@raspberrypi3:~ $ dsptoolkit write-reg 0xF194 0x0033
michael3@raspberrypi3:~ $ dsptoolkit write-reg 0xF21C 0x6C40
michael3@raspberrypi3:~ $ arecord -D hw:CARD=sndrpihifiberry,DEV=0 -d 10 -f S32_LE -r 44100 -c 2 sample.wav
Recording WAVE 'sample.wav' : Signed 32 bit Little Endian, Rate 44100 Hz, Stereo
michael3@raspberrypi3:~ $ sudo apt install audacity
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-colorzero
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  audacity-data libflac++6v5 libportaudio2 libportsmf0 libsuil-0-0 libvamp-hostsdk3v5 libwxbase3.0-0v5 libwxgtk3.0-0v5
Suggested packages:
  ladspa-plugin
The following NEW packages will be installed:
  audacity audacity-data libflac++6v5 libportaudio2 libportsmf0 libsuil-0-0 libvamp-hostsdk3v5 libwxbase3.0-0v5 libwxgtk3.0-0v5
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,230 kB of archives.
After this operation, 36.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf audacity-data all 2.2.2-1 [1,693 kB]
Get:2 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libflac++6v5 armhf 1.3.2-3 [34.7 kB]
Get:3 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libportaudio2 armhf 19.6.0-1+deb10u1 [56.7 kB]
Get:4 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libportsmf0 armhf 0.1~svn20101010-5 [47.3 kB]
Get:5 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libsuil-0-0 armhf 0.10.0~dfsg0-1 [19.5 kB]
Get:6 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libvamp-hostsdk3v5 armhf 2.7.1~repack0-1 [75.1 kB]
Get:7 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libwxbase3.0-0v5 armhf 3.0.4+dfsg-8 [891 kB]
Get:8 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf libwxgtk3.0-0v5 armhf 3.0.4+dfsg-8 [3,556 kB]
Get:9 http://mirror.pit.teraswitch.com/raspbian/raspbian buster/main armhf audacity armhf 2.2.2-1+b1 [2,857 kB]
Fetched 9,230 kB in 4s (2,144 kB/s)
Selecting previously unselected package audacity-data.
(Reading database ... 99492 files and directories currently installed.)
Preparing to unpack .../0-audacity-data_2.2.2-1_all.deb ...
Unpacking audacity-data (2.2.2-1) ...
Selecting previously unselected package libflac++6v5:armhf.
Preparing to unpack .../1-libflac++6v5_1.3.2-3_armhf.deb ...
Unpacking libflac++6v5:armhf (1.3.2-3) ...
Selecting previously unselected package libportaudio2:armhf.
Preparing to unpack .../2-libportaudio2_19.6.0-1+deb10u1_armhf.deb ...
Unpacking libportaudio2:armhf (19.6.0-1+deb10u1) ...
Selecting previously unselected package libportsmf0:armhf.
Preparing to unpack .../3-libportsmf0_0.1~svn20101010-5_armhf.deb ...
Unpacking libportsmf0:armhf (0.1~svn20101010-5) ...
Selecting previously unselected package libsuil-0-0:armhf.
Preparing to unpack .../4-libsuil-0-0_0.10.0~dfsg0-1_armhf.deb ...
Unpacking libsuil-0-0:armhf (0.10.0~dfsg0-1) ...
Selecting previously unselected package libvamp-hostsdk3v5:armhf.
Preparing to unpack .../5-libvamp-hostsdk3v5_2.7.1~repack0-1_armhf.deb ...
Unpacking libvamp-hostsdk3v5:armhf (2.7.1~repack0-1) ...
Selecting previously unselected package libwxbase3.0-0v5:armhf.
Preparing to unpack .../6-libwxbase3.0-0v5_3.0.4+dfsg-8_armhf.deb ...
Unpacking libwxbase3.0-0v5:armhf (3.0.4+dfsg-8) ...
Selecting previously unselected package libwxgtk3.0-0v5:armhf.
Preparing to unpack .../7-libwxgtk3.0-0v5_3.0.4+dfsg-8_armhf.deb ...
Unpacking libwxgtk3.0-0v5:armhf (3.0.4+dfsg-8) ...
Selecting previously unselected package audacity.
Preparing to unpack .../8-audacity_2.2.2-1+b1_armhf.deb ...
Unpacking audacity (2.2.2-1+b1) ...
Setting up libportaudio2:armhf (19.6.0-1+deb10u1) ...
Setting up libvamp-hostsdk3v5:armhf (2.7.1~repack0-1) ...
Setting up audacity-data (2.2.2-1) ...
Setting up libportsmf0:armhf (0.1~svn20101010-5) ...
Setting up libsuil-0-0:armhf (0.10.0~dfsg0-1) ...
Setting up libwxbase3.0-0v5:armhf (3.0.4+dfsg-8) ...
Setting up libflac++6v5:armhf (1.3.2-3) ...
Setting up libwxgtk3.0-0v5:armhf (3.0.4+dfsg-8) ...
Setting up audacity (2.2.2-1+b1) ...
Processing triggers for shared-mime-info (1.10-1) ...
Processing triggers for desktop-file-utils (0.23-4) ...
Processing triggers for mime-support (3.62) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.31.4-3) ...
Processing triggers for libc-bin (2.28-10+rpt2+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
michael3@raspberrypi3:~ $ arecord -D hw:CARD=sndrpihifiberry,DEV=0 -d 10 -f S32_LE -r 44100 -c 2 sample.wav
Recording WAVE 'sample.wav' : Signed 32 bit Little Endian, Rate 44100 Hz, Stereo
michael3@raspberrypi3:~ $ sudo reboot
Connection to raspberrypi3 closed by remote host.
Connection to raspberrypi3 closed.
michaeldsimon@Michaels-MacBook-Pro ~ % ssh michael3@raspberrypi3
michael3@raspberrypi3's password:
Linux raspberrypi3 5.10.60-v7+ #1449 SMP Wed Aug 25 15:00:01 BST 2021 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Sep 10 05:18:50 2021 from 192.168.86.27
michael3@raspberrypi3:~ $ wget https://raw.githubusercontent.com/hifiberry/hifiberry-os/master/buildroot/package/dsptoolkit/spdif2pi
--2021-09-10 05:31:22--  https://raw.githubusercontent.com/hifiberry/hifiberry-os/master/buildroot/package/dsptoolkit/spdif2pi
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 844 [text/plain]
Saving to: ‘spdif2pi’

spdif2pi                                     100%[===========================================================================================>]     844  --.-KB/s    in 0s     

2021-09-10 05:31:22 (4.48 MB/s) - ‘spdif2pi’ saved [844/844]

michael3@raspberrypi3:~ $ mv spdif2pi spdif2pi.sh
michael3@raspberrypi3:~ $ chmod +x spdif2pi.sh
michael3@raspberrypi3:~ $ ./spdif2pi.sh
michael3@raspberrypi3:~ $ arecord -D hw:CARD=sndrpihifiberry,DEV=0 -d 10 -f S32_LE -r 44100 -c 2 sample.wav
Recording WAVE 'sample.wav' : Signed 32 bit Little Endian, Rate 44100 Hz, Stereo

Michael
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
255
Likes
258
michael3@raspberrypi3:~ $ mv spdif2pi spdif2pi.sh
michael3@raspberrypi3:~ $ chmod +x spdif2pi.sh
michael3@raspberrypi3:~ $ ./spdif2pi.sh
michael3@raspberrypi3:~ $ arecord -D hw:CARD=sndrpihifiberry,DEV=0 -d 10 -f S32_LE -r 44100 -c 2 sample.wav
Recording WAVE 'sample.wav' : Signed 32 bit Little Endian, Rate 44100 Hz, Stereo[/CODE]

Michael

SUCCESS! I had run those dsptoolkit commands before, but executing spdif2pi just now got it to work. No idea why, even ran a diff between the script I ran before and this one, and it's the same. Thank you for your taking the time and re-running it though as now it's pretty clear what the minimum steps are needed!

Dori
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
255
Likes
258
I now have sound in from S/PDIF and out through S/PDIF with CamillaDSP, however the quality seems pretty bad. It's sounding echo-y, with added noise, maybe a phase issue, unsure. I don't have filters yet. I tried playing with the resample options, but I haven't found anything to fix it. Then I had the bright idea of routing the CamillaDSP output through USB instead (using Topping EX5 as DAC), and that sounded better, but I left S/PDIF out cable connected, and to my surprise, even though I didn't have CamillaDSP routing to it, it was still playing when I switched the EX5 input.

It seems that the DAC+DSP is always routing to S/PDIF out if you send it S/PDIF in, and probably having CamillaDSP on top of it, was messing it up. Now I'm wondering how do you only have CamillaDSP handle the output so that it goes through its processing. Probably more a question for Hifiberry and I'll check on their forums, but if anyone knows what's going on, please chime in. I'm guessing one of the dsptoolkit commands turned this on, however would it be possible to turn off the straight routing and only do it through CamillaDSP or is the S/PDIF out on DAC+DSP just passthrough (then again CamillaDSP didn't complain and it did seem to affect the output when I used it)?

Also not entirely sure I've accurately listed the DAC+DSP in CamillaDSP for both capture and playback as I've used the same name...

Thank you

Code:
---
devices:
  samplerate: 96000
  chunksize: 2048
  enable_rate_adjust: true
  enable_resampling: true
  resampler_type: BalancedAsync
  capture:
    type: Alsa
    channels: 2
    device: "hw:sndrpihifiberry"
    format: S32LE
  playback:
    type: Alsa
    channels: 2
#    device: "hw:sndrpihifiberry"
    device: "hw:EX5"
    format: S32LE
mixers:
  stereo:
    channels:
      in: 2
      out: 2
    mapping:
    - dest: 0
      sources:
      - channel: 0
        gain: 0
        inverted: false
    - dest: 1
      sources:
      - channel: 1
        gain: 0
        inverted: false
pipeline:
- type: Mixer
  name: stereo
...
 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,536
Likes
3,413
Location
Detroit, MI
I haven't tried the TOSLINK output on the DAC+DSP but I did have somewhat similar issues when using the TOSLINK input on my MOTU Ultralite Mk5. Originally I routed the TOSLINK input signal using MOTU Cuemix to all the output channels but when I used CamillaDSP for processing it was basically combining the CamillaDSP processed signal and the TOSLINK input. I solved this by removing the TOSLINK routing in Cuemix and let CamillaDSP handle the routing alone.

I agree that there must be a solution using dsptoolkit. It might be helpful to use Sigma Studio to modify the dsp profile as it seems like that should give you more visualization of routing and such.

Michael
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,536
Likes
3,413
Location
Detroit, MI
I tried to replicate your issue with the DAC+ DSP but wasn't able to. I get nothing out of the SPDIF output unless I specify the DAC+ DSP as my playback device in CamillaDSP. Maybe just run "dsptoolkit reset" and then run the spdif2pi script? I do have the script running at startup by adding "@reboot ./spdif2pi.sh" to crontab but I also tried resetting and running the script and it worked fine.

Michael
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
255
Likes
258
I tried to replicate your issue with the DAC+ DSP but wasn't able to. I get nothing out of the SPDIF output unless I specify the DAC+ DSP as my playback device in CamillaDSP. Maybe just run "dsptoolkit reset" and then run the spdif2pi script? I do have the script running at startup by adding "@reboot ./spdif2pi.sh" to crontab but I also tried resetting and running the script and it worked fine.

Michael

I don't think you need to have spdif2pi.sh run on startup, but you probably do need to run a dsptoolkit save after you run spdif2pi.sh. Also on your steps I see you manually running "dsptoolkit write-reg" commands which I think are doing the same thing as the spdif2pi script so probably redundant.

I think my problem may be that during my troubleshooting steps I ran the dsptoolkit install-profile dacdsp-default.xml and I have no idea what that did or how to undo it :)
 

dorirod

Active Member
Joined
Oct 9, 2019
Messages
255
Likes
258
Another couple items in the ongoing saga :)

I did after all have to do something about running those dsptoolkit commands as for some reason they do get lost under some conditions, but I decided to add it to run through /lib/systemd/system/sigmatcp.service as:
ExecStartPost=/usr/local/bin/spdif2pi.sh

Despite that, I also had to add a sleep 5 inside spdif2pi.sh. There is some weird timing thing, that I got tired of trying to fix so I put in that ugly hack of a delay.

I don't know if it's needed, but despite configuring camilladsp to run after sigmatcp service, I could never get it to work right. Could be varying reasons, but in my case I also added a udev rule to kick off a camilladsp service whenever my Topping EX5 is connected. I actually used restart so if I turn the EX5 off or if it goes into sleep mode when the pi is running, it will still work. You'd have to modify the attributes for other devices.

pi@mypi:~ $ cat /etc/udev/rules.d/90-camilladsp.rules
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="152a", ATTRS{idProduct}=="8750", ATTRS{product}=="EX5", SYMLINK+="dacex5", TAG+="systemd", RUN+="/bin/systemctl --no-block restart camilladsp"

In case anyone wants to know, when the EX5 is active is comes up as:
pi@mypi:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 152a:8750 Thesycon Systemsoftware & Consulting GmbH
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

And when it's in sleep mode it shows up as:
pi@mypi:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 152a:8750 Thesycon Systemsoftware & Consulting GmbH
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
Top Bottom