Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of drops connection trouble #26

Open
fadersolo opened this issue Oct 11, 2024 · 5 comments
Open

Lots of drops connection trouble #26

fadersolo opened this issue Oct 11, 2024 · 5 comments

Comments

@fadersolo
Copy link

Just found this tool, it’s AWESOME!

When I run commands it can’t seem to find my devices most of the time. For example, if I run netaudio device list, odds are it’ll return nothing, but if I run it 4-5 times in a row some devices start to show up. This is on macOS. If I run the same command from my raspberry pi, I consistently get my full list.

Here’s my problem: I wanna run netaudio config --set-sample-rate 44100, to help me change the sample rates across the network (for everything that can). I’m not having luck.

On macOS I have to keep running over and over before it finally finds both devices and updates them:

Device not found
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Setting sample rate of Red8Pre 192.168.1.91 to 44100
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Failed to get a service by type. 
Failed to get Dante device name
Failed to get a service by type. 
Failed to get Dante channel counts
Setting sample rate of  192.168.1.91 to 44100
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Device not found
 % netaudio config --set-sample-rate 44100
Setting sample rate of MCDUDE-002 192.168.1.66 to 44100

On my raspberry, it always times out:

 % netaudio config --set-sample-rate 48000
Setting sample rate of Red8Pre 192.168.1.91 to 48000

  timeout

  timed out

  at .local/lib/python3.9/site-packages/netaudio/dante/device.py:96 in dante_command
        92│         binary_str = codecs.decode(command, "hex")
        93│ 
        94│         try:
        95│             sock.send(binary_str)
    →   96│             response = sock.recvfrom(2048)[0]
        97│         except TimeoutError:
        98│             pass
        99│ 
       100│         return response
@fadersolo fadersolo changed the title Lots of drops and 'timed out getting mDNS service' Lots of drops connection trouble Oct 11, 2024
@chris-ritsen
Copy link
Owner

chris-ritsen commented Oct 11, 2024

That error message could be better, but basically you're required to give it a device IP or name (that is, whichever one device you're trying to change).

--device-host Specify a device to configure by network address
--device-name Specify a device to configure by name

I guess I never tried it without an argument, seems like it's still attempting to do something in your examples.
I should make the mDNS timeout configurable (it's currently 1.5 seconds), but if you specify the device IP it doesn't bother looking for mDNS services and just talks to the device directly. This is the fastest way to interact with devices if you're scripting things.

@chris-ritsen
Copy link
Owner

Also, I've started to implement a daemon mode that caches into redis and watches for mDNS changes on its own, so eventually the timeout won't matter.

@fadersolo
Copy link
Author

With a lot of the commands I’ve tried, it seems like if I don’t specify a device, it tries to go through every device on my network. I can imagine that’d be crazy for some people’s setups. 😬 TBH: when it works -- as in omitting a device hits everything on the network -- it’s really nice. I can imagine myself running these sample rate switch commands often.

@chris-ritsen
Copy link
Owner

chris-ritsen commented Oct 11, 2024

I can see the utility of setting AES67 mode or the sample rate on all devices at once, but how it works now was unintentional. I'll look into making this explicit. Setting anything on all devices in the network at once to any setting by accident is chaos I want to avoid. Please don't use this in prod yet.

@fadersolo
Copy link
Author

You’re awesome! Like I said before, this is such a cool project! I’m grateful for the smart folks like you who know how to build tools like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants