Ki3 can't support the UsbHost - Galaxy S II Q&A, Help & Troubleshooting

Here is my code:
Code:
UsbManager manager = (UsbManager) arg0.getSystemService(Context.USB_SERVICE);
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
while(deviceIterator.hasNext()){
UsbDevice device = deviceIterator.next();
Log.v(TAG,"Vendor-Id ="+device.getVendorId());
Log.v(TAG,"Product-Id="+device.getProductId());
Log.v(TAG,"DeviceName="+device.getDeviceName());
}
it works well on my Galaxy SII(android 2.3.4),but when i upgrade my phone to KI3(2.3.5),this code didn't work.And the logcat show me "java.lang.NoSuchMethodError: android.hardware.usb.UsbManager.getDeviceList"

I can't seem to find any info on this either.
This particular API was introduced in API 12 (3.1) and yet Galaxy S2 had this in 2.3.4, I wonder if it was experimental, or some code Samsung ported over for the USB host support for pen drives they added and have now gone and removed these additional APIs which just happened to have been working in 2.3.4.
Real shame because things like the DSLR Dashboard and any other host related things we want to implement can't be done, at least not until we get ICS it seems.

Related

[Q] How to use adb to install flash player ?

Yeah, someone may absolutely say that adobe flash is not working on our ARM v6 CPU and that is an undeniable fact.
BUT I have tried to flash a adobe flash 10.2 before
(maybe 3 months, long time ago )
And outcome it works on some flash only like wt the HTC flash player(in stock rom) did.
Now I m going to flash the CM7 rom again and wanna install flash 10.3 in it.
But I forget how to make it,so....
Could anyone tell me how to install that again by adb?
system\app or data\app and commands are ?
TY!
cphkelvin said:
Yeah, someone may absolutely say that adobe flash is not working on our ARM v6 CPU and that is an undeniable fact.
BUT I have tried to flash a adobe flash 10.2 before
(maybe 3 months, long time ago )
And outcome it works on some flash only like wt the HTC flash player(in stock rom) did.
Now I m going to flash the CM7 rom again and wanna install flash 10.3 in it.
But I forget how to make it,so....
Could anyone tell me how to install that again by adb?
system\app or data\app and commands are ?
TY!
Click to expand...
Click to collapse
You can get flash lite from a Samsung Galaxy 3? froyo rom. But this will only allow you to play flash files from your filemanager.
Run:
adb remount
adb push
The browser plugin in't included in the froyo release, but in the eclair version.
Unfortunately I haven't been able to load the plugin, even after modifying the source to accept any browser plugin. Not just the one's that got a Adobe Flash signature.
Comment the code in android/system/frameworks/base/core/java/android/webkit/PluginManager.java like this:
PHP:
/*if (SystemProperties.getBoolean("ro.secure", false)) {
boolean signatureMatch = false;
for (Signature signature : signatures) {
for (int i = 0; i < SIGNATURES.length; i++) {
//a hack to make it load any thing...
if (SIGNATURES[i].equals(signature)) {
signatureMatch = true;
break;
}
}
}
if (!signatureMatch) {
continue;
}
}*/
It seams that the browser plugin that the samsung phone's have is some what different to load in to the browser. (The one from eclair got the libs that have the load entry points for a browser plugin. But the gingerbread haven't)
Also the eclair browser plugin register some kind of URL listerner, the adobe one does not do this. Look in the AndroidManifest.
The HTC plugin is a hole lot more advanced with dependensis for multi-touch and allot more in framework. The plugin is also loaded some what different. It's a hardcoded javafunction in the PluginManager.java for webkit. (The samsung browser haven't got this, this may be hardcoded in the c-files of webkit)
I got the SDK sample plugins to install anyway
Get Smali/Baksmali and dex2jar if you want to look at some code, in the apk-files/frameworkfiles

[DONE, v1.1 source] linboothkvc - minimal strangely kexec with out kexec ;-)

>>>> 24Jan2012_2155 - linboothkvc v1.1 source - does a bit more thorough job with Cache flushing for the corner cases where the new guy in the Nirvana environment doesn't do a thorough job of cache invalidation. Now have added the source to this post itself (cas, it is pretty much done now, except for any forgotten corner cases, and also one pass at removing all dependence on hidden kernel functions which I shamelessly depend on - rather it is only setup_mm and cache flush walking, others (on 2nd thought rather all) are trivial to replace but have left it there just from a future proofing perspective). However the details or blah blahs are in the newer posts towards the end of the thread. <<<<
>>>> 22Jan2012_1430 - linboothkvc v1.0 source with working binary kernel module for Nook Tablet released - look towards end (may be page 2) for the source - As you would already know, it can also work with any rooted arm based linux device provided it is recompiled for the given linux kernel on that device along with updated kernel function addresses in lbhkvc_k.c and appropriate Nirvana (some minimal change, if required) and NChild code (ie the bootloader you love for your device) <<<<
>>>> 22Jan2012_0058 - I have uploaded the source for a working linboothkvc for Omap3/Omap4/Arm_Cortex_A SOC based devices. As far as linboothkvc is concerned, it works on NookTab also successfully. However there is some effort/love still required wrt the NChild or bootloader used from with in the Nirvana environment ;-) <<<<
>>>> 17Jan2012_2325 - FINALLY SUCCESS on NookTab also ALSO Note that the POWER of KERNEL Modules and linboothkvc in turn is well beyond NookTab for the adventurers ... ;-) <<<<
>>>> 16Jan2012_2326 - Beta version of code posted towards the end, Now it fully runs on BeagleXM Hw - with minimal love should run on NookTab also, so enjoy <<<<
>>>> 15Jan2012_0251 - Alpha version of source code in post towards end, fully runs in Qemu for now ;-). And the difference between this cup and the lip (i.e actual h/w) being the missing proper cache handling from my side <<<<
Hi All,
Before my ideas with init hijack, and uboot hijack, I had a idea with trying to implement a kernel module to allow execution of any code, after killing linux without a full reboot (which would give control back to secure boot). However 2ndihkvc and NOPBypass came in between this.
However I will try and put sometime into it, as and when possible. I have some work coming up over the next few days, so going will be bit slow compared to my other two threads, but if nothing turns up from BN side (what I heard from Adamoutler on the other thread) wrt open ended bootloader then I will spend bit time on this.
Note that one doesn't require kexec to achieve functionality similar to kexec ;-). Linux kernel modules is a very powerfull mechanism which we have in our hand to give lot of or all the control required (Unless linux has changed drastically over the last few years, when I have been away from it, but that seems less likely, even thou I have heard and discussed some ideas which curtail this power almost a decade back, but I don't think it has materialised yet, which should be good for the situation we are in, and hope it remains like that for the forseeable future, what with all these close minded companies and closed devices these days).
NOTE: Look to the newer posts below for the Source Codes. RC1 source code in a day or two (but has mentioned, no significant changes wrt Beta
[REPOST] MAYBE Exec_Anycode instead of kexec
>>>> This was my old post on bypass bootloader ideas thread, put here for completeness <<<<
*** MAY BE A POSSIBLE EXEC_ANYCODE logic instead of KEXEC***
NOTE: KEXEC tries to run another linux kernel, so may be its logic is more complicated, than if we are trying to run just any code in kernel or better privilage level. I haven't looked into kexec as of now, so I am only guessing about kexec complexity, beyond what I have mentioned below for my method (which again I haven't tried as of now, just a idea).
If one is trying to run something from memory when already in Linux, then one also has to worry about the privilage level at which the processor is running, as well as about page table mapping etc... If the other thing which we are trying to run is another kernel or x-loader or uboot or another bootloader for that matter.
So if kexec doesn't work, may be there is another option available which is to
a) Create a kernel module (NOTE: It runs with same privilages as the kernel) which does
a.1) Disable interrupts so that control doesn't get out of our code
a.2) Over write the reset vector with x-loader or what ever custom bootloader one wants to get control of.
a.3) Change the memory map to have a 1-to-1 map for the region where the code is currently running (or rather for the code which will be run in the next step) or overwrite a region which already has 1-to-1 map between Physical and Virtual addresses, with the code for the next steps. Go to next step.
a.4) Disable page tables (I haven't tried this before, ie after it has already been enabled, but I don't see any reason why ARM doesn't allow this - except for things like what we are trying).
a.5) Change to the reset ARM privilage level (If a soft reset doesn't do it already, haven't looked at ARM at this level for ages, so don't remember)
a.6) Trigger a soft reset
This should give control to the bootloader which we have loaded into the reset vector address. (Rather we should trap all possible exceptions i.e all the 8 or 16 or what ever is the number of exception addresses in the exception vector).
NOTE: If we are not able to change back to the reset time privilage level for the ARM processor, then we should be still able to have a modified Linux kernel, which doesn't try to switch ARM privilages if not required - this I have tried, ages ago, If I am not wrong as part of some other activity I had done.
Current thoughts
Hi,
On thinking once again
a) We definately want to disable interrupts, so that we don't lose control other than for exceptions if at all.
b) We may have to stop the other processor if it is up in SMP, but I have noticed that most of the time, the other processor is shutdown in NookTab.(Have to think thro this bit more, later).
c) May be trap the TLB exception handler and inject custom pagetable till MMU is switched off (An idea for now, have to experiment a bit later). Rather than going thro the linux mmu code (am getting bit old, a decade back I would have done the required linux magic in few jiffies, but have been away from linux for too long now . OR force few entries into current/kernel linux memory map.
d) Copy
d.1) the core code required to manage stuff to a 1:1 mapped region.
d.2) Also the code required to jump to like (i.e the bootloader or what ever)
Other d.2) Or implement minimal code (as part of d.1) to read uart (oops - now that would have cut the complexity by 3/4th, but for people hating uart these days;-) or may be sd card and get a sector into memory (like x-loader).
e) Disable the mmu
f) Jump to the required code location of new universe
Today I did a quick running/jumping glance thro kexec code once, and even it does some what similar only, if I am not wrong, except for may be it not hijacking the TLB exception handler or having some junk for debugging or so ..., so I am not that off wrt the required idea.
First baby step - try and understand the default memory map
Hi,
Did try the 1st baby step towards this, by trying to go thro the running systems memory map.
LBHKVC driver v04Jan2012_2110
INFO: Total memory is iTotalMem 0x40000000
INFO: Page Size ??? PAGE_SHIFT 12 ie 4096
INFO: Begining of Platform ram PHYS_OFFSET 0x80000000(0x40000000)
INFO: End of userspace mapping TASK_SIZE 0xbf000000(0x7f000000)
INFO: Start address for Modules Space MODULES_VADDR 0xbf000000(0x7f000000)
INFO: End address for Modules Space MODULES_END 0xbfe00000(0x7fe00000)
INFO: Permanent kernal mappings PKMAP_BASE 0xbfe00000(0x7fe00000)
INFO: Kernel direct 1:1 map ??? platform RamBeg PAGE_OFFSET 0xc0000000(0x80000000)
INFO: Kernel direct 1:1 map ??? platform RamEnd high_memory 0xf0000000(0xb0000000)
INFO: vmalloc/ioremap space Begin VMALLOC_START 0xf0800000(0xb0800000)
INFO: vmalloc/ioremap space End VMALLOC_END 0xf8000000(0xb8000000)
Now one thing which is potentially true and easy is, the Physical Memory from 0x8000.0000 is 1:1 mapped to 0xc000.0000 in a linear way (Have to validate, but should be). There are certain virtual to physical maps which seem bit odd, most probably I am using the wrong function to do the conversion and or traversal of pagetable. Also some of them are not necessarily meant to have a mapping other than act has markers conceptually (Have to verify later).
Having something same to same mapped would have kept things to a minimal, and made this too trivial now - why not ooh linux gods ;-(. Now this is forcing some hijacking or forcing of page table entries or experimenting and seeing if this is good enough to me/any one else interested.
Also there seems to be something called SAR_RAM, have to see if this is of any use. As well as some of the regions reserved thro kernel command line and see if anyone is using it, or if it can be evicted if required, there are only for funny experimentations.
Otherwise I think, I should be able to get even my current modules virtual address translated to physical address and may be same-to-same mapped if required. Or forcefully take some region beyond my current running code and any exception logic I require.
Also I have to check how critical is the same-to-same map if any when switching off mmu, or is 1:1 map good enough, have been away from lowlevel arm also for too long now.
Wow hkvc you respond quicker then I do.
First off it is not a 1 to 1 mapping if you look at the arm B&Ndefconfig youll see that they utilize a different way of mapping (not looking at the code right now).
Second off kexec with the kernel module that does KEXEC_LOADED is essentially this. I would look at the kexec.c code, and you will see that you can comment out the sanity checks in the find hole function and it will find a valid hole, then with injection you could make this work. However, while i have done embedded design and some hacking, kernel modules are not my specialty. We need a high priority kernel module that removes interrupts, so that the kexec code can load.
baby step2 of linboothkvc
Hi Loglud/All,
Thanks for your inputs.
Not sure about ur (Loglud) 1:1 map part comment. Currenty when people say 1:1 I am not sure whether they mean linear map (i.e with a constant addition or substration you can get virtual - to - physical mapping and inturn the other way round) or same to same mapping, I have to look at arm initial booting code and see what they mean (and in turn what ARM requires), because they require this when booting and inturn the mmu gets enabled.
Also the code to dump the map what I put above, was my first attempt at kernel level view of memory maps after ages, so there are some FUNNY ;-) errors in the way I tried to dump it quick and dirty.
If you are talking about 0xC000.0000 (Virt) to 0x8000.0000 (Phys) mapping which I mentioned, I still feel it is linear mapping, but I have to verify once. Linux kernel used to maintain a linear mapped region to simplify the internal management of physical pages(i.e memory), so that they can convert from virt2phy and back easily wrt physical memory with out requiring to go thro pagetables and for other reasons (Obviously with limits, i.e the Full memory is not linearly mapped but the initial 800MB or 900MB or so used to be). I will verify it later.
Either way independent of that I have potentially found the region which I will be attacking wrt getting the required same-to-same mapping (which I want to use, even if linear map is good enough, which again I am not sure is true at this time). The VIRTUAL ADDRESS space set aside for kernel Modules in Linux (MODULES_VADDR (0xbf00.0000 ...) and MODULES_END) overlaps with the actual physical memory location (0x8000.0000 - 0xc000.0000) here. And there is enough free memory in this module virtual address space, as there are only 2 modules loaded in NookTab, plus the region is originally there to allow lot of modules plus worst case I don't really worry much about stomping_on/reusing someone elses used memory because I am going to kill the system shortly and I have already locked the current cpu by blocking interrupts.
Inturn I will initially see if there is a physical page in the physical address space from 0xbf00.0000 to MODULES_END such that I can do a direct same-to-same mapping into the corresponding Virtual address space. Again even if there is non, at one level I may not have to mind really ;-) as I will be nuking the full system shortly.
I am looking at same-to-same mapping to allow the code which will do the mmu disable to continue to work before and after mmu disabling. While a Linear mapped region is good to load the code (bootloader, kernel, ....), before mmu is switched off, which will be passed control after mmu has been disabled, and which inturn can welcome the new system.
NOTE: I am in this more for the fun of exploring, so at least initially I don't want to use kexec and modify it (If I fail, then I may look at using it directly, but don't see a reason to fail for now), rather I want to come up with a concept (and as you rightly mentioned, even kexec follows (and it definitely should) similar concept to a great extent except for may be some of the implementation steps, as end goals are similar) and then implement it for the fun of it, even in crazy ways if possible (I am just starting out on this now, so I dont want to say one way or the other on this aspect now) just for it
NOTE: I am explaining my thoughts, so if someone else is interested in experimenting parallely on his/her own, they can get some ideas (good or bad
BabyStep3 basic implementation done - but results say long fight ahead
Hi All,
Over yesterday and today, I have implemented a basic logic to test minimal kexec equivalent logic using kernel module.
Rather had to dig thro the kernel source code to
a) refresh thro my kernel basics and to understand atleast some of the changes in the newer kernel versions and MORE importantly
b) to OVER COME the tendency of core kernel developers to DISABLE EXPORT of some of the useful functions to external kernel modules.
Eitherway most of the disabled symbols I could pickup and hardcode the address in my code to still access them indirectly using function pointers - what would world be with out function pointers or rather pointers in general.
Also because of the SMP nature of the SOC, had to dig thro some of those stuffs also. Then for now decided to use some of the support mechanism already available within kernel to help with kexec logic like fin, reset, etc to try and see if I could use the easy path into it for now initially
However what I seem to have realised/found is that
a) Either these support routines haven't been fully implemented in the used kernel version on NookTab currently and or
b) I am missing few more additional steps wrt SMP (Have already killed the 2nd Processor using proper api in kernel - Have to cross check the CP15 to verify for sure once again later).
It seems to be mostly (a) and inturn related to cache cleanup and may be mmu switching, have to debug further.
Otherwise the same logic seems to be working in BeagleboardXM (rather within qemu -M beaglexm) except for some reason the uart messages seem to disappear once I switch over even thou the code seems to be running in the new Same-to-Same map with the physical memory address part, with proper UART address - checked using info registers in qemu (Have to debug this part of qemu related to how it decides which uart to show in Ctl-Alt-3 etc bit more and or try on a physical board sometime next week).
In few days time I will upload the code I have come up with (even thou useless from using/achieving kexec logic perspective currently, still may provide some ideas or act as a base platform for someone wanting to experiment, but having initial inertia , if I am not able to spend more time on it.
Initial Pre-Alpha source for linboothkvc kernel module and utils
Hi All,
As promised, I am uploading the initial version of the kernel module source code (with lot more updates compared to last weekend, when I mentioned about it) for achieving kexec like functionality even if kexec is disabled in kernel. As I always told, kernel modules are equivalent to kernel, so you can do what ever you want in kernel module that can be done in kernel, provided one is bit patient ;-).
Note: This is pre - alpha version of code for people with initial inertia/starting trouble to experiment. This has a known bug with cache handling which I have to fix as well as some restructuring and cleanup to do.
This will currently only run in Qemu, because it doesn't bother much with Cache. But on ACTUAL targets it will fail Randomly (there is a very very small one in a million chance that it can succeed if all the stars line up and the cache gods support you
This is no longer as critical for NookTab has it was 1 week back, because Now some people have already released a exploit which uses a uboot bug ;-(, which ideally we could have with held for a future product (because NookTab was already sufficiently open and didn't need any more exploits to use its full potential, as I had mentioned last week). But either way I realise that people are very impatient these days. And congrats to those people for their work however.
For people who want to experiment, the initial skeleton is available in this release
Alpha release with embedded x-loader for BeagleXM Qemu
Hi,
NOTE: This release successfully bootstraps a new linux from with in linux in Qemu, my yesterdays release would have also done the same, but would have required additional code to handle the final nitty grities, this is taken care of now in this release. So that it is easier for people wanting to experiment.
I have updated the kernel module to allow two images to be embedded into it.
a) The initial boot strap loader called Nirvana (Examples like bloop0.S, bloop1.S, ... and now a full fledged omap3callbootrom1.S for BeagleXM on Qemu - Rather it in itself is independent of Qemu-BeagleXm or Hw-BeagleXM)
and
b) The actual bootloader/???? to run in the new prestine environment called Nirvana's Child (NChild). Currenlty it is a version of the x-loader for BeagleXM (Either Qemu or Actual BeagleXM).
In turn once the kernel module is done with its job. It passes control to Nirvana. Also it passes the physical address and length of the NChild image to Nirvana thro r0 and r1.
The Nirvana code in turn can decide what it wants to do with the system. The default Nirvana code i.e omap3callbootrom1.S takes care of copying the NChild(by default x-load.bin) to 0x4020.0800 and then pass control to 0x4001.4000 so that it loads x-loader properly (ie setup stack for all modes etc).
NOTE: As of now it works on Qemu only. My earlier release yesterday would have just printed 1s on the screen, while this version actually boots into a new linux kernel + system in Qemu from with in a already running Linux system in qemu.
However it won't run outside Qemu successfully, as I haven't yet had time to look at fixing the cache issue, because I had to add support for NChild image logic either way for doing anything useful with the code.
NOTE: As this is either way no longer critical for NookTab, I will take a stab at it based on my hack-vs-life balance also. Depending on what and all come up over the next few days in life.
HOWEVER this latest release has the FULL REQUIRED INFRASTRUCTURE/LOGIC for running this on a actual h/w expect for the missing proper cache handling. It also includes a x-load.bin by default for BeagleXM which can be used either with Qemu-BeagleXm or Hw-BeagleXm.
Beta Source - Success on a Hardware (beaglexm for now) should work on NT also ...
Hi All,
I have finally identified the stupid cache issue which was frustrating me and eating my head for long and stalling this project unnecessarily . However it gave a nice oppurtunity for me to dig thro the kernel code as well as Arm documentations - which is what I am after either way So ALL IS WELL in the end
The problem was related to kernel's normal code using MVA based cache operations for flushing, which in the newer architectures stops mostly at L2 cache rather than hitting the memory. This is fine for Normal linux kernel operations because they don't disable cache and so the proper data will get used. But for us as we want to disable cache to give a true pristine NIRVANA environment, this doesn't work, as memory contains old/stale/wrong data. In our code flow This even affects the KERNEL MODULE CODE itself, leave alone Nirvana or NChild code.
Once I realised this by digging thro documents as well as seeing the strange behaviour (rather unbelieavble, initially for me) of my code(kernel module as well as Nirvana and NChild)/logic after cache disable, I was able to get it RUNNING SUCCESSFULLY on BeagleXM actual hardware and not the qemu emulation which I was previously using.
As of now it is restricted to Omap3/BeagleXM, because the Nirvana code Omap3callbootrom2 makes use of the bootrom memory map usage knowledge to setup NChild appropriately and pass control to it thro Bootrom (so that stack is setup for all modes). With small effort the same can be changed or updated for Omap4 and NT should be in the fold (Unless SMP creeps up, inspite of me shutting down the 2nd processor, for some crazy reason in the worst case ;-)
NOTE: Also my last release (alpha) for Qemu beagle had a bug which was a blessing in disguise, in that it was not disabling the MMU from with in kernel module(which I had added just for the heck of it and is actually not required). However it was still doing it once it hit Nirvana code, as required. If I had not done the mistake of using mrc instead of mcr with in my kernel module code, it would have failed immidiately, because BeagleXM has only 512MB ram and the kernel module code space is at virtual address 0xbf00.0000 or around it, which is WELL BEYOND the 512 MB of physical memory, so there would not have been any 1-to-1 memory map for it and disabling MMU would have made things go crazy. Note that Nirvana and NChild are kmalloced into linear mapped kernel address space which is with in physical memory limits normally ;-).
NOTE: May be there is a watchdog timer or coprocessor or so which I have to disable, haven't looked into this yet, which seems to mess things up, if I stay in Nirvana code for too long. However as by default there is no need to remain in Nirvana code for long, as it is required to pass control to NChild as quickly as possible, this is not a immidiate issue to worry about now.
Let the experimentations begin
For H/w BeagleXM boot, bypass stupid SMI based L2 Cache maintaince rot in uboot ;-)
Hi All,
If anyone has tried running my yesterdays Beta release on BeagleXM h/w there is one update and one other IMPORTANT things to keep in mind.
a) Update the omap3callbootrom2.S to directly call into NChild rather than thro BootRom, that call into BootRom is not required. i.e jump to 0x4020.0800 instead of 0x4001.4000 at the end.
NOTE: This also makes the code more generic and usable with minimal love across Beagle and NookTab.
b) In U-Boot remember to DISABLE/BYPASS the calls to ROM Support routines thro SMI to setup L2 cache as well as to invalidate cache. This is no longer required in newer Omap3 chips as well as there is actually few bugs in u-boot code itself related to this, as one wants to clear full cache but SMI rom routine only clears L2 (also the full cache walking for invalidate is there following the SMI call, so bypassing doesn't lose functionality), if I get rom code description in TRM correctly, plus few other bugs atleast in rowboat version. The files board.c and cache.S contain the calls to SMI which has to be bypassed.
I have attached the minimal patch required to uboot to allow it to work with linboothkvc with BeagleXM.
With the above two changes, linboothkvc will always succeed in BeagleXM, enjoy
NOTE: In my setup today, I have modified the NChild x-loader to load u-bootk.bin rather than u-boot.bin. Thus I can have both the Normal u-boot.bin for Normal booting and u-bootk.bin for linboothkvc based booting . My Beta release doesn't contain this modified x-loader NChild, the next release will contain the modified one. But with source of x-loader, you can do it yourself and copy over as NChild into linboothkvc
Success on nook tab
Hi All,
LinBootHKVC has successfully booted into Nirvana code in NookTab
NOTE: No major change required to my beta release other than one mentioned in my last post to make my released Nirvana code more generic and the address update in this post for NookTab.
As I had mentioned yesterday, even thou I hadn't got the time yesterday to check it on NookTab yet, it should work 90% except for any crazy SMP issues, inspite of me disabling the 2nd Processor. WELL IT turns out that what I had done already was sufficient for NookTab also.
Only in omap3callbootrom2.S you have to change the sram address to which things are copied from 0x4020.0800 to 0x4030.0800 for NChild code. However I haven't crosschecked the x-loader based NChild on NookTab as of now, but DONT SEE ANY REASON why it should fail, other than for any issues with stupid code, like the SMI calls to manage L2 cache in u-boot for beaglexm and for some reason if 0x4030.0000 space has some issues I haven't thought of in Omap4 (I am relatively new to Omap4 started with NookTab only).
Will upload the Release Candidate version 1 of the code in a day or two. It is late here and I have been up on this NookTab project for few weeks now
a) starting from idea of linboothkvc
b) then moving to 2ndihkvc
c) followed by NOPBypass with UART access
0) The uboot loop hole (Oh my my my (But not released from my side hoping to keep it for future, but alas, if only people have/had patience ..., that is partly a dream now
d) followed by MenuK for 2ndihkvc - haven't released yet, time got sucked back
into linboothkvc
and back to
e) linboothkvc
all of the above work on NookTab successfully as of today and all can be used to achieve custom Roms and in case of NOPBypass and linboothkvc even custom kernels
So enjoy everyone. Some sweet rest for me atlast ;-)
NOTE: The POWER of Kernel MODULE and inturn linboothkvc goes well beyond NookTab for the adventures people out there
Oh My MURPHY - For now keep away from 0x4030.xxxx
Hi All,
Now as Murphys law would have it , 0x4030.4350 (the default address used by x-loader in Omap4) has some issue with it (which I have to debug later). So if trying on NookTab remember to use some other address (what other I will leave as a exercise to the interested
Also the x-loader from BN and or inturn from Ti expects a special meta data structure to be passed along thro r0, which inturn tells it about boot device and boot mode. So you will require to take care of this or better still simplify the structure to handle in cpu/omap4/start.S
Also I did the cardinal sin of doing too many changes when working/debugging on a new unknown device (from my perspective i.e NookTab) with no jtag access (atleast at my end for now).
So ended up digging into Arm L2X0 cache and inturn PL310 trm and writing a L2X0 cache flush logic (obviously also cross checking the equivalent logic in Linux kernel) when none was required in reality as I had already found and mentioned in my last post few days back. I forgot (rather got too lazy to checkout my own old code, just for the fun of exploring further ;-) my own Nirvana code which I had tried towards the beginning of the week which had successfully run and printed stuff on screen.
Also dug into the Address translation support registers in CP15 to be 100% sure that the 1-to-1 map was in fact there (again lazy to dig thro the linux kernel setup_mm code, when arm walks the page table tree for you and on top when I had not tried this arm instruction method before .
But ended up finally realizing that me using the 0x4030.4350 was the culprit atleast for now.
So keep away from that address for now (or debug further on this on your own for now, I will be looking at it only later, could be something to do with HS code using that region or ..., there is more interesting stuff to do for now) and remember to patch x-loader appropriately and you should be able to get it running on NookTab; again with my last code release with hardly any changes other than what I have already mentioned in the last 2 to 3 posts.
A updated source with the now useless l2x0 cache flush and va2pa address translation verification logic and a newer nirvana code with panda board support also (verified works perfectly - only slight changes required between Panda and NookTab as far as Nirvana code is concerned) I will release after some more experimentation and code stabilisation at my end.
hkvc said:
Hi All,
Now as Murphys law would have it , 0x4030.4350 (the default address used by x-loader in Omap4) has some issue with it (which I have to debug later). So if trying on NookTab remember to use some other address (what other I will leave as a exercise to the interested
Also the x-loader from BN and or inturn from Ti expects a special meta data structure to be passed along thro r0, which inturn tells it about boot device and boot mode. So you will require to take care of this or better still simplify the structure to handle in cpu/omap4/start.S
Also I did the cardinal sin of doing too many changes when working/debugging on a new unknown device (from my perspective i.e NookTab) with no jtag access (atleast at my end for now).
So ended up digging into Arm L2X0 cache and inturn PL310 trm and writing a L2X0 cache flush logic (obviously also cross checking the equivalent logic in Linux kernel) when none was required in reality as I had already found and mentioned in my last post few days back. I forgot (rather got too lazy to checkout my own old code, just for the fun of exploring further ;-) my own Nirvana code which I had tried towards the beginning of the week which had successfully run and printed stuff on screen.
Also dug into the Address translation support registers in CP15 to be 100% sure that the 1-to-1 map was in fact there (again lazy to dig thro the linux kernel setup_mm code, when arm walks the page table tree for you and on top when I had not tried this arm instruction method before .
But ended up finally realizing that me using the 0x4030.4350 was the culprit atleast for now.
So keep away from that address for now (or debug further on this on your own for now, I will be looking at it only later, could be something to do with HS code using that region or ..., there is more interesting stuff to do for now) and remember to patch x-loader appropriately and you should be able to get it running on NookTab; again with my last code release with hardly any changes other than what I have already mentioned in the last 2 to 3 posts.
A updated source with the now useless l2x0 cache flush and va2pa address translation verification logic and a newer nirvana code with panda board support also (verified works perfectly - only slight changes required between Panda and NookTab as far as Nirvana code is concerned) I will release after some more experimentation and code stabilisation at my end.
Click to expand...
Click to collapse
hkvc:
Thanks for all of your work. Even though the bootloader bypass has been found, you do not know how many others you are helping. This could be used as an indefinite alternative to locked bootloaders for ALL DEVICES! Keep chugging on this, and I'm sure you'll find your solution to the l2 cache flush. Also i have been looking around, and I was curious if this could be another explotable boot flaw,
Code:
/*
* The SAR RAM is maintained during Device OFF mode.
* It is split into 4 banks with different privilege accesses
*
* ---------------------------------------------------------------------
* Access mode Bank Address Range
* ---------------------------------------------------------------------
* HS/GP : Public 1 0x4A32_6000 - 0x4A32_6FFF (4kB)
* HS/GP : Public, Secured
* if padconfaccdisable=1 2 0x4A32_7000 - 0x4A32_73FF (1kB)
* HS/EMU : Secured
* GP : Public 3 0x4A32_8000 - 0x4A32_87FF (2kB)
* HS/GP :
* Secure Priviledge,
* write once. 4 0x4A32_9000 - 0x4A32_93FF (1kB)
* ---------------------------------------------------------------------
* The SAR RAM save regiter layout is fixed since restore is done by hardware.
*/
27.4.4.4.1 Public Use of SAR RAM
At system level, the OMAP4430 SAR RAM memory is divided into four banks. The public ROM code uses only the first bank, which is always public-accessible. More specifically, the software booting configurationstructure must be located in the upper 1.5KB of the first bank.
The public ROM code offers some flexibility about the location of the software booting configuration structure. The PUBLIC_SW_BOOT_CFG_ADDR pointer defines the start address of the structure within the SAR RAM bank (see Table 27-14).
As mentioned previously, the software booting configuration feature is optional. Hence, the public ROM code decides to use the feature based on the value read on a warm reset at the address pointed to by the PUBLIC_SW_BOOT_CFG_ADDR pointer. If the value matches the range 0x4A326A00 – 0x4A326FFF, the ROM code tries to extract the structure located at that address. The value pointed to by PUBLIC_SW_BOOT_CFG_ADDR is always overwritten to zero on a cold reset.
The recommended address for storing the software booting configuration structure described hereafter is defined as PUBLIC_SAR_RAM_1_FREE. It is, however, possible to locate the structure at any location within the 1.5-KB range.
It is moreover possible to use the public SAR RAM area for any other purpose, such as storing traces for HLOS use. Obviously, care must be taken not to overwrite the locations used for low-power modes and/or software booting configuration if used.
Click to expand...
Click to collapse
linboothkvc v1.0_RC3 with good x-loader for O3Beagle and O4Pandabrd and semi 4NookTab
Hi All,
I am attaching the source code for linboothkvc with a good basic Nirvana code for Omap3 (Many mobiles and few tablets) and Omap4 (few mobiles and tablets) devices. NOTE: for NookTab, basic linboothkvc works perfectly now (except for may be some toning down of the secure Monitor code if possible), However there is some more work required at x-loader (which I am using as my NChild code) level which I have mentioned further below as TODO. Otherwise the basic logic fully works for NookTab also now. At this stage it can be used by developers and not end users as NChild code for NookTab still requires some love.
[A] obviously there would be some minor tweaks to the NChild load address and args to pass etc based on x-loader/bootloader used in a given device, but still the basic skeleton is fully there in Nirvana code now. And the same can be modified for other SOCs from Samsung/NVidia/(Not getting the other vendor name now funny)... pretty easily.
Also the addresses for the linux kernel functions which I use require to be updated for any new device or for a new/different kernel for the devices which I have already put the code in this release.
[C] It expects to find a u-bootk.bin in mmc vfat root dir, provided you are using the x-loader code which I have bundled. How ever based on your device, you may have to change to a different bootloader or modify x-loader to suit that devices need, and thus With your own version of x-loader or NChild code, you can always modify it the way you want as to what it loads and from where.
But with the above changes/setup this can be used with any Rooted ARM based Linux device (be it android or webos or ...)
Changes I had to do to x-loader for NookTab:
[1] I had to bypass or find alternate locations for some of the 0x.4030.xxxx addresses used in x-loader from BN/Ti (Haven't had time to look into the details as to why this is forced on us and how to force the use of the same address yet). For this reason I am recompiling the x-loader with a load address of 0x8000.7ff0 for now and sidestepping it mostly.
[2] Clock and related init settings related to MPU,IVA and DDR memory are offlimits for now (but then again for a basic working these need not be changed at x-loader level eitherway).
[3] smc/SEC_Ppa functions are offlimits for now, again not required at x-loader level.
[4] TODO: the x-loader bundled with BN source seems to be a old version or has some non required (from BN perspective, but usefull from our perspective) logics for BN stripped. So even thou I have modified the high level logic to do a FAT load from MMC for u-bootk.bin. Because of this missing support for FAT boot mode, the current version of x-loader for NookTab which I have bundled in my code doesn't load u-bootk.bin.
Enjoy and happy Experimenting all
NOTE: When I say bundled x-loader, it is only binary blob, you can get the actual source code for x-loader from the respective git sources. I think few days back I uploaded the patch required for beagle x-loader to make it run in linboothkvc Nirvana env. I will do the same for x-loader for NookTab and Omap4 (rather omap4/panda hardly any change required from Ti release - I had to mainly simplify the argument mechanism passed to x-loader and nothing much, if I remember correctly, as I tried pandaboard 1 day back and after that I have done so many other things that, pandaboard is out of my memory Fifo) in few days.
[DONE] source of linboothkvc v1.0 (includes binary for NookTab with working xloader)
Hi All,
LinBootHKVC for NookTab is fully DONE now. Well (for developers) it can work with any ROOTED ARM based LINUX device (android or not doesn't matter) with kernel module support with minimal love, for those who are interested ;-).
Along with the source (which can work with any Arm based linux setup with some minimal love), this release also includes the binary kernel module for BN NOOK TABLET with firmware 1.4.0. Which inturn contains a working x-loader binary as its NChild for NookTab, which looks for a u-bootk.bin file on the uSD card.
To use this on NookTab (similar steps work for any other device, provided you have suitably compiled linboothkvc for your device with proper love)
a) get your required/prefered u-boot.bin file and prepend a 288 (0x120) byte dummy header and name it u-bootk.bin
i.e
dd if=/dev/zero of=/tmp/dummy.bin bs=288 count=1
cat /tmp/dummy.bin u-boot.bin > u-bootk.bin
b) copy this u-bootk.bin to the root directory of the 1st partiton on a uSD card which inturn should be VFAT formated. (To be 100% safe and sure use a newly formated uSD - Or you never know when Murphys law can kick in, see my note at the end for a bad luck I had yesterday night
c) Insert the uSD card to your Nook Tablet
d) Copy to your Rooted NOOK TABLET with firmware 1.4.0 the kernel module lbhkvc_km_DEVICE_NOOKTAB.ko which I have provided with in the release folder in the source package uploaded with this message/post.
__may be__ adb push lbhkvc_km_DEVICE_NOOKTAB.ko /data/local/tmp/
or similar or thro the uSD card and a file manager.
e) either from adb (on PC) or a terminal (on NookTab) or serial port (on PC) get to a root shell.
if using ADB on a PC connected to rooted Nook Tab it will be
adb shell
su
NOTE: PC is NOT required, you can also load the kernel module directly from Nooktab by using a android terminal package to get shell access.
f) insmod the copied Kernel module from the root shell/prompt
insmod lbhkvc_km_DEVICE_NOOKTAB.ko
This will load linboothkvc and inturn do a forced reboot/hijack into a x-loader environment, which will inturn load the u-bootk.bin which you had copied into SD card in steps a to c above.
NOTE: Based on what I have verified, u-boot works with out requiring any change to it (unless you want to bypass the security check in u-boot . So ENJOY.
NOTE: This can equally work on a 1.4.1 firmware based Nook Tablet, provided it is rooted. But for that you will most probably have to recompile my kernel module with updated addresses (if it has changed) for the kernel functions which I am using. However if BN hasn't done any change to kernel in 1.4.1 firmware, then the current kernel module which I have bundled it self will work. I haven't verified with 1.4.1 firmware currently (as I haven't upgraded to 1.4.1)
NOTE: Be sure to save any things you might be working on your NookTab, before loading the kernel module, because it will force a reboot with out any mercy, so any unsaved things in your NookTab can get lost. so BEWARE
NOTE: Rather even yesterdays release would have worked 99%, I had a problem with my uSD card being bit corrupt wrt rootdirectory, which is why it was failing yesterday when I finished it originally . However in this release I have also cleaned up the Nirvana code a small bit to avoid the hardcoded ioremap address of UART.
Release v1.1 source with binary for NookTab
Hi All,
Being bit lazy I had not called cache flush once again after disabling the cache, because I was calling it just a wee bit before disabling it and was also expecting any body who enables Cache in Nirvana environment to do a thorough job of cache invalidation before enabling it again.
However found that the linux kernel 2.6.35 used by Nook firmware has this problem, so now I take care of calling cache disable once again after disabling the Cache to be on safe side and it does help for NookTab (while on Beagle and Pandboard I didn't have this issue, it was a newer kernel which I had tried there so may be it has some additional effort put in wrt cache invalidation or it was pure luck, either way haven't debugged that aspect now).
So with this release, linboothkvc provides a better Nirvana environment, except for the SMC related stuff, which I am ignoring for now . So related to that there is some cleanup or bypassing required to be done in Kernel otherwise linux kernel should be pretty much ok in linboothkvc Nirvana environment, haven't had time to look at it fully yet. Will spend sometime in a day or two when a holiday is coming my way.
Check out the README file some of the same info as above and may be a few more things here and there. Also the new binary for NookTab is there in the source package within the release directory.
I've read every one of these posts and have no idea what is going on but I'm glad that it's all working. Great job!
Sent from my Nexus S using xda premium
Getting Linux kernel for NookTab up in LinBootHKVC - Step2 and 3
Hi All,
Step2
------------
There seems to be few race conditions in the linux kernel source and or some initialisations not being done properly in the kernel code, because of which by default the BN kernel source will fail in LinBootHKVC environment.
The below patch fixes 1 such race issue I have noticed wrt initial clock event handler for ipi timer (Have to debug this further later).
NOTE: A initialisation issue with the Cache, in that it not getting invalidated properly during booting was fixed in my v1.1 linboothkvc kernel module, by doing a additional flush before switching to Nirvana. Because that was also a appropriate stuff for linboothkvc also to do, independent of the kernel initialisation issue.
static void ipi_timer(void)
{
struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
irq_enter();
- evt->event_handler(evt);
+ if(evt) {
+ if(evt->event_handler) {
+ evt->event_handler(evt);
+ }
+ else
+ printk("WARN:ipi_timer: event_handler missing\n");
+ }
+ else
+ printk("WARN:ipi_timer: evt not set\n");
irq_exit();
}
Beyond this any additional issues, I have to check yet. Also the reason for this race, I haven't debugged for now.
UPDATE1 (Step3)
----------------------
I have further cross checked that CONFIG_OMAP_RESET_CLOCKS causes some problem in linboothkvc Nirvana environment for few specific clocks, either way for now Disabling this config in BN NookTab kernel before compilation will allow the resultant kernel to run SUCCESSFULLY on NOOKTAB.
NOTE: As of now, even thou SMP is enabled, one of the Processors doesn't come up live. That has to be debugged later. But otherwise the Linux is FULLY running in NookTab from with in the LinBoothKVC Nirvana Environment and in turn the Linux User space is also running fine.
That sounds like a big step. Awesome work!

[Q] Help with kernel adding driver

Hi guys
I am new to android and i need some help. Apologies if i have posted this in the wrong place.
I manufacture and supply large touch screens to special needs schools and in the past i have used multitouch overlays that came with a mini pc android called istick by PQ Labs that were coded to work as multi touch. now i have changed touch panel product i need an android pc to work with it.
I am thinking of using a MK809iv and the company that supplies the overlay has sent me the mods that need to be made to the kernel but i have no idea how to do this.
Here is what they sent me.
Transplanting under Android4.0 For IRMT Multi Touch Frame Driver V1.1
The following method is suitable for the kernel which above Linux 3.0, we take an example of Kernel 3.08.
1. Add manufacturer ID and Device ID in the 352st line of “drivers/hid/hid-ids.h”
#define USB_VENDOR_ID_IRMTOUCH 0x23c9
#define USB_DEVICE_ID_IRMTOUCH_SSERIAL 0x5666
2. Add device according to put the following program in the 669st line of “/drivers/hid/hid-multitouch.c”
/* IRM Multi-touch panel */
{ .driver_data = MT_CLS_CONFIDENCE,
HID_USB_DEVICE(USB_VENDOR_ID_IRMTOUCH,
USB_DEVICE_ID_ IRMTOUCH_SSERIAL) },
3. Add special protocol support in the 1392st line of “drivers/hid/hid-core.c”
{HID_USB_DEVICE(USB_VENDOR_ID_IRMTOUCH, USB_DEVICE_ID_IRMTOUCH_SSERIAL) },
4. Configuring the kernel. (menuconfig)
Firstly enter Device Drivers, then enter HID Devices ,then select Special HID drivers. Build-in HID Multitouch panels . ( select “*” )
Save and exit.
5. Compile the kernel and update the mirror of android 4.0
Shanghai IRMTouch Technology Co.,Ltd
2012.8.31
Any help would be greatly appreciated
Thanks
Ty
I suppose you already solved the problem or left it, anyway thanks for pasting the info, very usefull to modify the kernel to support this IRM Touch.
Regards

Android Test Cases

I am starting my Master Thesis which is more or less focussed on Android development and testing. Right now my question is, say I have developed an android application and have certain users who are already using my application. Is there a way where in I can push my custom test cases only to a specific set of users. For example, I have 300 users, I want to send the test cases only to people who are using Android 5.0, or only to users residing in Europe something like that. I have tried searching for this over the internet but unfortunately wasn't successful.
in your app somewhere include line of code that checks what version the os is? something like this
Check android.os.Build.VERSION.
CODENAME: The current development codename, or the string "REL" if this is a release build.
INCREMENTAL: The internal value used by the underlying source control to represent this build.
RELEASE: The user-visible version string.
Click to expand...
Click to collapse
Code:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
// only for gingerbread and newer versions
}
and same with where user lives, just check whats user location is with some line of code
i got those from stackoverflow but im not allowed to post links so youll just have to google something like: android java check for android version

Enable the 5 cams at OpenCamera including 108Mpx mode

Step by Step guide to enable the 5 cams using OpenCamara (probably can be extended for Gcam too)
1.- You need a unlocked Note 10
2.- Install TWRP-3.3.1-0709-XIAOMI_CC9-CN-wzsx150-fastboot or the last one
3.- Install Magix & The App Root Esentials for example
4.- Edit the file build.prop using for example Root Esentials
Edit this line :
vendor.camera.aux.packagelist=org.codeaurora.snapcam,com.xiaomi.runin,com.xiaomi.cameratest,com.xiaomi.factory.mmi,com.android.camera,org.lineageos.snap,net.sourceforge.opencamera,troop.com.freedcam
and add this one:
camera.aux.packagelist=net.sourceforge.opencamera
5.- reboot
6.- Install Android Studio or similar to edit the source code for opencamera
7.- Create the project from the opencamera git
https://sourceforge.net/p/opencamera/code/ci/master/tree/
8.- Edit the file MainActivity.java and fix the other cameras in this function
public void clickedSwitchCamera(View view) {
......
int cameraId = getNextCameraId();
if(cameraId==6)
cameraId=7;
if(cameraId==8)
cameraId=9;
if(cameraId==10)
cameraId=11;
if(cameraId==11)
cameraId=12;
if(cameraId==12)
cameraId=13;
( there are 14 cameras found, but some fail)
9.- Install the OpenCamera from AndroidStudio
To enable the 108Mpx mode keep reading the thread.
hi I'm trying to import that link via vcs and git, but it tells me that the link was not found, what should I import on android studio?
djisma86 said:
hi I'm trying to import that link via vcs and git, but it tells me that the link was not found, what should I import on android studio?
Click to expand...
Click to collapse
In android studio Go to
File > New > Project from version control > Git >
Type:
Code:
https://git.code.sf.net/p/opencamera/code
Test and should go Green > then it will take a while to import all the needed sources
And now with the 108Mpx Mode too!!!!
Finally was able to make the 108Mpx mode to work with OpenCamera too!
You need to edit the following files in the OpenCamera Source Code:
1.- build.gradle > to enable a bigger api level at least 26 sdk version
Code:
defaultConfig {
applicationId "net.sourceforge.opencamera"
minSdkVersion 26
targetSdkVersion 28
renderscriptTargetApi 26
2.- Edit the file net\sourceforge\opencamera\cameracontroller\CameraController2.java
to override the streaming info for the new resolutions
this is code is around line 2017 of the file
Code:
StreamConfigurationMap configs;
try {
configs =CameraStreamConfigurations.getCustomStreamConfigurationMap(characteristics); // New to enable the 108Mpx mode to show
// Updated for 108Mpx older was
//configs = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
}
3.- Add a new java file with the overriding code ( based on code found at https://gist.github.com/lgyjg/07fdc8146f1d472a0941dcd0e470c93d
You need to create a new file named CameraStreamConfigurations.java at
net\sourceforge\opencamera\cameracontroller\CameraStreamConfigurations.java
with the following code:
Code:
package net.sourceforge.opencamera.cameracontroller;
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.params.StreamConfigurationMap;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
public class CameraStreamConfigurations {
@SuppressLint("PrivateApi")
public static StreamConfigurationMap getCustomStreamConfigurationMap(CameraCharacteristics cameraCharacteristics) {
try {
Class<?> streamConfigurationArrayClazz = Class.forName("[Landroid.hardware.camera2.params.StreamConfiguration;");
Class<?> cameraCharacteristicsKeyClazz = Class.forName("android.hardware.camera2.CameraCharacteristics$Key");
Class<?>[] params = {String.class, Class.class};
Object[] values = {"xiaomi.scaler.availableStreamConfigurations", streamConfigurationArrayClazz};
Constructor<?> constructor = cameraCharacteristicsKeyClazz.getDeclaredConstructor(params);
CameraCharacteristics.Key<?> MI_SCALER_AVAILABLE_STREAM_CONFIGURATIONS = (CameraCharacteristics.Key<?>) constructor.newInstance(values);
Object configurations = cameraCharacteristics.get(MI_SCALER_AVAILABLE_STREAM_CONFIGURATIONS);
boolean listHighResolution = true;
Object[] streamConfigurationMapValues = {
configurations,
cameraCharacteristics.get(getFiled("SCALER_AVAILABLE_MIN_FRAME_DURATIONS")),
cameraCharacteristics.get(getFiled("SCALER_AVAILABLE_STALL_DURATIONS")),
cameraCharacteristics.get(getFiled("DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS")),
cameraCharacteristics.get(getFiled("DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS")),
cameraCharacteristics.get(getFiled("DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS")),
cameraCharacteristics.get(getFiled("CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS")),
cameraCharacteristics.get(getFiled("SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP")),
listHighResolution
};
Constructor<?> streamConfigurationMapConstructor = android.hardware.camera2.params.StreamConfigurationMap.class.getConstructors()[0];
StreamConfigurationMap mStreamConfigurationMap = (StreamConfigurationMap) streamConfigurationMapConstructor.newInstance(streamConfigurationMapValues);
return mStreamConfigurationMap;
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
static CameraCharacteristics.Key<Object> getFiled(String filed) {
CameraCharacteristics.Key<Object> result = null;
try {
Field f = CameraCharacteristics.class.getField(filed);
result = (CameraCharacteristics.Key<Object>) f.get(null);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
return result;
}
}
Hi @TF1920
I just modded open camera as per your excellent instructions above and at first glance, 108mp jpeg works fine! Well done lol.
I can confirm that with your original camera-id shifting code, my open camera on EU rom crashes at camera 8->9 so I've limited the max camera ID to 5 on mine.
As you said, RAW doesn't work and on mine, if RAW is enabled, neither does jpeg. The camera only works when only jpeg is enabled. If you do choose RAW, there's a long delay where the photo canvas freezes and eventually it frees up.
I'll get some samples later.
---------- Post added at 11:30 AM ---------- Previous post was at 11:28 AM ----------
Oh, yes I forgot. Each time I install a new version of open camera, it defaults back to camera.api from camera2 and you can't get the high res photos.
It threw me for short while lol.
Hi Again
I just had a play with RAW mode turned on and tried it with all lenses. I tried them all with Storage Access Framework on and off and this made no difference to the results.
Raw ON
======
camera 0 - 108mp
Makes click sound then screen freezes for 60 seconds.
No jpeg or raw saved.
Video and camera switch icons missing. Choose Settings/About/Back and icons reappaer
Camera 1 - selfie
Toast Message: "Failed to save RAW photo"
Save jpeg and DNG but jpeg distorted and DNG is 0 bytes
Camera 2 - 2x zoom
No RAW text on screen (below ISO text).
jpeg saved OK, no RAW saved
Camera 3 - UltraWide
jpeg and RAW both saved OK
Camera 4 - Macro
jpeg and RAW both saved OK
Camera 5 - 5x zoom
No RAW text on screen (below ISO text).
jpeg saved ok, no RAW saved.
Cheers
Steve
Good tests Steve, you can debug where raw fails in androidstudio , if you plug and build opencamera and run it from the play button of androidstuido without unplugin it take a look at the debug infor at the Logcat view, then try what fails and report possible errors there, I will keep looking too, also I am not sure of the quality at 108Mpx with OpenCam vs Stock need more tests., all the other stuff works well at 108Mpx with Jpg.
I my first test at 108Mpx the quality is similar as stock as long as you manual focus, easy with the 10X digital zoom with opencam once you focus go back to 0x zoom to avoid loss
Hi thanks for the tip. I'm still poking around Android Studio to get a feel for it. What I really need to do is build my own app from scratch. I'll give your suggestion a go in the next few days.
I'm intending to go out and get a few sample jpegs/raw with open camera and stock for comparison and will post them up but for some reason it's raining pretty much constantly here. I wonder why? Oh, yes I live in the UK.
I had a play with the stock cam to compare RAW support with open cam and got the following:
UltraWide - RAW
Wide 27MP - RAW
Macro RAW
Wide 108mp No RAW
TELE 2x No RAW
Tele 5x No RAW
Hi
I've taken a bunch of photos using opencam and stockcam, including RAW when possible and posted here:
https://forum.xda-developers.com/mi-note-10/help/sample-photos-original-resolution-t4013951#post81263619
Thanks Steve, I still see a bit more resolution in the stock 108Mpx vs the OpenCam, maybe a bit more sharpen due to some post process or other things may need further research, I am testing the unlimited repeats of opencam and works quite well made 4200 108Mpx picts 80Gbs total of 20Mb each at 100% jpg in about 1,5h
Anyone who has modified the apk and the build.prop could pass it? I have tried it several times and I am not able.
Thank you
any sample of shots on gcam at 108mpx?
Raw if possible
In LOS 16 all 5 cameras are enabled by default with Open Camera.
iSonik said:
In LOS 16 all 5 cameras are enabled by default with Open Camera.
Click to expand...
Click to collapse
And LineageOS 16 enable raw for 108 Mpx? can you post link to the rom please
Hi everyone,
I have created Open Camera MOD for Xiaomi Note 10 based on latest OpenCamera GIT code, that DOES NOT REQUIRE ROOT OR CUSTOM RECOVERY to be able to use all 5 rear cameras. Note that 108MP code patch is not included since its breaking Camera 2 API switch in preferences and making camera app to crash when you try to switch to Camera 2 API.
How I did it?
I have refactored Open Camera app in Android studio. Using this guide https://stackoverflow.com/questions/16804093/rename-package-in-android-studio + some simple "replace in files" for leftover references to old package name. During refactoring I have changed package name from "net.sourceforge.opencamera" to "org.codeaurora.snapcam" since that one is white listed to use AUX cameras in build.prop without any changes required. I have also changed labels for cameras so instead showing ID1, ID2, etc... Every camera have now proper name.
I have used similar technique of changing package name for GCam ports and Hedge Camera 2 in past and it works quite well for me.
Link to APK: https://drive.google.com/open?id=14kYxCPGvBEe1KujD07BX2t5r-u-owaq2
I hope this will make you happy.
D1G1TE said:
Hi everyone,
I have created Open Camera MOD for Xiaomi Note 10 based on latest OpenCamera GIT code, that DOES NOT REQUIRE ROOT OR CUSTOM RECOVERY to be able to use all 5 rear cameras. Note that 108MP code patch is not included since its breaking Camera 2 API switch in preferences and making camera app to crash when you try to switch to Camera 2 API.
How I did it?
I have refactored Open Camera app in Android studio. Using this guide https://stackoverflow.com/questions/16804093/rename-package-in-android-studio + some simple "replace in files" for leftover references to old package name. During refactoring I have changed package name from "net.sourceforge.opencamera" to "org.codeaurora.snapcam" since that one is white listed to use AUX cameras in build.prop without any changes required. I have also changed labels for cameras so instead showing ID1, ID2, etc... Every camera have now proper name.
I have used similar technique of changing package name for GCam ports and Hedge Camera 2 in past and it works quite well for me.
Link to APK: https://drive.google.com/open?id=14kYxCPGvBEe1KujD07BX2t5r-u-owaq2
I hope this will make you happy.
Click to expand...
Click to collapse
Do you have telegram? I want to see if you can get aux to expose in gcam properly because when I tried it did not work, only ultrawide works in gcam 7.2 with code aurora package
D1G1TE said:
Hi everyone,
I have created Open Camera MOD for Xiaomi Note 10 based on latest OpenCamera GIT code, that DOES NOT REQUIRE ROOT OR CUSTOM RECOVERY to be able to use all 5 rear cameras. Note that 108MP code patch is not included since its breaking Camera 2 API switch in preferences and making camera app to crash when you try to switch to Camera 2 API.
How I did it?
I have refactored Open Camera app in Android studio. Using this guide https://stackoverflow.com/questions/16804093/rename-package-in-android-studio + some simple "replace in files" for leftover references to old package name. During refactoring I have changed package name from "net.sourceforge.opencamera" to "org.codeaurora.snapcam" since that one is white listed to use AUX cameras in build.prop without any changes required. I have also changed labels for cameras so instead showing ID1, ID2, etc... Every camera have now proper name.
I have used similar technique of changing package name for GCam ports and Hedge Camera 2 in past and it works quite well for me.
Link to APK: https://drive.google.com/open?id=14kYxCPGvBEe1KujD07BX2t5r-u-owaq2
I hope this will make you happy.
Click to expand...
Click to collapse
Hi, I'm very interested in video recording with the x5 telephoto, since it's is not supported wit the stock camera. I couldn't install your apk, I have stock MIUI 11 and Android 9. What shoul I do in order to install it?
polfmarti said:
Hi, I'm very interested in video recording with the x5 telephoto, since it's is not supported wit the stock camera. I couldn't install your apk, I have stock MIUI 11 and Android 9. What shoul I do in order to install it?
Click to expand...
Click to collapse
I am also on stock MIUI 11 / Android 9 - Global ROM. What error do you get?
---------- Post added at 02:30 AM ---------- Previous post was at 02:26 AM ----------
xterminater07 said:
Do you have telegram? I want to see if you can get aux to expose in gcam properly because when I tried it did not work, only ultrawide works in gcam 7.2 with code aurora package
Click to expand...
Click to collapse
I am no expert in GCam, sorry. I don't even have GCam source code.
D1G1TE said:
I am also on stock MIUI 11 / Android 9 - Global ROM. What error do you get?
It says that the app could not be installed.
Edit: It is not installed because of its package name. I'm trying to solve it.
Edit 2: It couldn't be installed because I had UltraCam installed and it was using the same package name. I uninstalled it and now I'm able to use it.
Click to expand...
Click to collapse
---------- Post added at 08:33 PM ---------- Previous post was at 08:22 PM ----------
[/COLOR]
D1G1TE said:
Hi everyone,
I have created Open Camera MOD for Xiaomi Note 10 based on latest OpenCamera GIT code, that DOES NOT REQUIRE ROOT OR CUSTOM RECOVERY to be able to use all 5 rear cameras. Note that 108MP code patch is not included since its breaking Camera 2 API switch in preferences and making camera app to crash when you try to switch to Camera 2 API.
How I did it?
I have refactored Open Camera app in Android studio. Using this guide + some simple "replace in files" for leftover references to old package name. During refactoring I have changed package name from "net.sourceforge.opencamera" to "org.codeaurora.snapcam" since that one is white listed to use AUX cameras in build.prop without any changes required. I have also changed labels for cameras so instead showing ID1, ID2, etc... Every camera have now proper name.
I have used similar technique of changing package name for GCam ports and Hedge Camera 2 in past and it works quite well for me.
Link to APK:
I hope this will make you happy.
Click to expand...
Click to collapse
I was searching exactly for this! After testing Hedgecam 2 and Open Camera because I want more control for my videos, I was immediately dissapointed by the lack of support for ultra wide and 5x cameras. Your version of open cam works flawless! Thanks and wish you the best,
Flo

Categories

Resources