Closed coolbombom closed 6 years ago
Maybe it had trouble binding to some IP ? In particular if you have multiple interfaces (eth0 and some wlan), you need to decides that with explicitly setting the IP address to be bound to with the --ip-address
option. Maybe this is the issue ?
I have this exact issue when trying to launch gmediarender
from init.d
script. My rig's running Gentoo and OpenRC. I also tried the -I
option which won't work either. But if I manually start the service later when the system has fully booted, it would work. I don't quite understand the dependencies. Maybe you have some advise, @hzeller? Thanks in advance.
At my case setting --ip-address
doesn't help. Error message just contains that IP instead of null
. I have set that IP is assigned if I manually (successfully) start the systemd service after boot.
ERROR [2018-01-29 13:59:19.911878 | upnp] UpnpInit(ip=192.168.1.103, port=49494) Error: UPNP_E_SOCKET_BIND (-203)
ERROR [2018-01-29 13:59:19.911923 | main] ERROR: Failed to initialize UPnP device
Any further directions to dig in?
Did you arrange the init dependencies in a way to start gmrender-resurrect after the network is up?
Yes. This is the systemd service:
[Unit]
Description=UPnP renderer using gstreamer
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/gmediarender -f "gMedia UpPnP Renderer" -u 49e4f137-a832-481c-9117-bfa96a71aba5
[Install]
WantedBy=default.target
And this is ExecStart
tuning (that is override.conf
):
[Service]
ExecStart=
ExecStart=/usr/bin/gmediarender -f Anli_gRenderer -u b5f87cc9-c9d6-4f6f-ac04-7665d4c189a6 --gstout-audiosink=alsasink --gstout-audiodevice=iec958 --logfile=/home/andrew/.local/log/gmediarender.log --ip-address=192.168.1.103
On manual service start all is OK.
Perhaps try another WantedBy target? I am using systemd on my RPi3 and haven't had issues. Here is my service.
[Unit]
Description=GMediaRender
After=syslog.service network.target
[Service]
ExecStart=/usr/local/bin/gmediarender -f %H
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=GMediaRender
User=pi
Group=audio
[Install]
WantedBy=multi-user.target
I am using a locally compiled version so my path is in /usr/local/bin instead of /usr/bin
If that doesn't work trying delaying the execution of the service with the following
ExecStartPre=/bin/sleep 3
Maybe the network is still coming up when the service starts and that causes an issue.
@mill1000 thanks! - the trick with ExecStartPre
is that tick which did it!
I have same error on os x High Sierra. It works for 2 days, then stop now. Your trick doesn't work. What now?
#157 I thinks MiniDLNA shares libupnp but it use it own upnp. Also SO_REUSEADDR does not work as expected for datagram sockets on Mac OS X. Thanks
P/s however the PORT reported is incorrect. After an hour of LLDB debug, I found the conflict port is 1900 SSDP_PORT.
I could reproduce this with a current debian installation.
It seems like the systemd targets network.target
and network-online.target
are actually not waiting until all networks are configured so the UPnP socket initialization might fail.
Now, gmrender-resurrect does retries (up to a minute) to attempt establishing the socket. It now reliably initializes the service on a systemd configured system.
I'm pretty sure libupnp 1.6 tries to bind every interface even if you set one explicitly. Works with 1.8 correctly as far as I have seen.
I know, old thread. But for anyone stumbling upon this in the future:
I just added the following to my systemd unit and now it seems to work without retries and without any ugly sleep
:
[Unit]
Description=gmrender-resurrect
After=network-online.target sound.target
Requires=network-online.target sound.target
I'm not sure if the sound.target
is really required, but it made sense to me.
Important thing is that we use network-online.target
and not network.target
and that we add it in After
and in Requires
.
Hi
first off, thank for all the hard work.
I'm trying to run this on a hummingbird board, but i keep getting following error ... i can't figure out what is wrong!
EDIT: i'm running it on the latest version of armbian
please help
cheers c_bb