Jump to content
C4 Forums | Control4

Driver Development


Matt Lowe

Recommended Posts

working on creating some drivers for some matrixes. 

The control control interface seems to be fine when doing an video(hdmi) only or audio only driver. However if I have both audio and video connections then it seems to give me a odd interface and odd input and output selections. Controling the driver works just fine using a c4 interface, but control control goes to heck.

so see in the photo below selecting video input and out gives highlights a green square and lower output than 700(X) where as the c4 interface gives me an output of 700(X)

then selecting an audio input circle in red does not high light anything and also gives me a different output id

these do relate to the ID of the bindings for each the video and audio, but when using the c4 interface it always gives me the room id binding for 700(X)

any help would be appreciated and if you need more information please let me know.

290534026_Screenshot2022-02-16132109.thumb.png.12c24cf2ddecd155fb478d6c4cdb301b.png

 

Link to comment
Share on other sites


Just now, RyanE said:

The AVSwitch command command dialog sucks big time, and I don't use it for development or testing, so unfortunately, I can't give you any salient advice on it...

RyanE

Agreed. how do you test a driver? for me it has been a lengthy process to make changes to the driver, save it , add it to composer and wait for it to update then go and test again. 

Link to comment
Share on other sites

10 minutes ago, Matt Lowe said:

Agreed. how do you test a driver? for me it has been a lengthy process to make changes to the driver, save it , add it to composer and wait for it to update then go and test again. 

I have a set of scripts that I use that build the driver and send the Lua portion to the running driver on the controller.

Unless you're changing the .xml portion of the driver, executing the Lua is normally all you really need to do during development.

RyanE

Link to comment
Share on other sites

I made a 2 way serial driver for an 8x8 hdmi matrix that can extract audio based on HDMI input or output and then matrix the audio independently as well. I have the same results as you have when using the composer interface but the driver works 100% besides that one small part that I'm not to worried about. Look into Visual Studio Code and using the python driver packager for creating the driver. It is a much quicker way to build a driver and test it. RyanE is also above me on that side. That sounds like some nifty $*** some of us would like documented in the github of how to setup for ourselves. 

https://github.com/control4/drivers-driverpackager

Link to comment
Share on other sites

@Matt Lowe There was a pretty good discussion about how to get set up using Visual Studio Code (or really any other text editor you'd like) with the driverpackager tools on another thread. DriverEditor is OK for learning the way around C4 drivers and how to put them together, but you'll like life a lot more once you get the hang of how to use something better. My experience has been that Visual Studio Code with a few plugins paired to the DriverPackager Python tool has been much faster and easier to use. It's also less prone to crashing if you mess something up or use it in a way which it doesn't like.

 

 

Link to comment
Share on other sites

I'm in the process of updating my VSCode extension I started long ago. I actually just added support for updating Lua script today after Ryan's comment.

The formatting of the driver is quite different and there's no modifications inside of XML anymore. Most sections are broken out into JSON files for their specific purposes (properties, commands, events, connections, etc) and provide a webview for modification, you can still edit the underlying JSON file as well (backed by JSON schemas)

I've also been able to include some improvements for things that bothered me, for example you can now specify the amount of HDMI connections you want to generate rather than copy pasting a bunch of XML blocks:
image.png.ffcff5da695d0cd6901cd9fe639a2c02.png

Properties & Webview example:
image.png.44465d389ac462182198fcb0466752cc.png

Auto completion of functions:
image.png.1994113bd785869da99599be3d7e62d6.png

Signature helpers:
image.png.c47dda02fc4dc75d54e5b6c9981e8f1c.png

All that being said I still haven't pushed a release as there are some issues to work out around the UI capability section.

Repository here: https://github.com/annex4-inc/vscode-control4-ext

Link to comment
Share on other sites

I did publish that extension and what I posted above will be an entirely new extension. It's such a major overhaul that I'll leave the old one as a lightweight completion extension for the functions and developers that have their own build methods. The new one is opinionated and requires a certain project structure for building the driver, but it does come with quite a few benefits.

Here's some source code of an example driver: https://github.com/annex4-inc/generic-camera-driver

You'll notice there is no driver.xml file, it's been split apart into the components folder and a smaller JSON object in the package.json file.

EDIT: Should also mention the extension can import .c4z files to migrate to the expected project structure.

Link to comment
Share on other sites

  • 1 month later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.