How to add/support Teledyne DALSA framegrabber & camera drivers?

Well, I’m not sure even where to begin with this question, as these topics are completely outside of my domain of expertise.

Long story short, we are porting an embedded systems application from a Windows environment to NixOS, which utilizes Teledyne DALSA framegrabber card and cameras.

Teledyne DALSA provides a Linux SDK for both the framegrabber and camera that is currently supported on Ubuntu, Debian, Suse/openSUSE, and Red Hat (Fedora/RHEL/CentOS). Support is provided for Linux
distributions using Linux kernel version 2.6.32 and later on the Intel/AMD CPU architecture.

  • Ubuntu: Released every 2 years. Starting with Ubuntu 12.04 LTS, versions
    receive five years support.

  • CentOS: Release distributions provide long term support (end of life) for up to 10
    years. For example, CentOS-7 provides maintenance updates until June 30, 2024
    and the recently released CentOS-8 is supported until May 31, 2029.

  • Red Hat: Red Hat Enterprise Linux versions 6 and 7 each deliver 10 years of
    support (life cycle), unless otherwise noted, in Full Support, Maintenance Support
    1 and Maintenance Support 2 Phases followed by an Extended Life Phase. In
    addition, for Red Hat Enterprise Linux 6, customers may purchase annual Add-on
    subscriptions called Extended Life-cycle Support (ELS) to extend limited
    subscription services beyond the Maintenance Support 2 Phase.

You might notice that NixOS is not listed as a supported environment. :wink:

The $1M question is – given that Teledyne DALSA provides a Linux SDK that operates on any of the above linux distros, can these drivers be repackaged/ported and loaded into a NixOS environment? And if so, what is the process for getting these drivers ported over and up and running?

Reading thru the docs, it certainly sounds like getting these driver drivers up and running should be doable – both both kernel device driver development and NixOS packaging our new to our team – and thus we need all the advice/help we can get. :slight_smile:

Thanks in advance for your thoughts and suggestions.

I don’t see anything preventing you for doing that: many drivers are integrated into NixOs, including the complicated proprietary nvidia drivers (and if you pay me $1M I can certainly try to spend a bit on time on that :stuck_out_tongue:). I guess you won’t have the source code, so you will certainly need to patch the binaries. For that I wrote a tutorial here, you certainly want the autopatchelf method.

If your driver comes in the form of a kernel module, then you will certainly like boot.kernelModules (the full list of options and how they are used is here). I explained here how I used it to package and load a droidcam module (you can see there where to install your module…).

Finally, do not hesitate to look at nixpkgs’s source code to find example of drivers GitHub - NixOS/nixpkgs: Nix Packages collection. I find github search engine to be quite bad, but using git clone to get it locally and rg yourtext (from ripgrep) to search through it is quite efficient.

If you have more specific questions, feel free to ask. If you give more information on what the SDK is giving you it will certainly be easier to give you a better answer… If you have some .deb I would write a derivation that extracts them, patch them and copy the files at the right locations, then load the modules as explained above… but it’s hard to say more without knowing what is your starting point.

:slight_smile: Only $1M??? lol Given the fact we have zero experience with building these things, contracting you to build these things might actually be our best approach. Seriously, though, if you’re actually offering, we might be able to work something out.

First, thanks for taking the time to write this all up; I haven’t had time read thru all the resources you’ve references but will do shortly.

Let’s see if I can address some of your questions…

  1. The Teledyne drivers and SDK are commercial, however, the kit appears to contain source code for two drivers (frame grabber and camera), samples/demos, and documentation (pdf).

Frame Grabber

    ├── corinstall
    ├── README
    ├── Sapera
    │   ├── bin
    │   ├── camfiles
    │   ├── classes
    │   ├── examples
    │   ├── GenICam_v2_4_0_linux_pkg.tgz
    │   ├── include
    │   ├── lib
    │   ├── lib64
    │   ├── makefile
    │   └── utils
    └── src
        ├── sapera
        └── w32lib


    ├── src
    │   └── xtium
    └── Xtium-CL_MX4
        ├── bin
        ├── Firmware
        ├── history
        ├── lib
        └── README

SaperaLT_Linux_Users_2020_10.pdf (TOC)

  1. Kernel driver? Not entirely sure what I should be looking for to deduce this characteristic.

Let me know your thoughts and we can take it from there. Thanks again for you input here.

So the list of files you provided suggests that it might be possible to compile the SDK/drivers directly in NixOs without patching binaries (even if I’m a bit surprised that sources are opened). But it’s hard to say more without the source and README files. I guess we can use standard nix derivations to build the SDK as I explained here (sorry for all this shameless advertisement :stuck_out_tongue: ) packaging - How to package my software in nix or write my own package derivation for nixpkgs - Unix & Linux Stack Exchange

I tried to download the source to check in more details but seems like I can only download stuff for Windows. If you want, I’m happy to give it a deeper look as you proposed (just be aware that I don’t pretend to be any sort of “expert”, I’m just enjoying NixOs :wink: ), since I guess you can’t publically send the source here I sent you a private message with my email.