chris-ritsen / network-audio-controller

Cross-platform CLI control of Dante network audio devices without Dante Controller
The Unlicense
203 stars 21 forks source link

"timed out getting mDNS service" error #15

Open avotins opened 1 year ago

avotins commented 1 year ago

When using basic tool commands (device/subscription list) mdns service seams to timeout. This test deployment has quite a lot of Dante devices present in the space (about 50-60). In the end some device list is reported, but it does not represent all devices present in network.

Example:

^C[user>@<server ~]$ netaudio device list --name= timed out getting mDNS service timed out getting mDNS service timed out getting mDNS service timed out getting mDNS service timed out getting mDNS service timed out getting mDNS service timed out getting mDNS service timed out Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/netaudio/dante/device.py", line 277, in get_controls response = await self.dante_command(self.command_device_name()) File "/usr/local/lib/python3.9/site-packages/netaudio/dante/device.py", line 96, in dante_command response = sock.recvfrom(2048)[0] socket.timeout: timed out timed out Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/netaudio/dante/device.py", line 277, in get_controls response = await self.dante_command(self.command_device_name()) File "/usr/local/lib/python3.9/site-packages/netaudio/dante/device.py", line 96, in dante_command response = sock.recvfrom(2048)[0] socket.timeout: timed out timed out Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/netaudio/dante/device.py", line 277, in get_controls response = await self.dante_command(*self.command_device_name()) File "/usr/local/lib/python3.9/site-packages/netaudio/dante/device.py", line 96, in dante_command response = sock.recvfrom(2048)[0] socket.timeout: timed out

chris-ritsen commented 3 weeks ago

The timeout isn't configurable currently, but I'll look into making some options for it. I have far less than 50 devices, so the 1.5 second timeout I hardcoded worked for me. What kind of solution would be ideal? I've started implementing a daemon mode to cache to redis, but it's only on the list command right now. If you need to avoid the mDNS timeout, a workaround would be to specify devices by IP when doing anything besides listing devices.