Akaii APC Mini

The issues found when using the Input/Output Manager panel
Mehovoric
Posts: 7
Joined: Mon Dec 26, 2016 7:14 am
Real Name: JoshW

siegmund wrote:So you do not have an option to change this behavior on your external controller?
I do not. Akai isn't making a tool for this unfortunately. The only thing I can do is change initialization mode. The other modes work fine, they just don't have pages or banks built-in, so I need to start experimenting with creating pages using Bome.

Made a short little video so you can see exactly what it does. You may need to pause on the annotations, they're a little fast, sorry! haha

siegmund
Posts: 703
Joined: Mon Nov 02, 2015 11:03 am
Location: Germany
Real Name: Lukas

Haha very nice video thanks! :D
I would say this supports the "timing theory". Especially with the solo frames, if you turn on another scene in the same solo frame, the currently activated scene is deactivated by QLC+ itself and sent a proper feedback value.

Since this bug seems to affect multiple users and we are not able to change anything about it on our controllers, maybe one of the developers could have a look at it?

Would highly appreciate that!

Regards,
siegmund
User avatar
enbyted2
Posts: 17
Joined: Sat Dec 24, 2016 8:54 pm
Location: Poland
Real Name: Bartek

Okay, after a lot of testing different things I narrowed down my problem to couple simple and (for me and my controller) reproducible smaller ones.
I don't think it's related to timing in my case.

1. The buttons won't turn off, no matter the "Send note-off on 0 velocity" setting
2. after starting the show feedback on my akai dosen't work, I have to uncheck and check the feedback checbox in inputs/outpus

The #1 may be related to a missing initialization message (I've never setup anything in there). However I can easily control LEDs on akai by manually injecting midi messages.
Also when I have midisnoop active and messages are going through it the buttons actually work 100% of the time (but #2 still exists)

The #2 may actually be a bug in how QLC+ handles ALSA device. I will investigate it deeper, but probably not in the next 2 weeks.

Actually, it is possible that both issues are caused by the same bug. I did one change in QLC+ that got feedbacks working like described above - I added a very dirty std::cout with endl just before and just after sending feedback data, so that it's flushing. It may be a race condition or some other timing issue, but within QLC+ itself. It may also be a bug in ALSA or whatever middleware library QLC is using to access MIDI device. I will investigate it further, but as I said before - in about 2 weeks.

When I get some time I will provide a QLC+ build with some debugging stuff in place and hope that people with similar issues will provide more information.
I will also test it on Windows to see if it's Linux specific.

With all that in mind, I don't really have any experiemce with Qt and I don't fully understand QLC's structure (yet). It would be very helpful if somebody with more knowledge and a hardware to test it could take a look at it.
msccd
Posts: 7
Joined: Sat Jul 25, 2015 10:44 pm
Real Name:

Short question about the feedback to APCmini: Is it possible to disable it for some buttons only?

my problem is: i have to activate three buttons with different functions with button on the APCmini. And no, i know about the collections, but this time they can't help.

If i map more than one button in the VC to one button on the APCmini, the feedback won't work correctly any more. I'd have to disable it on two of the three functions, and set it on the last third.

Any idea? Thx!
User avatar
enbyted2
Posts: 17
Joined: Sat Dec 24, 2016 8:54 pm
Location: Poland
Real Name: Bartek

msccd wrote:Short question about the feedback to APCmini: Is it possible to disable it for some buttons only?
No, that's not available in QLC+ (at least not in a way I know about), but it seems like a useful feature - I'll suggest it on github, so Massimo has a better chance to see it :)

As a workaround you could find a program that will convert midi input to keystrokes and use keyboard shortcuts in QLC+. I don't know any software that does it, but there has to be something.

Edit: here is the issue filed: https://github.com/mcallegari/qlcplus/issues/926
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Alright, jumping in.
I've had some time to test with a BCF2000 and an AKAI APC mini.
No issues found, with the following considerations:

- by factory default, the BCF2000 sends just one MIDI message when pressing a button. Normally, QLC+ expects to receive a press and a release event to work properly.
That's why at some point I've added the option "Generate an extra Press/Release when toggled". I thought I enabled it by default in the bundled BCF2000 profile, but I haven't.
In any case, it's written in the documentation: http://www.qlcplus.org/docs/howto-input-profiles.html (Button properties)
If you enable that option for every button, there is no issue with feedbacks

- I tested enbyted2 project with an APC mini and after a while I figured out what's wrong with it. You cannot use feedbacks on a universe that's already sending output data to a DMX USB adapter ! It's been explained quite a few times in this forum. Just separate input+feedbacks and DMX output into 2 different universes

- as for Mehovoric video, without a test project I cannot tell what's going on in his setup
siegmund
Posts: 703
Joined: Mon Nov 02, 2015 11:03 am
Location: Germany
Real Name: Lukas

Thank you for your answer!
mcallegari wrote:- by factory default, the BCF2000 sends just one MIDI message when pressing a button. Normally, QLC+ expects to receive a press and a release event to work properly.
That's why at some point I've added the option "Generate an extra Press/Release when toggled". I thought I enabled it by default in the bundled BCF2000 profile, but I haven't.
In any case, it's written in the documentation: http://www.qlcplus.org/docs/howto-input-profiles.html (Button properties)
If you enable that option for every button, there is no issue with feedbacks
First of all, I need to apologize because I was not aware of this possibility. I tried the factory setting and realized that it is not possible to toggle buttons and so I edited the buttons on BCF2000 to be "Toggle Off". This means they act like a flash button and are only on as long as the button is pressed.

So far what happened in the past.

For testing, I've applied "Toggle On" agein as it is the factory default, created a profile (since I have other MIDI commands assigned I could not use the available one) and checked the "Generate an extra Press/Release when toggled" option. Toggling a scene works great, feedback is expected. Unfortunately I'm not able to flash a scene with this checkbox enabled, also the LED on the BCF2000 instantly goes off after pressing. If I disable the checkbox, I have the toggling-behavior again, but on a button that should work as a flash button.
Maybe I'm doing something wrong again. If so, please tell me.

I share the corresponding input profile file, .bcf mapping file (remove additional .qxw extension I needed to add since the forum does not allow .bcf files) and the workspace with which I tested.
Attachments
bcf.qxw
(2.29 KiB) Downloaded 134 times
Template1.bcf.qxw
(10.31 KiB) Downloaded 134 times
BCF-2000(own).qxi
(6.36 KiB) Downloaded 146 times
User avatar
enbyted2
Posts: 17
Joined: Sat Dec 24, 2016 8:54 pm
Location: Poland
Real Name: Bartek

mcallegari wrote:- I tested enbyted2 project with an APC mini and after a while I figured out what's wrong with it. You cannot use feedbacks on a universe that's already sending output data to a DMX USB adapter ! It's been explained quite a few times in this forum. Just separate input+feedbacks and DMX output into 2 different universes
Ohh, that explains it! Maybe it should be stated in the documentation somewhere? (if it is already maybe it's not clear enough? I didn't see it...)
I will change it and test as soon as I get my hands on Akai again, thanks!

As a side note, what is the underlaying reason/error behind it?

EDIT:
BTW, It seems that with ArtNet as output the issue is showing itself in a different way: The buttons will never turn off, but I can change their color. It makes it much stranger of an issue in my eyes.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

enbyted2 wrote:
mcallegari wrote:- I tested enbyted2 project with an APC mini and after a while I figured out what's wrong with it. You cannot use feedbacks on a universe that's already sending output data to a DMX USB adapter ! It's been explained quite a few times in this forum. Just separate input+feedbacks and DMX output into 2 different universes
Ohh, that explains it! Maybe it should be stated in the documentation somewhere? (if it is already maybe it's not clear enough? I didn't see it...)
I will change it and test as soon as I get my hands on Akai again, thanks!
As a side note, what is the underlaying reason/error behind it?
EDIT:BTW, It seems that with ArtNet as output the issue is showing itself in a different way: The buttons will never turn off, but I can change their color. It makes it much stranger of an issue in my eyes.
Actually, I need to correct myself for what I said before.
I've read in this forum that input+feedback and output should be on different universes, but then I thought that the code can handle them in the same universe, so I started digging again.
What I found is not nice at all :(

I started with a simple project with one button, and everything worked perfectly. Then I used your project with lots of buttons and saw the problem.
When QLC+ goes into operate mode, it sends ALL the feedbacks of the widgets that have an external input channel assigned.
In your project, 30-40 MIDI signals are sent to the APC mini very quickly.
For some reason, Linux detects an hotplug of the device ! Basically udev thinks the APC has been unplugged and plugged on the USB port.
Now I'm not sure if this is an issue specific to the APC or specific to Linux, but what happens next causes feedbacks not to work anymore.
At some point we added an option to the MIDI plugin to send "note off" extra event. Basically for who uses MIDI notes with particular controllers.
That option is enabled by default in the plugin, unless specified otherwise by the QLC+ engine.
In fact, if you look at the beginning of your project XML, you will see "<PluginParameters MIDISendNoteOff="false"/>"

If you unplug and plug a USB device, all the parameters read from the XML file are lost, and this is the real issue that needs to be resolved.
So when you load your project the "note off" parameter is correctly set to "off", but when you go into operate mode, the MIDI line gets re-initialized and "note off" goes back to "on", and feedbacks won't work anymore.

I've tried to understand if there's a quick fix for this, but there's not. This is a plain architecture error, emerged when we enabled the hotplug monitor.
I need some more time to figure how to solve this.
User avatar
enbyted2
Posts: 17
Joined: Sat Dec 24, 2016 8:54 pm
Location: Poland
Real Name: Bartek

mcallegari wrote: For some reason, Linux detects an hotplug of the device ! Basically udev thinks the APC has been unplugged and plugged on the USB port.
Now I'm not sure if this is an issue specific to the APC or specific to Linux, but what happens next causes feedbacks not to work anymore.
That's what I found and thought that was some bug to trace in ALSA or whatever QLC's using for midi.
That also explains why a dirty 'cout with endl' just before sending feedback to midi "fixed" it.
The limit seems to be 8-9 buttons at a time.
Oh, also when I routed midi through midisnoop the problem disappeared.
mcallegari wrote: I've tried to understand if there's a quick fix for this, but there's not. This is a plain architecture error, emerged when we enabled the hotplug monitor.
That's really unfortunate and should be fixed, but we should also trace the re-plug issue, since it might be something that QLC is doing wrong.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

enbyted2 wrote:
mcallegari wrote: I've tried to understand if there's a quick fix for this, but there's not. This is a plain architecture error, emerged when we enabled the hotplug monitor.
That's really unfortunate and should be fixed, but we should also trace the re-plug issue, since it might be something that QLC is doing wrong.
No, I just tried your project with a KORG Nanocontrol 2 and there is no re-plug sequence at all.
That's definitely an APC mini issue. Probably it detects it's being flooded with MIDI data and sort of "resets" itself at USB level.
Quite a bad firmware I would say...

As I said, the "only" issue to be fixed is that plugin parameters get lost on a unplug/plug event.
One solution could be to apply some time based filter to hotplug events. If a unplug/plug sequence happens in let's say less than 500ms, then it's a false positive, and should not close/open a plugin line at all.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

siegmund wrote: Unfortunately I'm not able to flash a scene with this checkbox enabled, also the LED on the BCF2000 instantly goes off after pressing. If I disable the checkbox, I have the toggling-behavior again, but on a button that should work as a flash button.
As I explained before, the BCF2000 doesn't send two events for press and release. It just sends "press", so I believe flashing with the BCF is not even possible, unless you are willing to accept an awkward button LED status.
Basically you would need to press and release a BCF button two times to start/stop flashing, that's why it is awkward.
User avatar
enbyted2
Posts: 17
Joined: Sat Dec 24, 2016 8:54 pm
Location: Poland
Real Name: Bartek

mcallegari wrote:
enbyted2 wrote:
mcallegari wrote: I've tried to understand if there's a quick fix for this, but there's not. This is a plain architecture error, emerged when we enabled the hotplug monitor.
That's really unfortunate and should be fixed, but we should also trace the re-plug issue, since it might be something that QLC is doing wrong.
No, I just tried your project with a KORG Nanocontrol 2 and there is no re-plug sequence at all.
That's definitely an APC mini issue. Probably it detects it's being flooded with MIDI data and sort of "resets" itself at USB level.
Quite a bad firmware I would say...
Oh, if that's the case then nothing to do about it. I'll just stick to having midisnoop in the middle, for now.
mcallegari wrote: As I said, the "only" issue to be fixed is that plugin parameters get lost on a unplug/plug event.
One solution could be to apply some time based filter to hotplug events. If a unplug/plug sequence happens in let's say less than 500ms, then it's a false positive, and should not close/open a plugin line at all.
But still it is a workaround, if somebody legitimately unplugs hardware and plugs it again QLC should initialize everything properly, as it was at the start.
User avatar
mcallegari
Posts: 4462
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

enbyted2 wrote:But still it is a workaround, if somebody legitimately unplugs hardware and plugs it again QLC should initialize everything properly, as it was at the start.
Then I guess you are able to unplug/plug a device in less than half a second...lucky you.
In any case, that was just an idea. I tried to implement it but it raises other issues, so now I'm gonna fix the parameters issue.

UPDATE: after hours of me being puzzled by debug messages, I think I've sorted at least 3 things:
- the reconnection of feedbacks was totally missing on hotplug. That's why when the APC disconnected itself, there were no more feedbacks
- the original plugin line parameters read from XML are now restored after a hotplug
- with many widgets and several nested frames in the VC, I noticed the same feedbacks were sent like SEVEN times to the controller.I was not able to completely solve this, but I limited the number of feedbacks sent, and now the APC doesn't disconnect itself anymore

Now can you please help me testing these changes for accidental drawbacks ? I believe there shouldn't be, but the more we test, the more we have the chance this is OK for eveyone
I've triggered Linux automated builds and will publish the Windows build as well when it finishes to build
siegmund
Posts: 703
Joined: Mon Nov 02, 2015 11:03 am
Location: Germany
Real Name: Lukas

mcallegari wrote:
siegmund wrote: Unfortunately I'm not able to flash a scene with this checkbox enabled, also the LED on the BCF2000 instantly goes off after pressing. If I disable the checkbox, I have the toggling-behavior again, but on a button that should work as a flash button.
As I explained before, the BCF2000 doesn't send two events for press and release. It just sends "press", so I believe flashing with the BCF is not even possible, unless you are willing to accept an awkward button LED status.
Basically you would need to press and release a BCF button two times to start/stop flashing, that's why it is awkward.
Actually I was able to get it to work by setting the mode of the buttons on the BCF to "Toggle OFF". This means they act like flash buttons, so send a key press and a key release event. Flashing works fine then. The only problem arising is the missing feedback when using the BCF button as external input for an vc toggle button. This is because the BCF internal turns the LED off on a key release and is not advised to light it up again. The feedback message from QLC+ has no effect since it arrives mostly before releasing the key.
My PR fixes this problem by an additional feedback message when releasing the key.
HaselnuesseTo
Posts: 2
Joined: Sun Dec 04, 2016 5:05 pm
Real Name:

Fix Led won't turn off problem:
Map the same controller button to a dummy button which is linked to a dummy scene in vc. :)
User avatar
GGGss
Posts: 2662
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

oke ... and then? Do nothing?
All electric machines work on smoke... when the smoke escapes... they don't work anymore
Post Reply