USB HOST working ! - myTouch 3G, Magic Android Development

Just confirmed working usb host mode on the magic 32b using hacked up version of the hero host patches posted to android-kernel google group by Andrew de Quincey, applied on top of current cyanogen. Y cable for external power required.
No where near ready for production (word to wise, dont try to mount a 32gb partition while each usb register operation is debug logged) but at least we now know the hardware can do it.
Chris

Can you provide the link with the patch?

pagubg said:
Can you provide the link with the patch?
Click to expand...
Click to collapse
When I get rid of the hacked up part... supposed to be asleep right now.

Andrew's patches are at
http://groups.google.com/group/android-kernel/browse_thread/thread/c8471573d7553331
The one for 2.6.27 will apply to current cyanogen 2.6.29.6 if you remove the diffs for the battery file which will fail incomplete.
However there is a bug that was causing one of the structure to get corrupted so some function pointers for phy setup never got called leading to inability to detect anything on the USB bus below the built-in hub. I did an ugly fix to verify the hardware works. I suspect for a real fix the hcd_to_msm7201() function needs an internal cast to (char *) or just some extra () or something to make the arithmetic come out right (it seems to be multiplying the size of the structs instead of adding them).
Of course you loose your adb when you play with this...

Related

[KERNEL][ICS] I.A.P Samurai - Updated- 6/8/12

Independent Android Project
and
The House Of The Samurai
Present
USB HOST MODE FOR THE EPIC
(special thanks to SZTUPY for his code and help)​
DISCLAIMER: We are in no way responsible for any damages that you may cause to your device or other equipment used... With that said I would like to add some input on this. The samsung epic seems to have an overcharge protection. When you apply to much voltage it seems to reboot. In order to find this out I burnt up a usb hub. With that said learn from my mistakes more power is not always a good thing... and 10v and 1.4a is far to much power for a hub. stick with 5v 0.7a...
SIDE NOTE: The I.A.P.Appv3... Works with both Gingerbread and Ice Cream Sandwich Roms. A Colaboration of Earthbound And Luna ! ! ! Still being refined but you have access to everything IAP has to offer with this app, from downloads, current news, to a donation page...
Download Link: I.A.P.APPv3
What is USB Host Mode: Well usb host mode was SzTupy's continuation of others work on implementing access to usb media & hid devices from our phone. He succeeded in porting it to many different devices but had not done it for the epic. With a little help from him, I was able to port it and get it working properly.
.:Materials:.
Code:
~OTG connector (do your self a favor & save on the headaches, Amazon $3)
~A jig (made of 2 male & a female USB connectors with a power supply)
~HID device/hdd/or some type of flash media (USB device)
~A 5v 0.7amp power supply (your stock epic charger...)
Notes: even though the kernel has ntfs support you will need a program like drive mount in order to mount these devices.
What works:
Code:
~ FAT32 support (usb host controller)
~ HID support (usb host controller) (love the mouse pointer... lol)
~ Wireless HID support now working (a bit finicky but it works)
~ NTFS support (drive mount) (watched a full video on my epic today)
What doesn't work yet:
Code:
~ Plugging a usb 1.0 device into a 2.0 usb hub
Please watch these videos before attempting this:
.:JIG SETUP:.
.:HOST MODE WITH HID DEVICE:.
Now that you have seen the setup and what you need.
.: Phone Setup :.
Code:
#1 download usb host controller by sztupy
#2 download and install usb host mode samurai kernel
#3 go into settings in usb host controller app..
#4 set the settings that are displayed below
.: SETUP THE JIG :.
Code:
#1 Plug the one end of your jig into the power supply.
#2 Plug your usb hub into one end of the jig.
#3 Plug a usb media device (fat32 format) into the usb hub.
#4 Plug the OTG Cable into the other end of the jig.
.: PLUGGING IN THE PHONE :.
Code:
[I]*NOTE : make sure your jig is all setup. Power Connected. USB hub connected, at least 1 usb media device plugged into the hub, and your otg cable connected to the hub.*[/I]
#1 MAKE SURE YOUR SYSTEM IS MOUNTED READ/WRITE (i use root explorer to check this)
#2 Plug the micro usb end into your samsung epic micro usb port.
(you will see it enumerate the the hub and the device, then it will show your devices listed below that.
#4 Select mount and choose your mount point (mount point is where you will view your files at from an explorer)
#5 Now open an explorer of your choice (once again I use root explorer)
#6 Navigate to the mount point you set. So if you used /mnt/emme it will be in mnt/emme, i set a mount point in my sd card /sdcard/host so I can browse the sd card to the host file and view, copy paste or edit files on the media device in that file...
#7 When you are done be sure to unmount the devices before pulling out the otg cable from the phone !
(if you do not do this depending on where you mounted it (system = reboot the phone) (sdcard = cannot mount to a pc, or unmount and remount from the system until you reboot)
.: DOWNLOAD LINKS :.
.: CM9/AOKP/MIUIv4 :.
SAMURAI.AKITA.CM9.OTG.06.08.15.38.zip
voodoo color tweaks
battery tweaks (not BLX crap)
low battery shutdown fix
Governor & I/O tweaks
1.5GHz max cpu freq
Cache Flush Routine
400mhz GPU overclocking
USB Host Mode
+ many other Samurai Tweaks
.:SOURCE:.
BARBONE.CM9.SAMURAI.HOST.MODE
[kernel] iap samurai *cm9 host mode updated* 04/21/2012
​
Reservered. Earthbound has passed on the OP to Uber.​
First?
Sent from my SPH-D700 using Tapatalk 2 Beta-5
.:OLD DOWNLOADS:.
CM9: SAMURAI.AKITA.CM9.OTG.04.09.22.48
Reserved for later use.... Damn it marcus ! ! ! Lol
earthbound[iap] said:
Reserved for later use.... Damn it marcus ! ! ! Lol
Click to expand...
Click to collapse
The funny thing is that I have not been on XDA for most of the day and was just checking ;P. If a moderator wants, they can remove my post.
Sent from my SPH-D700 using Tapatalk 2 Beta-5
Naw it's all good you just hit the thread at the perfect moment...
Sent from my SPH-D700 using xda premium
Can't wait for my OTG Cable to get here. This will be so awesome!
Oh yes
Sent from my SPH-D700 using XDA
So I watched the vid, and the hardware needed looks to be:
the standard power supply for my epic
standard male/female USB cord (to be cut to have power wires added to it)
adapter for standard USB (like on the HD) to the mini USB (of my epic)
That it hardware wise?
Everything else looked to be straight forward in the setup and explanation, just wanted to make sure I had the HW correct before I started cutting.
Gotta have an otg connector it has a ground that your phone needs in order to register usb host mode.
Sent from my SPH-D700 using xda premium
Source code link?
I'm not going to turn this into an argument of how it has to be formatted, but XDA rules do require it, in full.
jnadke said:
Source code link?
I'm not going to turn this into an argument of how it has to be formatted, but XDA rules do require it, in full.
Click to expand...
Click to collapse
Do you see a link yet ? ? ? The kernel hasn't even gone live yet the only people with access to the source code or even the kernel right now are current IAP developers... When the link goes up so will the source code... Pay close attention... Do not bring your source nazi BS in here before the thread is even a go... My source is always up to date and I always provide a link.....
I was going to push a commit but just for this instance of source nazi'ism b4 the kernel is even up for the general public, I believe I will throw the source up fresh with no commits. Thank you for your time and if anyone wants to truly contribute to the host cause with some valuable input just ask me once the kernel goes live and I will send you a patch otherwise the rest of you can weed out the commit from a completely commit free source... I suggest getting a diff viewer.... LMFAO !
THANKS AGAIN,
Justin D. Maggiolo
EarthBound.IAP
P.S. You got me thinkin about not even releasing this publicly now... I'm ok with that and I'm pretty sure our devs are as well...
jnadke said:
Source code link?
I'm not going to turn this into an argument of how it has to be formatted, but XDA rules do require it, in full.
Click to expand...
Click to collapse
A pm could have maybe been a little more better, sheesh.
Sent from my SPH-D700 using XDA Premium App
jnadke said:
Source code link?
I'm not going to turn this into an argument of how it has to be formatted, but XDA rules do require it, in full.
Click to expand...
Click to collapse
What an [email protected]@ho*e
thing is the kernel isn't even up yet, I do not have to provide source until it goes public... Even before the kernel comes out got cherry pickers hunting away.... lol.
What the hell they have a GPL committee now for earthbound.. seems like everytime you post things they automatically say something about it. Before someone says how important is i understand... but its not even up yet... let it go!
earthbound[iap] said:
thing is the kernel isn't even up yet, I do not have to provide source until it goes public... Even before the kernel comes out got cherry pickers hunting away.... lol.
Click to expand...
Click to collapse
I'm a cherry picker
But yes, kernel source does not have to be released for a time after the kernel is released.
His point is that somebody like me could go in, steal the commit, release my kernel and have people think I did it first.
Sent from my SPH-D700 using Tapatalk
jnadke said:
Source code link?
I'm not going to turn this into an argument of how it has to be formatted, but XDA rules do require it, in full.
Click to expand...
Click to collapse
Why would you require source for a video of something. Unless the actual kernel is up for download, source is not needed.
Sent from my SPH-D700 using Tapatalk
marcusant said:
Why would you require source for a video of something. Unless the actual kernel is up for download, source is not needed.
Sent from my SPH-D700 using Tapatalk
Click to expand...
Click to collapse
This is correct.

Linux on Shield

I would like to know some things about the Linux on the Shield.
1) I've heard in December of the Last Year it didn't support wifi, bluetooth and SD Cards. What is their current status now?
2) Does it supports USB Devices, like Keyboard, Mouse, Ethernet Adapter (I REALLY hope i don't need this), Printer and USB HUB?
3) Is there some kind of Driver for the Tegra 4 on the Linux?
4) How do i install Linux on the Shield?
5) Is there some way to dual boot it with Android?
Hi,
MADCastro said:
1) I've heard in December of the Last Year it didn't support wifi, bluetooth and SD Cards. What is their current status now?
Click to expand...
Click to collapse
Good news - Wifi and SD cards are now working (well, most SD cards at least) on my roth_next branch: https://github.com/linux-shield/kernel/tree/roth_next Bluetooth is still out of luck for now.
MADCastro said:
2) Does it supports USB Devices, like Keyboard, Mouse, Ethernet Adapter (I REALLY hope i don't need this), Printer and USB HUB?
Click to expand...
Click to collapse
All USB devices supported by Linux should be working with SHIELD, as long as the kernel driver for them is compiled. I have played with a keyboard, mouse, network adapter and mass storage device, all connected to a hub.
MADCastro said:
3) Is there some kind of Driver for the Tegra 4 on the Linux?
Click to expand...
Click to collapse
Not sure what you mean - Tegra 4 is supported in Linux mainline, and some of its devices as well.
MADCastro said:
4) How do i install Linux on the Shield?
Click to expand...
Click to collapse
It's a quite manual process at the moment. You might want to consider what your end goal is, and whether it is worth the trouble, knowing that there is no graphic acceleration, no way to sleep, and so on. If you really want to give it a try (it implies cross-compiling the kernel, playing with fastboot, and extracting user-spaces to SD cards), let me know and I will try to come with a documentation sometime soon.
MADCastro said:
5) Is there some way to dual boot it with Android?
Click to expand...
Click to collapse
Sort of. You can store the Linux user-space on a SD card, or even in a file on your Android data partition that will be mounted as a root loopback device.
The problem is that SHIELD's bootloader only supports booting via two means:
- Whatever kernel is on the BOOT partition
- Whatever boot image is given to it using the fastboot boot command.
This means that you can either keep the Android boot image on the BOOT partition and boot Linux using "fastboot boot" while your SHIELD is connected to your PC via USB, or the other way around. But if you want to switch the system to boot, you will need to connect your SHIELD to your PC and play with fastboot.
Let me know if this answers your questions and if you need more information. What you can do with Linux on SHIELD is still limited ; but it's a fun way to get involved in kernel hacking since many missing drivers can easily be written and general support can also be improved.
"Good news - Wifi and SD cards are now working (well, most SD cards at least) on my roth_next branch: https://github.com/linux-shield/kernel/tree/roth_next Bluetooth is still out of luck for now."
Nice! No need of a ethernet adapter.
"All USB devices supported by Linux should be working with SHIELD, as long as the kernel driver for them is compiled. I have played with a keyboard, mouse, network adapter and mass storage device, all connected to a hub."
Nice. Does there is HPLIP for ARM devices?
"Not sure what you mean - Tegra 4 is supported in Linux mainline, and some of its devices as well."
I mean 3D drivers. Which would allow specific apps to run fine.
"It's a quite manual process at the moment. You might want to consider what your end goal is, and whether it is worth the trouble, knowing that there is no graphic acceleration, no way to sleep, and so on. If you really want to give it a try (it implies cross-compiling the kernel, playing with fastboot, and extracting user-spaces to SD cards), let me know and I will try to come with a documentation sometime soon."
I want to use it as an office OS for doing things that Android can't as my desktop is dead.
"Sort of. You can store the Linux user-space on a SD card, or even in a file on your Android data partition that will be mounted as a root loopback device.
The problem is that SHIELD's bootloader only supports booting via two means:
- Whatever kernel is on the BOOT partition
- Whatever boot image is given to it using the fastboot boot command.
This means that you can either keep the Android boot image on the BOOT partition and boot Linux using "fastboot boot" while your SHIELD is connected to your PC via USB, or the other way around. But if you want to switch the system to boot, you will need to connect your SHIELD to your PC and play with fastboot.
Let me know if this answers your questions and if you need more information. What you can do with Linux on SHIELD is still limited ; but it's a fun way to get involved in kernel hacking since many missing drivers can easily be written and general support can also be improved."
So i still need a Desktop for boot it? :/
Sent from my GT-S7562L using XDA Free mobile app
If you just want to use your SHIELD as an office device, your needs may be better served by one of the many "Linux on Android" apps, e.g:
https://play.google.com/store/apps/details?id=com.zpwebsites.linuxonandroid
This will allow you to run a Linux desktop alongside with Android, without rebooting, without recompiling kernels, and without requiring a desktop PC.
Graphics will be slow as death, but that should be enough for LibreOffice & pals.
Network will work using the Android stack, USB devices such as keyboards and mouse should work fine too.
Jetson TK1 Development Pack
Have either of you looked at the Jetson TK1 Development Pack and the Linux4Android drive image that comes along with it? Its based off of Ubuntu 14.04 - and i believe has acceleration - so if it were to be flashed, it 'should' work - since its meant to work on the TK1 dev kit - no garuntees though
Can we please get a documentation writeup?
Very interested in your development process. I'm a new developer, and this is my main device.

Linux4Tegra R23.1/R24.1 beta for the Shield Tablet

Stuff that doesn't work: 3G/LTE, accelerometer, GPS, camera, and maybe some other stuff that I'm not remembering
Stuff that does work: GPU (full OpenGL 4.5 and Vulkan), sound, USB device and host, WiFi, Bluetooth, touchscreen (including stylus), SD/USB install
Downloads:
Linux4Tegra R24.1 beta (mirror) (updated on February 18th 2016)
Linux4Tegra R23.1 (mirror) (updated on November 21st 2015)
Linux4Tegra R21.4 (mirror) (updated on July 21st 2015)
Linux4Tegra R21.3 (mirror) (updated on March 9th 2015)
Installation instructions:
Install MultiROM (+ TWRP + touch support + patched kernel)
Download Linux4Tegra and install it through TWRP (Advanced -> MultiROM -> Add ROM)
Tips/notes:
To enable the on-screen keyboard during setup or login, press the blue icon in the corner and select on-screen keyboard from the menu that appears.
To enable the on-screen keyboard on desktop, run Onboard.
If your touch input becomes misaligned, install and run xinput-calibrator.
I am *very* interested in knowing which kernel you have used for this. Upstream, L4T, Android? This looks very promising in any case.
Gnurou said:
I am *very* interested in knowing which kernel you have used for this. Upstream, L4T, Android? This looks very promising in any case.
Click to expand...
Click to collapse
I've tried L4T 21.2, 19.3 and Lollipop. All of them need a small kernel patch (which might break HDMI, I have no idea) for the graphics to work, but apart from that they should all work fine for the most part.
Code:
In drivers/video/tegra/dc/dc.c, in tegra_dc_probe, after "int i;" add:
static int num_probed = 0;
if (++num_probed > 1) return -ENOENT;
Edit: this actually isn't needed, I was just using the wrong cmdline
Getting Started
THESE INSTRUCTIONS ARE OUTDATED. CONSIDER USING THE PREBUILT INSTALLER FROM THE MAIN POST INSTEAD!
You need a computer with Linux installed and some free space (I don't have the exact numbers, but 5GB would probably be enough). On the tablet, you need 2-3GB of free space (on the internal memory), an unlocked bootloader , root and you need Busybox installed too.
On the computer, you'll need to compile your kernel first (this guide includes the compiler, and there's a prebuilt boot.img in the attachments if you want to skip this part). I recommend using https://github.com/Bogdacutu/STLinux-Kernel, with st8_linux_defconfig.
The initramfs is pretty simple, it just mounts the relevant system partitions and loads Linux from them: https://github.com/Bogdacutu/STLinux-Initramfs. You'll need to edit KERNEL_PATH in build.sh and make the kernel beforehand, then running build.sh will result in a boot.img which you can boot with fastboot:
Code:
fastboot boot new_boot.img -c "console=tty1 fbcon=map:10 fbcon=rotate:2 fbfix"
For the rootfs, Linux4Tegra is the easiest place to start from. All the Tegra K1 versions should work fine. For example, with R21.2: (the sudo is necessary there)
Code:
$ wget http://developer.download.nvidia.com/mobile/tegra/l4t/r21.2.0/pm375_release_armhf/Tegra124_Linux_R21.2.0_armhf.tbz2
$ tar xfvj Tegra124_Linux_R21.2.0_armhf.tbz2
$ cd Linux_for_Tegra
/Linux_for_Tegra$ wget http://developer.download.nvidia.com/mobile/tegra/l4t/r21.2.0/pm375_release_armhf/Tegra_Linux_Sample-Root-Filesystem_R21.2.0_armhf.tbz2
/Linux_for_Tegra$ cd rootfs
/Linux_for_Tegra/rootfs$ sudo tar xfvj ../Tegra_Linux_Sample-Root-Filesystem_R21.2.0_armhf.tbz2
/Linux_for_Tegra/rootfs$ cd ..
/Linux_for_Tegra$ sudo ./apply_binaries.sh
/Linux_for_Tegra$ cd rootfs
/Linux_for_Tegra/rootfs$ sudo tar cfvj ../rootfs.tar.bz2 .
The resulting rootfs.tar.bz2 you'll need to somehow get on the device. For the next part, I'll assume it's in /sdcard/rootfs.tar.bz2. You'll need to do this on the device (through ADB or through Terminal Emulator)
Code:
$ su
# cd data
/data# mkdir linux
/data# cd linux
/data/linux# tar xfvj ../media/0/rootfs.tar.bz2
Enabling Bluetooth with brcm_patchram_plus:
Code:
$ sudo brcm_patchram_plus -d --patchram /system/etc/firmware/bcm43241.hcd --baudrate 3000000 --enable_lpm --enable_hci --use_baudrate_for_download --no2bytes --tosleep 1000 /dev/ttyTHS2
Prebuilt boot images:
new_boot(80).img - working WiFi and sound
new_boot(90).img - added pointer emulation to touchscreen driver
new_boot(94).img - fixed Bluetooth stability
new_boot(114).img - fixed HDMI, added support for non-LTE partition table, my tegra driver patch is now optional (without it fbcon doesn't work properly, enable by adding fbfix to cmdline)
new_boot(123).img (newest at the moment) - fbfix isn't needed anymore, added support for tmpfs ACLs, enabled XZ compression (because after reaching a certain size, the kernel wouldn't find the initramfs anymore), enabled KVM
Bogdacutu said:
Code:
In drivers/video/tegra/dc/dc.c, in tegra_dc_probe, after "int i;" add:
static int num_probed = 0;
if (++num_probed > 1) return -ENOENT;
Click to expand...
Click to collapse
Won't this code always return - ENOENT?
Sent from my Xperia Z1 Compact using Tapatalk
_TB_TB_ said:
Won't this code always return - ENOENT?
Sent from my Xperia Z1 Compact using Tapatalk
Click to expand...
Click to collapse
It will always return -ENOENT except for the first time the function gets called (which is enough for the screen to get initialized).
Unless you are looking to completely break the Ubuntu install, do not perform a release upgrade to 14.10.
Everyone here probably already knows this but I wanted to see what would happen, which was rendering the x-server unusable. These results did not surprise me but hopefully this will save someone else who has the same idea as I did some time.
joshtheitguy said:
Unless you are looking to completely break the Ubuntu install, do not perform a release upgrade to 14.10.
Everyone here probably already knows this but I wanted to see what would happen, which was rendering the x-server unusable. These results did not surprise me but hopefully this will save someone else who has the same idea as I did some time.
Click to expand...
Click to collapse
Try doing
Code:
sudo apt-mark hold xserver-xorg-core
before doing the upgrade, to prevent the driver from being overwritten.
Bogdacutu said:
Try doing
Code:
sudo apt-mark hold xserver-xorg-core
before doing the upgrade, to prevent the driver from being overwritten.
Click to expand...
Click to collapse
Thanks, that was the command I couldn't remember. Let me do a backup of it first then I will try again to see if the outcome is any different, I'll let you know how it goes once I have a chance.
Great i need a dual boot Android/Linux
Bogdacutu said:
What works:
Audio
WiFi
Click to expand...
Click to collapse
Bogdacutu said:
Got it working thanks to /u/GenuineAster, will post a full guide in a day or two.
Click to expand...
Click to collapse
Bogdacutu said:
Photos:
https://s3.amazonaws.com/pushbullet...OAfew/Screenshot from 2014-12-28 12:51:51.png
Click to expand...
Click to collapse
I got my tablet 2 days ago, and I'm already trying to mess up with it... I decided to try to install Ubuntu on my Shield Tablet (WiFi only, EU model).
So basically, I managed to boot it up thanks to you tutorial. It seems to be working well, but there are some things that does not work, and I see you apparently solved those issues already...
The issues I have are the following, ordered by priority:
- No WiFi (I see that you apparently solved this issue, can you please explain how you managed to do that?)
- While I was writing this message, I went to keyboard layout options, and the OS crashed, it went back to login screen twice (I was on the same window each time, it showed nvidia black screen, then the login screen)
- No audio (I only have a device named "Dummy audio input/output", you seem to have audio, can you confirm that?)
- Graphics flickering on some textures, for example, on the main sidebar menu, when my mouse pointer is over an icon, there is a background on that icon, but the background is flickering, that's weird...
- No touchscreen (But you don't neither)
For the moment, I think the most important thing is WiFi, since I can't do anything without network connexion. Can you help me with that? Thank you!
etienne51 said:
I got my tablet 2 days ago, and I'm already trying to mess up with it... I decided to try to install Ubuntu on my Shield Tablet (WiFi only, EU model).
So basically, I managed to boot it up thanks to you tutorial. It seems to be working well, but there are some things that does not work, and I see you apparently solved those issues already...
The issues I have are the following, ordered by priority:
- No WiFi (I see that you apparently solved this issue, can you please explain how you managed to do that?)
- While I was writing this message, I went to keyboard layout options, and the OS crashed, it went back to login screen twice (I was on the same window each time, it showed nvidia black screen, then the login screen)
- No audio (I only have a device named "Dummy audio input/output", you seem to have audio, can you confirm that?)
- Graphics flickering on some textures, for example, on the main sidebar menu, when my mouse pointer is over an icon, there is a background on that icon, but the background is flickering, that's weird...
- No touchscreen (But you don't neither)
For the moment, I think the most important thing is WiFi, since I can't do anything without network connexion. Can you help me with that? Thank you!
Click to expand...
Click to collapse
I just updated the boot.img from post #4, WiFi and sound work now, Bluetooth works if you load firmware but it's pretty unstable at the moment.
Ok, I just tested it, and I confirm it works! I haven't tried bluetooth for the moment, but I have WiFi and audio now with v80. Thank you for the update!
I have another question, I saw your previous screenshot showing glxgears running at around 900-1000fps. Since I have some small lags sometimes, I decided to try glxgears and I'm running at around 450fps, that's less that half the framerate you have on your Shield Tablet. Did you do something special with the drivers after the tutorial you wrote?
etienne51 said:
Ok, I just tested it, and I confirm it works! I haven't tried bluetooth for the moment, but I have WiFi and audio now with v80. Thank you for the update!
I have another question, I saw your previous screenshot showing glxgears running at around 900-1000fps. Since I have some small lags sometimes, I decided to try glxgears and I'm running at around 450fps, that's less that half the framerate you have on your Shield Tablet. Did you do something special with the drivers after the tutorial you wrote?
Click to expand...
Click to collapse
Not really, you can try messing with the governors and max frequency, iirc there's a script in the driver package that automatically sets the CPU frequency lower on boot.
Update: I got the touchscreen to work with the Android drivers! I will upload the changes to my kernel repo soon (as soon as I figure out which of all the changes I did are actually required).
How is HDMI out? I find it mildly function on Android, can I expect the same from Ubuntu? Also, I didn't see if LTE is supported.
adampdx said:
How is HDMI out? I find it mildly function on Android, can I expect the same from Ubuntu? Also, I didn't see if LTE is supported.
Click to expand...
Click to collapse
No idea if HDMI works, I don't have a cable (my patch might break it though, in which case we'll probably need to change it). And it works on LTE tablets, but mobile data doesn't work (at least for now).
adampdx said:
How is HDMI out? I find it mildly function on Android, can I expect the same from Ubuntu? Also, I didn't see if LTE is supported.
Click to expand...
Click to collapse
I just ordered a Mini HDMI to HDMI cable, it will arrive in less than a week. As soon as I get it, I'll tell you guys how it works!
/u/GenuineAster confirmed that HDMI isn't working. I'm going to get an Ethernet adapter for netconsole soon, so that I can find out why it doesn't work with my patch to the tegra driver (which I'm sure is the reason HDMI isn't working). I'm also working on a way to get libGL.so to work in an i386 chroot (so that we can try to play desktop games that aren't compiled for ARM yet).
I'm impressed that this actually works so well. Makes what I have on my Shield Portable look pitiful. No sound, no video acceleration, etc. Now the question is, what changes have to be made to a mainline kernel to get similar results? Well, minus the video acceleration that's likely hard-coded to a specific kernel version. Bogdacutu, do you have a patch of your changes? Your github repo isn't a forked copy of the kernel, so it's hard to see the initial changes. I'd like to get a copy of Fedora running. Also looking forward to your touchscreen fix. My usb-otg cable is flakey to the point it causes Ubuntu to reboot if I bump it too much...
Question to the larger community: Anyone know how to get the wireless controller to work with this? I poked at wpa_cli and a couple of the p2p_ commands, but so far haven't picked up anything from the controller when it's searching.
Edit: Seems the otg charging thing doesn't work either. Makes long-term use impracticle when an input device has to be plugged in. Any of the kernel hackers know the bits that changed in nvidia's lollipop kernel to allow this?

[APP][4.1+] Tuxoid v0.1.1 - A full Linux desktop environment on your Android

Code:
*** Disclaimer
As usual, I am not responsible for thermonuclear war or other apocalyptic futures.
TL;DR: If you break your device with this project, it's not my fault (although I will of course be willing to help you in your troubles!!).
Introduction
Have you ever wanted to use your Android device as a fully-fledged desktop Linux box? Now you can, with Tuxoid!
A year or two ago, I discovered the Linux-on-Android project. (http://forum.xda-developers.com/showthread.php?t=1585009) I was fascinated by the possibility of running Linux on top of Android and using a desktop environment. However, I was slightly disappointed by the lack of some features, as well as a lack of development over the time of the project's existence. Thus I embarked upon an epic quest (well maybe not quite that dramatic) to build my own version from the ground up, basing it upon the ideas explored by Linux-on-Android.
After some on and off hacking on my OnePlus One, I now have some very early working code.
Below is a video demonstration of the current state of Tuxoid, demonstrating a few of its features.
Here is a list of some of these features:
- The big one: fast and high quality display system
- Native keyboard and mouse support (automatically disables Android's built-in system)
- Audio support. Audio from the desktop environment is piped into Android's audio system, so you can use your device's speakers, headphones or bluetooth etc
UPDATE: First builds!
I've built the first publicly available versions of the project. Before you get excited, I should warn you that they are in an unstable state. You can grab the APKs in the Downloads section of this project, as well as on the Releases page of the project on GitHub. These builds are not for n00bs! If you're still determined to give them a try, here are the instructions:
Requirements
An Android device running 4.1 or newer (it will be availabe for older versions in the future, but for know only Lollipop is supported) Older versions now supported!
Root with SuperSU for managing permissions. I will not explain this here, as there are already hundreds of guides available. If you don't know how to root your device, this project (at least in these early stages) is not for you.
A reasonable amount of internal storage (at least 1-2 GB free)
A stable internet connection. Make sure you're using WiFi for best results.
A mouse and keyboard to control the desktop environment. You should be able to use wired ones (via an OTG adapter) or wireless via bluetooth. As long as Android recognizes it, you should be good to go.
This is not a requirement, but you won't be able to do much without it (for now): knowledge of the Linux command line and preferably how to use the pacman package manager for Arch Linux, as that is the distro upon which Tuxoid is based (more distros will be available down the line!)
Setup and installation
Once your device is rooted, open up the SuperSU app and go to the Settings tab. Find an option labelled "Mount namespace separation" and ensure it is UNchecked. (Make sure to reboot before continuing if you had to do this)
Download and install the APK for Tuxoid. Again, if you don't know how to do this, you shouldn't be attempting to install an early build Tuxoid...
Open the Tuxoid app and tap the gear in the actionbar to go to the settings menu. There are a few options you can tweak here, but the main one you should be interested in right now is 'Disk image size'. Select a size that suits the amount of space you have free on your internal storage. I would recommend 4GB (the default) to allow room for installation of your own packages later. If you have less space free on your internal storage than you select here, the setup process will fail.
Go back to the main screen of the app and ensure you have a stable internet connection. Now connect your keyboard and mouse (you must connect them before booting Tuxoid up every time). Then, press 'Start' to begin the setup process. This will probably take a while, so just leave your device down for a while and check up on it every once and a while.
Eventually, if all went well, you should see a screen with a grey background and an xterm window. Feel free to run some commands. To start, I'd recommend installing the Chromium browser (open source version Google Chrome). To do this, run 'sudo pacman -S chromium' (without quotes). The password is the same as your username. Once installed, run 'chromium' to start the browser. For those who are interested, the window manager installed by default is Openbox. If you want to install some more packages, the list of available ones in Arch Linux for ARM devices is available here: http://archlinuxarm.org/packages If you weren't able to get up and running (i.e. no screen with a cursor and no xterm), you can try some of the steps described in Troubleshooting & Tips.
When you're finished playing around, follow the steps below to ensure clean shutdown of Tuxoid. If you want to boot up again, you can just open up the app at any time and tap on the start button. Tuxoid will use your existing system image.
Shutdown procedure
When you're done, simply press the back key on your device to close the GUI and press the stop button to shutdown Tuxoid. After a few seconds, the log will show "SHUTDOWN!", meaning the shutdown procedure was completed successfully.
Troubleshooting & Tips
If Tuxoid failed to boot during the initial setup, you can retry by first removing files in the 'droidtop' folder on your internal storage (usually 'system.img' and 'arch.tar.gz') and then pressing 'Start' again in the app.
If your mouse and keyboard aren't working in Tuxoid, ensure that they were connected to your device BEFORE you pressed the start button and make sure they were detected by Android. If they weren't detected by Android itself the they definitely won't work with Tuxoid.
If you something goes wrong at any stage while using Tuxoid, please press the 'Send log' button in the app to send me a copy of the log shown on the main screen.
If the app crashes, a dialog will pop up asking you to send a report. Please do this as it makes it much easier for me to fix bugs!
If you have any feedback and suggestions, feel free to post them here in the forums! You can also submit issues on the GitHub project (although this is really more orientated towards developers)
If you are a developer and want to get involved in the project, you can post here in the forums and/or submit pull requests on GitHub.
Source code
I've published all of the source code for the app to GitHub (http://github.com/jackos2500/tuxoid) Feel free to fork and make changes, and, even better, submit pull requests to move the project forward!
Finally, I would like to say thanks to the guys over at Linux-on-Android for their great work, without which the idea for this project would never have existed!
XDA:DevDB Information
Tuxoid, App for all devices (see above for details)
Contributors
jackos2500
Version Information
Status: Testing
Created 2015-06-13
Last Updated 2015-06-14
Reserved
Changelog
v0.1.1
Adds compatibility for Android versions as far back as 4.1 (API level 16).
Bug fixes:
screen resolution could be detected incorrectly
'setenforce' could fail to execute due to its lack of existence on older platform versions
v0.1
Initial public release.
Reserved
Its really interesting to hear about linux on android
shahzu3 said:
Its really interesting to hear about linux on android
Click to expand...
Click to collapse
Yup! I think I'll put out a build later with some instructions so that people can try it for themselves.
Mm
shahzu3 said:
Mm
Click to expand...
Click to collapse
Well I've pushed out the first public build. Give it a try and tell me what you think!
Hi. Your project sounds great ??
Is really necessary to have so internal space or could it be possible one day to have the whole stuff on the external sd.??
That is just amazing, thanks for your work, a tablet running this would be really nice... I'm going to try it out.
Hello! This looks very promising but I can't find any download link. Is it missing?
Edit: My phone just didn't load the page fully, the download section is on the top.
DirkStorck said:
Hi. Your project sounds great
Is really necessary to have so internal space or could it be possible one day to have the whole stuff on the external sd.?
Click to expand...
Click to collapse
Good point! I'll see if I can do something about that sometime soon. Unfortunately if the chroot environment is not stored in a disk image the filesystem it is stored on must support Unix permissions, so no FAT32 formatted sdcards without disk images. FAT32 also limits file size to 4GB, so that would be the max size for a disk image there. I'll probably add a way of optionally adding an extra partition to your SD to get around this at some stage.
WideBRs said:
That is just amazing, thanks for your work, a tablet running this would be really nice... I'm going to try it out.
Click to expand...
Click to collapse
Cool, tell me what you think when you give it a go!
jackos2500 said:
Good point! I'll see if I can do something about that sometime soon. Unfortunately if the chroot environment is not stored in a disk image the filesystem it is stored on must support Unix permissions, so no FAT32 formatted sdcards without disk images. FAT32 also limits file size to 4GB, so that would be the max size for a disk image there. I'll probably add a way of optionally adding an extra partition to your SD to get around this at some stage.
Cool, tell me what you think when you give it a go!
Click to expand...
Click to collapse
I have been using Linux Deploy on my tablet and it worked quite well. They have the environment as an image on the internal or external sd card. I think 4GB is a enough for a Linux system. For those who want more would have to format the external as ext4.
DirkStorck said:
I have been using Linux Deploy on my tablet and it worked quite well. They have the environment as an image on the internal or external sd card. I think 4GB is a enough for a Linux system. For those who want more would have to format the external as ext4.
Click to expand...
Click to collapse
I've pushed a new release with support for devices running Android 4.1 and above. I think I'm going to start working on improving the user-friendliness of the project tomorrow. This will probably include improving the UI and setup process, as well as better error handling. Once that code is in place I won't have to refactor any new features I add to the new UI, so it makes sense to do it first. It will take a while, and whenever it's done, I'll probably start working on some of those new features.
Hi,
Could you tell me if:
a) my phones built-in keyboard will work?
b) if there's an option to use the touch screen to control the mouse?
Thanks
moodroid said:
Hi,
Could you tell me if:
a) my phones built-in keyboard will work?
b) if there's an option to use the touch screen to control the mouse?
Thanks
Click to expand...
Click to collapse
Right now, no. Both of these are definitely a high priority though.
jackos2500 said:
Right now, no. Both of these are definitely a high priority though.
Click to expand...
Click to collapse
Excellent, thanks. I'll keep an eye on this...
Can i decompile and compile apk with this Linux for Android? I havent pc
this is really amazing, as it is very useful for tablets, at least for my tab s 10.5 inch, keep it up!
Currently using Xserver Xsdl, with the pain of slow refresh rate and input interrupt.
Thank you for this effort!
Hello,
So far, I had these issues before it worked, otherwise its awesome, the only way to render x server on android smoothly and no input latency without using direct (kernel) framebuffer:
1)Latest arch armv7hf use xorg-server and xf86-input-evdev compiled for/by version 1.18.x , had to recompile 1.17 from source since your module (the source code isnt released in your github :/, guess you forgot) is compiled for ABI module 20, currently 23.
2) High cpu usage, probably implement refresh rate limitation on the app side for displaying the shared memory framebuffer, though having the source code for the module would really help, guess its a modified dummy.so (?) to copy framebuffer to shm? Anyways ill try to workaround the issue using a compositor.
Thats all! working perfectly... If anyone need the compiled 1.17 versions of xorg-server and evdev, just use ABS or pm me.
Thanks!
EDIT: I think it would be better to turn this into X server framebuffer viewer app, and combine it with Linux deploy (+ 'custom scripts' option is already implemented in Linux Deploy, useful for evdev and xorg config) for more linux flavours
apparently, it seems that you have copied droidtop project without mentioning it (license: MIT) : https://code.google.com/p/droidtop/
which has been archived now with no public access

Own a Fire HD 8, 8th Gen, Want to be able to put any OS on it.

Ideally I'd like to actually be able to put an arbitrary OS on my tablet. Has anyone figured out how to do this with the Fire HD 8, 8th generation, yet? I'm willing to use soldering to do so. If this is not possible with this hardware, does anyone have a recommendation about what tablet options I have, to do this?
dc123123 said:
Ideally I'd like to actually be able to put an arbitrary on my tablet. Has anyone figured out how to do this with the Fire HD 8, 8th generation, yet? I'm willing to use soldering to do so. If this is not possible with this hardware, does anyone have a recommendation about what tablet options I have, to do this?
Click to expand...
Click to collapse
There is a hardmod to secure root but no custom roms. Consider a 3rd gen HDX if seeking a selection of Nougat based custom ROMs.
Davey126 said:
There is a hardmod to secure root but no custom roms. Consider a 3rd gen HDX if seeking a selection of Nougat based custom ROMs.
Click to expand...
Click to collapse
It shouldn't be possible to modify /system on the 8th generation as it ships with dm-verity enabled.
xyz` said:
It shouldn't be possible to modify /system on the 8th generation as it ships with dm-verity enabled.
Click to expand...
Click to collapse
Ok, interesting, but how are software updates possible on devices with dm-verity? Doesn't that change the file/partitions to the extent that they need a new key for it?
Essentially the firmware update includes a hash of the /system partition (a tree of hashes) signed with Amazon's private key. The boot image includes the public key so that the device can verify the /system integrity. The rest of the boot process already ensures that the boot image isn't tampered with. So to update they just need to generate another /system, generate another hash tree for it and sign it with the private key.
xyz` said:
Essentially the firmware update includes a hash of the /system partition (a tree of hashes) signed with Amazon's private key. The boot image includes the public key so that the device can verify the /system integrity. The rest of the boot process already ensures that the boot image isn't tampered with. So to update they just need to generate another /system, generate another hash tree for it and sign it with the private key.
Click to expand...
Click to collapse
https ---- source.android ---- .com/security/verifiedboot/dm-verity
Yeah this seems to indicate that the more of that partition that is accessed during the runtime, the more time and power are invested into verification during use. Lame.
Anyways, thank you very much, guys, for answering the questions.
I'm also interested in knowing why it isn't possible to just redo the system partition but modify it to match the hash... but I'll wiki that to find out why it doesn't work (SHA-256). I'm guessing that this isn't as simple as a checksum. Even if it meant making another file system to do it... I guess the other option is getting the private key.
W.R.T. building a tablet that doesn't suck, the project that I saw was basically someone who slightly dissassembled a SBC, so that they didn't have to design a mobo and find a chip for it. That makes sense but the SBC that I looked at (Orange Pi Zero ) don't actually seem to use all the options/connectivity provided in the datasheet of the SoC chip. For instance, it's capable of HDMI but there's no HDMI on the board, etc. Also, the project I read about ended up getting very expensive.
Another thing from that site:
"A public key is included on the boot partition, which must be verified externally by the device manufacturer."
What do they mean by verified externally? Like, I know with my tablet I needed to connect to the internet at least once to do anything with it.
This is the part that makes me think that we can mess with it:
" To mitigate this risk, most manufacturers verify the kernel using a key burned into the device. That key is not changeable once the device leaves the factory."
Also, I want to translate this into noob:
" And since reading the block is such an expensive operation, the latency introduced by this block-level verification is comparatively nominal."
Does that mean that the time spent reading the hash is small because there's a lot of calculation involved, such that the transmit time is small compared to the total time, or that the transmission of the next block info can happen during the calculation of the prior block info?
dc123123 said:
Another thing from that site:
"A public key is included on the boot partition, which must be verified externally by the device manufacturer."
What do they mean by verified externally? Like, I know with my tablet I needed to connect to the internet at least once to do anything with it.
Click to expand...
Click to collapse
It means that the boot partition (the boot.img) is verified by the bootloader, in our case that would be LK.
dc123123 said:
Also, I want to translate this into noob:
" And since reading the block is such an expensive operation, the latency introduced by this block-level verification is comparatively nominal."
Does that mean that the time spent reading the hash is small because there's a lot of calculation involved, such that the transmit time is small compared to the total time, or that the transmission of the next block info can happen during the calculation of the prior block info?
Click to expand...
Click to collapse
They're saying that there's no performance hit when enabling dm-verity because reading the actual data from the emmc is so slow you won't notice the additional slowdown introduced by hashing and verifying the block data.

Categories

Resources