mcallegari / qlcplus

Q Light Controller Plus (QLC+) is a free and cross-platform software to control DMX or analog lighting systems like moving heads, dimmers, scanners etc. This project is a fork of the great QLC project written by Heikki Junnila that aims to continue the QLC development and to introduce new features.
Apache License 2.0
918 stars 349 forks source link

plugins/artnet: force IPv4 when binding UDP socket #1589

Open Pac72 opened 2 weeks ago

Pac72 commented 2 weeks ago

qlcplus on Ubuntu 22.04 right now when configuring ArtNet input on an IPv4 address seems not to receive UDP packets (see #1588). Forcing IPv4 when binding UDP socket solves the issue.

Another more complicated approach is to create a socket for each input address and bind it explicitly to the address

Pac72 commented 2 weeks ago

Still to be checked, since qlcplus 4.13.1 on Windows 11 and qlcplus 4.12.7 on Mac seem to work out of the box.

mcallegari commented 2 weeks ago

@Pac72 thanks for this but I'm afraid it won't work.

image

The first argument as SpecialAddress has been introduced in Qt 6.2. QLC+ still needs to be compatible with Qt 5.15 for a while.

coveralls commented 2 weeks ago

Coverage Status

coverage: 32.034%. remained the same when pulling fee6d22278f6de43acd9527dcc1a5f108640dd03 on Pac72:art-net-force-ipv4 into c1f5846de11931e43213afbd49b7cbac1031e23d on mcallegari:master.

Pac72 commented 1 week ago

@mcallegari I was puzzled, since I built against 5.15.2 and, as you say, the bind(QHostAddress::SpecialAddress addr,...) is not defined. Then I realized that there is a constructor

QHostAddress(SpecialAddress address)

so the call

udpSocket->bind(QHostAddress::SpecialAddress::AnyIPv4, ARTNET_PORT, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint)

is using

bool bind(const QHostAddress &address, quint16 port = 0, BindMode mode = DefaultForPlatform);

Anyway, this patch is not relevant anymore, since, until now, I haven't been able to reproduce the issue #1588 I opened. Either it was some network sillyness (likely) or some strange linking issue (unlikely).

I'm giving it a last try, then I'll close the issue as PEBKAC.