companion icon indicating copy to clipboard operation
companion copied to clipboard

feat: loupedeck-live support

Open Julusian opened this issue 1 year ago • 1 comments

Fixes #1311

Im not entirely happy with the changes to elgato_dm.js, I feel they are a bit risky and could cause the callback to never be fired, but I dont know how else to do the change without a larger refactor. Using a fork of the loupedeck library for now, while I figure out some issues I encountered in their latest release

Its not perfect, but this device maps reasonably well into the current grid system. The mapping I have gone for is best described with pictures: image

PXL_20220902_211725835

Essentially, the vertical touch segments are currently unused, as there was no space left to map them, and generating images for them would be a pain. The rest is mapped across, in a fairly logical fashion. The encoders is a bit of a hack, but it does work. They have to span two buttons in the grid to have both the rotation and click. Rotating the encoder clockwise fires the 'press' actions, and anti-clockwise fires the 'release' actions. They do fire for each click as you would hope. The color of the bottom row of buttons is taken as the background colour in companion

Exported page:

{"version":2,"type":"page","config":{"1":{"style":"png","text":"Encoder Rotate\\nTop L","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"2":{"style":"png","text":"Encoder Click\\nTop L","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"3":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"4":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"5":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"6":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"7":{"style":"png","text":"Encoder Click\\nTop R","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"8":{"style":"png","text":"Encoder Rotate\\nTop R","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"9":{"style":"png","text":"Encoder Rotate\\nMid L","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"10":{"style":"png","text":"Encoder Click\\nMid L","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"11":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"12":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"13":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"14":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"15":{"style":"png","text":"Encoder Click\\nMid R","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"16":{"style":"png","text":"Encoder Rotate\\nMid R","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"17":{"style":"png","text":"Encoder Rotate\\nBot L","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"18":{"style":"png","text":"Encoder Click\\nBot L","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"19":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"20":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"21":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"22":{"style":"png","text":"","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"23":{"style":"png","text":"Encoder Click\\nBot R","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"24":{"style":"png","text":"Encoder Rotate\\nBot R","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"25":{"style":"png","text":"0","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":16711680,"latch":false,"relative_delay":false,"show_topbar":"default"},"26":{"style":"png","text":"1","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":16728319,"latch":false,"relative_delay":false,"show_topbar":"default"},"27":{"style":"png","text":"2","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":52224,"latch":false,"relative_delay":false,"show_topbar":"default"},"28":{"style":"png","text":"3","size":"auto","alignment":"center:center","pngalignment":"center:center","color":0,"bgcolor":16776960,"latch":false,"relative_delay":false,"show_topbar":"default"},"29":{"style":"png","text":"4","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":0,"latch":false,"relative_delay":false,"show_topbar":"default"},"30":{"style":"png","text":"5","size":"auto","alignment":"center:center","pngalignment":"center:center","color":0,"bgcolor":16777215,"latch":false,"relative_delay":false,"show_topbar":"default"},"31":{"style":"png","text":"6","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":13421568,"latch":false,"relative_delay":false,"show_topbar":"default"},"32":{"style":"png","text":"7","size":"auto","alignment":"center:center","pngalignment":"center:center","color":16777215,"bgcolor":255,"latch":false,"relative_delay":false,"show_topbar":"default"}},"instances":{"bitfocus-companion":{"instance_type":"bitfocus-companion","label":"internal","id":"bitfocus-companion","_configIdx":2}},"actions":{"1":[],"2":[],"3":[],"4":[],"5":[],"6":[],"7":[],"8":[],"9":[],"10":[],"11":[],"12":[],"13":[],"14":[],"15":[],"16":[],"17":[],"18":[],"19":[],"20":[],"21":[],"22":[],"23":[],"24":[],"25":[],"26":[],"27":[],"28":[],"29":[],"30":[],"31":[],"32":[]},"release_actions":{"1":[],"2":[],"3":[],"4":[],"5":[],"6":[],"7":[],"8":[],"9":[],"10":[],"11":[],"12":[],"13":[],"14":[],"15":[],"16":[],"17":[],"18":[],"19":[],"20":[],"21":[],"22":[],"23":[],"24":[],"25":[],"26":[],"27":[],"28":[],"29":[],"30":[],"31":[],"32":[]},"feedbacks":{"1":[],"2":[],"3":[],"4":[],"5":[],"6":[],"7":[],"8":[],"9":[],"10":[],"11":[],"12":[],"13":[],"14":[],"15":[],"16":[],"17":[],"18":[],"19":[],"20":[],"21":[],"22":[],"23":[],"24":[],"25":[{"id":"-aR20WRPC","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16777215}}],"26":[{"id":"Jh6lPauu7","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16711680}}],"27":[{"id":"T-giHIYVB","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16711680}}],"28":[{"id":"SHXYgnDNH","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16711680}}],"29":[{"id":"QYvo65s14w","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16711680}}],"30":[{"id":"rP7n5PIGj","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16711680}}],"31":[{"id":"rc8o6_27AL","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16711680}}],"32":[{"id":"xmOUdJli7","type":"bank_pushed","instance_id":"bitfocus-companion","options":{"page":0,"bank":0},"style":{"color":16777215,"bgcolor":16711680}}]},"page":{"name":"PAGE"}}

Julusian avatar Sep 02 '22 21:09 Julusian

So what's missing from this is a setting to enable Loupedeck support and an add to the config wizard just the same. We could disable it by default to leave the existing code in elgato_dm and if Loupedeck is enabled use this new code. Label its support as experimental for the time being so people leave it off unless the need it. That doesn't let us stress that block like we'd prefer, but saves a major inline change for the majority of users for the moment.

I'll take another hard look later this weekend.

krocheck avatar Sep 03 '22 19:09 krocheck

This needs some additional testing. I merged support into satellite, and have found some bugs since starting to use it: https://github.com/bitfocus/companion-satellite/issues/51. They may or may not apply here too

Julusian avatar Sep 25 '22 20:09 Julusian

@krocheck do you have take time to review it ? It can be a hudge improvment for the loupedeck and since I already owned one, if I can avoid to buy a streamdeck for my pro streams management it could be great 😊

stevealexandre avatar Oct 10 '22 14:10 stevealexandre

@stevealexandre It needs a bit more work here before it is ready, but it is getting close. I spent yesterday refining the implementation in https://github.com/bitfocus/companion-satellite, and I need to port some of those fixes across to here.

I am doing a trial run today (at the desk in my office, along with a streamdeck xl), which is looking good so far, so hopefully I can get a new release of satellite in the next couple of days

Julusian avatar Oct 10 '22 14:10 Julusian

So effectively the 3 left dials become the navigation ones on the first column as mapped on a stream deck?

I probably would like to see an option to swap the 1st and 2nd column mapping in that case then, so the press on dial does the companion page navigation (up/down + home) where the rotation would then be on the 2nd column buttons and a left turn would 'latch' and right 'unlatch' (or inverse) when using the latch toggle on a custom button.

Hopefully someday the touch panels on the sides could display variables related to the dials, but this effectively creates a whole extra stream deck XL but with rotary knobs to use for e.g. incremental volume changes as repeat actions.

Wiethoofd avatar Oct 16 '22 00:10 Wiethoofd

So effectively the 3 left dials become the navigation ones on the first column as mapped on a stream deck?

I probably would like to see an option to swap the 1st and 2nd column mapping in that case then, so the press on dial does the companion page navigation (up/down + home) where the rotation would then be on the 2nd column buttons and a left turn would 'latch' and right 'unlatch' (or inverse) when using the latch toggle on a custom button.

That is completely possible to define that yourself. If you use the increment/decrement actions, then it will be possible to copy and paste the button across the pages. Im hesistant to do anything builtin for this, as if you are mixing loupedeck and streamdeck (like I am), then it will have to be done manually.

Hopefully someday the touch panels on the sides could display variables related to the dials, but this effectively creates a whole extra stream deck XL but with rotary knobs to use for e.g. incremental volume changes as repeat actions.

In an earlier prototype I was drawing to the side panels, but it is hard to do well because of their unusual aspect ratio. I am tempted to make them do a solid colour (in 3 segments), but im not sure on that yet.
And with there being no space left to map those side panels to any buttons, leaving them black feels reasonable.

Do remember that devices like this is very much not what companion is designed for currently. But we will get there on proper support eventually

Julusian avatar Oct 16 '22 13:10 Julusian

That is completely possible to define that yourself. If you use the increment/decrement actions, then it will be possible to copy and paste the button across the pages.

Having used this software for months if not years it never occurred to me you could move/delete the page navigation buttons until today 🤦‍♂️

In an earlier prototype I was drawing to the side panels, but it is hard to do well because of their unusual aspect ratio. I am tempted to make them do a solid colour (in 3 segments), but im not sure on that yet.

Using the left panel displaying the companion page navigation (and potentially interacting with it too, if supported?) could be a nice touch (pun intended). Otherwise making them the visual indicator for the dials to their left and right would help as visual indicator on those at least.

I've downloaded and tried the most recent betas since the merge yesterday, but can't seem to get my Loupedeck Live to show up as a control surface, where Satellite does work with an existing Companion instance and then also shows up as control surface there, but acts as a 15-key Stream Deck instead.

Wiethoofd avatar Oct 16 '22 20:10 Wiethoofd

@Julusian Well done mate. I have tried it this night and it's amazing ! It will open so much possibilities with loupedeck. On my side, one small improvement which can be great : If you can set the loupedeck grid template instead of the streamdeck when loupedeck is connected. (Maybe with a toggler on/off to not overide completly the initial streamdeck grid template and be able to switch between them)

stevealexandre avatar Oct 16 '22 20:10 stevealexandre

@Wiethoofd

Having used this software for months if not years it never occurred to me you could move/delete the page navigation buttons until today man_facepalming

haha, well back in 1.3/1.4 it wasnt possible to remove them, so its not unreasonable to think that.

I've downloaded and tried the most recent betas since the merge yesterday, but can't seem to get my Loupedeck Live to show up as a control surface

I should probably document that firmware v0.2.5 is required for the loupedeck, and you need to make sure you have enabled the loupedeck checkbox in the settings tab too. Also make sure the loupedeck software is closed/uninstalled.

Julusian avatar Oct 16 '22 20:10 Julusian

@stevealexandre

If you can set the loupedeck grid template instead of the streamdeck when loupedeck is connected.

That sounds pretty doable, that could be a completely client side setting, perhaps not even persisted across refreshes of the page. I suppose it just needs someone motivated enough to implement it, and figure out how to show each rotary with the rotate and press actions spanning multiple places.
Im a little hesitant to spend much time on it though, as nothing about how the loupedeck maps to the grid is nice, and once 3.0 is released I hope to start working on making that better

Julusian avatar Oct 16 '22 20:10 Julusian

@Julusian

I just realized right now, that last night I have tried it through companion-satellite because I was tired at 3AM and was thinking it was a requirement, I was building the master branch of companion instead of the beta branch... (stupid idea to do it so late in night 😅)

First of all, using the latest version of companion-satellite(including loupedeck integration) with the master branch of companion, works without having the native loupedeck implementation in companion. (No issues found after some tests)

I found that I can change the color of the first button at the bottom of loupedeck live; but with the beta of companion and the native integration, I cannot. (I tried many colors and no one working)

Companion master/beta + companion-satellite(including loupedeck) ldEagNLO3j

Companion beta 7ndVFJ1EES

~~I have also try the beta with companion-satellite to see if it's an error with the native integration in companion.~~ ~~I'm not able to detect my loupedeck in companion through companion-satellite.~~ ~~My loupedeck stay full back screen because device is not available in companion list.~~ ~~- Rescan done without any new device list~~ ~~- Tried with Loupedeck companion option enabled and disabled with a restart of companion at each time~~ Replug the loupedeck usb seems fix this.

I've tried also to define a knob with latch/unlatch to increment/decrement page on one knob and seems random working. (master & beta release)

stevealexandre avatar Oct 16 '22 23:10 stevealexandre

@Julusian didn't think to look for such a checkbox in the settings, but now it works. 👍 Amazing!

I should probably document that firmware v0.2.5 is required for the loupedeck

My v1.0.0 Loupedeck Live running 0.2.2 firmware (which I can't update from the software) works with this, so the FW version isn't necessarily a requirement, unless there is inconsistencies between I might have coincidentally documented below.


I still feel that with the buttons for navigation in Companion defaulting to 1, 9 & 17 in the first column and the dials only working with a counter clockwise action as a button press it feels very counterintuitive to twist the top dial to change page and having to do the same on the 3rd to go the previous page. Using the click action on the dial personally makes a lot more sense, I suppose that could be a device surface setting (similar to the stream deck button rotation option)?

The rotation for latch (clockwise) and unlatch (counterclockwise) works as intended, but if I want to use a Stream Deck as well as my Loupedeck I would end up having to move all navigation buttons from the 1st column to the 2nd, where I'd be fine with the right side dials to be click on the 7th column and rotating on the 8th.


I can also confirm the behaviour @stevealexandre is experiencing with the 1st touch button bottom left changing color when connected through Satellite, but defaulting to green in the newer beta supporting Loupedeck.

I've tried also to define a knob with latch/unlatch to increment/decrement page on one knob and seems random working. (master & beta release)

And also experiencing that the first counter-clockwise to unlatch does not always trigger the actual unlatch for me by looking at the buttons in the GUI updating the state.


Additionally the brightness setting on '4' or lower in the surface settings completely dimms all buttons, where the Stream Deck XL does this at 2.

Wiethoofd avatar Oct 17 '22 00:10 Wiethoofd

I can also confirm the behaviour @stevealexandre is experiencing with the 1st touch button bottom left changing color when connected through Satellite, but defaulting to green in the newer beta supporting Loupedeck.

@Julusian @Wiethoofd with companion-satellite on companion beta the color can be changed of the first touch button. Only not working on companion with native integration. The color of the first button is green if usb replugged with a scan and background color was green/blue for example, dim if color was red.

stevealexandre avatar Oct 17 '22 00:10 stevealexandre

@stevealexandre @Wiethoofd

The missing colour on the first button is fixed now.

I decided to do a task I had been putting off, and #2156 bring better support for the encoders. This will break any existing configs you have made, but I think it is worth the pain.
Instead of being split across two buttons, there is a checkbox to show some extra 'action groups' on buttons. One for rotate left, and one for rotate right. The encoders now trigger these actions when twisted instead, and the usual down and up when clicked.

This doesnt entirely help with the page change case, but fixing that doesn't have a clear solution.

Satellite has been updated to match this change, but I haven't done a release of it yet, so things wont entirely line up. But you can find beta builds from satellite in the same place as normal companion builds now

Julusian avatar Oct 31 '22 18:10 Julusian