[Q][Kernel] Support for HIDRAW devices - Acer Iconia A500

Hi there,
I am trying to port this: engadget. com /2011 /09 /16 / brain-scanner-app-lets-you-show-off-your-smarts-on-the-go (I can't post links, sorry) to the Acer A500 with Android 3.1. This requires connecting the receiver to the tablet and reading raw binary data it feeds through the USB port.
The way it was done for the Nokia N900 was to compile the hidraw.ko kernel module and insmod it on the device. I thought it would be the same for Android. I did the following:
1) I downloaded the source code of the 2.6.36.3 kernel and the toolchains from github
2) I pulled the default config from the device
3) Changed
Code:
#CONFIG_HIDRAW is not set
to
Code:
CONFIG_HIDRAW=y
and
Code:
CONFIG_USB_HID=y
4) Compiled modules with cross compilation
5) got only usbhid.ko and some other irrelevant modules but no hidraw.ko
6) Could not even insmod usbhid.ko, because it is already loaded. Could not rmmod the current usbhid.ko (I do have root).
7) When I plug the receiver into the USB port it is recognized, but then the dmesg says:
Code:
<6>[ 1591.572355] usb 1-1: new full speed USB device using tegra-ehci and address 2
<6>[ 1593.633364] usb 1-1: New USB device found, idVendor=1234, idProduct=ed02
<6>[ 1593.634022] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 1593.634377] usb 1-1: Product: Receiver Dongle L01
<6>[ 1593.635002] usb 1-1: Manufacturer: Emotiv Systems Pty Ltd
<6>[ 1593.635350] usb 1-1: SerialNumber: SNXXXXXXXXXXXXXX
<3>[ 1593.651672] generic-usb 0003:1234:ED02.0001: claimed by neither input, hiddev nor hidraw
<3>[ 1593.662383] generic-usb 0003:1234:ED02.0002: claimed by neither input, hiddev nor hidraw
Finally the question is:
How to enable HIDRAW on the Acer A500 and get this thing to work?

Related

USB Host mode on Defy

Has anyone tried Defy's USB Host mode?
Would like to attach USB devices onto Defy:
- USB keyboard / mouse
- USB disk drives
- Other types of USB 3G modems (like CDMA1x/EVDO)
- Arduino IO board
...
I haven't bought Defy yet, but want to do some pre-research before the purchase.
Could someone do me a favor to post the outputs of "dmesg" on Defy?
(Run dmesg command under the Linux console).
I expect to see something like:
Code:
...
OMAP3630 ES1.1
...
twl4030_usb twl4030_usb: Initialized TWL4030 USB module
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Sangoma WANPIPE r outer v1.1 (c) 1995-2000 Sangoma Technologies Inc.
Bluetooth: Core ver 2.15
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
musb_hdrc: version 6.0, musb-dma, otg (peripheral+host), debug=0
musb_hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
...
I got above dmesg by Web searching for an OMAP3630 test board, not a Defy.
Just want to make sure Defy is equipped with USB OTG controller.
This function not supported in the kernel, so kernel we can not replace, because bootloader is locked.
_ReBoot_ said:
This function not supported in the kernel, so kernel we can not replace, because bootloader is locked.
Click to expand...
Click to collapse
Understood the bootloader is locked by Moto, and a kernel must be signed.
Instead of replacing kernel itself, can we just load new driver modules (*.ko via insmod command)?
Does Moto also prevent from loading customized driver modules?
Can someone help to get the outputs of "cat /proc/driver/musb_hdrc" ?
Something like:
Code:
#cat /proc/driver/musb_hdrc
Status: MHDRC, Mode=Peripheral (Power=60, DevCtl=80)
OTG state: b_idle; inactive
Options: musb-dma, otg (peripheral+host), debug=3 [eps=16]
Peripheral address: 30
Root port status: 00000000
Gadget driver: (none)
http://copytaste.com/e272
unrafa said:
http://copytaste.com/e272
Click to expand...
Click to collapse
unrafa, thanks a lot for your info.
One correction to my previous command line for current USB mode:
"cat /sys/devices/platform/musb_hdrc/mode"
Following dmesg of Defy shows the internal USB modem is attached to the USB Host for modem init. But later reset as b_peripheral:
Code:
<6>[ 8.118133] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
<4>[ 8.118347] IRQ 78/usbtll: IRQF_DISABLED is not guaranteed on shared IRQs
<6>[ 8.119018] ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
<6>[ 8.119323] ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
<6>[ 8.119842] ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
<6>[ 8.134368] ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
<6>[ 8.135192] usb usb1: configuration #1 chosen from 1 choice
<6>[ 8.135650] hub 1-0:1.0: USB hub found
<6>[ 8.135833] hub 1-0:1.0: 3 ports detected
<6>[ 8.136688] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
<6>[ 8.137451] usbcore: registered new interface driver cdc_acm
<6>[ 8.137573] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
<6>[ 8.138244] usbcore: registered new interface driver usbserial
<6>[ 8.138366] usbserial: USB Serial Driver core
<6>[ 8.138641] USB Serial support registered for moto-modem
<6>[ 8.138946] usbcore: registered new interface driver moto-modem
<6>[ 8.139312] USB Serial support registered for QSC 6085 Modem Driver
<6>[ 8.139617] usbcore: registered new interface driver cdma-modem
...
<6>[ 80.229614] MUSB BUS RESET as b_peripheral
How about to use:
"echo b_host > /sys/devices/platform/musb_hdrc/mode"
to enable the Host mode again?
May run command "modinfo musb_hdrc" to get actual parameters we can use to enable the Host mode.
Something like "modprobe musb_hdrc mode_default=1".
$ cat /sys/devices/platform/musb_hdrc/mode
b_peripheral
# echo b_host > /sys/devices/platform/musb_hdrc/mode
# echo b_host > /sys/devices/platform/musb_hdrc/mode
# cat /sys/devices/platform/musb_hdrc/mode
b_peripheral
# ls
uevent
modalias
subsystem
power
driver
gadget
mode
vbus
srp
# cat power
power: invalid length
# ls
uevent
modalias
subsystem
power
driver
gadget
mode
vbus
srp
# cat mode
b_peripheral
# cat vbus
Vbus off, timeout 0 msec
# cat srp
srp: invalid length
# cat uevent
DRIVER=musb_hdrc
MODALIAS=platform:musb_hdrc
# cat modalias
platform:musb_hdrc
# cat subsystem
subsystem: invalid length
# modinfo musb_hdrc
modinfo: can't open '/lib/modules/2.6.32.9-ga649a2e/modules.dep': No such file or directory
# modprobe musb_hdrc
modprobe: chdir(/lib/modules): No such file or directory
by the way /lib/modules doesnt exist, there are 20 modules in /system/lib/modules
and no musb_hdrc module there
Inside android's menu if i change "motorola Phone portal" to "USB mass storage" dmesg got this
<3>[12344.262695] do_cmd_proc_msg: Acquisition cycle length overflow
<6>[12345.158843] musb_pullup - Disabling USB Pullups
<6>[12345.159606] usbnet_disable
<7>[12345.159881] mtp_function_disable(): disabled
<6>[12345.161651] adb_release
<6>[12345.163146] adb_open
<6>[12345.165618] Sending USBLAN disabled uevent
<6>[12345.279876] musb_pullup - Enabling USB Pullups
<6>[12345.389068] device_mode_change_write - Successfully enabled function - msc_adb
<6>[12345.594573] MUSB BUS RESET as b_peripheral
<6>[12345.674407] MUSB BUS RESET as b_peripheral
<6>[12345.705291] android_usb gadget: high speed config #1: android
<4>[12349.139770] mmc0: Starting deferred resume
<4>[12349.511322] mmc0: Deferred resume completed
/sys/module/musb_hdrc/parameters/debug exists. no more than that file
Would it be possible to connect an external hard disk to this phone?
MAPGPS said:
Does Moto also prevent from loading customized driver modules?
Click to expand...
Click to collapse
No, we really can load own driver modules....
sent from my moto defy with taptalk
It would be very great if this will work.
Is there any progress?
yeah, be nice to connect 2 usb hosts so i can copy my slr pictures from a 32gb sd card over to a 320gb hdd.
I have usb y cables so i can power the hosts with an external usb charger.
Any news on this?
It will be nice to see an USB host patch/mod on Defy
hi
I've seen that some phones will enable host mode if you boot them with the data pins shorted, done with a "dongle". anyone tried this on the defy? I'll make one and try it if no one has.
Sent from my MB525 using Tapatalk
hmm.. is that safe? I dont want to burn my usb port..
I doubt it will damage anything. they won't be able to source enough current.
I've checked and the omap3610 supports usb otg. I will try to test this weekend.
Sent from my MB525 using Tapatalk
http://www.tombom.co.uk/blog/?p=124
that page shows the 'dongle' I mean.
Sent from my MB525 using Tapatalk
drmouse81 said:
hi
I've seen that some phones will enable host mode if you boot them with the data pins shorted, done with a "dongle". anyone tried this on the defy? I'll make one and try it if no one has.
Sent from my MB525 using Tapatalk
Click to expand...
Click to collapse
Scratch that, it is not the data pins, you connect the "extra" pin (pin 4) to ground.
Maybe 2nd ini make this able...
Guys, i saw something on Blog.Makezine.
http://androidcommunity.com/ioio-fo...mples-from-usb-breakout-board-video-20110408/
http://ytai-mer.blogspot.com/2011/04/meet-ioio-io-for-android.html
Maybe this could help, would love to be able to play video files from a external HDD. Watching movies on the backseat while we drive to our vacation!
maybe we need another kernel,i think

[Q] USB Ethernet Network Adapter on ICS

Is it possible to get this working on the Acer A500 with the ICS leak? I've been able to use it on all 3.2 ROMs and Thors ICS, but when moving to the leak it will not execute "usb_ethernet", it recognizes it as a command but no output is shown. system is set to RW but it still doesn't load.
Just curious.
Thanks everyone!
On the ICS roms, usb1 is not showing up as a network interface
When I look at my dmesg, it shows "USB Ethernet Ver .2" but never loads the ASISX driver.
On Thors ICS it registers "asix 1-1.0: eth0: register "asix" at usb-tegra-ehci.2-1, ASIX AX8877 USB 2.0 Ethernet"
Perhaps its due to the leaked builds using the stock kernel?
I'm using Flexreaper R10 and here is what I get
I flashed the zip provided HERE
I insert the USB adapter and dmesg shows
Code:
<6>[ 146.691880] usb 1-1.3: new high speed USB device number 5 using tegra-ehci
<6>[ 146.763606] usb 1-1.3: New USB device found, idVendor=13b1, idProduct=0018
<6>[ 146.691880] usb 1-1.3: new high speed USB device number 5 using tegra-ehci
<6>[ 146.763606] usb 1-1.3: New USB device found, idVendor=13b1, idProduct=0018
<6>[ 146.764309] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 146.764980] usb 1-1.3: Product: USB 2.0 Network Adapter ver.2
<6>[ 146.765345] usb 1-1.3: Manufacturer:
<6>[ 146.765721] usb 1-1.3: SerialNumber: 01E821 device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 146.764980] usb 1-1.3: Product: USB 2.0 Network Adapter ver.2
<6>[ 146.765345] usb 1-1.3: Manufacturer:
<6>[ 146.765721] usb 1-1.3: SerialNumber: 01E821
I try to manually load the module I need, "asix410.ko" and I get
Code:
<3>[ 463.740506] asix410: version magic '2.6.36.3 SMP preempt mod_unload ARMv7 ' should be '2.6.39.4+ SMP preempt mod_unload ARMv7 '
Any ideas?
I see that it says that the kernel is not the proper version, but I was under the impression that as log as the kernel is 2.6.39.x, this driver should work.
Thanks!
Try using a hex editor to change the version info in the .ko file to match what the system is expecting and give it a try. I've done that successfully before with a cifs.ko module.
saeba said:
Try using a hex editor to change the version info in the .ko file to match what the system is expecting and give it a try. I've done that successfully before with a cifs.ko module.
Click to expand...
Click to collapse
I did that, having seen you do that with cifs, but the kernel is was made for has like 6 characters whereas this one has 7, so because of that the kernel finds that there is a mismatch and STILL won't load the module.

[Q] how can I debug otg connections

SOLVED: defective otg cable
useful tools:
any android terminal emulator plus root
dmesg
lsusb
2nd otg cable
I cannot seem to get otg working with any of the various USB storage devices I have.
Any ideas on how I can debug this?
If it were normal Linux it would be easy enough, however it's not.
Any suggestions would be appreciated.
Running AOKP buttered right now but sentinel stock and paranoid all do not work either. So it might be a cable or the tablet even.
Hmm not sure but I wonder if the kernel with this rom is missing the fat kernel modules
Thanks
Sent from my Nexus 10 using xda premium
tazmeister said:
I cannot seem to get otg working with any of the various USB storage devices I have.
Click to expand...
Click to collapse
I had the same problems with rooted Stock and various custom ROMs. Try installing "USB OTG Helper [root]" then retest. This app helped get me RW access to OTG storage from SD cards to powered HDD drives in various formats (ext2,3,4 and NTFS).
It worked so well I paid for the donate version just to support the developer. It even has exFAT support although I never tried it. Personally I think it should be part of standard Android.
Have you checked "lsusb" or "udevadm" in terminal if the device recognizes anything?
KasF said:
Have you checked "lsusb" or "udevadm" in terminal if the device recognizes anything?
Click to expand...
Click to collapse
Thanks more commands to jog my memory and try
I installed a console app and can check dmesg and other stuff.
Lsmod and related seem to be mostly obsolete.
Dmesg shows something is seen but the system keeps failing after this.
I see the same messages regardless of which device I try, powered and unpowered.
<6>[ 6171.135316] s5p-ehci s5p-ehci: S5P EHCI Host Controller
<6>[ 6171.136622] s5p-ehci s5p-ehci: new USB bus registered, assigned bus number 1
<6>[ 6171.137173] s5p-ehci s5p-ehci: irq 103, io mem 0x12110000
<6>[ 6171.145031] s5p-ehci s5p-ehci: USB 0.0 started, EHCI 1.00
<6>[ 6171.145636] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
<6>[ 6171.146150] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[ 6171.146439] usb usb1: Product: S5P EHCI Host Controller
<6>[ 6171.146925] usb usb1: Manufacturer: Linux 3.4.5-gb44fbc0 ehci_hcd
<6>[ 6171.147202] usb usb1: SerialNumber: s5p-ehci
<6>[ 6171.150947] hub 1-0:1.0: USB hub found
<6>[ 6171.151298] hub 1-0:1.0: 3 ports detected
<6>[ 6171.153725] exynos-ohci exynos-ohci: EXYNOS OHCI Host Controller
<6>[ 6171.156783] exynos-ohci exynos-ohci: new USB bus registered, assigned bus number 2
<6>[ 6171.157031] exynos-ohci exynos-ohci: irq 103, io mem 0x12120000
<6>[ 6171.214330] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
<6>[ 6171.214522] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[ 6171.214630] usb usb2: Product: EXYNOS OHCI Host Controller
<6>[ 6171.214813] usb usb2: Manufacturer: Linux 3.4.5-gb44fbc0 ohci_hcd
<6>[ 6171.215052] usb usb2: SerialNumber: exynos-ohci
<6>[ 6171.220588] hub 2-0:1.0: USB hub found
<6>[ 6171.220946] hub 2-0:1.0: 3 ports detected
<6>[ 6171.225049] manta_otg manta_otg_work: b_idle -> a_host
<6>[ 6171.705161] usb 2-1: new full-speed USB device number 2 using exynos-ohci
<3>[ 6171.835100] usb 2-1: device descriptor read/64, error -62
<3>[ 6172.070121] usb 2-1: device descriptor read/64, error -62
<6>[ 6172.300093] usb 2-1: new full-speed USB device number 3 using exynos-ohci
<3>[ 6172.430142] usb 2-1: device descriptor read/64, error -62
<3>[ 6172.665754] usb 2-1: device descriptor read/64, error -62
<6>[ 6172.895140] usb 2-1: new full-speed USB device number 4 using exynos-ohci
<3>[ 6173.305043] usb 2-1: device not accepting address 4, error -62
<6>[ 6173.430032] usb 2-1: new full-speed USB device number 5 using exynos-ohci
<3>[ 6173.840038] usb 2-1: device not accepting address 5, error -62
<3>[ 6173.840490] hub 2-0:1.0: unable to enumerate USB device on port 1
Sent from my Nexus 10 using xda premium
None of the org helper apps have helped.
I don't think the org cable is bad though maybe this detail means otherwise
one device starts charging itself of the musb port when i plug it in.
Sent from my Nexus 10 using xda premium
KasF said:
Have you checked "lsusb" or "udevadm" in terminal if the device recognizes anything?
Click to expand...
Click to collapse
udevadm doesn't seem to be present but lsusb lists 2 devices when I have something plugged in.
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Sent from my Nexus 10 using xda premium
ok problem solved.
The final debugging step was to "get another otg cable and test to make sure the first otg cable isn't defective"
Since I only owned a single OTG cable at the start, it was sort of difficult to perform this ultimate debug step.
But once I tried a different cable, almost everything worked just fine.
Only my 64gb micro-sd cards gave me a little trouble, but they all work now.

USB Debugging On Linux

USB debugging on Linux
Maybe it's just me being blind, but does anyone have `adb` working on Linux? Device ID shows up as 0fca, and I've added this to my udev rules, but still no device. Notification shows "USB debugging connected - Touch to disable USB debugging" with "Media device (MTP)" and "Camera (PTP)" USB connections.
Code:
07:32:04 ~$ lsusb |grep Research
Bus 001 Device 003: ID 0fca:8032 Research In Motion, Ltd.
Code:
[ 397.648593] usb 1-1: new high-speed USB device number 3 using ehci-pci
[ 397.920791] usb 1-1: New USB device found, idVendor=0fca, idProduct=8032
[ 397.920796] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 397.920798] usb 1-1: Product: BlackBerry
[ 397.920799] usb 1-1: Manufacturer: BlackBerry
[ 397.920801] usb 1-1: SerialNumber: <x>
Code:
07:39:49 ~$ adb devices
List of devices attached
Thanks!
Figured it out. My Linux environment (Ubuntu 14) had the package 'android-tools-adb' installed, but that version of `adb` doesn't seem to work. The `adb` binary with the SDK tools works fine. I removed the 'android-tools-adb' and all is well again. :laugh:

Errors with SP Flash tools on Ubuntu 18.04

I have been trying to flash some old M2 Note units and so far I can't get the Preloader to talk over USB:
Code:
[ 1774.167123] usb 1-1: new high-speed USB device number 35 using xhci_hcd
[ 1774.320150] usb 1-1: New USB device found, idVendor=0e8d, idProduct=2000, bcdDevice= 1.00
[ 1774.320152] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1774.320153] usb 1-1: Product: MT65xx Preloader
[ 1774.320153] usb 1-1: Manufacturer: MediaTek
[ 1774.344085] cdc_acm 1-1:1.0: Zero length descriptor references
[ 1774.344093] cdc_acm: probe of 1-1:1.0 failed with error -22
[ 1774.384238] cdc_acm 1-1:1.1: ttyACM0: USB ACM device
[ 1776.971989] usb 1-1: USB disconnect, device number 35
I tried adding the vendor ID and product ID to the new_id of the cdc_acm driver and also masking/disabling the ModemManager service in case it was interfering.
I had the same issue on WIndows... it would reset immediately and kick into normal Android mode.
Anyone has any advice? I'm going to trying using the OTA zip with the modified/unlocked images for the preloader.
Flashing TWRP via Flashify did not work out.... rebooted into recovery to the default Meizu one.

Categories

Resources