Page 1 of 1
SOLVED: Everything works, but only in debug mode
Posted: 19 Jul 2011, 21:42
by linuxgeek
I'm using kernel 2.6.24, udev version 100, usb-modeswitch v.1.1.7.
Everything works automatically only if I have udev running in debug mode and I have usb-modeswitch logging turned on. If either of those are NOT turned on, usb-modeswitch only works by invoking it manually.
Any suggestions on why this is happening?
Posted: 19 Jul 2011, 23:30
by Josh
Sorry, no idea, except that kernel and udev are a bit dated. There were many bug fixes in udev since that version. I believe the version is now in the 160 range ...
Posted: 19 Jul 2011, 23:54
by linuxgeek
I've got this running on an embedded processor and for code base reasons we just can't keep changing kernel versions. So really this is what I have to work with.
As far as udev, upgrading that is tricky as well because it relies on kernel headers that may or may not exist for the kernel version we're running. Getting a newer version to build may not work.
A lot of times on embedded systems we see situations like this where if you are writing things to the terminal such as during debugging that the timing changes enough to make things work. I'm guessing that's maybe what's going on here but I don't know what kind of timing that would be. Time for the device to settle?
That's the part I might need help solving.
Posted: 20 Jul 2011, 00:16
by Josh
If you suspect timing reasons, you could try to insert "after" commands in the dispatcher script. They work like "sleep" statements in bash, but take milliseconds as parameters.
"after 500" will wait for half a second.
The dispatcher is named "usb_modeswitch.tcl" before installing; it will be copied to
"/usr/sbin/usb_modeswitch_dispatcher".
Posted: 20 Jul 2011, 08:07
by linuxgeek
I believe its on the udev side, since when I run only it in debug mode, I can see that usb-modeswitch never gets kicked off. I have substituted other test programs in its place as well and they don't run either.
Still baffling.
BTW: I got udev version 135 to build and it behaves the same as version 100. Significantly newer with same results.
Posted: 20 Jul 2011, 21:14
by linuxgeek
Got things working, finally.
I introduced a 1000 ms delay in udev itself, right between the point where it gets kernel notification and it runs off and does something.
Thanks for your help Josh.
Posted: 21 Jul 2011, 00:13
by Josh
Well, I didn't really do anything ...