BBBAndroid: AOSP 4.4.4 (KitKat) with 3.8 kernel

Hi Andrew**,**

I am trying to use the BBB for basic picture analysis with OpenCV over Android OS.

I was wondering, does this release support any basic usb cameras (are there any drivers for known products)?

So far i have found this http://www.radiumboards.com/HD_Camera_Cape_for_BeagleBone_Black.php which is a bit pricy.

thank you very much,

Grayver

Hello Gianmaria. Sorry for the delay in getting back to you on this. The .img files for the various Android partitions are generated as part of the BBBAndroid build process. But, the makefile installs the kernel, firmware, and modules into the file system after the .img files are generated. I stay away from installing Android into the eMMC because I don’t want to limit the size of the partitions to fit within the 2GB/4GB eMMC. That is why I target the microSD card for the BBBAndroid build scripts. You can use the .img files that are generated during the BBBAndroid build process and use fastboot to place the images onto the eMMC (as Chris’s instructions show in the link that you mentioned). But, you may have to shrink the size of the images because I include a few extra packages (such as the i2ctools) that aren’t in the usual AOSP packages. Because of this, my images are bigger than normal and may not fit onto a 4GB eMMC as-is.

Hello Michael. I believe that Keith Conger supplied you with the 3.18 backport drivers for Bluetooth, right? I have Keith’s patches sitting in my review queue, but I haven’t yet created a branch with them. The problem that I’m running into is that the 3.8 kernel has the capemgr in it, but the later kernels do not. So, Bluetooth drivers in the newer kernels aren’t readily available for BBBAndroid without a lot of screwing around. The drivers that you need are available in the 3.14 kernel, but the 3.14 kernel does not have support for dynamic loading of device tree overlays in it. Only 3.8 has this feature, which is why I am sticking with 3.8 for BBBAndroid. I want to make it easy for people to try different hardware configurations and easily prototype Android interfacing code, though some features requiring the drivers from newer kernels (like Bluetooth drivers) aren’t available because of this.

You could try just dropping the 3.14 kernel into the BBBAndroid build process as you are doing, but you must make sure that the device tree (.dtb) in the boot partition matches the kernel. The FTDI serial output will tell you of any issues with the bootloader and help you diagnose these sorts of problems. If all of the lights are on, you are having a problem very early in the boot process. My guess is that it is a mismatch of some sort among the bootloader, uEnv.txt file, the device tree .dtb, and the kernel. You probably haven’t gotten far enough along in the build process to worry about having the correct kernel modules installed in the root file system, but that shouldn’t be a problem if you are using my makefile. My makefile installs the modules into place for you.

Also, make sure that you have the Android staging drivers (binder, anonymous shared memory, low memory killer, etc.) enabled in you kernel configuration for the 3.14 kernel. You were asked about all of those options when you built the kernel because you were using a kernel configuration file for the 3.8 kernel with your 3.14 kernel. There are a number of mismatches in the options between the two kernels, so the kernel Kconfig system was asking you to sort out the differences.

Andrew

Hello Grayver. Actually, USB cameras on the BBB are not something that I have any experience with. I do have support for V4L2 enabled in the kernel, and I have enabled USB camera support in the device/ti/BoardConfig.mk file for the Android build. But, I haven’t given it a try to see how well it works. You may very well have the camera working, but without OpenGL ES to scale the captured video to the full screen size, it may not actually work in any standard camera app. If you have a USB camera that is known to work under Linux, you can give it a try and see how well it works out for you.

My general rule is that if some device is supported under a Linux system with the 3.8 kernel on the BBB then it is supported under BBBAndroid with the 3.8 kernel. That doesn’t mean that the Android apps will always play nice with your hardware, but the userspace interface to the device that is exposed by the kernel will be the same under Linux as it is under Android. One of these days, I’m going to have to work with a USB camera under Android. But, until then, I can’t give you any concrete recommendations. Sorry. Your best bet is to check out what cameras people are using with OpenCV and then stick with one of those. If you need special modules loaded for a particular camera, you can place an “insmod” for the module or modules inside of the init.{ro.hardware}.rc file in the root file system of the BBBAndroid image.

Andrew

Hi Andrew,

Thanks for the reply. Indeed Keith Conger supplied me with the patches.
I have gotten a bit further now as I’m getting the hand of configuring and building the kernel for the beaglebone black. I’m now able to boot all the way to the android home screen.

However, I have major graphical glitches. It seems that the boot animation is being displayed together with the home screen. Their also seemed to be a lot of flickering on the screen. So there is something seriously wrong there.

The biggest issue for me that I came across was the fact that my usb host port didn’t seem to work. So no mouse available there.
Today I tried the 3.10 kernel and there I do not have the graphical glitches. However, again there is no host port available.

from the ftdi output I did find the following while booting the kernel:


[    2.725494] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517

[    2.733755] platform musb-hdrc.0.auto: Driver musb-hdrc requests probe deferral

Have you ever come across this error?

Thank you so much Andrew,
you are really kind. I will keep this extra packets for now… I also have to include the libs you used in your book to handle spi devices… will keep in touch.

Gianmaria
Italy

Are you using an LCD cape? I have seen flickering similar to what you described with the 3.8 kernel when I forced a video resolution via the “video=” kernel command line option (in uEnv.txt in the boot partition) for the LCD3/4/7 CircuitCo capes and the 4DCAPE-43T/70T capes from 4D Systems. For those display capes, the resolution is pulled from the device tree overlay for the cape automatically, so you should not specify a video resolution. If you are using HDMI, you may not be getting the proper EDID resolution information from your display. In that case, the TILCDC driver will default to 1024x768, which your display (if it is an HDMI display) may not properly support. Either way, I have seen that refresh problem when the logical resolution that the TILCDC driver expects mismatches the physical resolution of your display device.

I have not seen that particular USB error before, but I also have not worked with the 3.10 kernel on the BBB. I’ve gone straight from 3.8 to 3.13/14.

Andrew

Hi Andrew,

I retried the 3.14 kernel.

I’m getting the following error:

WARNING: CPU: 0 PID: 110 at drivers/usb/gadget/f_fs.c:2595 ffs_ep0_write+0x44d/0x474()

[ 149.939235] Modules linked in:

[ 149.942448] CPU: 0 PID: 110 Comm: adbd Tainted: G W 3.14.35+ #6

[ 149.949616] [] (unwind_backtrace) from [] (show_stack+0xb/0xc)

[ 149.957570] [] (show_stack) from [] (dump_stack+0x4f/0x64)

[ 149.965181] [] (dump_stack) from [] (warn_slowpath_common+0x4b/0x68)

[ 149.973686] [] (warn_slowpath_common) from [] (warn_slowpath_null+0x11/0x14)

[ 149.982940] [] (warn_slowpath_null) from [] (ffs_ep0_write+0x44d/0x474)

[ 149.991729] [] (ffs_ep0_write) from [] (vfs_write+0x6d/0x130)

[ 149.999599] [] (vfs_write) from [] (SyS_write+0x2d/0x64)

[ 150.006994] [] (SyS_write) from [] (ret_fast_syscall+0x1/0x46)

[ 150.014950] —[ end trace 3555ece349f08477 ]—

[ 151.039009] read descriptors

[ 151.042065] read strings

I believe it has to do with the FunctionFS. What is it used for? Can I disable it? I believe it is only used so that ADB would work right?

To provide you with some extra info, I had to build the kernel with the folowing modifications to the defconfig:

I commented:

CONFIG_USB_G_NOKIA=m //This led to an inconsistent state

I included this:
CONFIG_DMA_OMAP=y //This was a required dependency

Cheers,
Michael

For the video issue I tried changing the video parameter to 1920x1080-16@60 the native resoltion of my display. However, when I did, I did not see anything on the display.

Here is a small video of the display so you get what I mean with flicker. It seems that some video buffer isn’t emptied or something as I’m seeing old screens between the one that I should see
https://youtu.be/me1_O4iaHB8

I have not yet tried FunctionFS under 3.14. The only reason it was in the 3.8 kernel was to support ADB, so you can remove it if you wish. I am unfamiliar with that particular error.

OK, this is starting to make more sense. 1920x1080 at 60 Hz is not a supported mode for the BBB. I’ve seen screen shearing on 1920x1080 at 24 Hz before with OpenGL ES on 3.14 with single buffering before. My suggestion is to use the “video=” parameter to set a supported resolution lower than 1920x1080 and see how well that works for you. Here is a list of the supported modes: http://elinux.org/Beagleboard:BeagleBoneBlack_HDMI

Maybe try 1280x720-16@60, instead.

Hey Andrew,

I wasn’t able to solve either one of my problems.
Disabling FunctionFS led to a kernel panic.

Changing the resolutions definitely works but the flickering is still there.

I’m pretty much out of options here I guess so I think the next step is backporting the required kernel modules required for the BLE to 3.8 as I’m getting nowhere with the 3.14 kernel.

Cheers,
Michael

Hey Andrew,

I’m able to boot the 3.14 kernel now with usb and proper hdmi support.
I then started to include the bluetooth modules. The modules seem to load fine.
However, now when I’m seeing the boot animation and finally enter to homescreen a crash happens and the boot animation appears again.

This is the output after the crash:

binder: 8841: binder_alloc_buf, no vma

binder: 8841: binder_alloc_buf, no vma

[ 658.943483] binder: 9034:9191 transaction failed 29201, size 248-4

[ 658.951002] alarm_release: clear alarm, pending 0

[ 658.958173] binder: 8841: binder_alloc_buf, no vma

[ 658.963237] binder: 9034:9191 transaction failed 29201, size 188-4

[ 658.971025] binder: release 8841:9028 transaction 60843 in, still active

[ 658.978173] binder: send failed reply for transaction 60843 to 8968:8968

[ 658.985315] binder: undelivered transaction 61599

[ 658.990261] binder: undelivered transaction 61605

[ 658.995234] binder: undelivered transaction 61606

[ 659.000672] binder: undelivered transaction 61592

[ 659.005677] binder: send failed reply for transaction 61593 to 9265:9265

[ 659.012739] binder: send failed reply for transaction 61607 to 9281:9308

[ 659.019834] binder: send failed reply for transaction 61618 to 9296:9296

[ 659.029835] binder: 8968:8968 transaction failed 29189, size 208-0

[ 659.065614] binder: 9265:9265 transaction failed 29189, size 240-0

[ 659.251928] init: untracked pid 9296 exited

[ 659.394084] init: untracked pid 8998 exited

[ 659.398895] init: untracked pid 9116 exited

[ 659.454135] init: untracked pid 9281 exited

[ 659.464443] init: untracked pid 8927 exited

[ 659.495386] init: untracked pid 9265 exited

[ 662.203936] init: untracked pid 8985 exited

[ 662.220119] init: untracked pid 8968 exited

I was thinking that the vmalloc size was not big enough. However, It’s already at 486MB

I do always see the alarm release in the output. Maybe that has something to do with it?

Cheers,
Michael

Since this took me a few days to figure out, I figured I’d post how I got Wifi working in bbbandroid. Hope this saves a few days of your life :slight_smile: Obviously swap the kernel modules with the ones appropriate for your device.

Add to device/ti/beagleboneblack/init.genericam33xx_flatteneddevicetr.rc:

under “on post-fs-data”

wifi

mkdir /data/misc/wifi/sockets 0770 wifi wifi
insmod /system/vendor/lib/modules/3.8.13+/kernel/net/wireless/cfg80211.ko
insmod /system/vendor/lib/modules/3.8.13+/kernel/net/mac80211/mac80211.ko
insmod /system/vendor/lib/modules/3.8.13+/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko

At the bottom

service wpa_supplicant /system/bin/wpa_supplicant
-iwlan0 -Dwext -c/data/misc/wifi/wpa_supplicant.conf
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot

service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot

service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot

Add to following tags in file device/ti/beagleboneblack/overlay/frameworks/base/core/res/res/values/config.xml:

"wifi,1,1,1,-1,true" …

And

"1,1" …

Add to device/ti/beagleboneblack/BoardConfig.mk:

BOARD_WPA_SUPPLICANT_DRIVER := WEXT
BOARD_HOSTAPD_DRIVER := WEXT
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WLAN_DEVICE := wlan0

Add file device/ti/beagleboneblack/wpa_supplicant.conf with the following contents:

ctrl_interface=wlan0
update_config=1

Add to device/ti/beagleboneblack/device.mk:

PRODUCT_COPY_FILES +=
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml
device/ti/beagleboneblack/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf

PRODUCT_PROPERTY_OVERRIDES +=
wifi.interface=wlan0
wlan.driver.status=ok

Hi Andrew,

Please you help me with the USB ADB.
I downloaded bbbandroid_111514.img.xz image, and I wrote this image to my Beaglebone Black.
I use Ubuntu 14.04, I have made /etc/udev/rules.d file with content:
#adb protocol on BeagleBone Black (BBB 1)
SUBSYSTEM==“usb”, ATTR{idVendor}==“18d1”, MODE=“0666”
#adb protocol on BeagleBone Black (BBB 2)
SUBSYSTEM==“usb”, ATTR{idVendor}==“0451”, MODE=“0666”
and I grant permission:
chmod a+r /etc/udev/rules.d/51-android.rules
and: adb kill-server, adb start-server
But when I give command “adb devices”, I only see “List of devices attached”, my BBB can’t attach.
So I decide to replace three files that you have attached to my BBB.
But now my BBB can’t start into Android OS, I only see ‘ANDROID’ on screen forever.
What’s happen here?
Please you help me for USB ADB.

Best regards
Jimmy Trinh

Was this ever resolved? I am experiencing a similar issue.

I can confirm it works fine with MacOSX, my guess its a configuration
issue on the Linux desktop side.

Keith

Seems to work now. I made sure udev had the correct entries and I was able to boot into Android and toggle an LED once I modified a few pertinent files.

Thanks!

Hi,

Can any body help me out to automount(mmc or usb) supports to BBB or not with android kitkat 4.4.4. If it supports can help me how to add support.

Thanks & Regards,
Narasimha.

I recently followed the instruction to build my own image(Android 4.4.4 + kernel 3.8.13), the ADB doesn’t work no matter whether I replaced the three file you upload in the response.
Any suggestions.

Thanks

-yin

在 2014年9月28日星期日 UTC-4上午11:14:24,Andrew Henderson写道: