[Sony Cross-Device General] lagalaga:
My preliminary results and idea

Hey guys, let's do this!

I'm reposting my previous meagre results from the other thread.

Start with fresh KK 757 ROM

Deodex ROM, install Sejrar Xposed mod for SuperUser

Install [MENTION=5491189]xperiaz2[/MENTION]'s newSuperVideoCamera.apk

Push the Z2 media_profiles.xml

At this point, timeshift recording _stops_ working with a new error message:

E/CameraSource( 318): Requested frame rate (120) is not supported: 15,30,45,60

This means, to me, that the FPS setting is rejected further down in the validation chain. Some kind of success.

Things I have tried as well:

Push Z2 camera.msm8974.so, camera.qcom.so - does not really change anything

Push the Z2 libstagefright.so - this results in a boot loop. (Perhaps because the other libs did not match)

Decompile newSuperVideoCamera.apk - there is some validation code in there which reads an XML ressource that comes with the APK. But I don't think the limit is in there. After all, that APK works on the Z2.

My ideas at this point:

libcamera_clientsemc.so

libcamera_client.so

Push the z2 camera firmware? (/system/vendor/camera/)

Deodex ALL the APKs, disassemble ALL the .so files and grep ;)

I'm super short on time. My next step would be looking at where

E/CameraSource( 318): Requested frame rate (120) is not supported: 15,30,45,60

is coming from. I did find that string in some .so files. I basically wonder if the limitation is somewhere in the main framework or in a supporting camera file, like the EEPROM firmware.

laga@moar:/mnt/lib$ grep -E -ri "Requested frame rate .* is not supported" *
Binary file libstagefright.so matches
laga@moar:/mnt/lib$ cd ..
laga@moar:/mnt$ grep -E -ri "Requested frame rate .* is not supported" *

Hm, I just looked at the libstagefright source:

if (frameRate != -1) {
CHECK(frameRate > 0 && frameRate <= 120);
const char* supportedFrameRates =
params->get(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES);
CHECK(supportedFrameRates != NULL);
LOGV("Supported frame rates: %s", supportedFrameRates);
char buf[4];
snprintf(buf, 4, "%d", frameRate);
if (strstr(supportedFrameRates, buf) == NULL) {
LOGE("Requested frame rate (%d) is not supported: %s",
frameRate, supportedFrameRates);
return BAD_VALUE;
}

Where is CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES coming from? Is that even related to the problem at hand? It says _PREVIEW_.

Edit: I'll just leave this here: http://source.android.com/devices/camera/camera.html

---------- Post added at 09:58 AM ---------- Previous post was at 09:08 AM ----------

I took a very quick look at the libs in lib/*cam*.so. I disassembled them using an objdump build for ARM binaries. It seems like all parameter-related calls go elsewhere. I think lib/libcal* might contain the HAL. Or lib/camera/libexcal_halctrl_plugin.so.

---------- Post added at 10:25 AM ---------- Previous post was at 09:58 AM ----------

Instead of blindly disassembling files, I've made a list of cam-related which differ from the Z2 dump.

Differing files are prefixed with +/-.

laga@moar:~/download/sirius/vendor/lib$ diff -u /tmp/sirius_cam_libs.txt /tmp/z1_cam_libs.txt
--- /tmp/sirius_cam_libs.txt 2014-05-30 10:22:51.376765058 +0200
+++ /tmp/z1_cam_libs.txt 2014-05-30 10:20:54.143544043 +0200
@@ -1,71 +1,73 @@
93a1f926d3a12e9ca4824c956d508a66 libcamera_client.so
b3d3ef1d566b3707f5775e02d4692d52 libcamera_clientsemc.so
-a3edba0d2feef9e2ab9c3f4b91a3dc37 libcamera_metadata.so
+f4e5f060ae74c371e531202ef54100c6 libcamera_metadata.so
72c9d7ba9dbe6b73018545cde8ab372a libcameraextensionclient.so
d586a965ccd6f650cc77780a32dadc8c libcameraextensionjni.so
7a5579b182d8d2e1cd15ac94a30f81bd libcameraextensionservice.so
-494537a6cb1e5fb0035907d5cfcb5c8e libcameralight.so
+9d93128f6bed366f5ac2202862832236 libcameralight.so
27a1b4f36a139a4f83e5d009f4e2e850 libcameraservice.so
-0b75f5df9b40958b0b4974056ac5eee7 libcammw.so
-e4eef4a200f8a9ff29bcd839a878ca3f libgcam.so
-4b7b821ca095e3d8adcab5c75752812f libgcam_swig_jni.so
+0f359b812950510539bf51d59b57ccb8 libcammw.so
+bc03ce47cc6436beaea03e0b32d887a6 libgcam.so
+34e22f61aec410da9fe12ad122497bbf libgcam_swig_jni.so
e93d12f69d96d7d7ad7014ef5fc992e3 libimscamera_jni.so
-63be241b1f1789a4834329b54231312b libmm-qcamera.so
-f13787f130fcb2b9deeaa9c32df18016 libmmcamera_interface.so
-82cdf1807bbc6a598f610c932e0b6c1d libexcal_halctrl_plugin.so
-2a94119126f0b4740f1987a819d06a22 libexcal_idtctrl_plugin.so
-4a8a1430c8eab53f3ef738ca0241fcd3 LGI02BN1.dat
-bd0ef41189e3a35a39ba583a573bd074 LGI02BN1_CACAO.dat
-d871adc83bde1828d0b02f55f991be15 LGI02BN1_IMX132.dat
-3e49122f24e2b7a6e3d613959e288823 SEM02BN1.dat
-bd0ef41189e3a35a39ba583a573bd074 SEM02BN1_CACAO.dat
-d871adc83bde1828d0b02f55f991be15 SEM02BN1_IMX132.dat
-decd21e51fda98dd083a8928dbd47813 SOI20BS0.dat
+3775b2b51b778f99e42dc34784cf4a72 libmm-qcamera.so
+d5b1cba2549b64054de57b3a17c15196 libmmcamera_interface.so
+b6237e563273dc166c5024b74de281ac libexcal_halctrl_plugin.so
+841c2be632d27950545e5c0945cb15f8 libexcal_idtctrl_plugin.so
+db5dd107ac9d44984d10f03a33711f8b LGI02BN1.dat
+05a9e3971bc288c831644f69356493c4 LGI02BN1_CACAO.dat
+9dbee89f32e5d34e6660208d9fc4680c LGI02BN1_IMX132.dat
+d87835b026f535098358fa0a3699eaff SEM02BN1.dat
+05a9e3971bc288c831644f69356493c4 SEM02BN1_CACAO.dat
+9dbee89f32e5d34e6660208d9fc4680c SEM02BN1_IMX132.dat
+a8d0735567ba3b04175b0ecd864c85c1 SOI13BS9.dat
+0adf6448947587eda7b92649ebbbac61 SOI13BS9_CACAO.dat
+efbb4d4ce6312999362f78b5d1ab282c SOI20BS0.dat
ec390331a2fefa7db5930358da5b96e9 SOI20BS0_BU64296GWX.dat
-1421ff0f451398c3e585405a9ea1a10b SOI20BS0_CACAO.dat
-4e61468ac674fcb1020e2715dc8dec6b SOI20BS0_IMX200.dat
+519c86ac9bbbf99d7ad418bf82d82af3 SOI20BS0_CACAO.dat
+e4d94011669e4c47bb88f65e4dcea02c SOI20BS0_IMX200.dat
929c9f0b96f577e51edbcab9f1922e3e flash.dat
-13a874cc2898fb3fd9b254834a0f0433 product.dat
+ee8a3c0ef00c8f6c8a9458a5d4fc06c6 product.dat
e9bd05f4403d30c2512abb517168ee63 product_CACAO.dat
-ef22da65ed1cd0e6fa89ec2c89ae6fc8 lib-imscamera.so
-39137471837272672a0ff48ffee5b4be libmmcamera2_c2d_module.so
-3c37dc9eec1790c03605abf6ac3983ee libmmcamera2_cpp_module.so
-1196676d59f606e1c458864808d8d1c3 libmmcamera2_iface_modules.so
-eef8fbe9f58afed5add9500ab533485c libmmcamera2_imglib_modules.so
-63c3981f5217c6e119e7574af08acbf2 libmmcamera2_isp_modules.so
-bbdf76cb4c21655060013c67569b8151 libmmcamera2_pproc_modules.so
-2570d502c5e6bf29125853f704bb8ad5 libmmcamera2_sensor_modules.so
-43d17188bad9a05b60adf30e4c193719 libmmcamera2_stats_algorithm.so
-f78b5538003b3bd79705ca8a935d1112 libmmcamera2_stats_modules.so
-fef566ec52a6308f170db11f23dd188e libmmcamera2_vpe_module.so
+9f29f495df282a671b6c163be6cdb30d lib-imscamera.so
+a1a4cb8ce8577d2b6333894e081d8c65 libmmcamera2_c2d_module.so
+75c8ffb6fd8bad34adf5f5eb40f1e02a libmmcamera2_cpp_module.so
+363f6d193977c4d10d4c7cfc401d7108 libmmcamera2_iface_modules.so
+d4fe52fce08bfea259f47677fd909681 libmmcamera2_imglib_modules.so
+8be561df7588929d21eb10fd6391dcd8 libmmcamera2_isp_modules.so
+23857108a8de8cc45c6b7c029f7336a4 libmmcamera2_pproc_modules.so
+3f0f59d3ab545bd64b273fa30cc6bd1d libmmcamera2_sensor_modules.so
+e026ad2af46ef786e431fae5852dbf4d libmmcamera2_stats_algorithm.so
+a7aba420d1e21208c90feff869811caa libmmcamera2_stats_modules.so
+c059bd13cb4692d24efa60286b52a29f libmmcamera2_vpe_module.so
f7767985d442ba1dc3da4c9172f44b6f libmmcamera2_wnr_module.so
98a7907d524c953f3b666feb3407083c libmmcamera_faceproc.so
-fc8d85b36cbd033956681bff04a06aab libmmcamera_hdr_gb_lib.so
-85354bcc6210e2d9b4fb17631a995a95 libmmcamera_hdr_lib.so
-5823693674a58cc40eb561bc4e437086 libmmcamera_imglib.so
-3bdb7b22a3a4171d4fac9a74afb512af libmmcamera_ofilm_oty5f03_eeprom.so
-0e8922a3d08b237860ac02457f6f0bbd libmmcamera_sunny_p12v01m_eeprom.so
-1a3e919c181d002588be5a4f6a31bdf6 libmmcamera_sunny_p5v23c_eeprom.so
-db462f6d784d37f37aa15331059081af libmmcamera_sunny_q8v18a_eeprom.so
-868fb153dac744402900638af861429b libmmcamera_tintless_algo.so
-f4faadbd97ecb6117a5e84113ad6b05c libmmcamera_tintless_bg_pca_algo.so
-12a182ff996d13144a24fcd7f30dbdea libmmcamera_truly_cm7700_eeprom.so
-b6f78a47d7c5725b8386ed3b034b7a40 libmmcamera_tuning.so
-ec2d3de7882441c12a740053a0bb4a0f libmmcamera_wavelet_lib.so
-939f75ffb07bc2b04baa067ffd4aca7c liboemcamera.so
+8b91580908c8bbba9ca7a32ac0f64b6d libmmcamera_hdr_gb_lib.so
+8a4b3584449021844c734dbdd4ffbcce libmmcamera_hdr_lib.so
+41ecfa8bd5f328f9bd37b77fb6c61966 libmmcamera_imglib.so
+2d1061d71161491820ee66dd66b3288b libmmcamera_ofilm_oty5f03_eeprom.so
+c6d923dcfb40e5dbf93122111754b96b libmmcamera_sunny_p12v01m_eeprom.so
+dedd91532de2977c00491acc984f1df4 libmmcamera_sunny_p5v23c_eeprom.so
+53f614eb8ad32fa4d92c18e0fd98c19e libmmcamera_sunny_q8v18a_eeprom.so
+a879624ba28c110018e2ae8205f0497f libmmcamera_tintless_algo.so
+d483a68b03749eb13132aab0154e8690 libmmcamera_tintless_bg_pca_algo.so
+0a178ce9b50ab4e6c053a8e5cdc97f7e libmmcamera_truly_cm7700_eeprom.so
+f8cbd2dd4f0e077e6e89e01a1a5cd3d0 libmmcamera_tuning.so
+3e982409dc91f11bb5b4b114bb582e6c libmmcamera_wavelet_lib.so
+27867ab76d31a46729646e31344777e0 liboemcamera.so
53bd825ac673f39f5cfbac5a82694104 libchromatix_SKUAA_ST_gc0339_common.so
91fe5ec1d3f13b7578aebaeb87afa401 libchromatix_SKUAA_ST_gc0339_default_video.so
b24bf7fa8d3a7e8e65c4edea6a355845 libchromatix_SKUAA_ST_gc0339_preview.so
ec30ed4fc7279b148a910e29b453794b libchromatix_SKUAB_ST_s5k4e1_common.so
-f8e399fa4afc64eb884e3fdb4ab7813c libchromatix_SKUAB_ST_s5k4e1_default_video.so
-7a6d551c28832a0a457e0514e199bcfd libchromatix_SKUAB_ST_s5k4e1_hfr_120fps.so
-706ac5e46c06e0d523d1febfbd10cb22 libchromatix_SKUAB_ST_s5k4e1_hfr_60fps.so
-2b51ad44d62c26b8ff095f303af7dd71 libchromatix_SKUAB_ST_s5k4e1_hfr_90fps.so
-ff7d89fc55788a71ce43077e8a9ff647 libchromatix_SKUAB_ST_s5k4e1_liveshot.so
-980ce2a3181e5b502aaa339504148ad8 libchromatix_SKUAB_ST_s5k4e1_preview.so
-86c6ddcc6b8342001d2cfd8c2ec36b9b libchromatix_SKUAB_ST_s5k4e1_snapshot.so
-b7304ae1e3719dde6f4268b44d55c8cc libchromatix_SKUAB_ST_s5k4e1_video_hd.so
-09d5bbc80c14aa638007a174debdf60e libchromatix_SKUAB_ST_s5k4e1_zsl.so
+ab5c972a78c23ae116e9e779b87cbfd4 libchromatix_SKUAB_ST_s5k4e1_default_video.so
+b50b1bb5dc89682197271b4b2a38789f libchromatix_SKUAB_ST_s5k4e1_hfr_120fps.so
+59e4adc79ce7256b2209338230adf674 libchromatix_SKUAB_ST_s5k4e1_hfr_60fps.so
+436a828d36be2b06802110f73ad11eb4 libchromatix_SKUAB_ST_s5k4e1_hfr_90fps.so
+eb4a412e1e082242fa58e3e081b4c2fa libchromatix_SKUAB_ST_s5k4e1_liveshot.so
+500e12147dbab0efee22b437d3c814d1 libchromatix_SKUAB_ST_s5k4e1_preview.so
+523e4950ac1001d24a3367019a5b7fbf libchromatix_SKUAB_ST_s5k4e1_snapshot.so
+1ded59af8a39029052cd43240a831bb6 libchromatix_SKUAB_ST_s5k4e1_video_hd.so
+86d5a8c26730acb26ce157c351164848 libchromatix_SKUAB_ST_s5k4e1_zsl.so
30e4c8c92ca754fe9b3319fe3bf45cbc libchromatix_imx134_common.so
f4199401d6aa464df711f34d244dac2d libchromatix_imx134_default_video.so
2217b32c548fa7fe8c260e4455c4eaca libchromatix_imx134_hfr_120.so
@@ -73,24 +75,24 @@
06c848b52fcf7ab79dee52d62f6b9902 libchromatix_imx134_preview.so
2dd3f4ef1cbd4bde61690c62b7d551d4 libchromatix_imx134_snapshot.so
e340858bd283c2e5ebe753b20af4e135 libchromatix_imx135_common.so
-78baf0e548af301dab5ddfb62b0a5d87 libchromatix_imx135_default_video.so
+557c15cf742559c36d9adfa7d81c866d libchromatix_imx135_default_video.so
37e794554421d3ec27937df96cbd0a7c libchromatix_imx135_hfr_120.so
7202126d9c6ecae036ece26bfdb3dd55 libchromatix_imx135_hfr_60.so
aadad7e9723cf58cebc766fc9a989238 libchromatix_imx135_hfr_90.so
-485983c388f87bf55e1e81e82862b9bc libchromatix_imx135_preview.so
-298fdecf75d9d893cea8639fe1657055 libchromatix_imx135_snapshot.so
-a43d4e752ffbb02a2404099f1f29d7b8 libchromatix_imx135_video_hd.so
+8e261788956847653294aaaffd3e33de libchromatix_imx135_preview.so
+e6a45db75fd4b82ebdb3bb79ec3f19f6 libchromatix_imx135_snapshot.so
+73e9af28f258c93e9dbafa8f7a8af90a libchromatix_imx135_video_hd.so
eb15537549887f222df684c4cc9546e6 libchromatix_ov2720_common.so
e109a1a032788624205442b51a40ccf6 libchromatix_ov2720_default_video.so
79ae6e084a11ef919147c7803c716451 libchromatix_ov2720_hfr.so
154ae2090b2251393843aeb0895f1151 libchromatix_ov2720_liveshot.so
88676a68918ccf651a49c3144c73fdd7 libchromatix_ov2720_preview.so
3a3488e0beb32c6cf3966ba52aece6d3 libchromatix_ov2720_zsl.so
-bfa6d04363964b68da5d88ed962bc56f libchromatix_ov5648_oty5f03_common.so
-9e7aec4feee9c249588ba229f2264f3e libchromatix_ov5648_oty5f03_default_video.so
-b65a1e3f9be559c1971fd57610dfffd1 libchromatix_ov5648_oty5f03_preview.so
-3562ce083f12b84a17e737991d15b09a libchromatix_ov5648_oty5f03_snapshot.so
-fbead760a33e399d7f6344b477b3e2cc libchromatix_ov5648_oty5f03_zsl.so
+4cd474f4272dde42c312e20e543ba57e libchromatix_ov5648_oty5f03_common.so
+a3b1785b37a3c73bb9e8aafe82eb1b55 libchromatix_ov5648_oty5f03_default_video.so
+e4bff3685e2d3baa589bfb3c2e04ccf8 libchromatix_ov5648_oty5f03_preview.so
+fcbe6ae1c33590d34f975b7be6af0f4c libchromatix_ov5648_oty5f03_snapshot.so
+ccde332fe3e14d1c1d180c8c98fbf9c7 libchromatix_ov5648_oty5f03_zsl.so
0a5edc031cfbb47bb6b1125545bb5617 libchromatix_ov8825_common.so
f6439e6909141a189ad34d38294420fd libchromatix_ov8825_default_video.so
53d7376f9f1b5c774de57991c8832942 libchromatix_ov8825_hfr_120fps.so
@@ -107,8 +109,8 @@
b513f118deb40d2d2dcc72ca304fa3e7 libchromatix_ov8865_q8v18a_common.so
498ee582bbca041ca6f1d1e0d12b024e libchromatix_ov8865_q8v18a_default_video.so
dd75ef2335ae5a7cfb933d3e4ca7972b libchromatix_ov8865_q8v18a_hfr_120fps.so
-fbe827e6411845a40b1103cf9beba4aa libchromatix_ov8865_q8v18a_hfr_60fps.so
-a74ebec872caaf1ea9e1dd5f5157a442 libchromatix_ov8865_q8v18a_hfr_90fps.so
+905d11aa09200de08da7e4bd8a72f097 libchromatix_ov8865_q8v18a_hfr_60fps.so
+16c2afb0ba3a14389454eab3e23090fd libchromatix_ov8865_q8v18a_hfr_90fps.so
eab4ee1f0fa18b292c15ccee1ea91a10 libchromatix_ov8865_q8v18a_liveshot.so
c37ba33169dc6519f10aff55be157721 libchromatix_ov8865_q8v18a_preview.so
17df16cea2081afa29dddb2efa657bb2 libchromatix_ov8865_q8v18a_snapshot.so

---------- Post added at 11:00 AM ---------- Previous post was at 10:25 AM ----------

I decided lib-imscamera.so looked promising. I dumped the assembly with

arm-none-eabi-objdump -g -t -T -x -D -S -s lib-imscamera.so

and diff'ed the files. Nothing spectacular. I guess I should try to diff the assembly for all relevant files.