minidsp-rs icon indicating copy to clipboard operation
minidsp-rs copied to clipboard

Not showing in the app after bootup until service is restarted

Open gwurb opened this issue 2 years ago • 8 comments

MiniDSP device not showing in the app after bootup. Have to restart the service or add a sleep timer.

Setup: minidsp-rs installed on volumio 3. Volumio 3 is running on raspberry pi zero 2 w using a usb dongle. /etc/minidsp/config.toml has bind_address = "0.0.0.0:5380" bind_address = "0.0.0.0:5333" advertise = { ip = "192.168.1.20", name="Volumio" }

where 192.168.1.20 is the DHCP reservation for the raspberry pi 2 w.

After bootup: -bash-5.0# systemctl status minidsp minidsp.service - MiniDSP Server Loaded: loaded (/lib/systemd/system/minidsp.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2022-12-12 08:49:49 UTC; 1min 43s ago

But, minidsp device does not show up in the app.

If the service is restarted with: systemctl restart minidsp

minidsp device does show up in the app.

Changing /lib/systemd/system/minidsp.service to the following does not help [Unit] After=network-online.target Wants=network-online.target

Had to add [Service] ExecStartPre=/bin/sleep 30

Is there any other way to solve the device not showing in the app without a sleep pre service start?

gwurb avatar Dec 12 '22 09:12 gwurb

I wonder if it wouldn't be binding to the wrong address when sending out broadcast packets, can you try setting the config to this?

advertise = { ip = "192.168.1.20", name="Volumio", bind_address="192.168.1.20" }

You can also set the RUST_LOG environment var to trace to get (a ton more) debug information.

mrene avatar Dec 17 '22 21:12 mrene

I tried:

advertise = { ip = "192.168.1.20", name="Volumio", bind_address="192.168.1.20" } but that made things worse. No device in the app, even after service restart. Had to delete the bind_address potion of that line (roll back) to get the service to work.

I now changed to a USB Eth adapter so the network interface should be coming up faster than WiFi.

Still, issue persists.

I don't know RUST but am willing to try the RUST_LOG suggestion. Where do I set it? In a file or command line? And, where will it log to?

gwurb avatar Dec 18 '22 10:12 gwurb

What most likely is happening is that minidspd is trying to bind on startup, and not retrying it later if it fails (although I'm confused as to why this happens even if you have Wants=network-online.target in your systemd unit file). The bind address I told you to set probably need a port number as well, or at least :0 to indicate it should use any available port (bind_address="192.168.1.20:0").

minidspd could retry to setup its advertisement broadcast if it detects a failure, that seem like it would solve the problem

mrene avatar Dec 20 '22 23:12 mrene

Same here. Adding a port ":0" doesn't help. minidsp always needs a scheduled restart, to be announced.

kettenbach-it avatar Mar 12 '23 15:03 kettenbach-it

Fixed it. You need to set:

[Unit]
After=default.target

instead of network-online.target

kettenbach-it avatar Mar 12 '23 16:03 kettenbach-it

Also experiencing this issue with default service config

scottshanafelt avatar Mar 25 '23 18:03 scottshanafelt

I'm also having the same issue as the OP. This change did not change anything for me unfortunately: [Unit] After=default.target

SlaveUnit22 avatar Apr 19 '23 20:04 SlaveUnit22

I have the same issue too. The work-around in the initial post allows the service to survive a reboot.

ExecStartPre=/bin/sleep 30

MervisDiamonds avatar May 13 '23 23:05 MervisDiamonds