OpenLightingProject / rp2040-dmxsun

RP2040-based USB DMX dongle with integrated web server
GNU General Public License v3.0
87 stars 17 forks source link

Use libartnet for Art-Net tx/rx instead of own implementation #50

Open kripton opened 1 year ago

kripton commented 1 year ago

OLP has a generic Art-Net implementation (https://github.com/OpenLightingProject/libartnet). This should probably be preferred to the current "custom" implementation

6by9 commented 1 year ago

I looked at libartnet previously.

It makes a lot of assumptions about being able to access the network stack directly in https://github.com/OpenLightingProject/libartnet/blob/master/artnet/network.c, which doesn't map very well onto lwip or other non-mainline (ie Linux or Win32) platform. Calling select on an file descriptor is really not going to fly on Pico.

Ideally it wants an abstraction layer for all the network level stuff so that the client can provide the appropriate implementations for eg enumerating interfaces, opening ports, and sending or receiving packets. The default implementation is effectively the current contents of network.c suitably wrapped.

It's also not been touched in 6 years, so is unlikely to support ArtNet4 or other recent additions. I don't know what behaviour you'll get trying multicast over these lower powered network stacks. The chips are unlikely to have significant offload, and whilst lwip has some support for IGMP subscription management, it may not make any significant difference.