FORUMS

[Q] Camera Swap on rooted TF101

4 posts
Thanks Meter: 1
 
By Oblonsky, Junior Member on 8th June 2012, 02:59 PM
Post Reply Email Thread
Hi - NaN (not a noob) to software and hacking but new to this device.

I have a rooted TF101 and wonder if anyone's hacked the device so that the front camera becomes the rear and the rear camera becomes the front.

Really just curious before I go ahead and brick my device. I'm thinking about mv /dev/ov5640 and /dev/tegra_camera but that sounds far too easy (and dangerous)...
8th June 2012, 06:55 PM |#2  
Senior Member
Thanks Meter: 55
 
Donate to Me
More
Why would You be interested in swapping the cameras anyways? Seems to be a biit pointless to me as every app ive used with cameras it had support to use front or back.

Sent from my Transformer TF101 using xda premium
8th June 2012, 07:09 PM |#3  
werewolferx's Avatar
Junior Member
Flag Puerto Vallarta
Thanks Meter: 2
 
More
Thumbs down I agree
Quote:
Originally Posted by kenshin1388

Why would You be interested in swapping the cameras anyways? Seems to be a biit pointless to me as every app ive used with cameras it had support to use front or back.

Sent from my Transformer TF101 using xda premium

I agree to this, there is no point to make the change.
8th June 2012, 08:24 PM |#4  
OP Junior Member
Thanks Meter: 1
 
More
Well for starters Opera 12, which includes support for getUserMedia() WebRTC extensions uses the first webcam it comes across, the rear. If I wanted to even make a mock up of a video call I would need the front camera (granted this is only good for the lab, not production).

But really I was trying to understand how the underlying media device capability works. If you simply exchange using mv /dev/mi1040 (the front camera device) and /dev/ov5640 (back camera) then it goofs the images to any app that uses cameras.

There must therefore be other layer(s) determining device capabilities, codecs, etc.

There's a file /etc/nvcamera.conf but that only seems to affect the main camera app. I swapped 1 and 0 and front and back tags, although admittedly haven't yet swapped the device ID whilst leaving the front/back tags the same.

And there's a whopping /etc/media_profiles.xml defining all the camera capabilities.

Do I need a reason? Isn't anyone even just curious doing something to push the device and learn more about the platform???
8th June 2012, 08:52 PM |#5  
baseballfanz's Avatar
Senior Member
Flag Sugar Land TX
Thanks Meter: 1,725
 
More
There was a point where Yahoo IM would use the back camera (when it was avaiable native to the TF). There was a member "droidx" he modified some files and got the front camera working with it. You're better off looking at modifying files as oppose to rewiring cameras.

More info here
http://forum.xda-developers.com/show....php?t=1087769
The Following User Says Thank You to baseballfanz For This Useful Post: [ View ] Gift baseballfanz Ad-Free
8th June 2012, 09:02 PM |#6  
OP Junior Member
Thanks Meter: 1
 
More
How to swap the cameras so Opera 12 uses front camera for getUserMedia()
Ok, here's how I did it.

Essentially you only need to swap the tags 'front' and 'back' in the file /etc/nvcamera.conf

The change is permanent across reboots, but messes the orientation/mirror image of the cameras, so the rear camera becomes a mirror image, not the front. This messes all portrait shots as the camera pic becomes upside down.

Device needs to be rooted.

Need to make /system directory read/write:

# mount -o rw,remount /system

# vi /etc/nvcamera.conf# format, cameraName=device,direction,orientation,type

This is the file before mods
# type can be 'stereo' for stereo capable, 'mono' for not stereo capable,
# 'usb' to enable searching for a usb device and where to put it in the list
# if found. Lines must be shorter then 256 characters
version=1
camera0=/dev/ov5640,back,0,mono
#camera1=/dev/ov5650,back,0,mono // 2nd camera for stereo once supported
camera1=/dev/mi1040,front,0,mono
#camera4=/dev/ov5650,back,0,stereo // virtual stereo device once supported


Change this line:
camera0=/dev/ov5640,back,0,mono

to:
camera0=/dev/ov5640,front,0,mono

And this line:
camera1=/dev/mi1040,front,0,mono

to:
camera1=/dev/mi1040,back,0,mono


Save and it works.
The Following User Says Thank You to Oblonsky For This Useful Post: [ View ] Gift Oblonsky Ad-Free
8th June 2012, 11:56 PM |#7  
Member
Thanks Meter: 0
 
More
Please remove :/
9th June 2012, 07:38 AM |#8  
Thing O Doom's Avatar
Senior Member
Flag Phoenix
Thanks Meter: 747
 
Donate to Me
More
No keep it, that's a good thing to have available to see or as a project. I love to learn things like this.
The Following User Says Thank You to Thing O Doom For This Useful Post: [ View ] Gift Thing O Doom Ad-Free
10th June 2012, 03:23 AM |#9  
TomTcom's Avatar
Senior Member
Thanks Meter: 536
 
More
Quote:
Originally Posted by Thing O Doom

No keep it, that's a good thing to have available to see or as a project. I love to learn things like this.

I second doom. It's about pushing the limits of the device.

Good on ya for doing this.

Sent from my SCH-I500 using Tapatalk 2
The Following User Says Thank You to TomTcom For This Useful Post: [ View ] Gift TomTcom Ad-Free
11th June 2012, 03:22 AM |#10  
Senior Member
scranton
Thanks Meter: 76
 
More
I also agree. as some may not understand the reasoning, obviously oblonsky has a reason for doing this, just because everyone doesnt understand or agree with him is no reason to cut him off and remove his post... anything anyone learns or attempts to learn about android or the transformers code will progress understanding of the platform and the device. I vote let it stay and continue your endeavor fellow androidian.....
The Following User Says Thank You to neofreek01 For This Useful Post: [ View ] Gift neofreek01 Ad-Free
11th June 2012, 09:28 AM |#11  
OP Junior Member
Thanks Meter: 1
 
More
Yes, thanks guys. I'm already wondering now whether it may be possible to add new cameras, or disable cameras - do more useful stuff than swap cameras. Also I took the time to post the answer to my own question just in case it was useful to anyone else - so it would seem odd to want to remove the information that just *might* be useful to others at some point.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes