Camera Swap (Best Buy S7-104)

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

  1. 50cals

    50cals Member

    Joined:
    Jan 5, 2011
    Messages:
    250
    Likes Received:
    18
    Trophy Points:
    87
    Location:
    Las Vegas
    Tablet / Device:
    Ideos s7
    woot , k got it all working and works great. Great job Celtus ! wtg !!

    Im still on original BB rom , i havnt done any changes to that. Opened my camera program default is front cam. Opened up fring and did test video call and default is front now ! sweet
     
  2. 50cals

    50cals Member

    Joined:
    Jan 5, 2011
    Messages:
    250
    Likes Received:
    18
    Trophy Points:
    87
    Location:
    Las Vegas
    Tablet / Device:
    Ideos s7
    does the mknod command also control camera rotation? noticed in main camera app default now front cam, when you switch to secondary(rear cam) it is a mirror image of what your looking at.
     
  3. Celtus

    Celtus Member

    Joined:
    Jan 14, 2011
    Messages:
    14
    Likes Received:
    9
    Trophy Points:
    62
    Location:
    Midwest, US
    Tablet / Device:
    Cruz Reader R103
    No, it doesn't change anything about the behavior. It just changes the symbolic names of the devices.
     
  4. ivyvisors

    ivyvisors Senior Member

    Joined:
    Dec 29, 2010
    Messages:
    233
    Likes Received:
    52
    Trophy Points:
    102
    Location:
    melbourne
    Tablet / Device:
    huawai s7
    Neat idea =)
    One could also script this to run on boot via the "install-recovery.sh" hack, that wouldn't be too hard to do.

    something like this:

    #!/system/bin/sh
    # celtus camera mod
    rm /dev/msm_camera/*
    busybox mknod /dev/msn_camera/frame0 c 245 5
    busybox mknod /dev/msn_camera/frame1 c 245 2
    busybox mknod /dev/msn_camera/config0 c 245 4
    busybox mknod /dev/msn_camera/config1 c 245 1
    busybox mknod /dev/msn_camera/control0 c 245 3
    busybox mknod /dev/msn_camera/control1 c 245 0
    chown system.system /dev/msn_camera/*
    chmod 660 /dev/msn_camera/*

    What you'd need to do is save that as say init-camera.sh in /system/etc/ (you'd need to set system read write first)

    chmod 755 the file, and then create a file in /system/etc/ called install-recovery.sh (if you've been playing with apps to sd you'd already have it.)

    the install-recovery.sh script would need the following:

    #!/system/bin/sh
    /system/etc/init-camera.sh &

    or if you're doing apps to sd, just add the line

    /system/etc/init-camera.sh& to it

    cmod 755 the file. And it should work.

    NOTE: I'm at work and I've not tested this at all.

    ~Ivy
     
    • Like Like x 6
  5. pvella

    pvella Senior Member

    Joined:
    Dec 20, 2010
    Messages:
    392
    Likes Received:
    38
    Trophy Points:
    102
    Location:
    Melbourne
    Tablet / Device:
    Huawei S7
    Doing it now. :)
     
  6. ivyvisors

    ivyvisors Senior Member

    Joined:
    Dec 29, 2010
    Messages:
    233
    Likes Received:
    52
    Trophy Points:
    102
    Location:
    melbourne
    Tablet / Device:
    huawai s7
    Tell me how it goes, or if it works or not.

    The one good thing about, the install-recovery.sh script is that we could get it to do anything that could be scriptable.

    ~Ivy
     
  7. kevmueller

    kevmueller Member

    Joined:
    Dec 7, 2010
    Messages:
    146
    Likes Received:
    20
    Trophy Points:
    87
    Location:
    Kansas City MO
    Tablet / Device:
    Huawei S7 & Droid X
    Alright so I have this working. I had done this to both my wifes and my tablet and we did a video call to each other. This is a great find.
     
  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
    Took ivy's idea created init-camera.sh that looks like

    #!/system/bin/sh
    # celtus camera mod
    rm /dev/msm_camera/*
    cd /dev/msm_camera
    busybox mknod frame0 c 245 5
    busybox mknod frame1 c 245 2
    busybox mknod config0 c 245 4
    busybox mknod config1 c 245 1
    busybox mknod control0 c 245 3
    busybox mknod control1 c 245 0
    chown system.system *
    chmod 660 *

    modified the install-recovery.sh and I have my front camera as the primary even after a reboot. For whatever reason fully qualifying it like /dev/msn_camera/frame0.... did not work, so just decided to do a cd to the right folder.
     
  9. pvella

    pvella Senior Member

    Joined:
    Dec 20, 2010
    Messages:
    392
    Likes Received:
    38
    Trophy Points:
    102
    Location:
    Melbourne
    Tablet / Device:
    Huawei S7
    Confirmed that it works here. As a side effect the camera application is using the wrong camera, but it has the option to switch to the secondary camera, which is now the rear camera.

    I think Huawei should employ the team here to do all their development. We seem to be doing a better job of making this machine work better. Also this procedure should definitely be stickied.
     
  10. Markus31788

    Markus31788 Member

    Joined:
    Dec 13, 2010
    Messages:
    39
    Likes Received:
    7
    Trophy Points:
    72
    Location:
    Moultrie, Georgia
    Tablet / Device:
    Huawei Ideos S7
    No option to select which camera to use for barcode type scanning ....uses front now.
     
  11. Celtus

    Celtus Member

    Joined:
    Jan 14, 2011
    Messages:
    14
    Likes Received:
    9
    Trophy Points:
    62
    Location:
    Midwest, US
    Tablet / Device:
    Cruz Reader R103
    I would think a pair of Gscripts should get you past that. One to set them to the original defaults, and one to swap them. That's what I have on my tablet right now, and it switches them very quickly.

    Edit: I wouldn't switch them with a camera app open, btw. Could cause the app to crash.
     
    Last edited: Jan 31, 2011
    • Like Like x 2
  12. Markus31788

    Markus31788 Member

    Joined:
    Dec 13, 2010
    Messages:
    39
    Likes Received:
    7
    Trophy Points:
    72
    Location:
    Moultrie, Georgia
    Tablet / Device:
    Huawei Ideos S7
    I am now confused about these Gscripts. I am using droid explorer in windows 7 64bit and using notepad++ and manually cut and pasting the lines into the teminal on the console with the usb connection active to my S7. I wanted to make sure I was not going to have typo errors. I really do not know how to do this any otherway
    I managed to get the apps2sd and it is working fine right now. I can do the camera swap also but, when I reboot I lose the swap again. I guess I do not know how to do a a unix line ending? or what do I need to do after the chmod 660 *
    as #EOF does not work.

    Any help you can give this newbie would be very helpful and I want to thank you Celtus and everyone for any help for this!
     
  13. pvella

    pvella Senior Member

    Joined:
    Dec 20, 2010
    Messages:
    392
    Likes Received:
    38
    Trophy Points:
    102
    Location:
    Melbourne
    Tablet / Device:
    Huawei S7
    TRY THIS...

    Download and install Notepad++, then change the following settings....

    *View->Show Symbol
    make sure "Show End of Line Character" is enabled.

    Your file should only show "LF" and not "CR LF", at the end of each line.

    The best way to fix this is to create a new file and set the following option...

    *Settings->Preferences
    select "New Document / Default Directory" tab

    under "New Document Format", select "Unix"

    Now you should have no problems creating files for your S7. :)
     
    • Like Like x 2
  14. 50cals

    50cals Member

    Joined:
    Jan 5, 2011
    Messages:
    250
    Likes Received:
    18
    Trophy Points:
    87
    Location:
    Las Vegas
    Tablet / Device:
    Ideos s7
    sweet got an init-cam.sh file in /system/etc and added the line to install-recovery.sh used adb shell to chmod 755 both files then rebooted .....still back camera

    used root explorer to go to /system/etc/install-recovery.sh pressed and held......scroll down to open in editor.......and saw my paste from ivy heheh init-camera.sh

    so i just backspaced the error to make it init-cam.sh , menu save&exit

    reboot in adb shell and bingo app2sd and front cam on boot now ! sweeeeeeeeeet

    great job everyone getting these 2 work arounds working !

    i have noticed some very small lag in some app's when you first open them , other than that this friggin rocks :cool:
     
    Last edited: Feb 19, 2011
  15. 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
    View attachment $CameraSwap.zip Attached is a zip file with the 2 scripts
     
    • Like Like x 12

Share This Page

Search tags for this page

amera swal