-
Notifications
You must be signed in to change notification settings - Fork 207
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
Add a Eurolite serial number check #1888
Add a Eurolite serial number check #1888
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aroffringa .
Yeah I think this is an acceptable compromise, its just a bit niche to have bothered doing it before unless you're in the position of having both (the benefits of open source).
I think there's just the one main suggested change, and then just look at the logging and readme but you've covered most of that to make it nice and easy,
It'll want a little cotton wool to ensure they don't add blank lines etc.
This MR adds an option 'eurolite_serials' to the usb dmx plugin. This option accepts a comma separated list of serial numbers that are assumed to be Eurolite mk2 devices (as long as their product and vendor ids also match). This allows finding the Eurolite MK2 without enabling the 'enable_eurolite_mk2' option. The advantage is that is avoids the conflicts that 'enable_eurolite_mk2' produces with other plugins. These conflicts make it impossible to connect the mk2 simultaneously together with most other interfaces to have multiple universes and/or input universes. I have tested this by connecting an Enttec pro together with the Eurolite Mk2, and this works.
1c73a76
to
0ea9bce
Compare
@peternewman I've adopted your comments and added the config key to the usbdmx readme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor wording tweaks (and a possible extension idea).
It might be good to set a default (blank) serial key here:
ola/plugins/usbdmx/UsbDmxPlugin.cpp
Lines 95 to 115 in 96aa95e
bool UsbDmxPlugin::SetDefaultPreferences() { | |
if (!m_preferences) { | |
return false; | |
} | |
bool save = m_preferences->SetDefaultValue( | |
LIBUSB_DEBUG_LEVEL_KEY, | |
UIntValidator(LIBUSB_DEFAULT_DEBUG_LEVEL, LIBUSB_MAX_DEBUG_LEVEL), | |
LIBUSB_DEFAULT_DEBUG_LEVEL); | |
save |= m_preferences->SetDefaultValue( | |
EuroliteProFactory::ENABLE_EUROLITE_MK2_KEY, | |
BoolValidator(), | |
false); | |
if (save) { | |
m_preferences->Save(); | |
} | |
return true; | |
} |
Although it would then throw the empty line error each time...
I don't know what you think about this (maybe as a future enhancement for another PR):
- Start up OLAd in enable_eurolite_mk2
- If no (non-blank) eurolite_mk2_serial set (at startup), it adds each found one to the list
- So workflow wise you could plug in your Eurolite dongles, turn on the setting, run up OLA. Turn off the setting and plug in your other devices.
- Upsides you wouldn't have to read logs or find serial numbers via other methods
- Downsides some potential confusion if you don't follow the right workflow
- Alternative suggestion is do the same thing but put them in another key (e.g. discovered_eurolite_mk2_serial) which you could rename if required.
FYI you can merge the suggestions straight in via the web UI if you want to:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request#applying-suggested-changes
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
I've added the blank default and made sure that if a single blank serial number is given no warning is produced. I'm not sure I understand your suggestion, do you want ola to rewrite the config file and add the serial numbers? As a user that's really not what I would expect ola to do, to be honest, but I might be misunderstanding you. |
@peternewman is this MR ready to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the big delay in getting back to you! This wasn't raised from an issue was it @aroffringa that we ought to link it to?
Quite a bit of this is just a few minor style things, feel free to just merge my suggestions as is for them. Please can you also resync with master.
Just to check, when you specify by serial and have one or more of FTDI, Stageprofi or USB Pro enabled, does it all play nicely, or does ConflictsWith need tweaking still? USB Pro would be fine, as there's two way comms and the Eurolite won't behave as a USB Pro (plus you said you've tested it), I can't remember about Stageprofi (so I probably need to check the code), but won't FTDI just happily start spewing DMX data at it when it finds it, which would just make it a race condition which plugin detects it first?
Great thanks!
I was just trying to think through how someone will use it. If like you I've got one Eurolite Mk2 and one Enttec, I find I can't use them both together unless I enable the serial number mode, but how do I find the serial number? If what's printed on the bottom of the unit is exactly what I need to type in, then perfect, but otherwise I was thinking OLA could effectively pull either any serials it finds, or the serials it found in the last run, into the config file, for you to copy and paste. Otherwise you need to either use lsusb or trawl through all the OLA logs or similar. But you're the one using the kit, does that make sense as a workflow or seem redundant? It can definitely be a future PR/open issue and certainly isn't a blocker to getting this merged! |
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
Co-authored-by: Peter Newman <[email protected]>
Someone would now indeed have to look at the OLA output or lsusb to find the serial number -- this is indeed not super user friendly. What would be really useful is if this could be configured on the web interface (including that the interface would show the serial numbers), but that's a whole different scope ;). What's currently implemented at least demonstrates the use of the serial number to solve the conflict. In fact, given that quite some modules conflict with each other, a future idea could even be to incorporate this in a more generic way so that the user would be shown the possible serial ids and select the right device for it. For now I wouldn't want to enlarge the scope of this pull request — as it is it seems to work. I again applied your suggestions and updated the branch to master, so I think it is ready to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for all the hard work @aroffringa and sorry it's taken me quite so long to get this reviewed and in!
I think outstanding tasks are as follows: For you to test:
For me to do and then for you to test: #1932
I've open a new issue to track potential simplification for the user of finding serial numbers to put in the config - #1929 |
@peternewman I enabled the stageprofi, opendmx and ftdi plugins one by one and checked if the Eurolite continues to work. The serial plugin (that's what you mean with usb pro enabled?) I have indeed already tested extensively. Conclusion: the Stageprofi and opendmx plugins are not an issue, but enabling the FTDI device causes the Eurolite to no longer work. It's somewhat weird because the Eurolite is still detected and patched, but it seems that the FTDI device also tries to claim it and that causes issues. This is the log:
When I then try to use the interface, I get lots of these errors:
|
Yes sorry, serial=usbpro.
Yeah as I feared, they discover in different ways (via libusb and libftdi) so I don't think they can share the file locking stuff, so it just becomes a free for all, and the FTDI plugin will just pump DMX packets at any DMX interface it finds. Opendmx works similar, but needs a kernel driver so is more niche and I think if the device got detected as that it wouldn't be found via libusb and vice versa so we're probably okay there (but it may be safe to disable it too)... I assume the StageProfi plugin did detect but then ignored the device? Looking at the code, there is some two way comms to establish it really is a StageProfi so I think we're safe there. Anyway would you mind doing another minor PR please that makes it so that only StageProfi and serial/usbpro can avoid conflicting when the specific serial setting is on (i.e. ensure the FTDI and OpenDMX continue to conflict and they can't break as your test just found)? So some other lines around here: |
This MR adds an option 'eurolite_serials' to the usb dmx plugin. This option accepts a comma separated list of serial numbers that are assumed to be Eurolite mk2 devices (as long as their product and vendor ids also match).
This allows using the Eurolite MK2 without enabling the 'enable_eurolite_mk2' option. The advantage is that is avoids the conflicts that 'enable_eurolite_mk2' produces with other plugins. These
conflicts make it impossible to connect the mk2 simultaneously together with most other interfaces to have multiple universes and/or input universes.
I have tested this by connecting an Enttec pro together with the Eurolite Mk2, and this works.
I still need to update documentation -- happy to finish that too if this approach is considered acceptable.