LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-11-2020, 08:14 PM   #1
satur9nine
LQ Newbie
 
Registered: Sep 2020
Posts: 5

Rep: Reputation: Disabled
Unstable USB connection to Android device


I am Android developer so I use my linux machine to program Android devices which means using adb and fastboot commands frequently to connect to Android devices via USB.

I recently got a new machine and I'm encountering errors when using the fastboot command, whereas the adb command works fine.

I'm running Ubuntu 20.04 on a machine with:
PRIME X570-PRO
AMD Ryzen 9 3900X 12-Core Processor

I've got the latest Asus BIOS installed build 2606.
Linux kernel is Linux version 5.4.0-47-generic (buildd@lcy01-amd64-014) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)) #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020

The errors are very strange, when I run a fastboot command it appears to work 50% of the time, but eventually it appears to cause Linux to disconnect the device:
Code:
17:44:19-jacob:~$ fastboot getvar current-slot
getvar:current-slot                                FAILED (remote: 'unknown command')
Finished. Total time: 0.000s
17:44:19-jacob:~$ fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.043s
17:44:20-jacob:~$ fastboot getvar current-slot
getvar:current-slot                                FAILED (remote: 'unknown command')
Finished. Total time: 0.000s
17:44:20-jacob:~$ fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.043s
17:44:20-jacob:~$ fastboot getvar current-slot
getvar:current-slot                                FAILED (remote: 'unknown command')
Finished. Total time: 0.000s
17:44:20-jacob:~$ fastboot getvar current-slot
getvar:current-slot                                FAILED (Write to device failed (Cannot send after transport endpoint shutdown))
Finished. Total time: 0.011s
17:44:20-jacob:~$ fastboot getvar current-slot
< waiting for any device >
dmesg doesn't show much of anything interesting:
Code:
Sep 11 17:43:49 jacob-thinkmate kernel: usb 1-1: new high-speed USB device number 13 using xhci_hcd
Sep 11 17:43:50 jacob-thinkmate kernel: usb 1-1: New USB device found, idVendor=18d1, idProduct=d00d, bcdDevice= 1.00
Sep 11 17:43:50 jacob-thinkmate kernel: usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep 11 17:43:50 jacob-thinkmate kernel: usb 1-1: Product: Android
Sep 11 17:43:50 jacob-thinkmate kernel: usb 1-1: Manufacturer: Google
Sep 11 17:43:50 jacob-thinkmate kernel: usb 1-1: SerialNumber: b0abde08
Sep 11 17:44:20 jacob-thinkmate kernel: usb 1-1: USB disconnect, device number 13
I haven't seen this behavior before on past machines I've used based on Intel Xeon on i7 processors. Any tips for debugging this issue? I have experience debugging linux kernel issues so I suppose I can start by enabling some usb dynamic debugging features? Anything else obvious I can try or look for?

Thanks,
Jacob Abrams
 
Old 09-12-2020, 12:54 PM   #2
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,040
Blog Entries: 3

Rep: Reputation: 134Reputation: 134
I would say you have a dodgy connection, try a different usb port and/or cable
 
Old 09-12-2020, 01:24 PM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,418

Rep: Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590
You probably know more of this than we do, generally speaking. But let me try, so others can jump in and correct me.

I was under the impression that you need uid 0 for most of that fastboot/adb stuff. The only context I remember it was in rooting the phone. Have you uid 0?

The usual caveat about cables applies. Have you tried a few?

What Android OS are you on? Is the cpu idle on the phone? Is the phone rooted? Are we on a VM here? You're giving us NOTHING to go on.
 
Old 09-12-2020, 09:04 PM   #4
satur9nine
LQ Newbie
 
Registered: Sep 2020
Posts: 5

Original Poster
Rep: Reputation: Disabled
I found the solution, add USB hub between the device and my PC... found it here: https://www.thundercomm.com/forum/to...date-usb-error

Anyone have a guess why that worked?


Just to respond to these questions:

Quote:
What Android OS are you on?
My device is running on Android 8.1 Qualcomm sda660 chipset.

Quote:
Is the cpu idle on the phone?
That's a really tough question, technically CPUs don't have an "idle" state, that's mostly an OS term for when there is no task the scheduler needs to execute so the OS runs an idle task that spins in a loop or sits on a WFI instruction or something. Anyway I can't say with any certainty what the fastboot OS is doing at each precise moment.

Quote:
Is the phone rooted?
Yes, but that has no effect on the fasboot OS. Also the device has the bootloader unlocked.

Quote:
Are we on a VM here?
No I am running Ubuntu 20.04 on the metal.
 
1 members found this post helpful.
Old 09-13-2020, 04:24 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,418

Rep: Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590Reputation: 2590
The reason the hub worked may well be voltage levels. The phone will hardly be reaching 3V. The usb on your box may be 5V. Or the low level may be the issue. It's impossible to know without slapping a fast oscilloscope on there. Or it could be the low not going low enough. or voltages on the edges - this sort of thing being read in the wrong place
Code:
 _
/ \
I had a 'scope, and discovered an awful lot of that.
 
Old 09-14-2020, 06:36 AM   #6
GPGAgent
Senior Member
 
Registered: Oct 2018
Location: Surrey UK
Distribution: Mint 20 xfce 64bit
Posts: 1,040
Blog Entries: 3

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by satur9nine View Post
I found the solution, add USB hub between the device and my PC... found it here:
Nice one!

Last edited by GPGAgent; 09-14-2020 at 06:37 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'Unstable' made my computer unstable...;) debuser123 Debian 10 01-26-2007 04:11 AM
how unstable is unstable? microsoft/linux Debian 11 01-06-2006 06:12 AM
is ubuntu unstable less unstable than debian unstable? lefty.crupps Ubuntu 9 10-14-2005 01:38 PM
Unstable is really unstable... shorty_boy Debian 22 09-16-2005 01:46 PM
Just how unstable is unstable??? R00ts Debian 8 02-12-2005 01:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration