Hi,
> It sounds good to me. We've got lots of suitable code to do the DMX and
> RDM
> bits at the byte level, we just need to deal with the low level timing
> stuff.
> I suspect it makes more sense, if possible, for it to just be a plugin
> rather than an actual Linux driver, as people will find that easier to
> use/install. But I guess there may be timing/interrupt requirements that
> mean it has to be a driver?
I am a friend of userspace drivers whenever possible, because they are
easier to debug and are more independent of the os version. The biggest
problem with the Linux tty driver is, that we do not get events like break
and error inline with the data. You can not decide when the break happend,
just that it happened. I am very unhappy with the linux serial port
implementation, because it is more a tty driver than a serial port driver.
When we have a serial-port or uart implementation for linux, that gives us
events like break start, break end, framing error, parity error and so on
inline with the data, we can write the DMX/RDM part in userspace.
For a famous german lighting console I divided the driver up into three
parts:
- userspace interface (DMX-Frames)
- DMX/RDM statemachine
- low level uart driver
One problem is the time the context switch between userspace and
kernelspace takes. I would implement a uart driver that can be used from
kernelspace and have a userspace wrapper, like with spidev, that makes it
possible to use it from userspace. Thus we can have a DMX/RDM driver where
the userspace driver latency is to hight and have a userspace driver
where we need the kernel independence.
I could think of a stacking like this:
+----------------------------------------------+
| userspace / kernelspace DMX wrapper library |
+----------------------------------------------+
| userspace DMX/RDM | | userspace DMX adapter |
+-------------------+ +------------------------+
|UART-adapter | | kernel DMX/RDM driver |
+-------------------+-+------------------------+
| UART-Driver A | UART Driver B | UART Driver C|
+----------------------------------------------+
Michael