Camera Swap (Best Buy S7-104)

Celtus

Member
Jan 14, 2011
14
9
If anyone else wants to try, this worked for me. The change is not persistent (until we can make a boot image). I'm running the Singapore ROM, btw.

You will need root privs, and a busybox that has mknod built into it. Mine came from z4root, so I now that one works.

Here are the steps. Proceed at your own risk. I can't be responsible if things go wrong (sorry).

1. Get a shell as root (I used adb).
2. cd /dev/msm_camera
3. ls -l

The directory should look like this. DO NOT PROCEED IF YOURS IS DIFFERENT!!!

crw-rw---- system system 245, 5 2011-01-30 08:45 frame1
crw-rw---- system system 245, 4 2011-01-30 08:45 config1
crw-rw---- system system 245, 3 2011-01-30 08:45 control1
crw-rw---- system system 245, 2 2011-01-30 08:45 frame0
crw-rw---- system system 245, 1 2011-01-30 08:45 config0
crw-rw---- system system 245, 0 2011-01-30 08:45 control0

We're going to change the node IDs for devices 0 and 1.

4. rm * (Yes, we're removing the old ones - stop now if you are afraid).
5. busybox mknod frame0 c 245 5
6. busybox mknod frame1 c 245 2
7. busybox mknod config0 c 245 4
8. busybox mknod config1 c 245 1
9. busybox mknod control0 c 245 3
10. busybox mknod control1 c 245 0
11. chown system.system *
12. chmod 660 *

Load up the camera app. If you had no typos, you will see your front cam as primary and back cam as secondary.

The new directory looks like this (your order may be different):

crw-rw---- system system 245, 3 2011-01-30 16:03 control0
crw-rw---- system system 245, 0 2011-01-30 16:03 control1
crw-rw---- system system 245, 4 2011-01-30 16:03 config0
crw-rw---- system system 245, 1 2011-01-30 16:03 config1
crw-rw---- system system 245, 5 2011-01-30 16:03 frame0
crw-rw---- system system 245, 2 2011-01-30 16:03 frame1

GOOD LUCK!! Don't blame me if it doesn't work for you, please.

Enjoy,
-Celtus

PS: I see no reason why this couldn't run from GScript, but I haven't tried it, yet.

Update: GScript confirmed. Runs fine with SU privs.
 
Last edited:
nice, can you please install fring and make the test call see if it defaults to your front cam.
 
woot nice wtg, thats great news.............FRING FRONT CAM WORKING !!!!

now if i only knew how and where to do this mod. is there a terminal i can bring up to do these commands on the S7? I'm rooted and have busybox (universalroot).
 
You can use the android terminal emulator (although I suggest the jackpal term - it seems better somehow). Once you have a terminal, and you've su'd to root, just type the commands (slowly and carefully, it's a really small keyboard - lol). Just don't type my line numbers. Remember that you must make sure that your directory (msm_camera) has the same entries as mine. The order doesn't matter, but the info on each line matters very much. The idea is to replace the device nodes with new nodes that swap the dev 0 lines with the dev 1 lines.

For those who might be unfamilar, here is a breakdown of what we see from a long listing (ls -l) of a device:

crw-rw---- system system 245, 0 2011-01-30 08:45 control0

crw-rw---- <<< This is the device type and permissions - c means it's a character device. rw-rw---- means the owner and group have read/write permission.
system system <<< This is the owner (system) and group (also system).
245 <<< This is the Major device number.
0 <<< This is the Minor device number (these are the ones we swap).
2011-01-30 08:45 <<< Date/Time.
control0 <<< Device name.

The syntax for mknod is:
mknod NAME TYPE MAJOR MINOR

So if I want to turn control0 into control1, I just need to get rid of the old control1 and type:
mknod control1 c 245 0

I don't have symlinks built for busybox, so I have to prefix the command with the busybox call.

Did that help?
 
Knew someone was going to get to this.

Nice job :D

Upload that Gscript?
 
Thanks Celtus for this one! I am using it with fring and test call video works correctly using 45 degree tablet mode (kickstand) but, when I use it in 90 degree my video flips upside down so, I rotate and still my video upside down. I may just not know how to use this since is the first for me lol...
This is awesome! Thanks, We owe you on this fix
 
I use droid explorer and notebook++ and just use copy and past commands since I have issues with droid explorer and windows 7 (64bit)
 
Here are the commands in gscript-friendly format. Just remember to use something that can do a unix line ending (I use Linux and OSX, so I'm not sure what that would be for Windows people).

# SwapCam script
cd /dev/msm_camera
rm *
busybox mknod frame1 c 245 2
busybox mknod frame0 c 245 5
busybox mknod config1 c 245 1
busybox mknod config0 c 245 4
busybox mknod control1 c 245 0
busybox mknod control0 c 245 3
chown system.system *
chmod 660 *
# EOF
 
How hard would it be to make a widget to flip the camera device? I am looking into it now.
 
How hard would it be to make a widget to flip the camera device? I am looking into it now.

Sure seems like something that Huawei should have provided, all this time switching the cameras was possible and even easy once the secret is known, but they didn't care that no video calling apps would work on the 2 camera versions.
 
Great work on this. So is everyone who has this working on the Singapore ROM or is anyone using the base Bestbuy ROM that this came loaded on. Not a big deal to switch but I wanted to check before I did this. Thanks
 
Back
Top