[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldsync-hackers] Re: Problem with ColdSync and Visor/USB



On Wed, 20 Sep 2000, Greg KH wrote:
> On Wed, Sep 20, 2000 at 11:13:07AM -0400, Andrew Arensburger wrote:
> > On Wed, 20 Sep 2000, Nicolas Bouthors wrote:
> > > Yet, there seems to be big problems. During the syncing, I have lots of
> > > "Bad CRC" messages, and whatever I try, after a few seconds of transfer,
[...]
> > 	I think this is fairly consistent. That is, if a packet is cut off
> > this way, then ColdSync won't acknowledge it, and the Visor will resend
> > it. The second, third, etc. packets will also be truncated the same
> > way. This leads me to believe that this is a software problem, and not
> > line noise.
> 
> I've seen this.  It's as if coldsync is reading the same buffer again
> and again from the tty driver.  It's strange, and I don't know what's up
> with it.

	Here's another data point. This is from a generic PC, running the
latest ColdSync snapshot, and a Palm V (not a Visor) on /dev/ttyS1, at
38400 bps. I added the "frag" messages: these show what each call to
read() reads.

Got a preamble
SLP(h) <<< be ef ed 03 03 02 01 17 d6 90                     | ......
Got a header: 3->3, type 2, size 279, xid 0xd6, sum 0x90
Good checksum
Not ignoring packet
Read SLP fragment:
frag <<< 01 c0 01 13 a0 01 00 00 a0 00 01 0b 00 83 50 44   | .............PD
frag <<< 00 36 01 01 00 05                                 | .6....
Read SLP fragment:
frag <<< 3b 3b 20 74 68 65 6f 72 79 2e 6c 69 73 70 0a 28   | ;; theory.lisp.(
frag <<< 64 0a 65 66 69 6e 65 20 2a 72 75 6c 65 73 2a 0a   | d.efine *rules*.
frag <<< 20 79 28 29 20 28 63 61 74 20 3f 78 29 28 66 69   |  y() (cat ?x)(fi
frag <<< 73 68                                             | sh
Read SLP fragment:
frag <<< 61 ef 6c 69 63 6f 20 3f 78 29 29 0a 20 20 20 20   | alico ?x)).    
frag <<< 28 75 6e 61 20 3f 78 29 29 0a 20 20 20 20 28 28   | (una ?x)).    ((
frag <<< 74 75 6e 61 20 63 68 61 72                        | tuna char
Read SLP fragment:
frag <<< 6c 69 65 29 29 0a 20 20 20 20 28 28 74 75 6e 61   | lie)).    ((tuna
frag <<< 20 68 65 72 62 29 29 0a 20 20 20 20 28 28 63 61   | herb)).    ((ca
frag <<< 6c 69 63 6f 20 6b 69 74 74 79 29 29               | lico kitty))
Read SLP fragment:
frag <<< 29 29 0a 28 64 65 66 69 6e 65 20 28 74 65 73 74   | )).(define (test
frag <<< 29 20 28 70 72 6f 76 65 20 27 28 28 6c 69 6b 65   | ) (prove '((like
Read SLP fragment:
frag <<< 73 2d 74 6f 2d 65 61 74 20 3f 78 20 3f 79 29 29   | s-to-eat ?x ?y))
frag <<< 20 2a 72 75 6c 65 73 2a 29 29 0a 00 56 75         | *rules*))..Vu
Read SLP fragment:
frag <<< be ef ed 03 03 02 01 17 d6 90 01 c0 01 13 a0 01   | ...........
frag <<< 00 00 a0 00 01 0b 00 83 50 44 00 36 01 01 00 05   | ........PD.6....
Read SLP fragment:
frag <<< 3b 3b 20 74 68 65 6f 72 79 2e 6c 69 73 70 0a 28   | ;; theory.lisp.(
frag <<< 64 65 66 69 6e 65 20 2a 72 75 6c 65               | define *rule
SLP(b) <<< 01 c0 01 13 a0 01 00 00 a0 00 01 0b 00 83 50 44   | .............PD
SLP(b) <<< 00 36 01 01 00 05 3b 3b 20 74 68 65 6f 72 79 2e   | .6....;; theory.
SLP(b) <<< 6c 69 73 70 0a 28 64 0a 65 66 69 6e 65 20 2a 72   | lisp.(d.efine *r
SLP(b) <<< 75 6c 65 73 2a 0a 20 79 28 29 20 28 63 61 74 20   | ules*. y() (cat 
SLP(b) <<< 3f 78 29 28 66 69 73 68 61 ef 6c 69 63 6f 20 3f   | ?x)(fishalico ?
SLP(b) <<< 78 29 29 0a 20 20 20 20 28 75 6e 61 20 3f 78 29   | x)).    (una ?x)
SLP(b) <<< 29 0a 20 20 20 20 28 28 74 75 6e 61 20 63 68 61   | ).    ((tuna cha
SLP(b) <<< 72 6c 69 65 29 29 0a 20 20 20 20 28 28 74 75 6e   | rlie)).    ((tun
SLP(b) <<< 61 20 68 65 72 62 29 29 0a 20 20 20 20 28 28 63   | a herb)).    ((c
SLP(b) <<< 61 6c 69 63 6f 20 6b 69 74 74 79 29 29 29 29 0a   | alico kitty)))).
SLP(b) <<< 28 64 65 66 69 6e 65 20 28 74 65 73 74 29 20 28   | (define (test) (
SLP(b) <<< 70 72 6f 76 65 20 27 28 28 6c 69 6b 65 73 2d 74   | prove '((likes-t
SLP(b) <<< 6f 2d 65 61 74 20 3f 78 20 3f 79 29 29 20 2a 72   | o-eat ?x ?y)) *r
SLP(b) <<< 75 6c 65 73 2a 29 29 0a 00 56 75 be ef ed 03 03   | ules*))..Vu..
SLP(b) <<< 02 01 17 d6 90 01 c0 01 13 a0 01 00 00 a0 00 01   | ..............
SLP(b) <<< 0b 00 83 50 44 00 36 01 01 00 05 3b 3b 20 74 68   | ...PD.6....;; th
SLP(b) <<< 65 6f 72 79 2e 6c 69 73 70 0a 28 64 65 66 69 6e   | eory.lisp.(defin
SLP(b) <<< 65 20 2a 72 75 6c 65                              | e *rule
SLP(c) <<< 73 2a                                             | s*
Got CRC
SLP: bad CRC: expected 0x75fa, got 0x732a

	This happened during a slow sync of MemoDB.pdb. The record really
reads:
	;; theory.lisp
	(define *rules*
	  '((<= (likes-to-eat ?x ?y) (cat ?x)(fish ?y))
	    (<= (cat ?x) (calico ?x))
	    (<= (fish ?x) (tuna ?x))
	    ((tuna charlie))
	    ((tuna herb))
	    ((calico kitty))))
	(define (test) (prove '((likes-to-eat ?x ?y)) *rules*))

If you read back through the hex dump on the right, you'll see that
characters are being dropped. Hence, ColdSync doesn't read the right
checksum (it grabs two bytes at random from the next packet), and
complains.

	This all comes from "libpconn/slp.c" (grep for "/* Read the body
*/"). The only thing that is happening here is read(), pointer addition,
and integer subtraction.

	Also, the fact that ColdSync seems to be reading the same packet
over and over might not be a problem with the serial or USB
drivers: according to the SLP (low-level) protocol, the Palm sends a
packet to ColdSync; in this case, ColdSync sees that it has a bad CRC, so
it fails to acknowledge it. The Palm notices that it hasn't received an
acknowledgement, and resends the packet.

> And if you see that there is a problem in the usb-to-serial translation,
> _please_ let me know.

	I'm seeing this under Linux, with just the plain serial port. I'm
not all that familiar with Linux internals, so if anyone has anything to
suggest, I'm all ears.

-- 
Andrew Arensburger                      Actually, these _do_ represent the
arensb@ooblick.com                      opinions of ooblick.com!
                        Generic Tagline V 6.01


--
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.