Teensyduino 1.56 Beta #1

Status
Not open for further replies.
@Paul:
Uploaded the code here : https://github.com/FrankBoesing/cdcbench
It just prints everything with line length != 10 and counts the lines between - pretty simple.
See above
smile.png
.. was Post #142

It reads pretty fast from serial, but prints only a small part (The MBit/s from my sketch). If you see anything else printed, it's one of the two issues - either the Windows bug (garbage) - or the missing data problem.

This way, it shows missing packets.
@Tim, the USB Packets are 512 Bytes :) Tim, which usb_serial.c do you use for your tests? Can we concentrate on my version? We already know that the original has problems - does not need more tests...
 
Sorry, Frank, I might be being a bit pernickety but should not this line in SpeedTest.ino
Code:
  Serial.printf("%d Bytes in %d us = %0.2f Megabits per second\n", n * size, t, n * size * 8 / (double)t);
be a divide by 10, not 8, to allow for start and stop bits.
Please explain to me if I am wrong.

USB has no start and stop bits (and no parity) - it transfers plain bytes.
USB has a hardware-CRC anyway, so the frame is not needed.
 
USB 2.0 at 480 MBit speed bulk transfer has 55 bytes of fixed protocol overhead per packet, plus additional data-dependent bit stuffing overhead. Bit stuffing inserts an extra bit for every place where 6 consecutive 0 or 1 bits occur. In a worst case scenario, bit stuffing could add ~85 extra bytes of overhead for an all 0x00 or all 0xFF data packet.

Theoretically 13 maximum size 512 data packets without any bit stuffing are supposed to be able to fit into each 125 us micro-frame, for a best-case speed of 53,248,000 bytes/sec. With moderate bit stuffing, 12 packets per micro-frame is probably the maximum, for 49,152,000 bytes/sec, but 11 or only 10 packets might fit into a micro-frame if bit stuffing adds a lot of overhead.

Occasionally zero length packets are also transmitted, having the same 55 byte protocol overhead. The ZLP setting is one of the extremely low priority issues on my list. With Teensy 3 sending a ZLP is an explicit operation. We send a ZLP from the autoflush function. But the EHCI controller does ZLP automatically, which may not be the most optimal way, since a ZLP or less-than-512 packet forces the host controller to receive an interrupt and process incoming data. Ideally we would only want to send a ZLP from autoflush timeout, and only if previously transmitted data didn't leave any bytes to send as a short packet.

I have wondered if we could turn off the automatic ZLP bit in the QH structure, and then write the autoflush function to only send a ZLP when absolutely necessary. This is a tricky problem because it manifests as the PC not receiving data in a timely manner only when the previously transmitted date happen to be an exact multiple 512 byte packets.
 
@Paul:

See above
smile.png
.. was Post #142

It reads pretty fast from serial, but prints only a small part (The MBit/s from my sketch). If you see anything else printed, it's one of the two issues - either the Windows bug (garbage) - or the missing data problem.

This way, it shows missing packets.
@Tim, the USB Packets are 512 Bytes :) Tim, which usb_serial.c do you use for your tests? Can we concentrate on my version? We already know that the original has problems - does not need more tests...

@Frank - had reverted to TD1.56b1 usb_serial.c, will go back to your test version to compare. Would be good if you put it on github rather than finding in forum?

Ran overnight here: this version of Frank's : https://github.com/defragster/cdcbench
2141 copies of some version of this: Lines-Delta: 100000. Received: 6400000 Bytes in 241461 us = 212.04 Megabits per second
Where each represents 50 transfers of 100,000 sets of 64 bytes:
> 2131 of them show correct Lines-Delta: 100000
> 5 of them show Lines-Delta: 99984.
> The rest seem to be interruptions from 'Select and Copy'

@Frank - your posted serialtest.exe works fine with a "| TEE afile.txt" I downloaded, but when I build it piping to tee '| TEE afile.txt' result in it doing nothing? Not sure why?

11:10 AM - running with the "...\teensy4\usb_serial.c"
>> Has lots of added :: asm("dsb" ::: "memory");

NOTE: PRIOR EDITS were to WRONG source file! I have NOT tested this code before!
 
Last edited:
Testing with edited usb_serial.c - seeing more misses already? Not even at machine doing anything to interfere?
Stopping and restarted : out of first 30 sets of 50, SIX showing the #99984 with 16 missing! So this is not an improvement, more misses in 30 just now than in 2100 overnight.
<edit> restored the td1.56b1 usb_serial.c and seeing more 'misses' already here too - maybe the machine is being multi-tasked more with WEB I/O or something. - but it is no better or worse? Both are dropping in multiples of 256, usually a full 512B multiple
Code:
C:\T_Drive\tCode\pjrc_latency_test\FB_SerTest>serialtestT.exe COM19
Port: \\.\COM19
After start, you'll probably see some garbage. Things will normalize after a few seconds.
Waiting...Start.

Lines-Delta: 111. Received: 13579abcdefghijklmnopqrstuvwxyz_02468ABCDEFGHIJK13579abcdefghijklmnopqrstuvwxyz_02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 45278. Received: 6400000 Bytes in 116814 us = 438.30 Megabits per second
.
Lines-Delta: 100000. Received: 6400000 Bytes in 242617 us = 211.03 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241504 us = 212.00 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241891 us = 211.67 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242337 us = 211.28 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 244242 us = 209.63 Megabits per second
.
Lines-Delta: 99984. Received: 6400000 Bytes in 237339 us = 215.73 Megabits per second
.................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241820 us = 211.73 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 228733 us = 223.84 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 271271 us = 188.74 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 234254 us = 218.57 Megabits per second
..............................................
Lines-Delta: 99984. Received: 6400000 Bytes in 242768 us = 210.90 Megabits per second
....
Lines-Delta: 100000. Received: 6400000 Bytes in 238009 us = 215.12 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241279 us = 212.20 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236743 us = 216.27 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238287 us = 214.87 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241506 us = 212.00 Megabits per second
...........................................
Lines-Delta: 99984. Received: 6400000 Bytes in 233294 us = 219.47 Megabits per second
.......
Lines-Delta: 100000. Received: 6400000 Bytes in 269933 us = 189.68 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237561 us = 215.52 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 234419 us = 218.41 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243016 us = 210.69 Megabits per second
.....................................
Lines-Delta: 99984. Received: 6400000 Bytes in 245701 us = 208.38 Megabits per second
.............
Lines-Delta: 100000. Received: 6400000 Bytes in 241358 us = 212.13 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241505 us = 212.00 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245646 us = 208.43 Megabits per second
................
Lines-Delta: 99984. Received: 6400000 Bytes in 280943 us = 182.24 Megabits per second
..................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242154 us = 211.44 Megabits per second
....................................
Lines-Delta: 99984. Received: 6400000 Bytes in 249160 us = 205.49 Megabits per second
..............
Lines-Delta: 100000. Received: 6400000 Bytes in 241698 us = 211.83 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 234126 us = 218.69 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242112 us = 211.47 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243574 us = 210.20 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 270046 us = 189.60 Megabits per second
................................
Lines-Delta: 99984. Received: 6400000 Bytes in 351807 us = 145.53 Megabits per second
..................
Lines-Delta: 100000. Received: 6400000 Bytes in 241592 us = 211.93 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241743 us = 211.80 Megabits per second
........................
Lines-Delta: 99968. Received: 6400000 Bytes in 248078 us = 206.39 Megabits per second
..........................
Lines-Delta: 100000. Received: 6400000 Bytes in 245584 us = 208.48 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245306 us = 208.72 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 271979 us = 188.25 Megabits per second
......................

This is with the TD 1.56b1 usb_serial.c restored - Recompiled and looking good:
Code:
C:\T_Drive\tCode\pjrc_latency_test\FB_SerTest>serialtestT.exe COM19
Port: \\.\COM19
After start, you'll probably see some garbage. Things will normalize after a few seconds.
Waiting...Start.

Lines-Delta: 95. Received: 13579abcdefghijklmnopqrstuvwxyz_02468ABCDEFGHIJKLMNOPQRST13579abcdefghijklmnopqrstuvwxyz_02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 58298. Received: 6400000 Bytes in 138471 us = 369.75 Megabits per second
.
Lines-Delta: 100000. Received: 6400000 Bytes in 240581 us = 212.82 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241708 us = 211.83 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 270244 us = 189.46 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245178 us = 208.83 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237117 us = 215.93 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233657 us = 219.12 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245952 us = 208.17 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242147 us = 211.44 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 377933 us = 135.47 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 248595 us = 205.96 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 247106 us = 207.20 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 280780 us = 182.35 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 246598 us = 207.63 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233161 us = 219.59 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 356777 us = 143.51 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 244994 us = 208.98 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 352613 us = 145.20 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242076 us = 211.50 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241452 us = 212.05 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245797 us = 208.30 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 352682 us = 145.17 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243960 us = 209.87 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 234171 us = 218.64 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236023 us = 216.93 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 254997 us = 200.79 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 239659 us = 213.64 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238804 us = 214.40 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236775 us = 216.24 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 239281 us = 213.97 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 244178 us = 209.68 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242323 us = 211.29 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241682 us = 211.85 Megabits per second
.
Lines-Delta: 99976. Received: 6400000 Bytes in 245242 us = 208.77 Megabits per second
.................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 235289 us = 217.60 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238640 us = 214.55 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240918 us = 212.52 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 291085 us = 175.89 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 247194 us = 207.12 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 244696 us = 209.24 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243982 us = 209.85 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237507 us = 215.57 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 232613 us = 220.11 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245107 us = 208.89 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241986 us = 211.58 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240483 us = 212.90 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 234533 us = 218.31 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241231 us = 212.24 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243553 us = 210.22 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241290 us = 212.19 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 232130 us = 220.57 Megabits per second
..
Lines-Delta: 99984. Received: 6400000 Bytes in 312464 us = 163.86 Megabits per second
................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240194 us = 213.16 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 246496 us = 207.71 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 265820 us = 192.61 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241690 us = 211.84 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241980 us = 211.59 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242286 us = 211.32 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236786 us = 216.23 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236398 us = 216.58 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240011 us = 213.32 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242181 us = 211.41 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 306495 us = 167.05 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 272166 us = 188.12 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 271525 us = 188.56 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242927 us = 210.76 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241635 us = 211.89 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237302 us = 215.76 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237985 us = 215.14 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242645 us = 211.01 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 235562 us = 217.35 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 234152 us = 218.66 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 275678 us = 185.72 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233144 us = 219.61 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243802 us = 210.01 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233362 us = 219.40 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241471 us = 212.03 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240335 us = 213.04 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240357 us = 213.02 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 349443 us = 146.52 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236579 us = 216.42 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 255992 us = 200.01 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 235482 us = 217.43 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241171 us = 212.30 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242545 us = 211.09 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233317 us = 219.44 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 246878 us = 207.39 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 293179 us = 174.64 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 247950 us = 206.49 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245818 us = 208.28 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 263307 us = 194.45 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 276685 us = 185.05 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240454 us = 212.93 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240805 us = 212.62 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240146 us = 213.20 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243310 us = 210.43 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 331720 us = 154.35 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 242501 us = 211.13 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 239680 us = 213.62 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 241116 us = 212.35 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240586 us = 212.81 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240817 us = 212.61 Megabits per second
..................................................
 
Last edited:
Oh my..
Can't reproduce that as I see only a very very few missing data.. I believe you, but must find a way to produce these errors.

Hm. Anyway, that obviosly means there is still a todo :(

Good night.
 
Oh my..
Can't reproduce that as I see only a very very few missing data.. I believe you, but must find to a way to produce these errors.

Hm. Anyway, that obviosly means there is still a todo :(

Wondering if the added conditionals in the 'c' code are messing with the timing? Or it could be your Ryzen box is better at USB than my 'faster' Intel i7?

Just updated Github and did another PR - Merge Conflict in my code?

With Dual Serial:
Added USB Output from serialTestT.c to Teensy that shows on USB1 : "Hello World - from serialTest"
'Send' on USB1 prints STATS on Mb/sec on USB1
Edited Byte count - it was 65 not 64 - including NewLine sent but not counted in receive.

Current status: Some runs starts horribly. More to do - but now now:
Code:
count=3888	Send sec =771.80
 >> Call by USB==1 or USB1==2 :: 2
Mb/sec 110 up to 120 = 3
Mb/sec 120 up to 130 = 4
Mb/sec 130 up to 140 = 11
Mb/sec 140 up to 150 = 23
Mb/sec 150 up to 160 = 37
Mb/sec 160 up to 170 = 49
Mb/sec 170 up to 180 = 65
Mb/sec 180 up to 190 = 73
Mb/sec 190 up to 200 = 97
Mb/sec 200 up to 210 = 385
Mb/sec 210 up to 220 = 2055
Mb/sec 220 up to 230 = 222
Mb/sec 230 up to 240 = 2
Mb/sec 240 up to 250 = 1
Mb/sec 290 up to 300 = 1
Mb/sec 340 up to 350 = 1
Mb/sec 370 up to 380 = 1
Mb/sec 480 up to 490 = 1
Bogus Speed calcs = 857

This is with TD1.56b1 ( changing to the usb_serial.c edit I got to let run - update later ):
Code:
Lines-Delta: 100000. Received: 6400000 Bytes in 239297 us = 213.96 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 244669 us = 209.26 Megabits per second
.........
Lines-Delta: 28121. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEFWXYZ

Lines-Delta: 71862. Received: 6400000 Bytes in 244077 us = 209.77 Megabits per second
.........................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237937 us = 215.18 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 245151 us = 208.85 Megabits per second
.....................
Lines-Delta: 3529. Received: 13nopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 96454. Received: 6400000 Bytes in 240960 us = 212.48 Megabits per second
.............................
Lines-Delta: 100000. Received: 6400000 Bytes in 237139 us = 215.91 Megabits per second
....
Lines-Delta: 51225. Received: 13579abcdefghijklmnopqrstuvwxyz024OPQRSTUVWXYZ

Lines-Delta: 48758. Received: 6400000 Bytes in 377111 us = 135.77 Megabits per second
..............................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237661 us = 215.43 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 235770 us = 217.16 Megabits per second
..
Lines-Delta: 12680. Received: 13579abcduvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 87303. Received: 6400000 Bytes in 244577 us = 209.34 Megabits per second
...............................................
Lines-Delta: 2291. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPabcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 97691. Received: 6400000 Bytes in 268319 us = 190.82 Megabits per second
.
Lines-Delta: 100000. Received: 6400000 Bytes in 243410 us = 210.34 Megabits per second
..................................................

Quickly showing similar with the edited usb_serial.c for the sketch?
Code:
Lines-Delta: 40641. Received: 6400000 Bytes in 293270 us = 174.58 Megabits per second
....
Lines-Delta: 100000. Received: 6400000 Bytes in 235070 us = 217.81 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237107 us = 215.94 Megabits per second
...............................
Lines-Delta: 8820. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIZ

Lines-Delta: 91163. Received: 6400000 Bytes in 241163 us = 212.30 Megabits per second
...................
Lines-Delta: 100000. Received: 6400000 Bytes in 231085 us = 221.56 Megabits per second
...................
Lines-Delta: 34834. Received: 13579abcdefghijklmnopqrstuvwxyz0246PQRSTUVWXYZ

Lines-Delta: 65149. Received: 6400000 Bytes in 237913 us = 215.20 Megabits per second
.....................
Lines-Delta: 7710. Received: 13579abcdefghijklmnopqrstuvwxyzLMNOPQRSTUVWXYZ

Lines-Delta: 92273. Received: 6400000 Bytes in 230650 us = 221.98 Megabits per second
..........
Lines-Delta: 100000. Received: 6400000 Bytes in 357668 us = 143.15 Megabits per second
...
Lines-Delta: 92758. Received: 13579ab02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 7217. Received: 6400000 Bytes in 235166 us = 217.72 Megabits per second
...............................................
Lines-Delta: 100000. Received: 6400000 Bytes in 234005 us = 218.80 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 239888 us = 213.43 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237256 us = 215.80 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 232705 us = 220.02 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 230791 us = 221.85 Megabits per second
..
Lines-Delta: 63572. Received: 13579abcdefghijklmnopJKLMNOPQRSTUVWXYZ

Lines-Delta: 36403. Received: 6400000 Bytes in 242046 us = 211.53 Megabits per second
..................
Lines-Delta: 52461. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABSTUVWXYZ

Lines-Delta: 47522. Received: 6400000 Bytes in 233304 us = 219.46 Megabits per second
..............................
Lines-Delta: 100000. Received: 6400000 Bytes in 239880 us = 213.44 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 235649 us = 217.27 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 232675 us = 220.05 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236566 us = 216.43 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 239152 us = 214.09 Megabits per second
.
Lines-Delta: 51024. Received: 13579abcduvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 48959. Received: 6400000 Bytes in 236202 us = 216.76 Megabits per second
.................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237818 us = 215.29 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237195 us = 215.86 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238423 us = 214.74 Megabits per second
........
Lines-Delta: 81728. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEVWXYZ

Lines-Delta: 18255. Received: 6400000 Bytes in 345688 us = 148.11 Megabits per second
..........................................
Lines-Delta: 100000. Received: 6400000 Bytes in 235071 us = 217.81 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233914 us = 218.88 Megabits per second

Lines-Delta: 26935. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDUVWXYZ

Lines-Delta: 73048. Received: 6400000 Bytes in 234900 us = 217.97 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 232298 us = 220.41 Megabits per second
 
Windows and multitasking must be a big factor. Frank's test ... with edits ... seems a good verification test.

Teensy has been running some time ... show it has a high set of counts and previous stats, included below.

Restarted the .EXE and 62 complete sets of ( 50 * 100K ) * 64 bytes with No Errors. And it started clean - only crossed two sets with errors, sometimes it does dozens to get in sync.

USB1 Teensy Stats below - there is some many cases where it gets a bad Mb/sec calc:
Code:
  int idx = (n * szSize * 8 / t) / 10;
  if ( idx > 49 ) idx = 49;
Code:
[B]count=22715	Send sec =4624.39[/B]
 >> Call by USB==1 or USB1==2 :: 2
Mb/sec 120 up to 130 = 8
Mb/sec 130 up to 140 = 43
Mb/sec 140 up to 150 = 126
Mb/sec 150 up to 160 = 127
Mb/sec 160 up to 170 = 170
Mb/sec 170 up to 180 = 244
Mb/sec 180 up to 190 = 379
Mb/sec 190 up to 200 = 551
Mb/sec 200 up to 210 = 676
Mb/sec 210 up to 220 = 12399
Mb/sec 220 up to 230 = 3959
Mb/sec 230 up to 240 = 66
Mb/sec 240 up to 250 = 1
Mb/sec 280 up to 290 = 2
Mb/sec 290 up to 300 = 1
Mb/sec 300 up to 310 = 1
Mb/sec 310 up to 320 = 1
Mb/sec 340 up to 350 = 1
Mb/sec 390 up to 400 = 1
Mb/sec 470 up to 480 = 1
[B]Bogus Speed calcs = 3958[/B]

Code:
Port: \\.\COM19
After start, you'll probably see some garbage. Things will normalize after a few seconds.
Waiting...Start.

Lines-Delta: 129. Received: 13579a13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 86487. Received: 6400000 Bytes in 212196 us = 241.29 Megabits per second
.
Lines-Delta: 100000. Received: 6400000 Bytes in 231139 us = 221.51 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 277540 us = 184.48 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236676 us = 216.33 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 235908 us = 217.03 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237578 us = 215.51 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237414 us = 215.66 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 274514 us = 186.51 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 229454 us = 223.14 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238683 us = 214.51 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237052 us = 215.99 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 228545 us = 224.03 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 249327 us = 205.35 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238527 us = 214.65 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237151 us = 215.90 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237065 us = 215.97 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236456 us = 216.53 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 287983 us = 177.79 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 231892 us = 220.79 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236535 us = 216.46 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236430 us = 216.55 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233826 us = 218.97 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 243983 us = 209.85 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236773 us = 216.24 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237032 us = 216.00 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 229469 us = 223.12 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 229735 us = 222.87 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 258390 us = 198.15 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233936 us = 218.86 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237730 us = 215.37 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233828 us = 218.96 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 232162 us = 220.54 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 258413 us = 198.13 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237392 us = 215.68 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236859 us = 216.16 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237160 us = 215.89 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237068 us = 215.97 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 256445 us = 199.65 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 232563 us = 220.16 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238032 us = 215.10 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237638 us = 215.45 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237400 us = 215.67 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 283057 us = 180.88 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238109 us = 215.03 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 230072 us = 222.54 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 231627 us = 221.05 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237532 us = 215.55 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237495 us = 215.58 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 231638 us = 221.03 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237775 us = 215.33 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236902 us = 216.12 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 231081 us = 221.57 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 233283 us = 219.48 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238328 us = 214.83 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237424 us = 215.65 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238234 us = 214.91 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236132 us = 216.83 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 236149 us = 216.81 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 237376 us = 215.69 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 239556 us = 213.73 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 239046 us = 214.18 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 240909 us = 212.53 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 238609 us = 214.58 Megabits per second
............................................

Doing the 'select all and Copy' above generated these errors as the .EXE gets halted for the user select. but it recovered perfectly, until this was copied:
> then it blipped - ran and blipped one more time to recovered to perfect.
Code:
Lines-Delta: 100000. Received: 6400000 Bytes in 238609 us = 214.58 Megabits per second
.............................................
Lines-Delta: 6263. Received: 13579abcdefghijklmnopqrDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 113. Received: 13579abcdefghijklmnopqrst13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 15732. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQbcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

Lines-Delta: 75036. Received: 6400000 Bytes in 228362 us = 224.21 Megabits per second
.....
Lines-Delta: 100000. Received: 6400000 Bytes in 313834 us = 163.14 Megabits per second
..................................................

<EDIT> :: Summary update 1350 completed "Lines-Delta" since last restart

1270 were sets of 50 * 100K

NONE were 99984

62 were some variation on broken line:
Lines-Delta: 72590. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCLMNOPQRSTUVWXYZ
 
Last edited:
Good Morning Tim!

Is it probably due to your use of a 2nd serial?
That code is not patched. Usb_serial2 / usb_serial3.

Connected a SD Card reader to the same USB-controller. Copied some Gigabytes. But all what happens is that the speed goes down. No missing data.. Hm
Normally 255..260Mbits, with concurrent file copy ~150MBit
Even changed the process priority to low. Ok, the cpu% is <2% anyway, so i wouldn't exepct any influence.
Still I see missing data during the first ~30 seconds only. No chance to reproduce it and after that it is rock stable on my PC.
We can probably fix the first seconds, too, but let's check that step after step... one thing at a time.

Wonder if a high speed serial transfer can influences MTP - broken files?
Edit: Or vice versa.

Edit: Changes the line-length in my program to 64 Bytes. Same Speed, still no missing data, no garbage... hm...

Edit: Lowered the Teensy MHZ to 24. Transfer is ~19.4MBit.. still no missing data. Same with overclocked to 816.. :(
Can you pleasy use with one serial only? - And with my usb_serial only. Otherwise we'll never find out what happens.
Do you use a HUB?

Not sure what I can try more :(
 
Last edited:
Good Morning Tim!

Is it probably due to your use of a 2nd serial?
That code is not patched. Usb_serial2 / usb_serial3.

Connected a SD Card Reader to the same USB-Controller. Copied some Megabytes. But all what happens is that the speed goes down. No missing data.. Hm

Dual Serial was giving stats average about 215 Mb/sec

Recompiled for USB=Serial and it did jump toward 230 Mb/sec average? { had to make an edit to sketch as one USB1 not under #ifdef }

Each gets their own buffer space - when not doing I/O assumed the USB and USB1 were mostly independent?

Assumed it may slow the Teensy down - but not cause any traffic problems for a few USB1 hundred bytes?

Though just now it might be more stable ? Though with Dual Serial some runs were perfect too. Was trying to use the web.

Current run on PC last stats shows 4001 sets of 100K packets and only 17 broken sets of 100K, where 5 of the 17 were secondary breaks in the same group.
> next stats up to 8001 sets of 100K - none came up short.
 
Didn't see that go by ... might have better known what your change was doing.

Does having USB1 active with Dual Serial break/compromise anything in USB Serial when it is inactive?

There is no active SPEW on USB1 - and only short messages when prompted with input.
 
I'm not sure. But it makes no sense to works with code that has known bugs. I only want to see problems with my new code. Otherwise, it will only distract us and lead us down the wrong path.

Tim, you also mus look if the error is the windows bug. Unfortunately we fight with two issues.
Currently, we ONLY look at missing data.
It can still be that the windows bug occurs - the serialtest reports that, too. But it is important to see the difference. Fixing the windows bug is out of scope...
 
I have seen this now:
Code:
Lines-Delta: 100000. String: 6400000 Bytes in 198741 us = 257.62 Megabits per second
Lines-Delta: 48655. String: abcd01234"bucket_count":100,"histogram_type":0,"sum":380,"range":[1,60000],"values":{"328":0,"362":1,"399":0}}},"WEBEXT_BROWSERACTION_POPUP_PRELOAD_RESULT_COUNT_BY_ADDONID":{"woop-NoopscooPsnSXQ@jetpack":{"bucket_count":51,"histogram_type":5,"sum":2,"rangeLines-Delta: 50368. String: 6400000 Bytes in 199815 us = 256.24 Megabits per second
Lines-Delta: 100000. String: 6400000 Bytes in 199201 us = 257.03 Megabits per second
Lines-Delta: 100000. String: 6400000 Bytes in 199656 us = 256.44 Megabits per second
This means Windows copies even memory that is from other programs. A Firefox plugin(?) in this case.
 
Last edited:
Ok,

the "scroll back" problem: Found that it's just a Timeout on the Teensy! If you scrollback the serialtest.exe window, the program stops - windows buffer will be filled but not read - then, teensy can't send and goes into timout state. The Garbage printed after that is a result of the Windows problem, no buffer issue on Teensy.

So, nothing to fix here. We can't fix a PC-Softwareproblem on Teensy.
 
So, I'll pause this now. Can't reproduce any problem re: missing data on my machine anymore. Will wait until Paul tests my fix on Mac&Linux, and fixes usb_serial2 and usb_serial3 and adds the memory barrier in yield() (and perhaps way more places in the core which need memory barriers)

@Paul, please use usb_serial.c copy on github. Or do your own fix. Thx.

After that, we might try to find a workaround for a least a few cases of "garbage" - but there is no chance to fix them all - at least the "garbage after scrollback" problem is unfixable from Teensy side.
Maybe it makes sense to use a faster timeout.

Maybe we can make a "Howto" with hints to reduce them in PC Software. Could be a thread that trys to keep reading data (and keeps emptying the windows buffers) even if somethings stalls..
This might be away to reduce the Teensy Serial Monitor garbage, too. Read as fast as much as possible (minimum 1MB buffer), regardless if gets printed later or not. Better the monitor deletes buffers than Windows does it (wrong).. ;)

Have fun,
Frank



Finally, here is a nice stylesheet:
Code:
Lines-Delta: 0. String:         role="button"
Lines-Delta: 0. String:         aria-disabled="☺ Qf╬©^a¶Lines-Delta: 0. String:         tabindex="☺ Qf♠│;┘◄Lines-Delta: 0. String:         class="Lines-Delta: 0. String:     >
Lines-Delta: 0. String:         ♦¢↑☺ Qfó↑       [◄Lines-Delta: 0. String:     </template>
Lines-Delta: 0. String: Lines-Delta: 0. String: Lines-Delta: 0. String:                 <span part="next" class="next">
Lines-Delta: 0. String:                     <slot name="next">
Lines-Delta: 0. String:                         <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
Lines-Delta: 0. String:                             <path
Lines-Delta: 0. String:                                 d="M4.023 15.273L11.29 8 4.023.727l.704-.704L12.71 8l-7.984 7.977-.704-.704z"
Lines-Delta: 0. String:                             />
Lines-Delta: 0. String:                         </svg>
Lines-Delta: 0. String:                     </slot>
Lines-Delta: 0. String:                 </span>
Lines-Delta: 0. String:             Lines-Delta: 0. String:                 <span part="previous" class="previous">
Lines-Delta: 0. String:                     <slot name="previous">
Lines-Delta: 0. String:                         <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
Lines-Delta: 0. String:                             <path
Lines-Delta: 0. String:                                 d="M11.273 15.977L3.29 8 11.273.023l.704.704L4.71 8l7.266 7.273-.704.704z"
Lines-Delta: 0. String:                             />
Lines-Delta: 0. String:                         </svg>
Lines-Delta: 0. String:                     </slot>
Lines-Delta: 0. String:                 </span>
Lines-Delta: 0. String:             ♦↓+♦═♠♦Ð♠☺►Qb.GÈã♦Lines-Delta: 0. String:         width: calc(Lines-Delta: 0. String:         height: calc(Lines-Delta: 0. String:         justify-content: center;
Lines-Delta: 0. String:         align-items: center;
Lines-Delta: 0. String:         margin: 0;
Lines-Delta: 0. String:         position: relative;
Lines-Delta: 0. String:         fill: currentcolor;
Lines-Delta: 0. String:         color: Lines-Delta: 0. String:         background: transparent;
Lines-Delta: 0. String:         border: none;
Lines-Delta: 0. String:         outline: none;
Lines-Delta: 0. String:         padding: 0;
Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host::before {
Lines-Delta: 0. String:         content: "";
Lines-Delta: 0. String:         opacity: 0.8;
Lines-Delta: 0. String:         background: Lines-Delta: 0. String:         border: calc(var(--outline-width) * 1px) solid Lines-Delta: 0. String:         border-radius: 50%;
Lines-Delta: 0. String:         position: absolute;
Lines-Delta: 0. String:         top: 0;
Lines-Delta: 0. String:         right: 0;
Lines-Delta: 0. String:         left: 0;
Lines-Delta: 0. String:         bottom: 0;
Lines-Delta: 0. String:         transition: all 0.1s ease-in-out;
Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     .next,
Lines-Delta: 0. String:     .previous {
Lines-Delta: 0. String:         position: relative;
Lines-Delta: 0. String:         ☺êQ☼äéÊ¡░|Lines-Delta: 0. String:         height: 16px;
Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host(.disabled) {
Lines-Delta: 0. String:         opacity: var(--disabled-opacity);
Lines-Delta: 0. String:         cursor: ☺|Q}▲♦.amLines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host(:hover) {
Lines-Delta: 0. String:         cursor: pointer;
Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host(:hover)::before {
Lines-Delta: 0. String:         background: Lines-Delta: 0. String:         border-color: ☺ Qf▓╩g.¶Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host(:☺<Qm"`>█-Lines-Delta: 0. String:         outline: none;
Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host(:Lines-Delta: 0. String:         box-shadow: 0 0 0 1px Lines-Delta: 0. String:         border-color: Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host(:active)::before {
Lines-Delta: 0. String:         background: Lines-Delta: 0. String:     }
Lines-Delta: 0. String:
Lines-Delta: 0. String:     :host::-moz-focus-inner {
Lines-Delta: 0. String:         border: 0;
Lines-Delta: 0. String:     }
Lines-Delta: 0. String: ♦-+♦)♦1♦ı'♦             ♦░I♦♦¼♦í§♣Lines-Delta: 0. String:             :host {
Lines-Delta: 0. String:                 background: Lines-Delta: 0. String:             }
Lines-Delta: 0. String:             :host .next,
Lines-Delta: 0. String:             :host .previous {
Lines-Delta: 0. String:                 color: Lines-Delta: 0. String:                 fill: currentcolor;
Lines-Delta: 0. String:             }
Lines-Delta: 0. String:             :host::before {
Lines-Delta: 0. String:                 background: ☺,QiBc☺╬ Lines-Delta: 0. String:                 border-color: ☺êQ☼äb╠◄${Lines-Delta: 0. String:             }
Lines-Delta: 0. String:             :host(:hover)::before {
Lines-Delta: 0. String:                 forced-color-adjust: none;
Lines-Delta: 0. String:                 background: Lines-Delta: 0. String:                 opacity: 1;
Lines-Delta: 0. String:             }
Lines-Delta: 0. String:             :host(:hover) .next,
Lines-Delta: 0. String:             :host(:hover) .previous {
Lines-Delta: 0. String:                 forced-color-adjust: none;
Lines-Delta: 0. String:                 color: Lines-Delta: 0. String:                 fill: currentcolor;
Lines-Delta: 0. String:             }
Lines-Delta: 0. String:             :host(.disabled) {
Lines-Delta: 0. String:                 opacity: 1;
Lines-Delta: 0. String:             }
Lines-Delta: 0. String:             :host(.disabled)::before,
Lines-Delta: 0. String:             :host(.disabled:hover)::before,
Lines-Delta: 0. String:             :host(.disabled) .next,
Lines-Delta: 0. String:             :host(.disabled) .previous,
Lines-Delta: 0. String:             :host(.disabled:hover) .next,
Lines-Delta: 0. String:             :host(.disabled:hover) .previous {
Lines-Delta: 0. String:                 forced-color-adjust: none;
Lines-Delta: 0. String:                 background: Lines-Delta: 0. String:                 fill: ☺0Qj·jÀÂ#Lines-Delta: 0. String:             }
Lines-Delta: 0. String:             :host(:Lines-Delta: 0. String:                 forced-color-adjust: none;
Lines-Delta: 0. String:                 border-color: Lines-Delta: 0. String:                 box-shadow: 0 0 0 2px ☺↑QdûLines-Delta: 0. String: ¸Y♫Lines-Delta: 0. String: └☺☻↑Þ▬☻ò♣|%☻↑þaÞþ♀-¨☻♫↑Õ⌂
Lines-Delta: 0. String: ☻☻↑Þ‼   ↑þ↓Þµd$Lines-Delta: 0. String: └↑Û⌂A    ☻↑Þ‼@↑þ↓Þµ↓÷Õd$Lines-Delta: 0. String: Lines-Delta: 0. String: áÇ☻
 
Last edited:
Ok,

the "scroll back" problem: Found that it's just a Timeout on the Teensy! If you scrollback the serialtest.exe window, the program stops - windows buffer will be filled but not read - then, teensy can't send and goes into timout state. The Garbage printed after that is a result of the Windows problem, no buffer issue on Teensy.

So, nothing to fix here. We can't fix a PC-Softwareproblem on Teensy.

Indeed as noted - 'Copy and Select' in DOS box HALTS EXEcution - so buffers go unhandled. That is 'by design' stopping program execution.

Left it running some time here: T_MM with the posted copy of usb_serial.c and USB=Serial
serialtest_TMM_USBfb.png

Average throughput is looking like ~230 Mbps after 148001 sets of 100,000 64 byte packets it is showing 125 failed groups of those 100K packet sets.

So even with code that can keep up at the transfer rate - the PC can get distracted in buffer filling and transfer.

Typical error is missing in alphabet string - not garbage . In all that output one garbage buffer {below} was shown between typical ALPHA strings:
{though output clipped with ".X_" is a bad string not displayed}
Code:
Lines-Delta: 100000. Received: 6400000 Bytes in 212480 us = 240.96 Megabits per second
..................................................
Lines-Delta: 100000. Received: 6400000 Bytes in 211147 us = 242.49 Megabits per second
.............................
X_Lines-Delta: 15161. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTU[COLOR="#FF0000"][U]VWhi[/U][/COLOR]jklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

X_Lines-Delta: 112. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVW[COLOR="#FF0000"][U]XY13[/U][/COLOR]579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

X_Lines-Delta: 14546. Received: 13579abcdefghijklmn
[B][COLOR="#FF0000"]X_Lines-Delta: 0. Received: ☻☺.X_.X_.X_[/COLOR][/B]
X_Lines-Delta: 17260. Received: 13579abcdefghijklmnopqrstuvwxyz02468ABCDEFGHIbcdefghijklmnopqrstuvwxyz02468ABCDEFGHIJKLMNOPQRSTUVWXYZ

X_Lines-Delta: 15871. Received: 13579aCDEFGHIJKLMNOPQRSTUVWXYZ

X_Lines-Delta: 13122. Received: 6400000 Bytes in 397235 us = 128.89 Megabits per second
.....................
Lines-Delta: 100000. Received: 6400000 Bytes in 225215 us = 227.34 Megabits per second

The earlier reports of missing 512B buffers ( 99984) was when output blocks were 65 bytes not 64 - so even packing of the 512 data blocks was not possible from printed strings. Not sure if that was PC Rx or Teensy Tx problem? That no longer shows now that sketch prints an even 64 bytes.
 
Average throughput is looking like ~230 Mbps after 148001 sets of 100,000 64 byte packets it is showing 125 failed groups of those 100K packet sets.
:-(

I don't see this :-(
Even with a parallel transfer form a USB drive - everything OK :-(

Hm, don't know how to reproduce ...
If can't see this it is impossible to fix, for me.. and the error you see seems to be very rare? 125 of 148001 (with 1MB each). hm.
All I can do is to look at the code again. But even If I find soemething suspicios, I have no chance to test ist because I don't see these errors.. :-(

Can you try to disable the autoflush completely? Just to know if it still has something to do with it..
Just comment it out. In the last function in usb_serial.c

Code:
static void usb_serial_flush_callback(void)
{
  return; //<- add return as first line

Interestingly, the transfer is a bit faster without that autoflush(?!)

Not sure if that was PC Rx or Teensy Tx problem? T
I have no idea...

If nothing helps, there is no other way than to slow down everything.
 
Last edited:
Started a T_4.1 running same code in second DOS box.

> On same HUB the T_MM kept running FINE - just speed drop to ~115 Mbps and the T_4.1 running about 110 Mbps

> Moved T_4.1 to PC front USB and Both are running about 215 Mbps.

Both running generally without breaks in the 100K groups. DOS Window Resizing seems to have some effect on data handling.

Watching TaskMan there is one 'core' (of 16) that is 50-60% busy: {Most All of the core is colored as KERNEL time}
> stopping one DOS box (with 'select') drops that to 40%
> stopping 2nd DOS box (with 'select') drops that to 10%
So it seems both DOS boxes run from a specific CORE.

What about a third in a PowerShell window: Bumps the SAME CORE to 62%
> on Hub it shares throughput with the other Teensy
> on 2nd Hub to rear USB port :: All three running at 205 to 211 Mbps.

>> Seems Windows can glitch USB data transfer with multitasking, but seeing Three Teensy combined on one core pulling 600+ Mbps reliably - continuous 100K xfers of 64 bytes without error.
>> This is running defragster version of FB SerialTest with Truncated output : 960,000,000 Bytes transferred between the three is only printing 6 lines of text output every 12 seconds
>> Adding streaming GUI output is the slowdown, compounded by slowdowns causing the glitches.

Stats on the third started in powershell has about 1% glitch rate : 20 100K fails in 2001 groups.
 
:-(

I don't see this :-(
Even with a parallel transfer form a USB drive - everything OK :-(

Hm, don't know how to reproduce ...
If can't see this it is impossible to fix, for me.. and the error you see seems to be very rare? 125 of 148001 (with 1MB each). hm.
All I can do is to look at the code again. But even If I find soemething suspicios, I have no chance to test ist because I don't see these errors.. :-(
...

Not sure there is anything for Teensy to fix? - it seems all Windows transfer limitations with multiTasking and GUI interruptions?
> Windows seems to be peaking just over 200 Mbps per Teensy
> There will be some 0.1% to 1% failure rate on the RAW MAX transfers in 'general usage' with computer in use.
> Streaming GUI will add overhead and more multi tasking errors.

Each 100K group of 64B is 6,400,000 Bytes in the test as run here, not 1MB. Each 640 MB arrives every 255 ms at the 200 Mbps rate.

The last stats on powershell only saw 2 more faults in the next 2000 groups of 6.4MB. So the failures were caused by Window movement and other usage during operation. The next 2000 groups saw NO failures.

The other two Dos boxes stats show completed 186,000 transfers combined of 6.4 MB with only 350 failures ... that is under 0.2% failure rate.
 
Watching TaskMan there is one 'core' (of 16) that is 50-60% busy: {Most All of the core is colored as KERNEL time}

I see one of 8 with 20%. On my slower machine. Overall CPU 3% with serialtest running.
The serialtest task is usually 1..2% with 25..30Mbit more throuput than yours.
Does that say anything?

2021-10-04 21_55_37-Task-Manager.png
Has it todo with the chipset?


Could you disable autoflush.. (as a last test), please? see #171
 
Last edited:
I see one of 8 with 20%. On my slower machine.
The serialtest task is usually 1..2% with 30Mbit more than yours.
Does that say anything?

Three serialtestT.exe's here each : 0.4 to 1.1%
> KERNEL time showing in the active core is not included in the time associated with the .EXE

Suggests that AMD may have some alternate efficiency in USB data handling across the CPU?

Stats on the PowerShell run of serialtestT just printed 12,001 complete 6.4 MB blocks with 26 counted broken blocks ...

Opps - forgot to post Now up to :
>> Stats on the PowerShell run of serialtestT just printed 32,001 complete 6.4 MB blocks with 34 counted broken blocks ... Very Few!
> all three Teensys running combined 600 Mbps
 
Status
Not open for further replies.
Back
Top