**** BEGIN LOGGING AT Tue Jun 25 02:59:58 2013 Jun 25 03:20:50 what does that code do? Jun 25 03:50:10 Ah, i think it was to turn off the USR0 LED (heart beat pattern) because i needed something quick to do , and it was annoying Jun 25 03:50:57 Or it would at least momentarily bring it low. Jun 25 03:56:47 :) Jun 25 03:56:55 back from dinner jj2baile Jun 25 03:57:01 I'll poke at this tonight Jun 25 03:57:19 :P sure. Jun 25 03:57:41 tee hee Jun 25 03:57:54 thanks for posting it so we can all look. Jun 25 03:58:03 No probs. I forgot which machine it was on Jun 25 03:58:23 It is the one such that the code was easy to access Jun 25 03:58:28 so i just did it now. Jun 25 06:11:52 what options do we normally specify when cross compiling for the BBB running angstrom distribution using the angstrom toolchain? Jun 25 06:16:23 not usually Jun 25 06:17:35 ka6sox: me? Jun 25 06:19:13 hatguy, yes Jun 25 06:20:28 ka6sox: ahh...ok... so everything should work just fine without any explicit options? Jun 25 06:20:28 hatguy, the angstrom toolchain using bitbake has a recipe that has the options in it already Jun 25 06:20:44 ka6sox, i see Jun 25 06:20:47 so if you need foo you would: bitbake foo Jun 25 06:21:44 ka6sox understood Jun 25 06:24:40 follow the angstrom developer guide and it will show you how to use oebb.sh Jun 25 06:30:57 and that will create packages that are compatible with the Angstrom on your bb Jun 25 06:38:55 ahh.. ok .. thanks :) Jun 25 06:40:32 np Jun 25 07:07:15 vvu|Mobile: perhaps first try and compile a non modified version Jun 25 07:07:21 little steps at a time Jun 25 07:07:52 It's the standard one 1.0.3 non modified Jun 25 07:08:30 Just took your Android.mk not the rest Jun 25 07:21:33 gm Jun 25 07:23:21 av500: mornin Jun 25 08:37:09 ka6sox-away: work around found [http://github.jfet.org/BBKNotes2.html] pru test result as expected. Jun 25 08:37:20 (well bottom of the page) Jun 25 08:39:46 oh, well, maybe not as expected, Jun 25 08:50:27 vvu: I found back my cable ! Jun 25 08:51:01 keesj: hope in humanity restored! Jun 25 09:26:17 keesj: got libusb.so with the ndk Jun 25 10:18:26 passed my System.loadLibrary("usb"); ! Jun 25 11:11:32 vvu: I hacked a little on your code. Jun 25 11:12:00 saw u forked my git Jun 25 11:12:38 https://github.com/keesj/BBBabb/tree/on-android Jun 25 11:12:54 now build using ndk-buid. Jun 25 11:13:12 but it uses my libusb needed the helper Jun 25 11:13:41 if you replace libusb.so by yours you can adb push and run boot on Android Jun 25 11:14:19 yep i have mine Jun 25 11:14:27 i need to understand your helper a bit Jun 25 11:15:20 be right back ~10minutes to grab my board from home... Jun 25 11:18:45 the key is at http://pastebin.com/RJk3md16#98 Jun 25 11:19:21 the helper will call the calling class's method called open http://pastebin.com/CHn0F7Hq#49 Jun 25 11:21:41 but first just try running it (whithout the helper I think it should just work[tm] Jun 25 11:22:28 ok one second to grab things Jun 25 11:23:01 also while developing on usb-host/android it might be handy to enable adb over ethernet Jun 25 11:24:01 i have it already active Jun 25 11:46:00 vvu|Mobile: I push yet an other version also containing some java code and the creation of a .so file Jun 25 11:47:00 you need to first just try the "boot" on android from the command line . afther that I guess getting it work and adding the usb-host devices xml and debugging (I only compiled the code did not test it) Jun 25 11:47:10 and I need to do other stuff :P Jun 25 11:47:28 thank you a lot! Jun 25 11:48:13 glad to help Jun 25 12:48:01 keesj: ran the binary, 1st it hanged at libusb_kernel_driver_active(dev_handle, 0), the android kernel has no rndis driver. commented out those lines with the kernel then it hanged at receiving stuff at the bulk transfer function. will debug more Jun 25 12:48:58 are you "root" ? Jun 25 12:49:04 yes Jun 25 12:49:56 keesj: what i have with dmesg http://pastebin.com/yxYZQ2V5 Jun 25 12:53:18 i`ll be off a couple of hours, brb Jun 25 12:53:27 k Jun 25 16:48:45 jj2baile, I'll be in a position to help in about 30 minutes Jun 25 18:26:00 hello Jun 25 18:33:09 okay I'm back Jun 25 18:39:26 bradfa, did you see the repo that jj2baile put up? Jun 25 18:40:55 yes but haven't yet had the time to check it out Jun 25 18:47:22 know how that goes Jun 25 18:47:28 I'm doing about 4 server installs right now Jun 25 18:47:36 feel like a plate spinner Jun 25 18:51:50 vvu|Mobile: I looked are the backtrace again. do you know that driver is bound ? Jun 25 18:51:57 can you try and disable it? Jun 25 18:52:18 mhmh i already did some hacking with the otg check Jun 25 18:52:48 commented out a full function that checks for the otg, and tried to fool it in not trying to guess which is host and which is device Jun 25 18:54:18 i can do a make menuconfig and look at all the usb settings but have no clue what to disable Jun 25 18:56:07 no try to understand what driver is bound to use e.g. the rndis driver Jun 25 18:57:14 and disable that one. you can look what driver is bound in ls -l /sys/bus/devices/[id]/driver or similar Jun 25 18:59:14 http://lwn.net/Articles/143397/ Jun 25 19:00:08 ok, lemme make a defconfig recompile kernel and then see Jun 25 19:08:53 keesj: any idea how to get tree command on android ? Jun 25 19:08:57 busybox does not have it Jun 25 19:15:59 install terminal ide from the android market or a full busybox Jun 25 19:16:11 found my device with lucky guesses Jun 25 19:16:16 now i`m in the driver folder of my device Jun 25 19:16:18 but ls -lR or similar also works Jun 25 19:18:07 got http://pastebin.com/WV22N1kU Jun 25 19:18:58 you say i should disable the musb-omap2430 driver from the kernel ? Jun 25 19:19:31 disable or blacklist and see how it goes when no driver is bound Jun 25 19:21:09 but the drivers I see here are not what you are looking for this is just the bus driver Jun 25 19:22:08 I don't know much about hacking on real phones BTW I am used to development boards or things you can open:P Jun 25 19:22:27 or at least put a sd-card in to boot from. Jun 25 19:23:02 We don't want you to first blow up you port and mess up the software Jun 25 19:23:38 hmhmh Jun 25 19:23:46 * vvu|Mobile is really confused Jun 25 19:27:16 if you compile a kernel that doesn't boot do you know how to "flash a new rom" or similar? Jun 25 19:27:46 yep no problem here Jun 25 19:27:55 did this some times until i got the right kernel Jun 25 19:30:42 there is something curious because my java code and this libusb port fail in the same place Jun 25 19:33:56 is that good or bad? Jun 25 19:35:02 bad until the end. something happened on the way because i was able 2 night ago to get output from the BBB with my java code Jun 25 19:35:23 commited the working code and then fail. Jun 25 21:24:23 keesj: tested now on the nexus 7 to see if it behaves differently. same result but did not crash the driver it gave me http://pastebin.com/G2NyFnwn Jun 25 21:37:08 and does the same code still work on linux? Jun 25 21:38:23 i'm off Jun 25 21:38:49 yep, the same code works on linux Jun 25 21:39:27 keesj: gn! Jun 25 23:39:03 ds2: ping Jun 25 23:49:37 vvu: pong Jun 25 23:50:00 hello! have you followed up my discussions with keesj about the android problems ? Jun 25 23:50:17 vvu: not quote, sorry. mind summarizing? Jun 25 23:50:49 wrote code with the Android host API, when i try to read i always get -1(timeout). Jun 25 23:51:12 time out? hmmm Jun 25 23:51:15 anything on dmesg? Jun 25 23:51:28 and is this a JB device or a ICS device? Jun 25 23:51:34 JB Jun 25 23:51:35 4.2.2 Jun 25 23:51:47 Nexus 7 and Glaxy Nexus same behaviour Jun 25 23:51:49 that should have a tolerable host support Jun 25 23:52:01 do you have the right permissions setup? Jun 25 23:52:10 and are you compiling with a new enough API level? Jun 25 23:52:13 yep, everything works ok. Jun 25 23:52:15 yep Jun 25 23:52:22 minimum 12, where host is implemented Jun 25 23:52:41 what are you trying to do with the host API? Jun 25 23:52:42 and i`m compiling against 16 api level Jun 25 23:52:50 just to read bytes from the BBB Jun 25 23:53:04 https://github.com/ungureanuvladvictor/BeagleDroid/blob/master/BeagleDroid/src/main/java/com/vvu/beagledroid/MainActivity.java#L67 Jun 25 23:53:13 what kind of bytes? and from what endpoint? Jun 25 23:53:22 from bulk IN endpoint Jun 25 23:54:08 interface and endpoint are good, checked them Jun 25 23:54:12 do you have a usb analyzer? Jun 25 23:54:21 nop... Jun 25 23:54:21 or know enough to rig one up? Jun 25 23:54:31 ds2: here is my dmesg when i try to read http://pastebin.com/dAFBH6yY Jun 25 23:54:31 Oh hmmm Jun 25 23:54:33 no idea Jun 25 23:54:57 didn't you say you had a spare BBB? Jun 25 23:55:37 i have mine, still not received my BBB package Jun 25 23:55:51 you sure ep1 is setup to work in the direction you wanted it to go? usb endpoints are unidirectional Jun 25 23:56:00 what about a BBW? Jun 25 23:56:04 nop Jun 25 23:56:15 i can buy one if needed Jun 25 23:56:19 okay Jun 25 23:56:31 interface is 1 and ep is 0 Jun 25 23:56:38 same as in my libusb linux code Jun 25 23:56:47 do you know enough to try new kernels w/o bricking a device? Jun 25 23:56:55 yep Jun 25 23:57:14 okay, then enable the USB monitor code in the kernel. I think tcpdump will read it Jun 25 23:57:15 changed my kerneles couple of times and got my nexus 7 unbootable state Jun 25 23:57:20 see what the device is really doing Jun 25 23:57:28 tcpdump on android? Jun 25 23:57:29 is it NAK'ing or something else Jun 25 23:57:36 yeah... you'll need to do it from the shell Jun 25 23:57:46 ok, have some time to spare with me ? Jun 25 23:57:52 if you are lazy, cross compile it as a static binary that way you don't get shot by bionic Jun 25 23:57:57 just a little bit Jun 25 23:57:59 compile takes a bit... Jun 25 23:58:03 *nod* Jun 25 23:58:11 look around, I think there are tcpdump android binaries Jun 25 23:58:16 okok Jun 25 23:58:20 usb monitor code in kernel ? Jun 25 23:58:29 tcpdump can be a PITA...you need to do that and libpcap Jun 25 23:58:31 yes Jun 25 23:58:44 let me see if Ic an find the option Jun 25 23:58:46 give me a few Jun 25 23:58:49 ok Jun 25 23:59:10 for the record i needed to remove OTG support from the kernel Jun 25 23:59:33 with OTG enabled the kernel could not decice which is which HNP -32 something error Jun 25 23:59:38 CONFIG_USB_MON, see Documentation/usb/usbmon.txt Jun 26 00:00:08 that almost suggests either VBUS is noisy or it is pulling too much power Jun 26 00:00:20 or that kernel has a F'ed MUSB driver with issues on HNP handling Jun 26 00:00:33 btw, ep0 seems wrong. Jun 26 00:00:42 ep0 should be the control endpoint for enumeration, not the bulk interfaces Jun 26 00:00:49 interface 1 ep0 Jun 26 00:00:53 interface 0 ep0 is control Jun 26 00:00:55 so you might want to confirm you are sending to the right place Jun 26 00:01:03 okay Jun 26 00:01:06 fair enough Jun 26 00:01:07 ROM has 2 interfaces Jun 26 00:01:16 checked with lsusb -v Jun 26 00:01:32 in that case, see if you can get usbmon to work on the android side. it is a poor man's USB analyzer Jun 26 00:01:48 okok, i got it on linux to work Jun 26 00:01:53 see if the BBB side is NAK'ing or doing something bad with the request. or if it even makes it to the work Jun 26 00:01:55 a week ago i think Jun 26 00:02:06 yes but you need it on the android side Jun 26 00:02:11 yep yep Jun 26 00:02:22 unless you want to hack up a ROM emulator on the BBB and look at it that way ;) Jun 26 00:02:27 also looked at prices for USB analyzer *woop woop* Jun 26 00:02:35 USB analyzers aren't THAT bad Jun 26 00:02:47 their prices are Jun 26 00:02:49 it has come down a LOT Jun 26 00:03:06 you can in theory setup a BB* as an analyzer Jun 26 00:03:21 just have it repeat things from host to device port and vice versa in SW Jun 26 00:03:22 it was a project 2 years ago same for GSoC from BB Jun 26 00:03:34 on a BBxM Jun 26 00:03:36 yes Jun 26 00:03:52 the code should in theory work on any BB but you need to tweak it Jun 26 00:04:33 Let me take care some requests locally (as in people pestering me in person). I'll check my screen when I get back so go ahead and type out any questions. Jun 26 00:04:44 okok now i`m flashing the kernel Jun 26 00:06:24 you know about fastboot boot raw zImage ramdisk.img? Jun 26 00:06:28 so you don't have to flash it Jun 26 00:06:47 yep know about it Jun 26 00:14:30 ds2: got tcpdump to run on android Jun 26 00:14:51 got a capture with your code running? Jun 26 00:14:55 no i get "mount: device or resource busy" for mount -t debugfs none_debugs /sys/kernel/debug Jun 26 00:15:00 following http://nagaraj-embedded.blogspot.ro/2012/03/usbmon-capturing.html Jun 26 00:15:19 do "mount" and see if /sys/kernel/debug is mounted Jun 26 00:15:29 often on android, that is mounted already Jun 26 00:15:54 yep mounted debugfs /sys/kernel/debug debugfs rw,realtime 0 0 Jun 26 00:16:04 then skip that step Jun 26 00:16:30 mhmh needed to build my kernel with modules and install them? Jun 26 00:16:44 modprobe: can`t change directory to /lib/modules Jun 26 00:16:55 shouldn't... are you getting any graphics at all? Jun 26 00:17:07 yes, fully functional nexus 7 Jun 26 00:17:15 then the modules should be good Jun 26 00:17:21 oh wait n/m Jun 26 00:17:38 this is the N7, a Tegra..they don't use modules unlike the GNexus with the PVR Jun 26 00:17:58 is wifi working? Jun 26 00:18:00 yep Jun 26 00:18:06 then probally not Jun 26 00:18:11 what are you modprobing? Jun 26 00:18:16 also i can try on a OMAP, Galaxy Nexus Jun 26 00:18:19 modprobe usbmon Jun 26 00:18:33 is CONFIG_USB_MON=y or is it CONFIG_USB_MON=m? Jun 26 00:19:05 y Jun 26 00:19:11 then skip the modprobe Jun 26 00:19:21 modprobe assumes it is built with =m Jun 26 00:19:55 okok Jun 26 00:24:15 i got some output with cat /sys/kernel/debug/usb/usbmon/2u > /tmp/1.mon.out Jun 26 00:24:18 bus no2 Jun 26 00:24:24 now this thingie in wireshark right? Jun 26 00:29:12 do tcpdump -w Jun 26 00:29:24 it'll save a pcap file that you can load into wireshark later Jun 26 00:30:05 if i do tcpdump -w i cannot see my usb interface Jun 26 00:30:50 tcpdump -D Jun 26 00:30:52 sorry Jun 26 00:31:58 i have wlan0, p2p0, any and loopback Jun 26 00:35:46 hmmm Jun 26 00:37:12 try 'tcpdump -n -i usbmon' Jun 26 00:37:36 no such device Jun 26 00:38:18 what about - Jun 26 00:38:23 'tcpdump -n -i usbmon0' Jun 26 00:38:30 or tcpdump -n -i usb0 Jun 26 00:38:46 same for both Jun 26 00:39:02 hmm I wonder if your tcpdump is built with a too old libpcap Jun 26 00:39:19 what version does 'tcpdump -h' say? Jun 26 00:39:29 building now with the latest one :D Jun 26 00:39:50 http://wiki.wireshark.org/CaptureSetup/USB Jun 26 00:40:00 that should be applicable as they both do the work with libpcap Jun 26 00:40:05 got it Jun 26 00:40:08 usbmon1 Jun 26 00:40:10 "libpcap releases prior to 1.0 do not include USB support, so you will need at least libpcap 1.0.0." Jun 26 00:40:14 in tcpdump -D Jun 26 00:40:15 oh nifty Jun 26 00:40:33 got a binary random internet libpcap 0.9.8 Jun 26 00:40:40 now build with 1.4.0 Jun 26 00:40:48 if you don't like tcpdump's format, you can always -w it to a file and use wireshark or some other tool Jun 26 00:40:49 'k Jun 26 00:46:51 ds2: there is something awkward going on here Jun 26 00:46:55 i start the capture Jun 26 00:47:07 run my code. wait like 2 mins to get something there Jun 26 00:47:31 and then ctrl c to close tcpdump, Jun 26 00:47:32 ^C0 packets captured 0 packets received by filter 2 packets dropped by kernel Jun 26 00:49:52 hmmm it is not making it down to the stack Jun 26 00:50:01 so either the kernel is failing it or android is...Hmmm Jun 26 00:50:28 can't think of anything else off hand Jun 26 00:50:41 i also spoke with chainfire about all this stuff Jun 26 00:50:58 same answer there, something is wrong but can`t figure out where Jun 26 00:51:06 he looked over my code and seemed ok by him Jun 26 00:51:11 my gut would say blame android Jun 26 00:51:26 you have a C version that works on the N7? Jun 26 00:51:40 the C one also fails Jun 26 00:51:42 with libusb Jun 26 00:51:45 at read Jun 26 00:51:48 same location Jun 26 00:52:35 chainfire suggester even if the device is recognised in dmesg to change the otg adapter Jun 26 00:52:38 that'd would suggests the kernel doesn't like something about it Jun 26 00:52:45 doesn`t really make sense but nah Jun 26 00:52:51 I suspect it is in the USB common code Jun 26 00:53:02 what you are doing is more or less like a urb_submit in kernel space Jun 26 00:53:18 if it`s there it`s way way over my knowledge Jun 26 00:53:31 maybe look at the kernel and see under what conditions you can get a ETIMEOUT for a urb_submit call? Jun 26 00:53:50 I probally won't chase it beyond the usb common code unless it is totally dead end Jun 26 00:54:22 the N7 uses a EHCI controller and that code is moderately well tested as a host Jun 26 00:54:53 chainfire told me same thing, he used n7 a lot with usb host Jun 26 00:55:37 this is not good when 2 people independantly are getting to the same point and getting stuck :( Jun 26 00:56:23 i think problem is in kernel Jun 26 00:56:31 because same thing happens on a Galaxy Nexus device Jun 26 00:56:41 that is good Jun 26 00:56:48 it can only be in the common code Jun 26 00:56:55 GNexus uses musb, N7 is EHCI Jun 26 00:57:15 will take me some time to figure it out... Jun 26 00:57:16 look at drivers/usb/host Jun 26 00:57:19 drivers/usb/core Jun 26 00:57:41 that should be the 2 places that can do this. your write should be translated into a urb_submit Jun 26 00:58:37 drivers/usb/host/ehci-tegra.c ? Jun 26 00:58:45 that would be device specific Jun 26 00:59:02 that code is not used on the GNexus Jun 26 00:59:16 and that code gets caleld from the stuff in the otehr 2 places Jun 26 00:59:28 uoke Jun 26 00:59:44 flow is something like - urb_submit -> checking by common code -> device specific code -> device specific code invokes callback when done/error Jun 26 00:59:59 good to know Jun 26 01:00:40 urb's are USB request blocks Jun 26 01:01:30 ds2: thx a lot for the help, i will bug more 2morrow. now need to get some sleep Jun 26 01:01:34 good night! Jun 26 01:04:54 'k Jun 26 01:04:56 good night **** ENDING LOGGING AT Wed Jun 26 02:59:58 2013