Camera Swap (Best Buy S7-104)

Discussion in 'Huawei Ideos S7 Development' started by Celtus, Jan 30, 2011.

  1. Celtus

    Celtus Member

    Joined:
    Jan 14, 2011
    Messages:
    14
    Likes Received:
    9
    Trophy Points:
    62
    Location:
    Midwest, US
    Tablet / Device:
    Cruz Reader R103
    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: Jan 30, 2011
    • Like Like x 14
  2. 50cals

    50cals Member

    Joined:
    Jan 5, 2011
    Messages:
    250
    Likes Received:
    18
    Trophy Points:
    87
    Location:
    Las Vegas
    Tablet / Device:
    Ideos s7
    nice, can you please install fring and make the test call see if it defaults to your front cam.
     
  3. Celtus

    Celtus Member

    Joined:
    Jan 14, 2011
    Messages:
    14
    Likes Received:
    9
    Trophy Points:
    62
    Location:
    Midwest, US
    Tablet / Device:
    Cruz Reader R103
    Yes. It defaults to the front cam. =)
     
  4. 50cals

    50cals Member

    Joined:
    Jan 5, 2011
    Messages:
    250
    Likes Received:
    18
    Trophy Points:
    87
    Location:
    Las Vegas
    Tablet / Device:
    Ideos s7
    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).
     
  5. SikYou

    SikYou Member

    Joined:
    Dec 25, 2010
    Messages:
    180
    Likes Received:
    17
    Trophy Points:
    87
    Location:
    Detroit
    Tablet / Device:
    S7
    Nice work!

    Sent from my nonsensikal froyo
     
  6. Celtus

    Celtus Member

    Joined:
    Jan 14, 2011
    Messages:
    14
    Likes Received:
    9
    Trophy Points:
    62
    Location:
    Midwest, US
    Tablet / Device:
    Cruz Reader R103
    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?
     
    • Like Like x 2
  7. xaueious

    xaueious Administrator Staff Member

    Joined:
    Jul 9, 2010
    Messages:
    3,483
    Likes Received:
    435
    Trophy Points:
    222
    Location:
    Canada
    Tablet / Device:
    Asus Transformer TF300, Huwaei Ideos S7-104, HSG X5A, (Past APAD IMX515, APAD RK2808, RK2818 RT7)
    Knew someone was going to get to this.

    Nice job :D

    Upload that Gscript?
     
  8. shanksv

    shanksv Member

    Joined:
    Nov 13, 2010
    Messages:
    117
    Likes Received:
    23
    Trophy Points:
    87
    Location:
    Haslett, MI USA
    Tablet / Device:
    Huawei S7, Nook Color, Nook orig, ATT Tilit2
    Great job! Tried it and works as claimed by Celtus!
     
  9. Markus31788

    Markus31788 Member

    Joined:
    Dec 13, 2010
    Messages:
    39
    Likes Received:
    7
    Trophy Points:
    72
    Location:
    Moultrie, Georgia
    Tablet / Device:
    Huawei Ideos S7
    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
     
  10. pvella

    pvella Senior Member

    Joined:
    Dec 20, 2010
    Messages:
    392
    Likes Received:
    38
    Trophy Points:
    102
    Location:
    Melbourne
    Tablet / Device:
    Huawei S7
    OMG, that rocks. We should turn that into an app.
     
  11. Markus31788

    Markus31788 Member

    Joined:
    Dec 13, 2010
    Messages:
    39
    Likes Received:
    7
    Trophy Points:
    72
    Location:
    Moultrie, Georgia
    Tablet / Device:
    Huawei Ideos S7
    I use droid explorer and notebook++ and just use copy and past commands since I have issues with droid explorer and windows 7 (64bit)
     
  12. Celtus

    Celtus Member

    Joined:
    Jan 14, 2011
    Messages:
    14
    Likes Received:
    9
    Trophy Points:
    62
    Location:
    Midwest, US
    Tablet / Device:
    Cruz Reader R103
    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
     
  13. pvella

    pvella Senior Member

    Joined:
    Dec 20, 2010
    Messages:
    392
    Likes Received:
    38
    Trophy Points:
    102
    Location:
    Melbourne
    Tablet / Device:
    Huawei S7
    How hard would it be to make a widget to flip the camera device? I am looking into it now.
     
  14. brachiopod

    brachiopod Member

    Joined:
    Nov 22, 2010
    Messages:
    114
    Likes Received:
    6
    Trophy Points:
    87
    Location:
    Near Madison, Wisconsin
    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.
     
  15. kevmueller

    kevmueller Member

    Joined:
    Dec 7, 2010
    Messages:
    146
    Likes Received:
    20
    Trophy Points:
    87
    Location:
    Kansas City MO
    Tablet / Device:
    Huawei S7 &amp; Droid X
    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
     

Share This Page

Search tags for this page

amera swal