Jump to content

DLNA exceptions with Linux Hotspot


fogpuppy

Recommended Posts

fogpuppy

I have a standalone Unbuntu 18 box that is used as a Media Server.  It has Wifi setup that DOES NOT automatically connect to a SSID on system boot.  The problem I'm having is that during Emby startup the DLNA server fails with an exception.  Ok I can understand the failure because here is no network except localhost but ... when I connect the Wifi to a SSID rest of Emby comes back to life except the DLNA server.  To get the DLNA sever to come back I need to restart Emby.  M expectation was that when the WiFi came up so would the DLNA server along with the HTTP and regular Emby clients.  Any thoughts?

the most significant part of the log seems to be (full log attached):

2020-06-11 14:52:15.932 Info Dlna: Registering publisher for urn:schemas-upnp-org:device:MediaServer:1
2020-06-11 14:52:15.938 Error App: Error in BeginListeningForBroadcasts
    *** Error Report ***
    Version: 4.4.3.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 5.3.0.59
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
    System.Environment.Version: 3.1.2
    Processor count: 8
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Net.Sockets.SocketException: System.Net.Sockets.SocketException (0xFFFFFFFF): Bad value for ai_flags
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
       at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
       at Rssdp.SsdpCommunicationsServer.CreateUdpMulticastSocket(IPAddress localAddress, Int32 multicastTimeToLive, Int32 localPort)
       at Rssdp.SsdpCommunicationsServer.ListenForBroadcastsAsync()
       at Rssdp.SsdpCommunicationsServer.BeginListeningForBroadcasts(CancellationToken cancellationToken)
    Source: System.Net.Sockets
    TargetSite: Void UpdateStatusAfterSocketErrorAndThrowException(System.Net.Sockets.SocketError, System.String)
    
2020-06-11 14:52:15.939 Error Dlna: Error registering endpoint
    *** Error Report ***
    Version: 4.4.3.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 5.3.0.59
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
    System.Environment.Version: 3.1.2
    Processor count: 8
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Net.Sockets.SocketException: System.Net.Sockets.SocketException (0xFFFFFFFF): Bad value for ai_flags
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
       at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
       at Rssdp.SsdpCommunicationsServer.CreateSsdpUdpSocket(IPAddress localIpAddress, Int32 localPort)
       at Rssdp.SsdpCommunicationsServer.BeginListeningForBroadcasts(CancellationToken cancellationToken)
       at Rssdp.SsdpDevicePublisher.AddDevices(List`1 devices, CancellationToken cancellationToken)
       at Emby.Dlna.Main.DlnaEntryPoint.RegisterServerEndpoints(CancellationToken cancellationToken)
       at Emby.Dlna.Main.DlnaEntryPoint.StartPublishingDevices(DlnaOptions options, CancellationToken cancellationToken)
    Source: System.Net.Sockets
    TargetSite: Void UpdateStatusAfterSocketErrorAndThrowException(System.Net.Sockets.SocketError, System.String)
    
2020-06-11 14:52:15.942 Error App: Error in BeginListeningForBroadcasts
    *** Error Report ***
    Version: 4.4.3.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 5.3.0.59
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
    System.Environment.Version: 3.1.2
    Processor count: 8
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Net.Sockets.SocketException: System.Net.Sockets.SocketException (0xFFFFFFFF): Bad value for ai_flags
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
       at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
       at Rssdp.SsdpCommunicationsServer.CreateUdpMulticastSocket(IPAddress localAddress, Int32 multicastTimeToLive, Int32 localPort)
       at Rssdp.SsdpCommunicationsServer.ListenForBroadcastsAsync()
       at Rssdp.SsdpCommunicationsServer.BeginListeningForBroadcasts(CancellationToken cancellationToken)
    Source: System.Net.Sockets
    TargetSite: Void UpdateStatusAfterSocketErrorAndThrowException(System.Net.Sockets.SocketError, System.String)
    
2020-06-11 14:52:15.942 Info App: Entry point completed: Emby.Dlna.Main.DlnaEntryPoint. Duration: 0.0790642 seconds

 

 

embyserver-63727484236.txt

Link to comment
Share on other sites

fogpuppy

Actually this problem may be more pervasive than I thought.  Even *if* I set the WiFi to automatically connect to one of the SSID I still have the same issue.  Help .....

Link to comment
Share on other sites

fogpuppy

Well ... I figured out what the issue is when you are connected to a SSID (sort of).  It's a race condition.  If I put a 60 second delay in the Emby startup script then this problem goes away if there is a network connection.  That's an ugly hack because it also delays server restart which is annoying.  The right solution is for the systemd service to actually have the right dependencies so it waits on what ever is really needed before starting Emby.  But I'm not sure what I'm waiting on per se since I don't know exactly what the exception is complaining about.  Any help from anyone (especially the Emby folks).  I'm willing to try stuff out but I could use a hint on where to looks.

 

Is anyone out there .....

Edited by fogpyppy
Link to comment
Share on other sites

fogpuppy

Ok here is a slightly better fix for anyone else running into this issue and you DO have you SSID set to autoconnect (no joy if not).  if you modify the emby-server.service file is /usr/lib/systemd/system to add a line to the [Service] section of

ExecStartPre=/bin/sleep 5

This causes the system service to wait 5 seconds before actually starting Emby but it does not affect restarts from inside the Emby UI..  5 seconds was long enough for me but .... your mileage may vary. It would really be better for the Emby folks to fix this correctly as the original problem still exists if you don't have a connected SSID the DLNA fails and does NOT recover when you do connect the SSID unless you manually restart Emby.  The Server really needs to monitor for whatever it's looking for any when the conditions are met it needs to start up DLNA properly.

 

BTW the complete service file attached (as a text file)

 

emby-server.service.txt

Link to comment
Share on other sites

fogpuppy

Hopefully someone can help with this.  I have a stand alone Linux Server that is using the WiFi adapter as a Hotspot (access point).  So it sets up its own network that people connect to to watch media.  Overall this works reasonably well.  I can connect to Emby ok via a Browsers/HTML and the Emby app on my iPad/iPhone.  Even the Fuse app which seems to understand Emby pretty well works.  However DLNA refuses to function.  Now maybe it's configuration issues on Linux but everything else seems to work ok and Linux Hotspots have been around for a while so ... I'm suspecting Emby.   Thoughts anyone?  Any hints of any direction to go would be appreciated.

The key sections of the log seem to be:

2020-06-15 13:13:06.182 Info App: Starting entry point Emby.Dlna.Main.DlnaEntryPoint
2020-06-15 13:13:06.257 Info Dlna: Registering publisher for urn:schemas-upnp-org:device:MediaServer:1
2020-06-15 13:13:06.268 Error App: Error in BeginListeningForBroadcasts
    *** Error Report ***
    Version: 4.4.3.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 5.3.0.59
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
    System.Environment.Version: 3.1.2
    Processor count: 8
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Net.Sockets.SocketException: System.Net.Sockets.SocketException (0xFFFFFFFF): Bad value for ai_flags
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
       at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
       at Rssdp.SsdpCommunicationsServer.CreateUdpMulticastSocket(IPAddress localAddress, Int32 multicastTimeToLive, Int32 localPort)
       at Rssdp.SsdpCommunicationsServer.ListenForBroadcastsAsync()
       at Rssdp.SsdpCommunicationsServer.BeginListeningForBroadcasts(CancellationToken cancellationToken)
    Source: System.Net.Sockets
    TargetSite: Void UpdateStatusAfterSocketErrorAndThrowException(System.Net.Sockets.SocketError, System.String)
    
2020-06-15 13:13:06.269 Error Dlna: Error registering endpoint
    *** Error Report ***
    Version: 4.4.3.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 5.3.0.59
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
    System.Environment.Version: 3.1.2
    Processor count: 8
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Net.Sockets.SocketException: System.Net.Sockets.SocketException (0xFFFFFFFF): Bad value for ai_flags
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
       at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
       at Rssdp.SsdpCommunicationsServer.CreateSsdpUdpSocket(IPAddress localIpAddress, Int32 localPort)
       at Rssdp.SsdpCommunicationsServer.BeginListeningForBroadcasts(CancellationToken cancellationToken)
       at Rssdp.SsdpDevicePublisher.AddDevices(List`1 devices, CancellationToken cancellationToken)
       at Emby.Dlna.Main.DlnaEntryPoint.RegisterServerEndpoints(CancellationToken cancellationToken)
       at Emby.Dlna.Main.DlnaEntryPoint.StartPublishingDevices(DlnaOptions options, CancellationToken cancellationToken)
    Source: System.Net.Sockets
    TargetSite: Void UpdateStatusAfterSocketErrorAndThrowException(System.Net.Sockets.SocketError, System.String)
    
2020-06-15 13:13:06.271 Error App: Error in BeginListeningForBroadcasts
    *** Error Report ***
    Version: 4.4.3.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 5.3.0.59
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
    System.Environment.Version: 3.1.2
    Processor count: 8
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Net.Sockets.SocketException: System.Net.Sockets.SocketException (0xFFFFFFFF): Bad value for ai_flags
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
       at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
       at Rssdp.SsdpCommunicationsServer.CreateUdpMulticastSocket(IPAddress localAddress, Int32 multicastTimeToLive, Int32 localPort)
       at Rssdp.SsdpCommunicationsServer.ListenForBroadcastsAsync()
       at Rssdp.SsdpCommunicationsServer.BeginListeningForBroadcasts(CancellationToken cancellationToken)
    Source: System.Net.Sockets
    TargetSite: Void UpdateStatusAfterSocketErrorAndThrowException(System.Net.Sockets.SocketError, System.String)
    
2020-06-15 13:13:06.271 Info App: Entry point completed: Emby.Dlna.Main.DlnaEntryPoint. Duration: 0.0892608 seconds
2020-0

 

embyserver.txt

Link to comment
Share on other sites

fogpuppy

One other unusual thing I've noticed (and might be a hint for the Emby folks) ... the dashboard does not show a local url for the server (thought it does work).  the Hotspot is on 10.42.0.1 and a dns lookup of <<severname>>.local does resolve to that address ...

Link to comment
Share on other sites

I've merged your two topics as it appears to be the same discussion. What we'll do for the next release is catch this error and try to proceed anyway and see if it performs better. Thanks.

Link to comment
Share on other sites

fogpuppy

Luke the only thing potentially different here from the other issue is the last issue that when using a hotspot no local address is listed. 

Link to comment
Share on other sites

fogpuppy

Luke, the two issues turn out to be slightly different.

 

In the first isssue if you have no SSID then the DLNA service doe not start.  Once I connect and restart Emby the DLNA will start.  This is OK and a little bit beter error hnadling so taht I don't ahve to manually restart will fix the issue.

 

The second issue of the Linus server acting as it's own hotspot has NO solution.  The hotspot s UP.  The server has an IP address (10.24.0.1) and I can connect ot it thrue the web.  But .. the DLNA server will NOT start no matter how many time I restart the server.  It keeps failing.  Not sure what tis issue is but I'm trying to create a totally stand alone server.

 

BTW is DLNA a "second class" feature.  If I should discourage it's use I may be able to push back on my clients if given a good argument but it was one of the requirements I was given in setting up this server.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...