[Lcdproc] PROTOTYPE Crystalfontz 633 USB

Wayne Wylupski projects@webBastards.com
Wed May 28 01:28:01 2003


Hello,

I hacked at it a little more and I have a workaround, if not the answer.
The Prototype CrystalFontz 633 screen is now displaying stuff.

What makes this problem different from the USB 632/634 is the 'test_packet'
stuff.  The 632/634 never checked for incoming information except when
expecting it.  The 633 always checks for the response from the display.  I
did try to add the "USB=yes" hack to the 634 (removing O_NDELAY) and what
happens is that the program hangs on the read() call within
Sync_Read_Buffer().

What I suggest we do (and I'll try this out for -- later) is:
1) Remove the O_NDELAY from the open.
2) do not use cfmakeraw, but instead use cfsetospeed and cfsetispeed
3) explicitly set portset.c_cc[VMIN] to 0; portset.c_cc[VTIME] to 2.  (this
is tuneable).

In other words, have the I/O time out after .2 seconds  but without
requiring any characters to be read.  This is like using the select()
statement, which I understand is frowned upon for serial lines.  I got this
information from the Serial programming HOWTO:
http://en.tldp.org/HOWTO/Serial-Programming-HOWTO/x115.html#AEN129

I'm going to experiment with it a little more (I'll make it work only when
someone specifies "USB=" in the conf file).

David, would you be able to try this on the serial version of 633 as well?

Would anyone object if I put it in the 0.4.4 version in addition to the 0.5
version of lcdproc?

Wayne

----- Original Message ----- 
From: "David GLAUDE" <dglaudemailing@gmx.net>
To: "Wayne Wylupski" <projects@webBastards.com>
Cc: "Brian Gentry" <BGentry@ncst.com>; "Goetz Bock" <bock@blacknet.de>;
<lcdproc@lists.omnipotent.net>
Sent: Tuesday, May 27, 2003 6:17 AM
Subject: Re: [Lcdproc] PROTOTYPE Crystalfontz 633 USB


>
>
> Wayne Wylupski wrote:
> > I took a look at this one (Thanks Brian for sending a unit).  It's a
problem
> > with the ftdi_sio driver, almost assuredly the same as previous times.
I
> > tried this with the patched ftdi_sio 1.2.2, as well as the plain
ftdi_sio
> > 1.3.3.
>
> Well, the serial (/dev/ttyS0) never ask for EAGAIN. So most of the code
> was writen assuming you just have to dump information and it work.
>
> I don't know if it is a bug or a feature of USB2Serial translation.
> I made my USB CwLinux LCD work without any problem. Actually there are
> two USB kernel module, the kernel original and the one provided by
> CwLinux, both seems to work (however I mostly used the one provided).
>
> > The behavior is that when SendByte issues a write(), nothing is written,
and
> > errno is set to EAGAIN.  This was the behavior before with the other
> > CrystalFont 632/4 USB device.  I had put in a workaround to remove
O_NDELAY
> > from the LCDproc's open() call because, well, because it was recommended
to
> > me, and because we never checked the write() returns anyway, and most
> > importantly it made LCDproc work.
>
> I could put the same work arround in CF633. One of the problem is what
> to do if requested to wait and retry. I don't want to write a busy
> waiting loop (cpu)...  also waiting mean LCDd is stuck and can not do
> anything. I think the best option would be a select (does it work for
> write?) with some maximal waiting time to avoid endless wait...
>
> One think about the CF633 is that it is packet oriented, so sending not
> all byte of a packet is kind of a problem. I prefere sending all or
> nothing. ;-)
>
> > Well, it doesn't work here with the 634, where we explicitly check for
> > returns.  I'll take a look at it a little more later when I have had
some
> > rest.
>
> So you mean you tested a loop write in the 634 driver to make it work
> for the USB version and it does not solve the problem???
>
> If that's true, then the same fix for CF633 will not work.
>
> David GLAUDE
>
> PS: About me and CF633 code, I must admit I did not touch the code since
> a long time... I have been busy lately with CwLinux driver and activisme
> (Fighting against software patent and against Electronic voting) with
> little time for coding.
>
> Give me a few day to commit my CwLinux driver for 0.5 (supporting USB).
>
> Then I can spend a few day on CF633 (if still needed).
>
> About the offer of getting one of those, yes it would be great.
> But it sound like a linux kernel/driver issue.
> You could start by sending me the spec about than USD2Serial thing you
> use. LCDd hacking and kernel hacking is something different (I did both,
> my name is into Umsdos FS code).
>
> -- 
> Don't let the computer/expert control the election
> Information for Belgium in french: http://www.poureva.be/
>
> _______________________________________________
> LCDproc mailing list
> LCDproc@lists.omnipotent.net
> http://lists.omnipotent.net/mailman/listinfo/lcdproc
>
>