Jump to content

Error Dlna: Error in BeginListeningForBroadcasts


joeseph

Recommended Posts

joeseph

The emby server seems to be conflicting with other servers running on my machine.

Specifically, (if port 1900 is the conflicting port) a unifi video service and OpenHAB.

 

Since the logs don't  tell me which port is the problem, is it port 1900 that is the conflicting port?

 

Perhaps I should run emby in a container and configure it to use a virtual ethernet device with a different IP address?

 

 

 

2018-07-29 00:13:47.871 Error Dlna: Error in BeginListeningForBroadcasts
    *** Error Report ***
    Version: 3.5.1.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 4.15.0.29
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Processor count: 4
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.Net.Sockets.SocketException (98): Address already in use
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.Bind(EndPoint localEP)
       at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)
       at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)
       at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()
       at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()
    System.Net.Sockets.SocketException
       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
       at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.Bind(EndPoint localEP)
       at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)
       at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)
       at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()
       at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()

 

Link to comment
Share on other sites

joeseph

Oh, heh... I was the person with the RTSP problem. I was just reporting this in the off chance that it was interfering with some kind of global initialization and was preventing RTSP from working :-)

Link to comment
Share on other sites

Ok great, thanks for the info. This particular error in the log is nothing to worry about. The server will handle it and continue forward. We will look into it though. Thanks.

Link to comment
Share on other sites

nunuxx

Ok great, thanks for the info. This particular error in the log is nothing to worry about. The server will handle it and continue forward. We will look into it though. Thanks.

Hi,

 

I have exactly the same problem

 

 

2018-08-01 14:49:15.607 Error Dlna: Error in BeginListeningForBroadcasts
*** Error Report ***
Version: 3.5.2.0
Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
Operating system: Unix 4.9.0.7
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Processor count: 4
Program data path: /var/lib/emby
Application directory: /opt/emby-server/system
System.Net.Sockets.SocketException (98): Address already in use
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)
   at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)
   at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()
   at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()
System.Net.Sockets.SocketException
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)
   at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)
   at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()

 

   at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()

This is annoying because my log file is HUGE (15gb last time !)

 

Please give a solution, or tell me how to disable logs

Link to comment
Share on other sites

nunuxx

Hi,

 

Any news? Everyday my log is more than 5gb

 

thursday night I had to reboot my server, my ram was FULL (15.9/16gb) / Swap full too / Log file around 5gb

 

last night again Log file around 5gb

 

I have sometime around 30 people simultaneous, and error appear every minuts

 

Some Error into my log file :

 

 

2018-08-03 21:50:47.612 Error HttpServer: Error processing request

    *** Error Report ***
    Version: 3.5.2.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Unix 4.9.0.7
    64-Bit OS: True
    64-Bit Process: True
    User Interactive: True
    Processor count: 4
    Program data path: /var/lib/emby
    Application directory: /opt/emby-server/system
    System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: offset
     at Microsoft.Extensions.Primitives.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
     at Microsoft.Extensions.Primitives.StringSegment.Subsegment(Int32 offset, Int32 length)
     at ServiceStack.Text.Json.JsonTypeSerializer.EatValue(StringSegment value, Int32& i)
     at ServiceStack.Text.Common.DeserializeArrayWithElements`2.ParseGenericArray(StringSegment value, ParseStringSegmentDelegate elementParseFn)
     at ServiceStack.Text.Json.JsonReader`1.Parse(StringSegment value)
     at ServiceStack.Text.Json.JsonReader`1.Parse(String value)
     at ServiceStack.Text.JsonSerializer.DeserializeFromString[T](String value)
     at Emby.Common.Implementations.Serialization.JsonSerializer.DeserializeFromStreamAsync[T](Stream stream)
     at Emby.Server.Implementations.Updates.InstallationManager.GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken)
     at Emby.Server.Implementations.Updates.InstallationManager.GetAvailablePluginUpdates(Version applicationVersion, Boolean withAutoUpdateEnabled, CancellationToken cancellationToken)
     at MediaBrowser.Api.PackageService.Get(GetPackageVersionUpdates request)
     at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
     at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
     at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
    System.ArgumentOutOfRangeException
     at Microsoft.Extensions.Primitives.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
     at Microsoft.Extensions.Primitives.StringSegment.Subsegment(Int32 offset, Int32 length)
     at ServiceStack.Text.Json.JsonTypeSerializer.EatValue(StringSegment value, Int32& i)
     at ServiceStack.Text.Common.DeserializeArrayWithElements`2.ParseGenericArray(StringSegment value, ParseStringSegmentDelegate elementParseFn)
     at ServiceStack.Text.Json.JsonReader`1.Parse(StringSegment value)
     at ServiceStack.Text.Json.JsonReader`1.Parse(String value)
     at ServiceStack.Text.JsonSerializer.DeserializeFromString[T](String value)
     at Emby.Common.Implementations.Serialization.JsonSerializer.DeserializeFromStreamAsync[T](Stream stream)
     at Emby.Server.Implementations.Updates.InstallationManager.GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken)
     at Emby.Server.Implementations.Updates.InstallationManager.GetAvailablePluginUpdates(Version applicationVersion, Boolean withAutoUpdateEnabled, CancellationToken cancellationToken)
     at MediaBrowser.Api.PackageService.Get(GetPackageVersionUpdates request)
     at Emby.Server.Implementations.Services.ServiceExecGeneral.GetTaskResult(Task task)
     at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken)
     at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)

 

that one recurrent

 

   2018-08-03 21:50:54.921 Error Dlna: Error in BeginListeningForBroadcasts

*** Error Report ***
Version: 3.5.2.0
Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
Operating system: Unix 4.9.0.7
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Processor count: 4
Program data path: /var/lib/emby
Application directory: /opt/emby-server/system
System.Net.Sockets.SocketException (98): Address already in use
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)
   at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)
   at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()
   at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()
System.Net.Sockets.SocketException
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)
   at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)
   at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()
   at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()

 

And that one ULTRA MEGA reccurrent !

that one cause BIG LOG, please tell me what is the problem with this ? I have maybe 4.5gb with that log 

 

 

   2018-08-03 23:08:49.993 Error HttpServer: WebSocketException Success

*** Error Report ***
Version: 3.5.2.0
Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
Operating system: Unix 4.9.0.7
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Processor count: 4
Program data path: /var/lib/emby
Application directory: /opt/emby-server/system
System.Net.WebSockets.WebSocketException (0x80004005): net_WebSockets_InvalidState
   at SocketHttpListener.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates)
   at SocketHttpListener.Net.WebSockets.ManagedWebSocket.ReceiveAsync(ArraySegment`1 buffer, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at SocketHttpListener.Net.WebSockets.WebSocket.ReceiveAsync(Memory`1 buffer, CancellationToken cancellationToken)
   at EmbyServer.SocketSharp.SharpWebSocket.StartReceive()
System.Net.WebSockets.WebSocketException
   at SocketHttpListener.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates)
   at SocketHttpListener.Net.WebSockets.ManagedWebSocket.ReceiveAsync(ArraySegment`1 buffer, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at SocketHttpListener.Net.WebSockets.WebSocket.ReceiveAsync(Memory`1 buffer, CancellationToken cancellationToken)
   at EmbyServer.SocketSharp.SharpWebSocket.StartReceive()
Link to comment
Share on other sites

joho500

Hi Luke,

 

I do have a dlna problem. I have similar error messages in my logfile and my Emby server is not showing up in my dlna devices (BubbleUpnp and Marantz receiver). Problem exits a couple of days. Perhaps after the update to 3.5.2.0? Re-updating didn't help.

 

Any suggestions?

 

Kind regards,

Joost

Link to comment
Share on other sites

Hi Luke,

 

I do have a dlna problem. I have similar error messages in my logfile and my Emby server is not showing up in my dlna devices (BubbleUpnp and Marantz receiver). Problem exits a couple of days. Perhaps after the update to 3.5.2.0? Re-updating didn't help.

 

Any suggestions?

 

Kind regards,

Joost

 

Can you please attach the emby server log? Thanks.

Link to comment
Share on other sites

mellon85

I used strace to figure out which bind call was actually causing the issue and I found

socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP) = 176                    
setsockopt(176, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0                          
setsockopt(176, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0                          
setsockopt(176, SOL_IP, IP_MULTICAST_TTL, [4], 4) = 0                          
setsockopt(176, SOL_IP, IP_ADD_MEMBERSHIP, {imr_multiaddr=inet_addr("239.255.255.250"), imr_interface=inet_addr("0.0.0.0")}, 12) = 0
setsockopt(176, SOL_IP, IP_MULTICAST_LOOP, [1], 4) = 0                         
bind(176, {sa_family=AF_INET, sin_port=htons(1900), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)

It looks like port 1900 is already in use. Stopping the process that was using it (minissdpd in my case) removed the issue

Edited by mellon85
  • Like 1
Link to comment
Share on other sites

paddimouche

I did restart the NAS but no success..

 

now I have this error :

 

*** Error Report *** Version: 3.5.1.0 Command line: /volume1/.@plugins/AppCentral/emby-server/system/EmbyServer.dll -programdata /home/emby -ffmpeg /usr/local/AppCentral/emby-server/bin/ffmpeg -ffprobe /usr/local/AppCentral/emby-server/bin/ffprobe -updatepackage emby-server-asustor_{version}_x86-64.apk Operating system: Unix 4.4.24.0 64-Bit OS: True 64-Bit Process: True User Interactive: True Processor count: 2 Program data path: /home/emby Application directory: /volume1/.@plugins/AppCentral/emby-server/system System.Net.Sockets.SocketException (98): Address already in use at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip) at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort) at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync() at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts() System.Net.Sockets.SocketException at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip) at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort) at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync() at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()

Link to comment
Share on other sites

widget100

Found the source of it on mine -

 

pi@raspberrypi:~ $ sudo netstat -nap | grep :1900
tcp         0      0 192.168.1.21:38627      192.168.1.254:1900      CLOSE_WAIT  1205/EmbyServer
udp        0      0 239.255.255.250:1900    0.0.0.0:*                                                 638/tvheadend
 

TVH is holding the port open all the time so Emby throws the error every time it scans. TVH obviously at fault, not Emby but I cant fix TVH :(

 

There appears to have been a fix to stop the Sat/IP server doing this but it's not in the PI builds of TVH as far as I can tell.

 

https://tvheadend.org/issues/4482

Edited by widget100
Link to comment
Share on other sites

widget100

Yes and No.

 

The Sat/IP component that's causing the issue has a setting that says Disable UPNP discovery. I've checked it but it doesn't disable the listener. I'm running the bleeding edge 4.3.x version and you cant disable the component completely.

 

From the sat/ip spec:

A SAT>IP server joining the network, declares its presence by sending a NOTIFY message using the NTS value ssdp:alive to the SSDP multicast channel:port 239.255.255.250:1900
The SAT>IP server as a UPnP root device must multicast three distinct messages with the NT andUSN values as specified in table 1-1 of the UPnP Device Architecture 1.1 [1].
Multicast NOTIFY ssdp:alive messages are sent regularly by all SAT>IP servers in order to signal their presence

 

Unless you can put in an exception for 239.255.255.250 or stop the error being logged in Emby I think we're stuck with the logs flooding.

Link to comment
Share on other sites

  • 3 weeks later...

On my QNAP TS-869L the cause and solution are obvious.

 

Emby is trying to bind to 0.0.0.0:1900 but a different application (Resilio Sync) always starts first with exactly the same binding, hence the "Address already in use" error. Unless I manually start Emby first or disable Resilio Sync completely, then I get the same exception reported by @joeseph. Since I don't use DLNA due to this other issue it's not something I'm worried about.

 

What do you mean by put in an exception?

I'm also unclear on what @widget100 means, could mean SEH changes, could be something else. Either way here's some suggestions to consider.
  • Disable all UPnP features the first time the exception is raised to prevent the log flooding, then, set a Dashboard Alert to advise the admin that there is a problem.
  • Use a trap to gather telemetry so the extent of the problem can be gauged without relying on user reports.
Link to comment
Share on other sites

  • 4 weeks later...

The emby server seems to be conflicting with other servers running on my machine.

Specifically, (if port 1900 is the conflicting port) a unifi video service and OpenHAB.

 

Since the logs don't  tell me which port is the problem, is it port 1900 that is the conflicting port?

 

Perhaps I should run emby in a container and configure it to use a virtual ethernet device with a different IP address?

 

 

 

2018-07-29 00:13:47.871 Error Dlna: Error in BeginListeningForBroadcasts

    *** Error Report ***

    Version: 3.5.1.0

    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb

    Operating system: Unix 4.15.0.29

    64-Bit OS: True

    64-Bit Process: True

    User Interactive: True

    Processor count: 4

    Program data path: /var/lib/emby

    Application directory: /opt/emby-server/system

    System.Net.Sockets.SocketException (98): Address already in use

       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)

       at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)

       at System.Net.Sockets.Socket.Bind(EndPoint localEP)

       at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)

       at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)

       at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()

       at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()

    System.Net.Sockets.SocketException

       at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)

       at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)

       at System.Net.Sockets.Socket.Bind(EndPoint localEP)

       at Emby.Server.Implementations.Net.UdpSocket..ctor(Socket socket, Int32 localPort, IPAddress ip)

       at Emby.Server.Implementations.Net.SocketFactory.CreateUdpMulticastSocket(String ipAddress, Int32 multicastTimeToLive, Int32 localPort)

       at Rssdp.Infrastructure.SsdpCommunicationsServer.ListenForBroadcastsAsync()

       at Rssdp.Infrastructure.SsdpCommunicationsServer.BeginListeningForBroadcasts()

 

is there anything new to this or some way to solve this? my log keeps showing this message every minute.

Link to comment
Share on other sites

  • 3 months later...

Having the same problem here. EmbyServer tries to open UDP port 1900 for SSDP exclusively, which is a bad idea.

  • When I start EmbyServer first, it works fine, but several other applications then fail to open port 1900.
  • If one of the other applications is started first, other applications can share port 1900 fine, but I get the described error from EmbyServer.

SSDP is often used by multiple processes for service discovery like DLNA and (at least on Linux) should be opened with the SO_REUSEADDR socket option set.

 

I think above post is enlightening, thanks @@mellon85 for tracing:

 

I used strace to figure out which bind call was actually causing the issue and I found

socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP) = 176                    
setsockopt(176, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0                          
setsockopt(176, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0                          
setsockopt(176, SOL_IP, IP_MULTICAST_TTL, [4], 4) = 0                          
setsockopt(176, SOL_IP, IP_ADD_MEMBERSHIP, {imr_multiaddr=inet_addr("239.255.255.250"), imr_interface=inet_addr("0.0.0.0")}, 12) = 0
setsockopt(176, SOL_IP, IP_MULTICAST_LOOP, [1], 4) = 0                         
bind(176, {sa_family=AF_INET, sin_port=htons(1900), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)

It looks like port 1900 is already in use. Stopping the process that was using it (minissdpd in my case) removed the issue

 

EmbyServer sets SO_REUSEPORT (twice), but not SO_REUSEADDR. Some quick tests with Python show that Linux requires SO_REUSEADDR to be set for sharing multicast UDP ports, SO_REUSEPORT does not work.

 

Hope this helps? Happy to do more testing and/or provide more details.

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...