Camera Swap (Best Buy S7-104)

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
 
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.
 
No, it doesn't change anything about the behavior. It just changes the symbolic names of the devices.
 
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
 
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
 
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.
 
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.
 
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.
 
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:
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!
 
...
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 *....

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. :)
 
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:
Back
Top