#202879 - 06/02/2004 21:33
Hijack v362 breaks GPSapp. :(
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
Hijack v354: Gpsapp works.
Install Hijack v362: Gpsapp says "Failed to set up serial port" when you start it and never detects the GPS.
Reinstall v354: Gpsapp works again.
Note that in both cases, "Apps use serial port" was properly selected in the Hijack menu.
|
Top
|
|
|
|
#202880 - 07/02/2004 08:16
Re: Hijack v362 breaks GPSapp. :(
[Re: tfabris]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14493
Loc: Canada
|
You'll have to narrow it down better. Was it v361 that affected this?
Also, try starting GPSapp "by hand" from kftpd SITE EXEC, and see if that makes any difference.
Cheers
|
Top
|
|
|
|
#202882 - 07/02/2004 22:59
Re: Hijack v362 breaks GPSapp. :(
[Re: mlord]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
You'll have to narrow it down better. Was it v361 that affected this? Yes.
Install v360: No error message.
Install v361: "Failed to set up serial port" error message.
Haven't tried Site Exec, gonna sign off for the night and maybe mess with it tomorrow.
|
Top
|
|
|
|
#202883 - 07/02/2004 23:04
Re: Hijack v362 breaks GPSapp. :(
[Re: tfabris]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Mark probably knows exactly what broke, but I'm looking at a diff now.
|
Top
|
|
|
|
#202884 - 08/02/2004 02:25
Re: Hijack v362 breaks GPSapp. :(
[Re: tfabris]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
v363. alpha6. Forced to "DC/Car mode" (I'm in the house). Set to "App's use serial port" (and I still dislike that apostrophe )
Works fine, I'm looking at the output on the screen. 4 satellites despite the GPS receiver being indoors.
I have
[serial]
car_rate=4800
in my config.ini. Nothing else is special.
So, I think you have some other problem?
|
Top
|
|
|
|
#202885 - 08/02/2004 02:37
Re: Hijack v362 breaks GPSapp. :(
[Re: Daria]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
|
I have, AND ALWAYS HAVE HAD...
[serial]
car_rate=115200
because otherwise I always got strange pauses and slowdowns during regular MP3 playback as the player toodles along and writes useless stuff like "seek failed" etc. to the serial port.
For some reason, the GPS works fine even if I do that. I think it's because something else throttles it down to 4800 when it needs to talk to the GPS. I never understood it, it was all FM to me.
Would be interesting to see if you get the same failure modes with that setting.
|
Top
|
|
|
|
#202886 - 08/02/2004 02:40
Re: Hijack v362 breaks GPSapp. :(
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Aha. No, it doesn't work, *when the kernel started it*. The problem before was when I attached with strace it interrupted the system call and it exited, so I reran it from the shell.
|
Top
|
|
|
|
#202887 - 08/02/2004 02:51
Re: Hijack v362 breaks GPSapp. :(
[Re: tfabris]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
GPSapp uses termios to set 4800. I used to have the strange slowdowns, but they stopped. I wonder why.
|
Top
|
|
|
|
#202888 - 08/02/2004 02:54
Re: Hijack v362 breaks GPSapp. :(
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Modified the app slightly so I can attach with strace after it's running and have the ioctl get restarted.
Now, I see:
open("/dev/ttyS1", O_RDWR|O_NONBLOCK|O_NOCTTY) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE, {B115200 opost isig icanon echo ...}) = 0
ioctl(4, TCSETS, {B4800 -opost -isig -icanon -echo ...}) = -1 EIO (Input/output error)
ioctl(4, TCFLSH, 0x2) = -1 EIO (Input/output error)
close(4) = 0
|
Top
|
|
|
|
#202889 - 08/02/2004 13:34
Re: Hijack v362 breaks GPSapp. :(
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
I have a copy of 363 checked out from CVS and I'm tweaking some stuff. If it works, I'll put it somewhere.
|
Top
|
|
|
|
#202890 - 08/02/2004 13:47
Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
It does.
http://empeg.dementia.org/v363-hacked-for-tfabris.zImage
Mark: the diff is:
--- arch/arm/special/kexec.c 26 Jan 2004 05:03:50 -0000 1.4
+++ arch/arm/special/kexec.c 8 Feb 2004 19:46:28 -0000
@@ -42,7 +42,10 @@
int i;
current->session = 1;
+#if 0
current->pgrp = 1;
+#endif
+
use_init_filesystem_context();
// Block parent process signals
why the process group matters, I'm honestly not sure.
|
Top
|
|
|
|
#202891 - 08/02/2004 19:53
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14493
Loc: Canada
|
Mmm.. good find.
Now we need to figure out why GPSapp fails with pgrp pointing at "init". Hijack will not be fixed for this -- other commands work just fine with the existing EXEC stuff, so in this case the app needs fixing.
Meanwhile, I'm off to nuke the apostrophe.
Cheers
|
Top
|
|
|
|
#202892 - 08/02/2004 19:55
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Well, you tell me why a termios ioctl should ever return EIO... Seriously, I have no idea. Other applications may work, but do any of them do termios ioctls? Do any of them use the serial port? Are you offering me an orange to compare to my apple?
|
Top
|
|
|
|
#202893 - 08/02/2004 19:58
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14493
Loc: Canada
|
Does it OPEN /dev/ttyS0 first? or just rely on stdin/stdout/stderr ??
|
Top
|
|
|
|
#202894 - 08/02/2004 20:02
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
serial_sa1100.c doesn't look like it should be returning the EIO either. The rs_ioctl routine can, but we should be calling rs_set_termios directly from tty_ioctl.c.
|
Top
|
|
|
|
#202895 - 08/02/2004 20:04
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
A thought: the serial code seems to dislike the pgrp of a process not matching that with which a serial port was opened. However, we're getting ttyS1 attached to stdout and stderr when we start.
|
Top
|
|
|
|
#202896 - 08/02/2004 20:05
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
It opens /dev/ttyS1 (not S0). If it didn't, it wouldn't work when you telnet'd in and ran it, since /dev/pty0 or whatever won't have a gps receiver on it.
|
Top
|
|
|
|
#202897 - 08/02/2004 20:08
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
In fact in this message the strace output shows the port being open()d and ioctl()d, and that's a direct excerpt.
|
Top
|
|
|
|
#202898 - 08/02/2004 20:09
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14493
Loc: Canada
|
So what happens when it opens the serial port itself, rather than relying on stdin/stdout ? (which I'm now thinking more and more about binding to /dev/null for all EXEC operations..).
Cheers
|
Top
|
|
|
|
#202899 - 08/02/2004 20:10
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
What happens is it breaks, since that's already what it's doing, and it's already breaking
Like I said, it's not relying on stdin/stdout.
|
Top
|
|
|
|
#202900 - 08/02/2004 20:11
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14493
Loc: Canada
|
A thought: the serial code seems to dislike the pgrp of a process not matching that with which a serial port was opened. However, we're getting ttyS1 attached to stdout and stderr when we start.
How about we just remove that check from the serial drivers? Try it and let me know if things work. (and.. patchfile?)
Cheers
|
Top
|
|
|
|
#202901 - 08/02/2004 20:12
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Actually, I'm tempted to bind std(in,out,err) to /dev/null with a patch and try that; I almost did that last night.
|
Top
|
|
|
|
#202902 - 08/02/2004 20:12
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14493
Loc: Canada
|
Or just close them on program startup.
|
Top
|
|
|
|
#202903 - 08/02/2004 20:14
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Yuck.
I don't recall every process getting ttyS1 for std(out,err) before 361; Is there a reason that changed?
|
Top
|
|
|
|
#202904 - 08/02/2004 20:16
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
I tried that last night, FWIW, with no luck; There's something subtle I'm missing. But every other process on the system including player also gets ttyS1 for std(out, err), which seems wrong.
|
Top
|
|
|
|
#202905 - 08/02/2004 20:28
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Right, I guess it's not serial_sa1100.c which matters because this is a tty ioctl.
But tty_ioctl itself also doesn't return EIO. That means it should be passing to n_tty_ioctl. n_tty_ioctl passes to set_termios. Neither (directly) can return EIO.
But... set_termios calls tty_check_change, where I see:
if (is_orphaned_pgrp(current->pgrp))
return -EIO;
So is 1 an orphaned pgrp? I'm still looking for the macro.
|
Top
|
|
|
|
#202906 - 08/02/2004 20:45
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Not a macro, a function in kernel/exit.c.
Wait, where are you getting "1" from, anyway?
|
Top
|
|
|
|
#202907 - 08/02/2004 20:59
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
ps -eo "%p %r %G"
shows init's process group is 0. The kernel threads have a process group id of 1. With the patch I posted, gpsapp's pgrp is 8. So is the player's. Perhaps the open serial port attached to std(in,out,err) of the player is thus not coincidental but the crux of the problem, and unbinding /dev/ttyS1 from std(in,out,err) is the answer after all.
I'll try it.
|
Top
|
|
|
|
#202908 - 08/02/2004 21:07
Re: Fix for Hijack v362 breaks GPSapp. :)
[Re: Daria]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Wait. Player has:
player 86 0 0u CHR 4,65 48 /dev/ttyS1
player 86 0 1u CHR 4,65 48 /dev/ttyS1
player 86 0 2u CHR 4,65 48 /dev/ttyS1
but this is orthogonal to the exec code. (Well, it "matters" because the pgrp is now different and wasn't before)
So fixing the exec code to use /dev/null instead of /dev/console isn't helpful.
|
Top
|
|
|
|
|
|