Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent cable errors from TI-84 + CE #40

Open
caseyavila opened this issue Aug 15, 2020 · 5 comments
Open

Frequent cable errors from TI-84 + CE #40

caseyavila opened this issue Aug 15, 2020 · 5 comments

Comments

@caseyavila
Copy link

When using tilp, I will occasionally use a functionality such as Dirlist, Ready ? or sending a file and be met with the following error:

tilp-INFO: 05:16:53.153: Opening cable DirectLink on port #1 to communicate with calculator TI84+CE USB
ticables-INFO: 05:16:53.153: Check for libusb support:
ticables-INFO: 05:16:53.153:     usb support: available.
ticables-INFO: 05:16:53.153: Check for libusb usability:
ticables-INFO: 05:16:53.153:     usb filesystem (/dev/bus/usb/): mounted
ticables-INFO: 05:16:53.162:  found TI-84 Plus CE on #1, version <2.20>

ticables-INFO: 05:16:53.166: found bulk in endpoint 0x81

ticables-INFO: 05:16:53.166: found bulk out endpoint 0x02

ticalcs-INFO: 05:16:53.166: Checking hand-held status:
ticalcs-INFO: 05:16:53.166:   PC->TI: Buffer Size Request (1024 bytes)

(tilp:15099): ticables-WARNING **: 05:16:54.166: slv_bulk_read (Operation timed out).

ticalcs-INFO: 05:16:54.166: Checking hand-held status:
ticalcs-INFO: 05:16:54.166:   PC->TI: Buffer Size Request (1024 bytes)

(tilp:15099): ticables-WARNING **: 05:16:55.667: slv_bulk_read (Operation timed out).

ticables-INFO: 05:16:56.565:  found TI-84 Plus CE on #1, version <2.20>

ticables-INFO: 05:16:56.570: found bulk in endpoint 0x81

ticables-INFO: 05:16:56.570: found bulk out endpoint 0x02

This occurs around 1/3 of the times I attempt to do something over the cable, but it doesn't seem to have any side effects either (I can still read/write to the file system perfectly when I don't get the error). Please let me know if this is intended functionality, or if there is anything I can do.

Calc OS: 5.3.0.0037
Tilp version: latest from the Gentoo repositories

@debrouxl
Copy link
Owner

Nope, that is clearly not intended functionality... when communication fails at such a rate, libti*+tilp are not usable. However, the thing is, I don't know what happens. It's news to me that it can happen on an older, non-Python Edition TI-eZ80 calculator.
It's not that libticalcs is talking garbage to the calculator, or failing to understand what the calculator returns, since communication is reliable for most non-Python Edition TI-eZ80 calculators (my older 83PCE is in that set), and even on affected calculators (my 83PCE EP is in that set), the desired operations eventually work. It shouldn't be the USB cable's fault, since the same cable has never triggered issues with other calculators.
If the issue happens at a lower level, software USB analyzers such as usbmon on Linux might help debugging the issue, but if they don't, I don't have an external USB analyzer...

Did you try using another USB port on the computer, or (not to) plug on your calculator on some form of external USB hub, if you have that ? I know that this can impact communication, since my 89 Titanium does not work at all when plugged into a USB 3 port (it's not even detected at the USB level, so libticables doesn't get a chance to see it in the first place), but it works flawlessly, with the same USB cable, when plugged into an external USB 1.1 hub or a 2.0 port.

@caseyavila
Copy link
Author

Hmm, I have tried using different USB ports, but the error persists. Thanks for the help, I'll probably end up trying out some USB analyzers.

@caseyavila
Copy link
Author

Well, it seems I have fixed this problem after resetting my kernel configuration. Although I changed a multitude of settings, one that stands out to me as a possible solution is disabling CONFIG_SCSI_SCAN_ASYNC. I haven't had the time to test whether it was specifically this kernel configuration, but I can probably soon.

@MithicSpirit
Copy link

I also get similar issues (though with much higher error rates than 1 in 3… more like 6 in 7 times) on my TI-84 Plus when attempting to restore a backup. Specifically, it gets all of the variable names and, at the very end, the PC sends a Request to Send, at which point it hangs for a few seconds and times out on the operation slv_bulk_read (see pic below for graphical error message; I can provide more extensive logs if desired). I've found that spamming the "List calculator content" button a bit before restoring can sometimes improve the error rates, though this is also inconsistent.

I am on Linux (Arch), and disabling CONFIG_SCSI_SCAN_ASYNC in the kernel does not change anything for me. I have a couple kernels installed (both xanmod-edge and regular linux from the Arch repos) and this issue occurs on both. I've also tried this both with just leaving the calculator on and with setting it to "Receive" mode (2ndX,T,θ,n (Link) → >1), all to no avail.

Note that this only happens when restoring backups, and regularly sending files or listing contents works fine for me (there may be other broken operations but I have yet to find them). If you need any additional info or have anything I should test please let me know.

System info:

  • PC:
    • Kernel: 5.16.1
    • TiLP2 v1.18 (cables=1.3.5, files=1.1.7, calcs=1.1.9, conv=1.1.5)
    • ^ All built from source using the AUR packages tilp, libticalcs, libticables, libtifiles, and libticonv (I tried to use the -git versions that compile from the latest commits to the repository but I was having other issues with it running due to incompatible library versions and stuff, but I'll try it again later)
  • Calculator:
    • TI-84 Plus (not CE, not Silver)
    • Running OS version 2.55MP (afaik the latest)

Graphical error message:
image

@debrouxl
Copy link
Owner

Thanks for the report. It's interesting that the issue occurs on a 84+ as well.

It reminds me of a corner case of multi-file transfers I fixed a while ago, long after fixing single file transfer of specific sizes on multiple models. The current commit ID for the fix I'm talking about is debrouxl/tilibs@36e7d8f . I never integrated it onto the main branch because of insufficient regression testing on other models.
However, that issue and this one should be different, because that communication issue is deterministic, AFAICT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants