Monday, November 26, 2012

FXP14x: Unfortunately, Instagram has stopped [SOLVED]

Okay, I had to touch something somewhere and since a few days ago switching to the camera tab in Instagram crashes the whole thing.

I was quite confident it has something with the face-facing camera broken in FXP but as a fix was promised for FXP148 I stayed on the patient side.

I thundered 148 this morning and while the camera flash is fixed there, the rest keeps as broken as my English.

Here's the important part of logcat:

I/ActivityManager(  362): START {flg=0x10000 cmp=com.instagram.android/.activity.MediaCaptureActivity u=0} from pid 9175
I/CameraService( 4185): Opening camera 1
W/ServiceManager( 4185): Permission failure: com.sonyericsson.permission.CAMERA_EXTENDED from uid=10057 pid=9175
I/caladbolg( 4185):  380936309 cald_camctrl.c                    (6713)  9289 P [SVR]  380936248 + Cald_CamCtrl_PowerUp
I/caladbolg( 4185):  381160583 cald_camctrl.c                    (7484)  9289 P [SVR]  381160522 + Cald_CamCtrl_FSM_Func_PowerUp
I/caladbolg( 4185):  381203338 cald_hal_qct.c                    (2789)  9289 P [HAL]  381203247 + Cald_Hal_Qct_If_PowerUp
I/caladbolg( 4185):  381208679 cald_hal_qct.c                    (2847)  9289 P [HAL]  381208648 - Cald_Hal_Qct_If_PowerUp (0)
I/caladbolg( 4185):  381218536 cald_camctrl.c                    (7563)  9289 P [SVR]  381218475 - Cald_CamCtrl_FSM_Func_PowerUp (0)
I/caladbolg( 4185):  381218933 cald_camctrl.c                    (6720)  9289 P [SVR]  381218902 - Cald_CamCtrl_PowerUp (0)
I/AwesomePlayer( 4185): setDataSource_l('/system/media/audio/ui/camera_click.ogg')
W/WVMExtractor( 4185): Failed to open libwvm.so
I/AwesomePlayer( 4185): setDataSource_l('/system/media/audio/ui/VideoRecord.ogg')
W/WVMExtractor( 4185): Failed to open libwvm.so
D/Camera  ( 9175): app passed NULL surface
I/caladbolg( 4185):  381951782 cald_capctrl.c                    (6128)  9291 P [CAP]  381951751 + Cald_CapCtrl_FSM_Func_StartPreview
I/caladbolg( 4185):  381954376 cald_hal_qct.c                    (2983)  9291 P [HAL]  381954345 + Cald_Hal_Qct_If_StartPreview
I/caladbolg( 4185):  382005187 cald_hal_qct.c                    (3042)  9291 P [HAL]  382005157 - Cald_Hal_Qct_If_StartPreview (0)
I/caladbolg( 4185):  382005432 cald_capctrl.c                    (6358)  9291 P [CAP]  382005432 - Cald_CapCtrl_FSM_Func_StartPreview
F/libc    ( 4185): Fatal signal 11 (SIGSEGV) at 0x00008f28 (code=1), thread 9298 (cam_conf)
I/DEBUG   (  132): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  132): Build fingerprint: 'SEMC/MT11i_1254-2184/MT11i:4.0.4/4.1.B.0.431/UL5_3w:user/release-keys'
I/DEBUG   (  132): pid: 4185, tid: 9298, name: UNKNOWN  >>> /system/bin/mediaserver <<<
I/DEBUG   (  132): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00008f28
I/ActivityManager(  362): Process com.cyanogenmod.filemanager (pid 7528) has died.
I/DEBUG   (  132):     r0 2bb55c98  r1 00008e00  r2 2bb56800  r3 00000000
I/DEBUG   (  132):     r4 2bb608fc  r5 2bb1892c  r6 2bb54f50  r7 2d3469cc
I/DEBUG   (  132):     r8 2d346a58  r9 2d346a5c  sl ffffffff  fp 2d346c80
I/DEBUG   (  132):     ip 2bb1897c  sp 2d3469c8  lr 2bb0dc5b  pc 2bb08578  cpsr 00010030
I/DEBUG   (  132):     d0  0000000000000000  d1  0000000000000000
I/DEBUG   (  132):     d2  0000000000000000  d3  0000000000000000
I/DEBUG   (  132):     d4  0000000001e00000  d5  0000000000000000
I/DEBUG   (  132):     d6  0007080000000000  d7  3f8000003f800000
I/DEBUG   (  132):     d8  0000000000000000  d9  0000000000000000
I/DEBUG   (  132):     d10 0000000000000000  d11 0000000000000000
I/DEBUG   (  132):     d12 0000000000000000  d13 0000000000000000
I/DEBUG   (  132):     d14 0000000000000000  d15 0000000000000000
I/DEBUG   (  132):     d16 3a64696f72646e61  d17 7265676775626564
I/DEBUG   (  132):     d18 bfe0000000000000  d19 0000000000000000
I/DEBUG   (  132):     d20 0000000000000000  d21 0000000000000000
I/DEBUG   (  132):     d22 0000000000000000  d23 0000000000000000
I/DEBUG   (  132):     d24 3ff55d890c229271  d25 3fd8000000000000
I/DEBUG   (  132):     d26 400170a260000000  d27 40020307a0000000
I/DEBUG   (  132):     d28 4003ba2980000000  d29 400150da20000000
I/DEBUG   (  132):     d30 4003ba2980000000  d31 40055815a0000000
I/DEBUG   (  132):     scr 20000012
I/DEBUG   (  132): 
I/DEBUG   (  132): backtrace:
I/DEBUG   (  132):     #00  pc 00045578  /system/lib/liboemcamera.so (vfe_cmd_sharpnessscale+27)
I/DEBUG   (  132):     #01  pc 0004ac57  /system/lib/liboemcamera.so (vfe_util_update_asf_5x5+30)
I/DEBUG   (  132):     #02  pc 0004af9b  /system/lib/liboemcamera.so (vfe_util_sharpness_afilter+2)
I/DEBUG   (  132):     #03  pc 00040701  /system/lib/liboemcamera.so (vfe_process_VFE_ID_SOF_ACK+44)
I/DEBUG   (  132):     #04  pc 0003d06b  /system/lib/liboemcamera.so (vfe_proc_vfe_msg+74)
I/DEBUG   (  132):     #05  pc 0000c77d  /system/lib/liboemcamera.so (config_proc_vfe_event_message+12)
I/DEBUG   (  132):     #06  pc 0000c43b  /system/lib/liboemcamera.so (cam_conf+314)
I/DEBUG   (  132):     #07  pc 000130d4  /system/lib/libc.so (__thread_entry+48)
I/DEBUG   (  132):     #08  pc 0001283c  /system/lib/libc.so (pthread_create+180) 
 
Apparently the things crashes right after trying to open camera 1.
Unlike the rest of the civilized world, the computing area starts numbering with zero, so there's no doubt Instagram is trying to use the second (implying less important) camera - the face-facing one we already know is broken!

Cause found, how about the fix?

I suppose I could just clean the app's settings, but that's a too crude a measure for a 21st century gentleman.

A bit of searching reveals the file

/data/data/com.instagram.android/shared_prefs/com.instagram.android_preferences.xml 

sports a very interesting line:

<string name="pref_camera_id_key">1</string>

Flip the 1 to a zero:

<string name="pref_camera_id_key">0</string>

and viola!

 ... eh, voilà!
This fixed it.


Wednesday, November 21, 2012

And a baby





About 4-5 months after the first eggs were laid and two months after her mother died, baby Phyllium biocculatum was born today. We named her Járinka.





It's a boy!

I'm not sure I mentioned it but we happen to keep about thirty phasmids of the Extatosoma tiaratum species. All of them are the posthumous offspring of a single mother - she died a year and something ago and the first ones hatched a half year ago.
Since the eggs weren't fertilized, all of them were supposed to be females, but nature has its ways ... When a phasmid individual has two sexual (X) chromosomes, it becomes a female. If it has only one it becomes a male. In this rare case something went wrong during the mitosis, the X chromosome didn't duplicate and the boy was born.

We noticed his unusual look - very few thorns, longer antennae, slim, almost green in colour, but it was only in the penultimate instar I took a picture of him:


Since then it grew a pair of wings and the antennae are even longer. Also he's mating with his sisters (ugh!) every now and then.






Monday, November 5, 2012

Boost regression tests with stdcxx4

Boost documentation describes nicely how to run regression tests, but when I tried to follow it on Solaris I encountered some caveats.
First of all, the testsuite assumes that one would want to build the bootstrap toolset with gcc and fails miserably on a system without it. The solution is to use the '--pjl-toolset=sun' option to run.py.

Second, I wanted to use the stdcxx4 Apache library instead of stlport4. I tried to add stdcxx4 as a new platform to boost, but it turned out to be more and more complicated so in the end I followed an advice from the boost community and just created ~/user-config.jam with this contents, to force use of stdcxx4:
using sun : : : -library=stdcxx4 -library=stdcxx4 ;

But it was still not enough, the script trying to build process_jam_log mixes the user flags and the default ones so the build was failing. A workaround:
$ cd tools_bb
$ svn diff
Index: tools/sun.jam
===================================================================
--- tools/sun.jam       (revision 81173)
+++ tools/sun.jam       (working copy)
@@ -20,7 +20,7 @@

 feature.extend stdlib : sun-stlport ;
 feature.compose sun-stlport
-    : -library=stlport4 -library=stlport4
+    : -library=stdcxx4 -library=stdcxx4


Step by step instructions:
$ wget http://svn.boost.org/svn/boost/trunk/tools/regression/src/run.py
$ export PATH=/export/home/tester/SolarisStudio12.3-solaris-x86-bin/solarisstudio12.3/bin:$PATH
$ echo "using sun : : : -library=stdcxx4 -library=stdcxx4 ;" > ~/user-config.jam
$ python run.py --runner=Solaris 11.1-Studio-stdcxx4 --toolsets=sun --pjl-toolset=sun --local=/home/tester/Downloads/boost_1_51_0.tar.bz2
...
wait till tools_bb is checked out and hit Ctrl-C
...
$ vi tools_bb/tools/sun.jam
$ python run.py --runner=hajma --toolsets=sun --pjl-toolset=sun --local=/home/tester/Downloads/boost_1_51_0.tar.bz2

The results are upladed to http://www.boost.org/development/tests/trunk/developer/summary.html