Page 1 of 1

[SOLVED: USB AUTOSUSPEND] USB port powers up and shuts down again: card reader, smartphone etc. not connecting

Posted: Mon Dec 17, 2018 6:02 am
by linux80
Hello guys,

First of all, brand new MX LINUX user here. Been using this on a 10yo gaming laptop for 3 months now. This is the smoothest and most stable distro I have had uptil now, after having used several other ones like Mint, Ubuntu and "regular" Debian.

I am however experiencing a rather annoying problem with my USB ports.

Whenever I connect my card reader,
(i.e. ID chip / "smart" or bank chip card reader like this: Image)

or my smartphone or tablets,

they power up or charge for 2-3 seconds and then lose connection again.

In the case of my smartphones or tablets, I then have to change my phone's configuration to "File transfer mode" and then go to MX Linux File Manager and hit the Android phone or tablet, in order to restore connection. This is annoying but at least I can get it to work and charge.

In the case of my card reader, however, this one obviously is not visible in the File Manager, so it just remains dead.

I have tried several things already, so FYI:

- switching hard disks and getting back to the horribly slow Windows 7 solves the problem immediately. So I guess it has nothing to do with the cable or the reader.
- connecting to my other laptop with Debian Linux solves the problem too. Which makes me think it really is a distro-specific issue.
- even with the card reader seemingly dead, it is in reality still visible (but not usable) when I use the usb-devices command. The reader is in the list.
- resetting the usbmuxd just makes the whole thing start over again: it powers up for 3 seconds and then goes out.
- the same issue occurs on all 3 USB ports (2 left + 1 right port configuration).
- sliding a smart card in the reader does not make any difference; it stays dead.
- I have a wireless mouse with a USB dongle connected to one of the ports. This one works perfectly.

No idea as to what to do next... Since my distro has worked perfectly until now, I'd rather hear your opinions first, before starting to mess with configuration files and risking to lose my current stability. Thx in advance!

Re: USB port powers up for 3 seconds, then shuts down: card reader, smartphone etc. not connecting

Posted: Mon Dec 17, 2018 7:01 am
by Eadwine Rose
Ah.. the banking card reader by the looks?

I know from my bank that Linux is not a supported OS and that's that. Connecting via USB is not going to work. I have to use the thing without the cable the old fashioned way.

Re: USB port powers up for 3 seconds, then shuts down: card reader, smartphone etc. not connecting

Posted: Mon Dec 17, 2018 7:21 am
by linux80
Eadwine Rose wrote: Mon Dec 17, 2018 7:01 am Ah.. the banking card reader by the looks?

I know from my bank that Linux is not a supported OS and that's that. Connecting via USB is not going to work. I have to use the thing without the cable the old fashioned way.
Thx for your reply.

That could've been the reason but it isn't, because it works perfectly on Debian. Also, this would not explain why I have the exact same issue with my phone and tablets.

Re: USB port powers up for 3 seconds, then shuts down: card reader, smartphone etc. not connecting

Posted: Mon Dec 17, 2018 9:37 pm
by dreamer
linux80 wrote: Mon Dec 17, 2018 7:21 am That could've been the reason but it isn't, because it works perfectly on Debian. Also, this would not explain why I have the exact same issue with my phone and tablets.
Maybe TLP auto-suspends your USB-ports? Have a look at this link:
https://mxlinux.org/wiki/hardware/scanners#Canon

There are instructions for manual configuration of TLP and there is also a GUI called TLPUI I think.
It seems that the TLP power management that is automatically enabled in MX Linux autosuspends idle USB ports (except for hdi, i.e. mouse or keyboard ports). Most USB drivers are smart enough to wake up the ports when they need to, and the scanimage program does this when fed a device name which includes a libusb port ID. Unfortunately the plustek sane-backend code doesn't do that by itself, and neither do SimpleScan or Xsane. I wouldn't expect them to as they treat scanners the same regardless of the connection type, expecting the discovered sane-backend to deal with hardware issues.

But TLP is configurable, and USB autosuspend can be turned off by device ID. The Canon LIDE30 only draws about 250ma while in standby which is insignificant for a desktop, and if that 1.25 W draw is important on your notebook you can always unplug the USB cable when you're not scanning.

Re: USB port powers up for 3 seconds, then shuts down: card reader, smartphone etc. not connecting

Posted: Tue Dec 18, 2018 3:26 pm
by linux80
dreamer wrote: Mon Dec 17, 2018 9:37 pm
linux80 wrote: Mon Dec 17, 2018 7:21 am That could've been the reason but it isn't, because it works perfectly on Debian. Also, this would not explain why I have the exact same issue with my phone and tablets.
Maybe TLP auto-suspends your USB-ports? Have a look at this link:
https://mxlinux.org/wiki/hardware/scanners#Canon

There are instructions for manual configuration of TLP and there is also a GUI called TLPUI I think.
It seems that the TLP power management that is automatically enabled in MX Linux autosuspends idle USB ports (except for hdi, i.e. mouse or keyboard ports). Most USB drivers are smart enough to wake up the ports when they need to, and the scanimage program does this when fed a device name which includes a libusb port ID. Unfortunately the plustek sane-backend code doesn't do that by itself, and neither do SimpleScan or Xsane. I wouldn't expect them to as they treat scanners the same regardless of the connection type, expecting the discovered sane-backend to deal with hardware issues.

But TLP is configurable, and USB autosuspend can be turned off by device ID. The Canon LIDE30 only draws about 250ma while in standby which is insignificant for a desktop, and if that 1.25 W draw is important on your notebook you can always unplug the USB cable when you're not scanning.
Damn you hit the nail right on the head. You made my day, @dreamer. I've been looking for this for a VERY long time and since I didn't really know which keywords to use to describe the problem, I had a hard time finding a solution on the Linux forums...

Explanation for people who experience the same issue:

I made my life a bit easier and installed TLPUI through the Package Installer (Test Repo).

Run TLP-UI, go to USB > uncheck USB_AUTOSUSPEND.

Don't forget to save your settings by hitting File > Save, and entering your root PW.

You can also simply add your USB device ID to the blacklist, using TLP-UI.

If you prefer not to install the extra pack, you can easily follow the instructions that were provided in the link shared by dreamer. Exactly the same but without interface.

THANK YOU!

Re: USB port powers up for 3 seconds, then shuts down: card reader, smartphone etc. not connecting

Posted: Tue Dec 18, 2018 4:45 pm
by dreamer
linux80 wrote: Tue Dec 18, 2018 3:26 pm Damn you hit the nail right on the head. You made my day, @dreamer. I've been looking for this for a VERY long time and since I didn't really know which keywords to use to describe the problem, I had a hard time finding a solution on the Linux forums...

Explanation for people who experience the same issue:

I made my life a bit easier and installed TLPUI through the Package Installer (Test Repo).

Run TLP-UI, go to USB > uncheck USB_AUTOSUSPEND.

Don't forget to save your settings by hitting File > Save, and entering your root PW.

You can also simply add your USB device ID to the blacklist, using TLP-UI.

If you prefer not to install the extra pack, you can easily follow the instructions that were provided in the link shared by dreamer. Exactly the same but without interface.

THANK YOU!
I knew I would have to take a closer look at this myself some time. Thank you for the instructions. Good teamwork! :number1:

Re: [SOLVED: USB AUTOSUSPEND] USB port powers up and shuts down again: card reader, smartphone etc. not connecting

Posted: Tue Oct 27, 2020 3:01 am
by OoglaBoogla
Thank you so much. I was having this same problem, and I had gotten in the habit of always charging my android phone on my PC. After I started using MX Linux, I noticed my phone was dying. I knew exactly why, but had no idea how to change USB Autosuspend options. Thanks again. The forum is excellent. MX Linux is excellent. Maybe the MX Tweaks or MX Tools app could address this in the future?

Re: [SOLVED: USB AUTOSUSPEND] USB port powers up and shuts down again: card reader, smartphone etc. not connecting

Posted: Wed Jul 14, 2021 7:33 am
by linuxforever
I went through the whole process thinking I had found a solution to my problem. Alas, every time i uncheck "usb auto-suspend", push the gliding button to the left and save the config, it automatically rechecks "usb auto-suspend".
Also I cannot edit "usb blacklist"...

PS I asking questions in a [SOLVED] subject even allowed...?

Re: [SOLVED: USB AUTOSUSPEND] USB port powers up and shuts down again: card reader, smartphone etc. not connecting

Posted: Wed Jul 14, 2021 7:51 am
by JayM
@linuxforever
Do not reply to others' existing topics to ask for help nor post multiple issues in one topic. Start a new topic for each issue. This helps to avoid confusion and chaos.

Do not reply to or "bump" old topics unless you have something useful to contribute. Do not unnecessarily bump your own topics. Wait at least 24 hours for a reply.
viewtopic.php?p=255061#p255061

Re: [SOLVED: USB AUTOSUSPEND] USB port powers up and shuts down again: card reader, smartphone etc. not connecting

Posted: Wed Jul 14, 2021 9:10 am
by linuxforever
Sorry @JayM, can you erase my post?