ADB over USB doesn't work on Origen

Bug #859896 reported by Zach Pfeffer
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro Android
Fix Released
High
Prashanth S
linaro-landing-team-samsung
Fix Released
Undecided
Angus Ainslie

Bug Description

On https://android-build.linaro.org/builds/~linaro-android/staging-origen-11.09-release/#build=2 adb over USB dosen't work. Plugged into CON8.

Affects 11.09, 11.10 release.

Zach Pfeffer (pfefferz)
Changed in linaro-android:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Zach Pfeffer (pfefferz)
Zach Pfeffer (pfefferz)
Changed in linaro-android:
assignee: Zach Pfeffer (pfefferz) → Botao Sun (botao-sun)
milestone: none → 11.10
Zach Pfeffer (pfefferz)
summary: - ADB doesn't work on Origen on build 2 of the 11.09 release
+ ADB over USB doesn't work on Origen on build 2 of the 11.09 release
Revision history for this message
Zach Pfeffer (pfefferz) wrote : Re: ADB over USB doesn't work on Origen on build 2 of the 11.09 release
Revision history for this message
Zach Pfeffer (pfefferz) wrote :
Revision history for this message
Angus Ainslie (angus-akkea) wrote :

The landing team has USB host, gadget and device working.

What other kernel side interfaces are needed for ADB ?

Are there specific kernel options that need enabling ?

Changed in linaro-landing-team-samsung:
status: New → Confirmed
Revision history for this message
Zach Pfeffer (pfefferz) wrote :
Changed in linaro-android:
importance: Medium → High
Botao (botao-sun)
Changed in linaro-android:
milestone: 11.10 → 11.11
Changed in linaro-landing-team-samsung:
status: Confirmed → Incomplete
Botao (botao-sun)
tags: added: adb linaro-android
Zach Pfeffer (pfefferz)
Changed in linaro-android:
assignee: Botao Sun (botao-sun) → Prashanth S (prashanth-srinivasan)
Revision history for this message
Angus Ainslie (angus-akkea) wrote :

The trick here is to enable USB_G_ANDROID, the only way to find this is if you search the drivers directory for a file named f_adb.c there's no reference to ADB in the kernel config.

USB_G_ANDROID is only available if your gadget devices are built into the kernel it will not show up if if they are built as modules. Is there a good reason for this ?

Changed in linaro-landing-team-samsung:
status: Incomplete → Fix Committed
assignee: nobody → Angus Ainslie (angus-akkea)
milestone: none → 2011.11
Revision history for this message
Botao (botao-sun) wrote :

After applied Angus's latest kernel updates, it works on the latest staging-origen build, refer to this: https://bugs.launchpad.net/linaro-android/+bug/888647

I copy the procedures here:

######################################################
I did not take care of user-space adb initialization. It works fine after running following commands from android console.

# echo 0 > /sys/class/android_usb/android0/enable
# echo adb > /sys/class/android_usb/android0/functions
# echo 1 > /sys/class/android_usb/android0/enable

Reconnect the usb cable after running these above commands. You will see the following message on android console.

"android_usb gadget: high speed config #1: android"
######################################################

Changed in linaro-android:
status: Confirmed → Fix Committed
Fathi Boudra (fboudra)
summary: - ADB over USB doesn't work on Origen on build 2 of the 11.09 release
+ ADB over USB doesn't work on Origen
description: updated
Revision history for this message
Amit Pundir (pundiramit) wrote :

Pushed a patch for review http://review.android.git.linaro.org/#change,814 which does the adb user space initialization from init.origen.rc

Revision history for this message
Botao (botao-sun) wrote :

Change 814 has been merged, but I still can't get the correct information about the Origen board which I connected to my computer:

noname@noname-pc:~$ adb devices
List of devices attached
???????????? no permissions

And I can't launch the ADB shell either:

noname@noname-pc:~$ adb shell
error: insufficient permissions for device

I tried to kill the ADB server and restart it, the error message is same.

Changed in linaro-android:
status: Fix Committed → In Progress
Revision history for this message
Botao (botao-sun) wrote :

The build I used is #46 on our Android build platform which contained the changes we made.

Revision history for this message
Amit Pundir (pundiramit) wrote :

Thats weird. I have seen this "no/insufficient permissions" error number of times and "sudo adb kill+start server" solves it every single time for me. Did you get "android_usb gadget: high speed config #1: android" message on Android console (minicom)?

Revision history for this message
Botao (botao-sun) wrote :

I got the points:

1. ADB must run with the root permission, which means "sudo adb devices".

2. If the USB cable is connected before board powered up, ADB won't work, you have to plug it out and plug it in after the board boots up, then you will see these 2 lines:

<6>android_usb gadget: high speed config #1: android
android_usb gadget: high speed config #1: android

After that, run the ADB on host computer, it works.
noname@noname-pc:~$ sudo /home/noname/programs/android-sdk-linux_x86/platform-tools/adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
0123456789ABCDEF device

And ADB shell also can be launched successfully:
noname@noname-pc:~$ sudo /home/noname/programs/android-sdk-linux_x86/platform-tools/adb shell
# pwd
/

But for my HTC Sensation phone, I don't need run ADB with root permission:

noname@noname-pc:~$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
SH17GV804706 device

Changed in linaro-android:
status: In Progress → Fix Committed
Changed in linaro-landing-team-samsung:
status: Fix Committed → Fix Released
Changed in linaro-android:
status: Fix Committed → Fix Released
Revision history for this message
Botao (botao-sun) wrote :

ADB over USB only work 1 time:

https://android-build.linaro.org/builds/~linaro-android/origen-ics-gcc47-samsunglt-stable-blob-12.05-release/#build=6

After plug in the USB cable, then do the "sudo adb shell", then the device serial number can be shown. But once exit the shell, then the ADB connection can't be established again.

ADB install doesn't work either under the USB mode.

Revision history for this message
Sangwook Lee (sangwook) wrote :

>once exit the shell, then the ADB connection can't be established again.
if you exit from the adb shell, please unplug USB cable and then plug it again before you run ADB again.

Revision history for this message
Botao (botao-sun) wrote :

Tried that, but after it, it still only works once, and the ADB install doesn't work either.

Revision history for this message
Sangwook Lee (sangwook) wrote : Re: [Bug 859896] Re: ADB over USB doesn't work on Origen

Ok let me reproduce this scenario.

On 30 May 2012, at 15:17, Botao Sun <email address hidden> wrote:

> Tried that, but after it, it still only works once, and the ADB install
> doesn't work either.
>
> --
> You received this bug notification because you are a member of Linaro
> Landing Team: Samsung, which is subscribed to linaro-landing-team-
> samsung.
> https://bugs.launchpad.net/bugs/859896
>
> Title:
> ADB over USB doesn't work on Origen
>
> Status in Linaro Android:
> Fix Released
> Status in Linaro Samsung Landing Team Project:
> Fix Released
>
> Bug description:
> On https://android-build.linaro.org/builds/~linaro-android/staging-
> origen-11.09-release/#build=2 adb over USB dosen't work. Plugged into
> CON8.
>
> Affects 11.09, 11.10 release.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/linaro-android/+bug/859896/+subscriptions

Revision history for this message
Botao (botao-sun) wrote :

The ADB over USB works again, it possibly depends on the USB cable quality.

Revision history for this message
Sangwook Lee (sangwook) wrote :

Summary:
it seems to have some relation to the USB OTG cable, It is higly
recommended to use the high speed shield USB cable.

For example, with some cables (USB OTG), it requires plug/unplug eveytime PC host is connected to Origen board
Or worse case, it is not work after running a few time, which is reported by Botao.

With the good shield cable, USB OTG hence ADB works fine with Origen even withoug plug/unplugging.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.