Hey,
Trying to set up a HiFiBerry DSP. Managed to get everything installed and running on the Pi4, and a connection to SigmaStudio to install dacdsp-v11 project/profile.
However trying to create a basic interface using DSPToolkit - it appears I can correctly set the MasterVolume fader:
eg: (0.0dB) dsptoolkit write-mem 0x2F 0x01000000
(Where the exported Sigma Header lists:
#define MOD_MASTERVOL_ALG0_TARGET_ADDR 47 = 0x2F)
But when I read the same register back, I get a different value:
dsptoolkit read-hex 0x2F
00 80 00 00
The data value returned changes when the fader is adjusted via the dsptoolkit, or via the SigmaStudio GUI, but never returns the expected value.
I cannot see any obvious relationship between the 'expected' and 'returned' numbers (they're not obviously byte-swapped, bit-shifted, or bit-reversed).
Have I gotten something obvious wrong, or is this maybe a bug in the SPI readback process within the DSPToolkit??
Expected: 0x00CB5918 Readback: 00 72 96 86
Expected: 0x0000068E Readback: 00 00 01 63
Expected: 0x00028F5C Readback: 00 00 63 97
Many thanks
8 comments
-
HiFiBerry team Ok, I see the problem. We didn't create a Pypi package for quite a long time. Therefore, the latest release is not yet on pypi. You can either download and install directly from Github:
https://github.com/hifiberry/hifiberry-dsp
Or wait a bit until we packages and released it to pypi. -
HiFiBerry team If you already clones it, just change to the directory and run
pip install --upgrade . -
Keith Ovenden Problem resolved.
Just a quick note for anyone who ever has the same problem. I solved the issue by getting a fresh RaspbianOS install on my Pi4 then NOT installing the BEOCreate toolkit, and instead:sudo pip3 install --upgrade hifiberrydsp bash <(curl https://raw.githubusercontent.com/hifiberry/hifiberry-dsp/master/install-dsptoolkit) git clone github.com/hifiberry/hifiberry-dsp cd /hifiberry-dsp sudo pip install --upgrade . bash <(curl https://raw.githubusercontent.com/hifiberry/hifiberry-dsp/master/install-dsptoolkit)
reboot Test TCP-=IP Server is running: sudo systemctl status sigmatcp Should say 'ACTIVE'I'm guessing I probably didn't actually need the original pip3 install, and could have just checked out and installed the GitHub HifiBerry version directly. But that's the process that worked for me.
I now have the ability to connect via SigmaStudio, AND can control parameters via DSPToolkit - with 'set' and 'get' commands working as expected.
Thanks for the assistance. Great product :o) -
HiFiBerry team Interesting. I'm not sure why this happens. I haven't seen this before. Try using decimal numbers instead of hexadecimal. Maybe it's a bug in parsing the hex numbers.
-
Keith Ovenden I believe the write is working correctly - if I set the Fader to -6dB via Sigma, and send a value of 0x00800000 via DSPToolkit - I get the same level of audio at my output (although I haven't hooked up a test sinewave wav and measured the actual gain change on a scope).
So it's 99% likely to be the readback where the fault occurs.
Setting:
dsptoolkit write-mem 47 16777216
returns:
dsptoolkit read-hex 47: 00 80 00 00
dsptoolkit read-int 47: 8388608
dsptoolkit read-dec 47: 0.50000000
I've tried rebooting the Pi, and restarting beocreate-tcp, but always see the same behaviour.
Any pointers would be much appreciated. -
HiFiBerry team Just tested here:
# dsptoolkit write-mem 31 0x01000000
# dsptoolkit read-hex 31
01 00 00 00Seems to work fine. Are you using the latest version?
-
Keith Ovenden Thanks, I've tried a few things but still no joy with this board.
I believe im on latest version of the dsptoolkit:sudo pip3 install --upgrade hifiberrydsp
and I've run:
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 3454 0 --:--:-- --:--:-- --:--:-- 3454
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [380 kB]
Fetched 13.4 MB in 18s (743 kB/s)
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 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 10 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://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf icu-devtools armhf 63.1-6+deb10u1 [163 kB]
Get:2 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf libicu-dev armhf 63.1-6+deb10u1 [8,841 kB]
Get:3 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf libxml2-dev armhf 2.9.4+dfsg1-7+deb10u2 [641 kB]
Get:4 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf libxslt1-dev armhf 1.1.32-2.2~deb10u1 [491 kB]
Get:5 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf python-backports.functools-lru-cache all 1.5-3 [6,704 B]
Get:6 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf python-soupsieve all 1.8+dfsg-1 [27.6 kB]
Get:7 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf python-bs4 all 4.7.1-1 [94.2 kB]
Get:8 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf python-webencodings all 0.5.1-1 [10.7 kB]
Get:9 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf python-html5lib all 1.0.1-1 [89.8 kB]
Get:10 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf python-lxml armhf 4.3.2-1+deb10u3 [1,021 kB]
Fetched 11.4 MB in 11s (1,002 kB/s)
Selecting previously unselected package icu-devtools.
(Reading database ... 101600 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: zeroconf in /usr/local/lib/python3.7/dist-packages (from hifiberrydsp) (0.36.2)
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: pyalsaaudio in /usr/local/lib/python3.7/dist-packages (from hifiberrydsp) (0.9.0)
Requirement already satisfied, skipping upgrade: xmltodict in /usr/local/lib/python3.7/dist-packages (from hifiberrydsp) (0.12.0)
Requirement already satisfied, skipping upgrade: spidev in /usr/lib/python3/dist-packages (from hifiberrydsp) (3.5)
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 \u2192 /lib/systemd/system/sigmatcp.service.
mv: failed to preserve ownership for '/boot/config.txt': Operation not permittedBut as you can see the Config.txt couldn't be updated correctly as write-permissions weren't granted.
Would the version of beocreate-tcp matter? (for a couple of reasons I've got the 'beocreate1' branch installed rather than 'beocreate2' -
Keith Ovenden Thanks. Glad you can understand what might be happening.
Sorry, I'm still relatively new to Linux - so apologies for the dumb question.... I've got a git-clone of the latest hifiberry-dsp repo.
How do I install the DSPtoolkit from there, rather than doing 'sudo pip3 install --upgrade hifiberrydsp' (which is obviously going to Pypi to look for a new version).