LCDproc development and user support list

Text archives Help

[Lcdproc] Patch for lcd2usb

Chronological Thread 
  • From: bsdfan at (Markus Dolze)
  • Subject: [Lcdproc] Patch for lcd2usb
  • Date: Wed, 29 Dec 2010 13:15:06 +0100

On 21.12.2010 13:51, Michael Zanetti wrote:
> Hi,
> On Tuesday 21 December 2010 11:06:38 Michael Zanetti wrote:
>> What about using Bus-ID and Device-ID where the device is attached? AFAIK
>> it should be easy to get them in the code without changing the devices
>> firmwares and the user can easily obtain it using lsusb.
> Never mind this... I just realized that the device id changes each time the
> device gets unplugged so this is obviously not a solution. First I thought
> they would be always the same for the same USB port.
> The next problem is how LCDd parses its config file. If I add two "Driver="
> entries and then add two sections "[hd44780]", config_get_string() just
> gives
> me the entries in the first section twice. So it is not possible to define
> two
> devices using the same driver but differently configured serial numbers.
> As I'm still pretty new to LCDproc's codebase I might be overlooking
> something.
> Anyone has an idea how to solve this issues in a clean manner?

Hello Michael,

I spend some time modifying and testing the lcd2usb code. Attached you
find a patch that adds device selection based on bus or device name and
a sample configuration file.

The config file now understands a 'bus' option which accepts a bus name
as seen by libusb.

The 'device' option is already present in config file, but had been
ignored by lcd2usb up to now.

IMPORTANT: The 'device' option is set in the default config. Existing
user have to comment out that line or put in the correct value.
Otherwise lcd2usb driver will not load.

The code currently prints out which bus and device it scans. This info
will likely be removed for final commit.

Some drawbacks are there however:
* The first driver loaded decides about the screen size reported to the
client. You should only use displays of the same size.
* The device name is sufficient for device selection (you don't need the
bus as well), but it depends on the order of how the devices are plugged
in or detected upon reboot. Anyway, if all your devices are working the
same order doesn't matter.
* On my laptop each USB port is assigned to a different bus and its
order is always the same, so using the 'bus' option was the better.
* LCDd does update the devices sequentially. (Please do not try to
introduce threading here!) Depending on the size and number of devices
you will experience reduced frame rate (read below)!

In sample config file note the two 'Driver' lines using different
section names and the the 'File' option in section 'lcd2usb_162'. The
sample config file use the 'Device' option as seen on FreeBSD.

More info on performance:

On my 20x4 display updating a complete screen takes about 120ms, on my
16x2 just about 40ms. With LCDd's target frame rate of 8 frames/s this
is fast enough.

Using 20x4 on multiple displays will result in bad performance if the
complete screen changes (e.g. from one screen to another or on screens
with a lot of fast updates). Screens with only small updates are no
problem as is using small displays (16x2, 20x2).

I reworked the hd44780 flush code for better performance, this will be
addressed in separate mail.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-lcd2usb-device-selection.diff
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LCDd.dual.conf

Archive powered by MHonArc 2.6.18.

Top of page