blus-audio / sigmadsp

An application for controlling Analog Devices Sigma DSPs via Network.
GNU General Public License v3.0
18 stars 1 forks source link

backend not running #103

Open garathds opened 1 month ago

garathds commented 1 month ago

when running sigmadsp-backend, i get the following error

person1@raspberrypi:~/sigmadsp $ sigmadsp-backend 
INFO:sigmadsp.backend:Starting the sigmadsp backend, version 3.0.12.
Traceback (most recent call last):
  File "/home/person1/.local/bin/sigmadsp-backend", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 393, in main
    settings = SigmadspSettings(Path(arguments.settings))
                                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 872, in __new__
    self = cls._from_parts(args)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 510, in _from_parts
    drv, root, parts = self._parse_args(args)
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 494, in _parse_args
    a = os.fspath(a)
        ^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

This sigmadsp 3.0.12 was installed using 1. pipx , 2. install.sh.
On a Raspberry Pi 5, running 64-bit Debian 12 (bookworm) Kernel version: 6.6

sigmadsp-background was not registered as a service either.

elagil commented 1 month ago

The error from running it directly results from you not passing a configuration file (mandatory). You can try

sigmadsp-backend -s path/to/config_file

I will investigate, why the service is not created.

garathds commented 1 month ago

Ok. I have tried passing the config file as recommended. however i get the following error.

person1@raspberrypi:~/sigmadsp $ sigmadsp-backend -s /var/lib/sigmadsp/config.yaml      
INFO:sigmadsp.backend:Starting the sigmadsp backend, version 3.0.12.
INFO:sigmadsp.helper.settings:Settings file /var/lib/sigmadsp/config.yaml was loaded.
INFO:sigmadsp.helper.parser:Parameter file /var/lib/sigmadsp/current.params not found.
Traceback (most recent call last):
  File "/home/person1/.local/bin/sigmadsp-backend", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 394, in main
    launch(settings)
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 365, in launch
    add_BackendServicer_to_server(BackendService(settings), grpc_server)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 80, in __init__
    self.dsp = dsp_from_config_fn(self.config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/dsp/factory.py", line 53, in dsp_from_config
    device = int(config["dsp"]["device_address"])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '0x76'

for the ADAU1452,

0x76 is the i2c address (7bit) i am using. I tried 0x3b (8bit) as well. It gives the same error

within the config.yaml

parameters:

    # these options were tried one after another 
     path: "/var/lib/sigmadsp/current.params"
     # path: "/var/lib/sigmadsp/current.params"
     path:  # "/var/lib/sigmadsp/current.params"

the error message was identical to the one posted above

elagil commented 1 month ago

Can you share your config.yaml?

Python may not be able to parse "0x76" to an integer, because it complains about it not being base 10. Please try with the equivalent "118". If that is the case, I will add detection for hex strings.

garathds commented 1 month ago

I have tried "118" as the address,

this is the result

person1@raspberrypi:~ $ sigmadsp-backend -s /var/lib/sigmadsp/config.yaml 
INFO:sigmadsp.backend:Starting the sigmadsp backend, version 3.0.12.
INFO:sigmadsp.helper.settings:Settings file /var/lib/sigmadsp/config.yaml was loaded.
INFO:sigmadsp.helper.settings:No parameter path was defined in the configuration file.
INFO:sigmadsp.protocols.common:Starting I2cProtocol handling thread.
Traceback (most recent call last):
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 101, in pin
    pin = self.pins[n]
          ~~~~~~~~~^^^
KeyError: 17

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/person1/.local/bin/sigmadsp-backend", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 394, in main
    launch(settings)
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 365, in launch
    add_BackendServicer_to_server(BackendService(settings), grpc_server)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 80, in __init__
    self.dsp = dsp_from_config_fn(self.config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/dsp/factory.py", line 84, in dsp_from_config
    output_pin = OutputPin(
                 ^^^^^^^^^^
  File "<string>", line 7, in __init__
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/dsp/common.py", line 77, in __post_init__
    self.control = gpiozero.DigitalOutputDevice(self.number, self.active_high, self.initial_value)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/devices.py", line 108, in __call__
    self = super(GPIOMeta, cls).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/output_devices.py", line 200, in __init__
    super(DigitalOutputDevice, self).__init__(
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/output_devices.py", line 83, in __init__
    super(OutputDevice, self).__init__(pin, pin_factory=pin_factory)
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/mixins.py", line 85, in __init__
    super(SourceMixin, self).__init__(*args, **kwargs)
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/devices.py", line 549, in __init__
    pin = self.pin_factory.pin(pin)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 103, in pin
    pin = self.pin_class(self, n)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/pins/rpigpio.py", line 111, in __init__
    GPIO.setup(self.number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
RuntimeError: Cannot determine SOC peripheral base address
garathds commented 1 month ago

as requested, here is my config.yaml

# This  file contains all settings that can be changed on the sigmadsp-backend.

# The IP address and port, on which the sigmadsp-backend listens for requests from SigmaStudio.
host:
  # The default value "0.0.0.0" allows listening on any address.
  ip: "0.0.0.0"
  port: 8087

# Settings for the sigmadsp-backend.
backend:
  # The port, on which the sigmadsp-backend is reachable.
  port: 50051

parameters:
  # The parameter file path, which contains DSP application parameters,
  # such as cell names, addresses and other information. This parameter file is required
  # for the backend, in order to be able to control DSP functionality at runtime, e.g. volume.
  #path: #"/var/lib/sigmadsp/current.params"

dsp:
  # The type of the DSP to control with the sigmadsp-backend service.
  # Can be "adau14xx" or "adau1x0x".
  type: "adau14xx"
  # The protocol used to communicate.
  # Can be "spi" or "i2c"
  protocol: "i2c"
  bus_number: "1"
  device_address: "118"

  pins:
    # The DSP's hardware reset pin.
    reset:
      number: 17
      active_high: false
      initial_state: true
      mode: "output"

    # The self-boot pin, enabling the DSP to load its application from external flash when set.
    self_boot:
      number: 22
      active_high: true
      initial_state: true
      mode: "output"
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
~                                                                                                                                                                                    
"/var/lib/sigmadsp/config.yaml" 43 lines, 1311 bytes
elagil commented 1 month ago

Apparently, the older GPIO libraries do not work with the RaspberryPi 5. I will update my package and let you know when you can try with a new version.

elagil commented 4 weeks ago

@garathds Please try to pull the latest main and run the ./install.sh command again. You should choose not to overwrite your existing config when asked.

The creation of the service should work now, there was an issue with it.

The updated version will install an additional package python3-dev and use a different library for accessing GPIOs. Please let me know how it goes.

You may have to run pipx upgrade sigmadsp afterwards and restart the service, but I am not quite sure. It does not hurt anyway.

garathds commented 3 weeks ago

Thanks. Ill report back in a day or so

garathds commented 3 weeks ago
person1@raspberrypi:~ $ sigmadsp-backend -s /var/lib/sigmadsp/config.yaml
INFO:sigmadsp.backend:Starting the sigmadsp backend, version 3.0.13.
INFO:sigmadsp.helper.settings:Settings file /var/lib/sigmadsp/config.yaml was loaded.
INFO:sigmadsp.helper.settings:No parameter path was defined in the configuration file.
INFO:sigmadsp.protocols.common:Starting I2cProtocol handling thread.
Traceback (most recent call last):
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 101, in pin
    pin = self.pins[n]
          ~~~~~~~~~^^^
KeyError: 17

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/person1/.local/bin/sigmadsp-backend", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 394, in main
    launch(settings)
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 365, in launch
    add_BackendServicer_to_server(BackendService(settings), grpc_server)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/backend.py", line 80, in __init__
    self.dsp = dsp_from_config_fn(self.config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/dsp/factory.py", line 84, in dsp_from_config
    output_pin = OutputPin(
                 ^^^^^^^^^^
  File "<string>", line 7, in __init__
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/dsp/common.py", line 77, in __post_init__
    self.control = gpiozero.DigitalOutputDevice(self.number, self.active_high, self.initial_value)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/devices.py", line 108, in __call__
    self = super(GPIOMeta, cls).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/output_devices.py", line 200, in __init__
    super(DigitalOutputDevice, self).__init__(
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/output_devices.py", line 83, in __init__
    super(OutputDevice, self).__init__(pin, pin_factory=pin_factory)
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/mixins.py", line 85, in __init__
    super(SourceMixin, self).__init__(*args, **kwargs)
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/devices.py", line 549, in __init__
    pin = self.pin_factory.pin(pin)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 103, in pin
    pin = self.pin_class(self, n)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/gpiozero/pins/rpigpio.py", line 111, in __init__
    GPIO.setup(self.number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
RuntimeError: Cannot determine SOC peripheral base address

If the ports are commented out such as below,

# This  file contains all settings that can be changed on the sigmadsp-backend.

# The IP address and port, on which the sigmadsp-backend listens for requests from SigmaStudio.
host:
  # The default value "0.0.0.0" allows listening on any address.
  ip: "0.0.0.0"
  port: 8087

# Settings for the sigmadsp-backend.
backend:
  # The port, on which the sigmadsp-backend is reachable.
  port: 50051

parameters:
  # The parameter file path, which contains DSP application parameters,
  # such as cell names, addresses and other information. This parameter file is required
  # for the backend, in order to be able to control DSP functionality at runtime, e.g. volume.
  path: #"/var/lib/sigmadsp/current.params"

dsp:
  # The type of the DSP to control with the sigmadsp-backend service.
  # Can be "adau14xx" or "adau1x0x".
  type: "adau14xx"
  # The protocol used to communicate.
  # Can be "spi" or "i2c"
  protocol: "i2c"
  bus_number: "1"
  device_address: "118"

  pins:
    # The DSP's hardware reset pin.
    reset:
#     number: 17
      active_high: false
      initial_state: true
      mode: "output"

    # The self-boot pin, enabling the DSP to load its application from external flash when set.
    self_boot:
#      number: 22
      active_high: true
      initial_state: true
      mode: "output"

The service loads at this point.

However, when a connection is attempted from Sigma Studio, a successful connection message is not shown. If "Link Compile Download" is attempted, the following messages appear

person1@raspberrypi:~ $ sigmadsp-backend -s /var/lib/sigmadsp/config.yaml
INFO:sigmadsp.backend:Starting the sigmadsp backend, version 3.0.13.
INFO:sigmadsp.helper.settings:Settings file /var/lib/sigmadsp/config.yaml was loaded.
INFO:sigmadsp.helper.settings:No parameter path was defined in the configuration file.
INFO:sigmadsp.protocols.common:Starting I2cProtocol handling thread.
INFO:sigmadsp.dsp.factory:No DSP pin definitions were found in the configuration file.
INFO:sigmadsp.backend:Specified DSP type is 'Adau14xx', using the 'I2cProtocol' protocol.
WARNING:sigmadsp.dsp.common:No hard-reset pin is defined, not resetting.
INFO:sigmadsp.dsp.adau14xx:Soft-resetting the DSP.
INFO:sigmadsp.backend:Run startup safety check.
WARNING:sigmadsp.backend:No parameter file was loaded! Configuration remains locked.
INFO:sigmadsp.backend:Startup finished.
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a4e0> with error: [Errno 121] Remote I/O error
INFO:sigmadsp.backend:Sigma TCP server started on [0.0.0.0]:8087.
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
INFO:sigmadsp.backend:Backend service started on [::]:50051
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a600> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a600> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff43d4a570> with error: [Errno 121] Remote I/O error
elagil commented 3 weeks ago

I think you need to run as root, or you will not get hardware access. Or add yourself to some group that is allowed to access GPIO or I2C - but I don't know which one(s).

The service should run as root by default, so maybe just try to start it with sudo service sigmadsp-backend start.

elagil commented 3 weeks ago

I installed it fresh on a RaspberryPi 5 and the service starts fine

● sigmadsp-backend.service - Sigma DSP backend
     Loaded: loaded (/lib/systemd/system/sigmadsp-backend.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-08-25 13:06:43 CEST; 1s ago
   Main PID: 939 (sigmadsp-backen)
      Tasks: 14 (limit: 4450)
        CPU: 230ms
     CGroup: /system.slice/sigmadsp-backend.service
             └─939 /home/elagil/.local/pipx/venvs/sigmadsp/bin/python /home/elagil/.local/bin/sigmadsp-backend -s /var/lib/sigmadsp/config.yaml

Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.dsp.common:Found DSP pin definition 'reset' (17)
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.dsp.common:Found DSP pin definition 'self_boot' (22)
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.backend:Specified DSP type is 'Adau14xx', using the 'SpiProtocol' protocol.
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.dsp.common:Hard-resetting the DSP.
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.dsp.adau14xx:Soft-resetting the DSP.
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.backend:Run startup safety check.
Aug 25 13:06:44 pi bash[939]: WARNING:sigmadsp.backend:No safety hash cell exists in the DSP configuration! Configuration remains locked.
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.backend:Startup finished.
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.backend:Sigma TCP server started on [0.0.0.0]:8087.
Aug 25 13:06:44 pi bash[939]: INFO:sigmadsp.backend:Backend service started on [::]:50051
elagil commented 3 weeks ago

@garathds The install script is broken though, I had to run it twice. The reloading of .bashrc does not seem to work.

garathds commented 2 weeks ago

I tried reinstalling twice

person1@raspberrypi:~ $ rm -rf sigmadsp
person1@raspberrypi:~ $ git clone https://github.com/elagil/sigmadsp.git && cd sigmadsp && ./install.sh
Cloning into 'sigmadsp'...
remote: Enumerating objects: 2022, done.
remote: Counting objects: 100% (349/349), done.
remote: Compressing objects: 100% (268/268), done.
remote: Total 2022 (delta 168), reused 136 (delta 77), pack-reused 1673 (from 1)
Receiving objects: 100% (2022/2022), 498.83 KiB | 438.00 KiB/s, done.
Resolving deltas: 100% (1202/1202), done.
=== Install 'sigmadsp'.
=== Install required packages.
Hit:1 https://deb.nodesource.com/node_20.x nodistro InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:4 http://deb.debian.org/debian bookworm-updates InRelease
Hit:5 http://archive.raspberrypi.com/debian bookworm InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-dev is already the newest version (3.11.2-1+b1).
The following package was automatically installed and is no longer required:
  rpi.gpio-common
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.
=== Installing pipx.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
pipx is already the newest version (1.1.0-1).
The following package was automatically installed and is no longer required:
  rpi.gpio-common
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.
/home/person1/.local/bin is already in PATH.

⚠️  All pipx binary directories have been added to PATH. If you are sure you want to proceed, try
again with the '--force' flag.

Otherwise pipx is ready to go! ✨ 🌟 ✨
'sigmadsp' already seems to be installed. Not modifying existing installation in
'/home/person1/.local/pipx/venvs/sigmadsp'. Pass '--force' to force installation.
sigmadsp is already at latest version 3.0.13 (location: /home/person1/.local/pipx/venvs/sigmadsp)
=== Stopping and disabling existing 'sigmadsp-backend' service.
Removed "/etc/systemd/system/multi-user.target.wants/sigmadsp-backend.service".
=== Existing configuration found for 'sigmadsp' in '/var/lib/sigmadsp/config.yaml'.
Backup and overwrite existing configuration? [y/n]: n
> Keep existing configuration.
=== Setup 'sigmadsp-backend' service.
> Found service executable at '/home/person1/.local/bin/sigmadsp-backend'.
Created symlink /etc/systemd/system/multi-user.target.wants/sigmadsp-backend.service → /lib/systemd/system/sigmadsp-backend.service.
=== Finished installation of 'sigmadsp' and its backend service 'sigmadsp-backend'.

Then Stopped the service and ran the backend manually as root

person1@raspberrypi:~/sigmadsp $ systemctl stop sigmadsp-backend
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
Authentication is required to stop 'sigmadsp-backend.service'.
Authenticating as: ,,, (person1)
Password:
==== AUTHENTICATION COMPLETE ====
person1@raspberrypi:~/sigmadsp $ sudo /home/person1/.local/bin/sigmadsp-backend -s /var/lib/sigmadsp/config.yaml
INFO:sigmadsp.backend:Starting the sigmadsp backend, version 3.0.13.
INFO:sigmadsp.helper.settings:Settings file /var/lib/sigmadsp/config.yaml was loaded.
INFO:sigmadsp.helper.settings:No parameter path was defined in the configuration file.
INFO:sigmadsp.protocols.common:Starting I2cProtocol handling thread.
INFO:sigmadsp.dsp.factory:No DSP pin definitions were found in the configuration file.
INFO:sigmadsp.backend:Specified DSP type is 'Adau14xx', using the 'I2cProtocol' protocol.
WARNING:sigmadsp.dsp.common:No hard-reset pin is defined, not resetting.
INFO:sigmadsp.dsp.adau14xx:Soft-resetting the DSP.
INFO:sigmadsp.backend:Run startup safety check.
WARNING:sigmadsp.backend:No parameter file was loaded! Configuration remains locked.
INFO:sigmadsp.backend:Startup finished.
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff295ca3c0> with error: [Errno 121] Remote I/O error
INFO:sigmadsp.backend:Sigma TCP server started on [0.0.0.0]:8087.
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7fff295ca450> with error: [Errno 121] Remote I/O error
INFO:sigmadsp.backend:Backend service started on [::]:50051

This is the output when a session is initiated through Sigma Studio

person1@raspberrypi:~/sigmadsp $ sudo /home/person1/.local/bin/sigmadsp-backend -s /var/lib/sigmadsp/config.yaml
INFO:sigmadsp.backend:Starting the sigmadsp backend, version 3.0.13.
INFO:sigmadsp.helper.settings:Settings file /var/lib/sigmadsp/config.yaml was loaded.
INFO:sigmadsp.helper.settings:No parameter path was defined in the configuration file.
INFO:sigmadsp.protocols.common:Starting I2cProtocol handling thread.
INFO:sigmadsp.dsp.factory:No DSP pin definitions were found in the configuration file.
INFO:sigmadsp.backend:Specified DSP type is 'Adau14xx', using the 'I2cProtocol' protocol.
WARNING:sigmadsp.dsp.common:No hard-reset pin is defined, not resetting.
INFO:sigmadsp.dsp.adau14xx:Soft-resetting the DSP.
INFO:sigmadsp.backend:Run startup safety check.
WARNING:sigmadsp.backend:No parameter file was loaded! Configuration remains locked.
INFO:sigmadsp.backend:Startup finished.
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7ffedb56a4e0> with error: [Errno 121] Remote I/O error
INFO:sigmadsp.backend:Sigma TCP server started on [0.0.0.0]:8087.
ERROR:sigmadsp.protocols.i2c:I2C failed to write message <ctypes.LP_c_char object at 0x7ffedb56a570> with error: [Errno 121] Remote I/O error
INFO:sigmadsp.backend:Backend service started on [::]:50051
----------------------------------------
Exception occurred during processing of request from ('192.168.1.5', 36910)
Traceback (most recent call last):
  File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/sigmastudio/server.py", line 219, in handle
    packet = self.new_packet()
             ^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/sigmastudio/server.py", line 199, in new_packet
    header = self.server.packet_header_generator.new_header_from_operation_byte(operation_byte)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/person1/.local/pipx/venvs/sigmadsp/lib/python3.11/site-packages/sigmadsp/sigmastudio/header.py", line 314, in new_header_from_operation_byte
    operation_key = OperationKey(bytes_to_int(operation_byte, offset=0, length=1))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/enum.py", line 717, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/enum.py", line 1133, in __new__
    raise ve_exc
ValueError: 27 is not a valid OperationKey
----------------------------------------
elagil commented 6 days ago

These seem to be two separate issues.

I cannot test I2C myself (I don't have any I2C DSP), but this looks like your device does not respond. Please double-check the address. When looking at my oscilloscope, I get I2C clock and data output on the respective pins. I tested with I2C bus 1, which is available on the RPi 5 header here:

image

Regarding the OperationKey: this is an invalid key. I will test with SigmaStudio again. Which version are you using?