2011-02-04 16:01:31     Touchscreen not working from app when started by /etc/rc

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-02-04 16:01:31     Touchscreen not working from app when started by /etc/rc

Jay Ku (UNITED STATES)

Message: 97936   

 

My application uses tslib to access the touchscreen (this is on a custom BF537 board running 2010R1).  If I start my app from /etc/rc, the touchscreen opens ok (ts_open() and ts_config() both return no error), but I get no events.  /etc/pointercl is there.  If I start the app from the console once the system boots, the touchscreen works fine.

 

The environment vars (i.e. TSLIB_TSDEVICE, etc.) are being set up in /etc/profile... this gets run before /etc/rc, right?

 

- Jay

QuoteReplyEditDelete

 

 

2011-02-04 16:15:28     Re: Touchscreen not working from app when started by /etc/rc

Mike Frysinger (UNITED STATES)

Message: 97938   

 

are you sure it is the touchscreen that is having problems ?  strace or attach gdb to it from another shell and see what it is doing.

QuoteReplyEditDelete

 

 

2011-02-06 03:01:39     Re: Touchscreen not working from app when started by /etc/rc

Jay Ku (UNITED STATES)

Message: 97956   

 

I added some code to print out the environment at the beginning of my app, and sure enough the vars set in /etc/profile (TSLIB_*) haven't been set yet, so I guess these don't happen before /etc/rc (I thought I'd read someplace that they do).  No matter... I just duplicated the 'export TSLIB_...' in /etc/rc before my app starts (and put a small delay in there to let the touchscreen drivers finish loading - probably I should build those into the kernel), and it works fine now.

 

Even though tslib seemed to be initializing properly and was returning events, the coordinates were way off without those enviromnent vars set properly.

Attachments

    Outcomes