Development Status / Support?

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
Hey guys I just picked up this device a few days ago, and I'm an experience kernel developer for anroid, although I haven't worked on a project in quite some time and I really didn't intend to pick up a project phone, but seeing where the development took off with heads high in the air, and kinda left everyone high and dry with all this DISCONTINUED status of dev work, it makes me just want to try something. I by no means have a PC right now that is anywhere near fast enough or has enough ram to do in depth android development, so I really don't 'want' to get into this. But looking at the issues with 7.x rom's and the R1 HD, it appears to me a simple problem that could be fixed once the original kernel sources were obtained.

I see a lot of fiasco about the 64bit / 32 bit support which isn't of importance to me since this device isn't trying to allocate more than 4GB of usable memory anyway. As far as performance with less than 2GB ram on this device the matter about the kernel / rom being 32/64 doesn't really mean much.

From what I do see it looks as though everything that is bootable using a non-stock rom still uses the stock kernel / boot.img right?

Does any developers here have any logcat output of a non-stock kernel they've tried to boot using a nougat 7.x rom?

Has anyone tried pulling the Kernel config for the device from /proc/config.gz? Or is the proc config not compiled in support for this kernel (OEM's for some reason don't like to include this option) which makes life on a dev that doesn't have original kernel sources available a little bit easier as we can look and see what we need =Y and =M to relatively quickly and then see what non-mainline kernel patches we need to include to get a non-stock working kernel built for 7.x

My thoughts of the matter are a cross-compiler toolchain incompatiblity in the userland of android 7.x vs the stock kernel, OR VERMAGIC of a proprietary kernel module not matching properly.

It seems the only things that appears to be a struggle with the development of this device have all been kernel related. I really wish a dev that had a proper arm toolchain could work with me a bit in some spare time to get things like the Camera working properly. Recompiling all of Android N isn't really necessary as this is most likely a kernel specific bug or ABI mismatch with the newer Nougat libs. Our 3.x kernel is quite obsolete when compared to the newer things implemented into Android 7, and most usually one would expect to have a lot more breakage than just the camera. So if we could get this camera working and any other hardware that might not be working, then it would be a big success. The kernel version has no meaning, and being 32bit/64bit has no meaning really either.

Some direct links to github sources or any other sources of what you guys have woking right now would be really helpful. Logcat output of whats working. Logcat output of custom kernels that fail to boot. Any direct links to a device tree overlay for our board would be real nice too. With all these pages of information on the device its hard for me to make heads or tails of where the actual development stands and what the major holdback is.

To be clear though the working Lineage rom that has everything working EXCEPT camera, is using the stock kernel boot.img but basically just a 32bit ported /system /lib /etc in a flashable .zip? I could decipher the .zip's update-script / binary to see what is really going on but I'd a lot rather speak to an experienced dev about all this, in hopes of a collaborative effort to patch the camera issue and any other issues that may not be so noticeable to the standard users. I seen some mention of the hotspot feature being broken in some of the threads I've looked through. Whats the status on the hotpsot? Thats one thing I do have to have working for it to be a daily driver and is of much more importance to me than the camera actually.

Sorry for a long post guys, I really hope to hear from someone who has done a bit more than pieced together some /system files from another device.

P.S. ignore my signature in this post pertaining to devices, I don't post on XDA very often unless I'm working on a project I've not updated my signature in a couple years ;)
 

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
Most of this is TLDR;

I don't like to reply to myself, but for reference this .config file on lines 186 and 187 contains:


CONFIG_CUSTOM_KERNEL_IMGSENSOR="ov13850_mipi_raw hi842_mipi_raw imx258_mipi_raw_liteon imx258_mipi_raw_sunny s5k4h8_mipi_raw ov5670_mipi_raw_sunwin ov5670_mipi_raw_cmk"
CONFIG_CUSTOM_KERNEL_CAM_CAL_DRV="hi842_otp imx258_eeprom"

I'd suspect the camera not to work since the original source code is specifying binary blobs for the camera or it appears that way, and if those drivers aren't included precompiled with the 7.x ROMS in a common location such as /lib/modules then the camera can't work, if the kernel modules with the right vermagick from our working kernel is used then it will work. If we have working 64bit ROM all except the camera then we need these .ko's:

hi842_otp imx258_eeprom ov13850_mipi_raw hi842_mipi_raw imx258_mipi_raw_liteon imx258_mipi_raw_sunny s5k4h8_mipi_raw ov5670_mipi_raw_sunwin ov5670_mipi_raw_cmk

I need a little clarification on all this 32bit vs 64bit stuff I've been seeing on here. Developing for this phone will really be hard on me as I DO use it for a hotspot, and I don't have it in my hands to perform basic grep/cat commands to pull up some simple things I could just easily get from another developer (if we have one available). My only internet at home is through this phone, and I can't easily test things without losing internet connection.

Anyways - I have dug up some info on my own and from the looks of it we need the same arch (32bit / 64bit arm) ROM from another device of MT6735 that has working 7.x (from what i read we have just that in the 'discontinued lineage rom' right?)

If so, Then we need to keep our original Stock working kernel for now and add the missing blobs of the precompiled kernel modules /proprietary drivers, stick them in the familiar location for them to be insmod during init.

After that a device node should be populated for the camera that is attached to the board and there should be no more Unknown Device 'Camera0" <<example

But if our stock kernel and rom is only 32bit, and the ROM being ported is 64bit it will not work.. There is no need to mix 32/64 bit sources anyway. I'm almost certain that the kernel sources I took that config snippet from is the proper kernel source for the R1 HD, and that config file I linked to should be the actual configuration file used by BLU. Compiling it for 64 bit at compile time would simply solve all those issues. (Unless we only have a 32bit camera kernel module available and it depends on 32bit libraries to function for some reason in which are also dependencies of other things on the phone - in that case it would be a worse DepHell than redhat ever dreamed of having, if thats the case BLU took the easy way out and just recompiled the sucker entirely as 32bit to resolve the entire issue. That would be a sad development move from the company standpoint, but in reality it doesn't effect us much as there isn't any hardware this phone has that is limited by only using a 32bit OS)

Truly the cleanest way to do this would to build both the rom and kernel from source and forget about 'porting' any of it. So if someone can build that kernel using the config here: https://github.com/anpage/android_k.../blob/master/arch/arm/configs/p6601_defconfig the source is in the parent dirs. After the zImage and modules are created if you can create the boot.img and flash only the boot.img to the appropriate partition using custom recovery, if it boots and works then you will know we have the right source. That will mean everything else will be straightfrom there... I understand what I"m asking is a bit much for the average joe on here, but I really am not in a situation where I can easily do those things and lose my internet while using adb on the device. So really I need an experienced dev here that knows how to write a simple update-script to flash boot.img. I need someone that knows how to compile a kernel with arm-eabi toolchain plus compile the modules and then create a custom boot.img from those. If someone here can do those things and provide details we'll move from there.

Unfortunately I can't currently afford to buy a spare R1 HD to tinker with and figure all this out on my own, but I can tell you right now this device is capable of running much newer releases of android than what it officially supports, and it greatly saddens me that such a device's 3rd party development ends because of a kernel related issue. I just can't come to accept that!
 
  • Like
Reactions: Tiggam and Unscedeo

Unscedeo

Senior Member
Sep 11, 2016
70
54
18
Thank You

I don't understand everything that you are talking about, as I am fairly new to XDA and Android modding. I just wanted to say thank you for at least researching and trying to figure out the answer. The camera is our only major problem, and I do believe that everything can be fixed. Hopefully you can get someone who understands this stuff to help you achieve every Blu R1 HD owner's dream: a stable, fast, custom ROM.
@linuxsociety, thanks for giving us a new hope. :)
 

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
I don't understand everything that you are talking about, as I am fairly new to XDA and Android modding. I just wanted to say thank you for at least researching and trying to figure out the answer. The camera is our only major problem, and I do believe that everything can be fixed. Hopefully you can get someone who understands this stuff to help you achieve every Blu R1 HD owner's dream: a stable, fast, custom ROM.

@linuxsociety, thanks for giving us a new hope. :)
In lamons terms it boils down to nobody has really tried to provide a custom compiled kernel based off the original BLU config, or they haven't documented their work on xda / github right. The links I provided are for the original kernel source. If the problem is an ABI mismatch it would only require the same toolchain to compile the kernel as used on the CM/Lineage rom working. I highly doubt thats the issue. I'm guessing that the BLOBs that are needed to load the camera firmware arent in place on the ported roms we need. The files will be exact or real close matches to the ones I mentioned in the previous post. Really looks like someone attempted to port the rom from a similar device, and all they got that didn't work was the camera. Thats some luck if thats the case, and is a relatively simple fix that shouldn't take over a couple hours or no more than a days worth of work.
 

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
Found CM13 project for p6601 / BLU R1 HD on github, and the init files needed for setting permissions on the device nodes of the camera: This info will be useful on the Nougat 7.x rom that works all except the camera: https://github.com/anpage/android_d...a68445d35fb172082/rootdir/etc/init.project.rc If someone can check out the 7.x rom and see if the device nodes/files exist that are referenced on lines 25 -48 of that init file I just pasted. a command such as
Code:
grep IMX258_CAM_CAL_DRV /etc/*init*
and/or
Code:
ls /dev/*IMX258*
and see if you get any output from either command. I need to really dig further into the actual kernel modules since the camera in the stock kernel is configured as a custom config option, I'd expect the drivers to be binary drivers that get loaded somewhere else during init. I really wish I could just get a full output of the full filesystem contents of the 7.x rom that has broken camera. Most importantly I need the contents of /lib /etc /system/etc /system/lib.

If the 7.x rom that everyone is using has been simply ported from a different mediatek device that has the same SoC and a similar boardconfig, then it would explain the whole deal about the camera not working as the camera is probably one of the only things that differs in these budget mediatek devices. Does GPS work good? Most usually you'll have another piece of embedded hardware that will fail to work too. I've seen mostly mentioning of the Camera, if thats the only piece of hardware that isn't working then we got real lucky there, but I'd like to confirm things like GPS, accelerometer, etc work properly too.
 

mrmazak

Senior Member
Jun 16, 2013
3,212
1,324
253
Found CM13 project for p6601 / BLU R1 HD on github, and the init files needed for setting permissions on the device nodes of the camera: This info will be useful on the Nougat 7.x rom that works all except the camera: https://github.com/anpage/android_d...a68445d35fb172082/rootdir/etc/init.project.rc If someone can check out the 7.x rom and see if the device nodes/files exist that are referenced on lines 25 -48 of that init file I just pasted. a command such as
Code:
grep IMX258_CAM_CAL_DRV /etc/*init*
and/or
Code:
ls /dev/*IMX258*
and see if you get any output from either command. I need to really dig further into the actual kernel modules since the camera in the stock kernel is configured as a custom config option, I'd expect the drivers to be binary drivers that get loaded somewhere else during init. I really wish I could just get a full output of the full filesystem contents of the 7.x rom that has broken camera. Most importantly I need the contents of /lib /etc /system/etc /system/lib.

If the 7.x rom that everyone is using has been simply ported from a different mediatek device that has the same SoC and a similar boardconfig, then it would explain the whole deal about the camera not working as the camera is probably one of the only things that differs in these budget mediatek devices. Does GPS work good? Most usually you'll have another piece of embedded hardware that will fail to work too. I've seen mostly mentioning of the Camera, if thats the only piece of hardware that isn't working then we got real lucky there, but I'd like to confirm things like GPS, accelerometer, etc work properly too.

The same sources you are referring to have been tried and used. They appear to be incomplete. But I am not a build expert. So you decide.

There are two 7.0 roms in the thread. One is built and other is the built one with attempted changes (port style)

I believe @vampirefo 's build tree is a better start for you. That tree has a succsesfull build at least.

https://forum.xda-developers.com/r1-hd/development/lineage-os-r1hd-t3530751
 
Last edited:

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
The same sources you are referring to have been tried and used. They appear to be incomplete. But I am not a build expert. So you decide.

There are two 7.0 roms in the thread. One is built and other is the built one with attempted changes (port style)

I believe @vampirefo 's build tree is a better start for you. That tree has a succsesfull build at least.

https://forum.xda-developers.com/r1-hd/development/lineage-os-r1hd-t3530751
If it builds successfully but fails to boot it may be a further regression than just taking what is actually booting and working all except the camera. I normally wouldn't recommend a port at all and would prefer things be built from scratch, but if we already have a working nougat rom where cam is the only thing that's broken, it would be a lot easier to just try to resolve the broken lib / module issue.. Honestly by the time we put enough time and effort into getting a fully working kernel, device tree / overlay sources, it won't be too ideal to try to continue development to support releases beyond Android O. It would be possible, but just not typical. If we can get a fully working Android N I'd say thats a big progress. If the stock kernel supplied is compatible with the HAL layer used in the nougat rom for the camera, then there won't really be any benefits by reworking the kernel and source tree. We could add some cool things like cpu governors / gpu governors, etc, but thats just optional features. really. If we can verify the stock kernel works, then chances are the stock device tree overlay will plug right into the 7.x AOSP/CM/Lineage sources and be patched for the small broken things such as the camera. Once we really figure out what the exact problem with the camera is we can determine from there what the best solution is.
 
Last edited:

Unscedeo

Senior Member
Sep 11, 2016
70
54
18
Found CM13 project for p6601 / BLU R1 HD on github, and the init files needed for setting permissions on the device nodes of the camera: This info will be useful on the Nougat 7.x rom that works all except the camera: https://github.com/anpage/android_d...a68445d35fb172082/rootdir/etc/init.project.rc If someone can check out the 7.x rom and see if the device nodes/files exist that are referenced on lines 25 -48 of that init file I just pasted. a command such as
Code:
grep IMX258_CAM_CAL_DRV /etc/*init*
and/or
Code:
ls /dev/*IMX258*
and see if you get any output from either command. I need to really dig further into the actual kernel modules since the camera in the stock kernel is configured as a custom config option, I'd expect the drivers to be binary drivers that get loaded somewhere else during init. I really wish I could just get a full output of the full filesystem contents of the 7.x rom that has broken camera. Most importantly I need the contents of /lib /etc /system/etc /system/lib.

If the 7.x rom that everyone is using has been simply ported from a different mediatek device that has the same SoC and a similar boardconfig, then it would explain the whole deal about the camera not working as the camera is probably one of the only things that differs in these budget mediatek devices. Does GPS work good? Most usually you'll have another piece of embedded hardware that will fail to work too. I've seen mostly mentioning of the Camera, if thats the only piece of hardware that isn't working then we got real lucky there, but I'd like to confirm things like GPS, accelerometer, etc work properly too.
Hey @linuxsociety, again, great work. I remember that there were some issues with the GPS before (look here: https://forum.xda-developers.com/r1-hd/development/cm14-1-r1hd-t3518202/post70553905#post70553905). I do believe that they were fixed, but make sure to review the thread. With @KazuDante ZenUI ROM, there were some auto-rotation bugs, and those were patched. I wish I could help you with running those commands, could you tell me or point me somewhere I could learn how to do this stuff? I'm happy to help!
 

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
https://github.com/vampirefo/androi...260ad3582807fb162a0d4/rootdir/init.project.rc

init.project.rc

#camrea section does not fit the bill for the stock kernel's parameters:

Stock Cam section follows:

Code:
#Camera
    chmod 0660 /dev/MAINAF
    chown system camera /dev/MAINAF

    chmod 0660 /dev/MAINAF2
    chown system camera /dev/MAINAF2

    chmod 0660 /dev/SUBAF
    chown system camera /dev/SUBAF

    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF

    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF

    chmod 0660 /dev/AD5820AF
    chown system camera /dev/AD5820AF

	chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF
    chmod 0660 /dev/IMX258_CAM_CAL_DRV
    chown system camera /dev/IMX258_CAM_CAL_DRV
VampireEFO Lineage 14.1 rom file follows:
Code:
#Camera
    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF

    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF

    chmod 0660 /dev/LC898212AF
    chown system camera /dev/LC898212AF

    chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF
Nobody has enough commit history on any of the p6601 sources I can find to really tell what changes have been made and why. It's real hard to try to debug this stuff, but from what I see the init scripts are missing some permission settings on device nodes, about as I suspected. I'd hate to think someone hasn't already tried to fix that init script to make the proper permission changes on the correct camera device nodes.

Can anyone provide a pastebin for:
Code:
 ls -l /dev/
on the 14.1 lineage rom? Thanks
 
G

GuestK00465

Guest
Hey guys I just picked up this device a few days ago, and I'm an experience kernel developer...
Thanks a lot for what you're doing, it'll help a lot of fellow R1 HD users out there, including myself. I tried to pick up the project a while back but a bunch of personal stuff happened and I wasn't able to. I've got a lot of school stuff going on right now but I'd love to help as much as I can. I'm not too shabby in coding, developing, meming, etc. so if you need any help with such things I'd be glad to do anything I can.

However, my Blu R1 HD runs stock because I need the camera, it's one of the main purposes of the phone lol. If you need any screwing around on PCs or on the stock kernel I can help there.

Thanks again for everything ?
 

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
Hey @linuxsociety, again, great work. I remember that there were some issues with the GPS before (look here: https://forum.xda-developers.com/r1-hd/development/cm14-1-r1hd-t3518202/post70553905#post70553905). I do believe that they were fixed, but make sure to review the thread. With @KazuDante ZenUI ROM, there were some auto-rotation bugs, and those were patched. I wish I could help you with running those commands, could you tell me or point me somewhere I could learn how to do this stuff? I'm happy to help!
Most everything I ask people to run will need to be ran from an adb shell prompt, or you can install a terminal emulator app on your phone, adb is a lot more comfortable to use for me, but it requires you have adb installed on your computer and the working usb drivers. I only use linux, so I can't really point you to simple adb solutions for windows, but they are available, just the drivers require more effort on windows. You don't need the full android SDK toolkit either. A lot of references will tell you to install that, and its unnecessary, you will probably need something like a universal adb driver and the adb.exe and any dll files it requires on windows.

I have a few R1 HD .zip files on here that pertained to the dirtycow exploit that had both linux and windows ADB tools, so you may already have it too. You don't need to do any modifcation or anything to paste output I request, but if anyone really wants to put some effort with root - read/write access to / and /system it would greatly help in trying to test a few things.

I really don't think we are going to need to recompile anything to get the camera working, it seems we are just missing a few file permissions and have a few mixed libraries that need to be corrected, most of which can be fixed without even needing to reboot the phone.

I really wish I didn't depend on my hotspot on the R1 so much because I can't really afford to install a broken rom and have the downtime as its the only means of internet access we have in our home (we live in the sticks )
 

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
If someone on the 14.1 rom that could please run this in a shell prompt and paste the output to compare the permissions and files in the dev nodes owned by the camera group it would help to start;

Code:
for i in `find /dev/ -group camera`;do ls -l $i;done
The output of the Stock Rom looks like:
[email protected]_HD:/dev # for i in `find /dev/ -group camera`;do ls -l $i;done
crw-rw---- system camera 235, 0 2017-04-20 17:10 IMX258_CAM_CAL_DRV
crw-rw---- system camera 241, 0 2017-04-20 17:10 kd_camera_hw_bus2
crw-rw---- system camera 239, 0 2017-04-20 17:10 MAINAF
crw-rw---- system camera 240, 0 2017-04-20 17:10 S5K4H8_CAM_CAL_DRV
crw-rw---- system camera 242, 0 2017-04-20 17:10 kd_camera_hw
crw-rw---- system camera 244, 0 2017-04-20 17:10 camera-isp
crw-rw---- system camera 236, 0 2017-04-20 17:10 CAM_CAL_DRV
crw-rw---- system camera 243, 0 2017-04-20 17:10 camera-fdvt
crw-rw---- system camera 238, 0 2017-04-20 17:10 kd_camera_flashlight
I expect some differences on the 14.1 lineage and expect this to be the start of fixing the issues.
 

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
Thanks a lot for what you're doing, it'll help a lot of fellow R1 HD users out there, including myself. I tried to pick up the project a while back but a bunch of personal stuff happened and I wasn't able to. I've got a lot of school stuff going on right now but I'd love to help as much as I can. I'm not too shabby in coding, developing, meming, etc. so if you need any help with such things I'd be glad to do anything I can.

However, my Blu R1 HD runs stock because I need the camera, it's one of the main purposes of the phone lol. If you need any screwing around on PCs or on the stock kernel I can help there.

Thanks again for everything
I appreciate you offering your help, right now I'm on the stock rom too and I can pretty much check everything on this end myself, but stick around because its very possible I can overlook something that you may think of yourself. I personally know how all these projects are and if its a one man team they usually end up going dead because nobody really has the time to put into this kind of thing just for fun all by themselves. I can contribute as much time as I can, but I will need some people willing to get their hands dirty on the 14.1 rom. I can't do anything at this point but check the sources and kinda guess what the actual ROM is doing on 14.1 and compare it to the original sources and what our stock roms actually does.
 

EZJohnson

Member
Nov 20, 2016
8
1
3
If someone on the 14.1 rom that could please run this in a shell prompt and paste the output to compare the permissions and files in the dev nodes owned by the camera group it would help to start;



The output of the Stock Rom looks like:


I expect some differences on the 14.1 lineage and expect this to be the start of fixing the issues.
I have an r1 hd running one of the cm 14.1 roms and have the same nodes in dev but the permissions on 235, 240, and 239 are root.root 0600 instead of system.camera.
 

mrmazak

Senior Member
Jun 16, 2013
3,212
1,324
253
I have an r1 hd running one of the cm 14.1 roms and have the same nodes in dev but the permissions on 235, 240, and 239 are root.root 0600 instead of system.camera.
I think a comparison to the Zen rom, which is a port, but the camera does work will confirm if this is a move in correct direction.

.

I also will go back through my notes. There was a second ported rom that I remember worked 100% , but can't find a thread for it. Will update when I find it.
This is the other rom says working all, including camera
https://forum.xda-developers.com/r1-hd/development/wiko-feel-port-6-0-mra58k-mt6735-x32bit-t3518836

I may have some time in next few days to load my tester phone with these two roms and pull the requested permissions. Hope you are onto something.
 
Last edited:
  • Like
Reactions: vettejock99

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
I think a comparison to the Zen rom, which is a port, but the camera does work will confirm if this is a move in correct direction.

.

I also will go back through my notes. There was a second ported rom that I remember worked 100% , but can't find a thread for it. Will update when I find it.
This is the other rom says working all, including camera
https://forum.xda-developers.com/r1-hd/development/wiko-feel-port-6-0-mra58k-mt6735-x32bit-t3518836
It is important those nodes have RW permission by the system user and also the camera group, otherwise nothing can work unless it is the root user trying to access them. A simple modification to the init scripts will fix that issue, but you don't even need to change the init scripts to modify the permissions and test, however during the next boot they will return to the root root 0600 permissions unless the init script is changed to execute on each boot.

from adb shell you could to execute the following commands one line at a time (you must grant root access to the adb shell):
Code:
    su
    chmod 0660 /dev/MAINAF
    chown system camera /dev/MAINAF
    chmod 0660 /dev/MAINAF2
    chown system camera /dev/MAINAF2
    chmod 0660 /dev/SUBAF
    chown system camera /dev/SUBAF
    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF
    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF
    chmod 0660 /dev/AD5820AF
    chown system camera /dev/AD5820AF
    chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF
    chmod 0660 /dev/IMX258_CAM_CAL_DRV
    chown system camera /dev/IMX258_CAM_CAL_DRV
Executing those commands manually will set the appropriate permissions on the nodes. You can try to open the camera (i'd stop any previous running instance) These may need to be set in init, in that case modifying the init file to contain the missing dev node permissions will be necessary.

File is /init.project.rc
 

mrmazak

Senior Member
Jun 16, 2013
3,212
1,324
253
It is important those nodes have RW permission by the system user and also the camera group, otherwise nothing can work unless it is the root user trying to access them. A simple modification to the init scripts will fix that issue, but you don't even need to change the init scripts to modify the permissions and test, however during the next boot they will return to the root root 0600 permissions unless the init script is changed to execute on each boot.

from adb shell you could to execute the following commands one line at a time (you must grant root access to the adb shell):
Code:
    su
    chmod 0660 /dev/MAINAF
    chown system camera /dev/MAINAF
    chmod 0660 /dev/MAINAF2
    chown system camera /dev/MAINAF2
    chmod 0660 /dev/SUBAF
    chown system camera /dev/SUBAF
    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF
    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF
    chmod 0660 /dev/AD5820AF
    chown system camera /dev/AD5820AF
    chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF
    chmod 0660 /dev/IMX258_CAM_CAL_DRV
    chown system camera /dev/IMX258_CAM_CAL_DRV
Executing those commands manually will set the appropriate permissions on the nodes. You can try to open the camera (i'd stop any previous running instance) These may need to be set in init, in that case modifying the init file to contain the missing dev node permissions will be necessary.

File is /init.project.rc

the lineage os 14 that i have is supposed to be the stock boot.img, but i unpacked it and compaired the /init.project.rc and those last two lines in the camera section are missing. ¿ ?

there are couple other changes too. but one at a time. Will try to see if adding it will make a difference. also before I do that i need to check the boot.img foe the other two roms that camera works, to see if there is a common occurrence of those lines.

UPDATE:
I checked the boot.img used on the lineage beta 4 (camera not working) and it has all the lines in the init, but there is a "tab" in front of every line. maybe the indent is causing trouble ¿ ?

The "zen" rom that has a working camera has Identical init.project.rc to the stock V12 version

The download link to the "wiko -u fell" port is broken so cannot check that one.

so next thing for me to do is try it on live system. will update when done testing.
 

Attachments

Last edited:

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
the lineage os 14 that i have is supposed to be the stock boot.img, but i unpacked it and compaired the /init.project.rc and those last two lines in the camera section are missing. ¿ ?

there are couple other changes too. but one at a time. Will try to see if adding it will make a difference. also before I do that i need to check the boot.img foe the other two roms that camera works, to see if there is a common occurrence of those lines.

UPDATE:
I checked the boot.img used on the lineage beta 4 (camera not working) and it has all the lines in the init, but there is a "tab" in front of every line. maybe the indent is causing trouble ¿ ?
The tab in front of the lines will not impact anything, but the two missing lines definitely will.

PS do you care to pastebin all the contents of the init files from the lineage boot.img? Has nobody tested flashing the stock boot.img on top of lineage 14.1 to see the results?
 
Last edited:

mrmazak

Senior Member
Jun 16, 2013
3,212
1,324
253
The tab in front of the lines will not impact anything, but the two missing lines definitely will.

PS do you care to pastebin all the contents of the init files from the lineage boot.img? Has nobody tested flashing the stock boot.img on top of lineage 14.1 to see the results?
i dont know about paste bin. i mean i have heard the name but never used it. here is the contents in code boxes.

LineageOS boot init.project.rc

Code:
# MTK project .rc configure

import init.mt6735.usb.rc

on init
    mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw
    mkdir /storage/usbotg 0700 root root

on post-fs-data

#
# Connectivity related device nodes & configuration (begin)
#

#/dev/ttyMT2 for Connectivity BT/FM/GPS usage
    chmod 0660 /dev/ttyMT2
    chown system system /dev/ttyMT2


# STP, WMT, GPS, FM and BT Driver
#   insmod /system/lib/modules/mtk_hif_sdio.ko
#   insmod /system/lib/modules/mtk_stp_wmt.ko
#   insmod /system/lib/modules/mtk_stp_uart.ko
#   insmod /system/lib/modules/mtk_stp_gps.ko
#   insmod /system/lib/modules/mtk_stp_bt.ko
#   insmod /system/lib/modules/mtk_fm_drv.ko
#   insmod /system/lib/modules/mtk_wmt_wifi.ko


# Create char device file for WMT, GPS, BT, FM, WIFI
#    mknod /dev/stpwmt c 190 0;
#    mknod /dev/stpgps c 191 0;
#    mknod /dev/stpbt  c 192 0;

#    chmod 0660 /dev/stpwmt
#    chown system system /dev/stpwmt

#    chmod 0660 /dev/wmtdetect
#    chown system system /dev/wmtdetect

    mknod /dev/wmtWifi c 153 0
    chmod 0660 /dev/wmtWifi
    chown system system /dev/wmtWifi

#Camera
    chmod 0660 /dev/MAINAF
    chown system camera /dev/MAINAF

    chmod 0660 /dev/MAINAF2
    chown system camera /dev/MAINAF2

    chmod 0660 /dev/SUBAF
    chown system camera /dev/SUBAF

    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF

    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF

    chmod 0660 /dev/AD5820AF
    chown system camera /dev/AD5820AF

	chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF

#SMB
    chown system system /proc/smb/ScreenComm
    chmod 0660 /proc/smb/ScreenComm

# BT
#    chmod 0660 /dev/stpbt
#    chown bluetooth radio /dev/stpbt

# GPS
#    chown gps gps /dev/stpgps
    chown gps gps /sys/class/gpsdrv/gps/pwrctl
    chown gps gps /sys/class/gpsdrv/gps/suspend
    chown gps gps /sys/class/gpsdrv/gps/state
    chown gps gps /sys/class/gpsdrv/gps/pwrsave
    chown gps gps /sys/class/gpsdrv/gps/status
#    chmod 0660 /dev/stpgps

# WiFi
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wpa_supplicant 0770 wifi wifi
    chown wifi wifi /data/misc/wifi

#Define device for ATCID
    chmod 660 /dev/ttyGS0
    chown system /dev/ttyGS0
    chmod 660 /dev/ttyGS1
    chown system /dev/ttyGS1

#Disable for one Single loader
# Load WiFi Driver
#   insmod /system/lib/modules/wlan_mt.ko

# Char device for BT 3.0 HS
    mknod /dev/ampc0 c 151 0
    chown bluetooth bluetooth /dev/ampc0
    chmod 0660 /dev/ampc0

# for gesture
    chown system system /sys/devices/mx_tsp/gesture_control
    chown system system /sys/devices/mx_tsp/gesture_data

# for notification light
    chown system system /sys/devices/mx_leds/leds_mode

#FLYME_EDIT:[email protected] Permissions add for power saving mode {@
#Permissions for power saving mode
        chown system system /sys/power/power_mode
        chmod 0660 /sys/power/power_mode
#@}

#
# Connectivity related device nodes & configuration (end)
#

# Encrypt phone function
    setprop vold.post_fs_data_done 1

#
# Connectivity related services (Begin)
#

service atci_service /system/bin/atci_service
	socket atci-service stream 660 radio system
	socket atci-serv-fw stream 660 radio system
	user root
        disabled
	group radio system
service atcid-daemon-u /system/bin/atcid
	user system
	group radio system media
	disabled
	oneshot

service atcid-daemon-e /system/bin/atcid
	user root
	group radio system
	disabled
	oneshot

on early_property:ro.build.type=eng
start atci_service
start atcid-daemon-e
service audio-daemon /system/bin/audiocmdservice_atci
    class main
    socket atci-audio stream 660 media system
    user media
    group nvram media system sdcard_rw
    disabled
    oneshot

service wmtLoader /system/bin/wmt_loader
    user root
    group root
   class core
    oneshot


service conn_launcher /system/bin/6620_launcher -p /system/etc/firmware/
    user system
    group system
    class core

#
# Connectivity related services (End)
#
zen rom working camera init.project.rc 100% match to stock version

Code:
# MTK project .rc configure

import init.mt6735.usb.rc

on init
    mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw
    mkdir /storage/usbotg 0700 root root

on post-fs-data

#
# Connectivity related device nodes & configuration (begin)
#

#/dev/ttyMT2 for Connectivity BT/FM/GPS usage
    chmod 0660 /dev/ttyMT2
    chown system system /dev/ttyMT2


# STP, WMT, GPS, FM and BT Driver
#   insmod /system/lib/modules/mtk_hif_sdio.ko
#   insmod /system/lib/modules/mtk_stp_wmt.ko
#   insmod /system/lib/modules/mtk_stp_uart.ko
#   insmod /system/lib/modules/mtk_stp_gps.ko
#   insmod /system/lib/modules/mtk_stp_bt.ko
#   insmod /system/lib/modules/mtk_fm_drv.ko
#   insmod /system/lib/modules/mtk_wmt_wifi.ko


# Create char device file for WMT, GPS, BT, FM, WIFI
#    mknod /dev/stpwmt c 190 0;
#    mknod /dev/stpgps c 191 0;
#    mknod /dev/stpbt  c 192 0;

#    chmod 0660 /dev/stpwmt
#    chown system system /dev/stpwmt

#    chmod 0660 /dev/wmtdetect
#    chown system system /dev/wmtdetect

    mknod /dev/wmtWifi c 153 0
    chmod 0660 /dev/wmtWifi
    chown system system /dev/wmtWifi

#Camera
    chmod 0660 /dev/MAINAF
    chown system camera /dev/MAINAF

    chmod 0660 /dev/MAINAF2
    chown system camera /dev/MAINAF2

    chmod 0660 /dev/SUBAF
    chown system camera /dev/SUBAF

    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF

    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF

    chmod 0660 /dev/AD5820AF
    chown system camera /dev/AD5820AF

	chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF
    chmod 0660 /dev/IMX258_CAM_CAL_DRV
    chown system camera /dev/IMX258_CAM_CAL_DRV

#SMB
    chown system system /proc/smb/ScreenComm
    chmod 0660 /proc/smb/ScreenComm

# BT
#    chmod 0660 /dev/stpbt
#    chown bluetooth radio /dev/stpbt

# GPS
#    chown gps gps /dev/stpgps
    chown gps gps /sys/class/gpsdrv/gps/pwrctl
    chown gps gps /sys/class/gpsdrv/gps/suspend
    chown gps gps /sys/class/gpsdrv/gps/state
    chown gps gps /sys/class/gpsdrv/gps/pwrsave
    chown gps gps /sys/class/gpsdrv/gps/status
#    chmod 0660 /dev/stpgps

# WiFi
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wpa_supplicant 0770 wifi wifi
    chown wifi wifi /data/misc/wifi

#Define device for ATCID
    chmod 660 /dev/ttyGS0
    chown system /dev/ttyGS0
    chmod 660 /dev/ttyGS1
    chown system /dev/ttyGS1

#Disable for one Single loader
# Load WiFi Driver
#   insmod /system/lib/modules/wlan_mt.ko

# Char device for BT 3.0 HS
    mknod /dev/ampc0 c 151 0
    chown bluetooth bluetooth /dev/ampc0
    chmod 0660 /dev/ampc0
    chmod 0666 /dev/sensors_state

#
# Connectivity related device nodes & configuration (end)
#

    
    chmod 0666 /dev/exm0

on init
    # Refer to http://source.android.com/devices/tech/storage/index.html
    # It said, "Starting in Android 4.4, multiple external storage devices are surfaced to developers through
    #           Context.getExternalFilesDirs(), Context.getExternalCacheDirs(), and Context.getObbDirs().
    #           External storage devices surfaced through these APIs must be a semi-permanent part of the device (such as an SD card slot in a battery compartment).
    #           Developers expect data stored in these locations to be available over long periods of time."
    # Therefore, if the target doesn't support sd hot-plugging (Ex: the SD card slot in a battery compartment), we need to export SECONDARY_STORAGE in 'boot' section
    #
    # export SECONDARY_STORAGE /storage/sdcard1

service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbotg /storage/usbotg
    class late_start
    disabled


#service fingerprintd /system/bin/fingerprintd
#    class late_start
#    user system
#service gx_fpd /system/bin/gx_fpd
#    class late_start
#    user root
#    group root system

#
# Connectivity related services (Begin)
#

service atci_service /system/bin/atci_service
	socket atci-service stream 660 radio system
	socket atci-serv-fw stream 660 radio system
	user root
        disabled
	group radio system
service atcid-daemon-u /system/bin/atcid
	user system
	group radio system media
	disabled
	oneshot

service atcid-daemon-e /system/bin/atcid
	user root
	group radio system
	disabled
	oneshot

on early_property:ro.build.type=eng
start atci_service
start atcid-daemon-e
service audio-daemon /system/bin/audiocmdservice_atci
    class main
    socket atci-audio stream 660 media system
    user media
    group nvram media system sdcard_rw
    disabled
    oneshot

service wmtLoader /system/bin/wmt_loader
    user root
    group root
   class core
    oneshot


service conn_launcher /system/bin/6620_launcher -p /system/etc/firmware/
    user system
    group system
    class core

#
# Connectivity related services (End)
#

#
# vtservice
#
service vtservice /system/bin/vtservice
        class main
        socket soc_vt_tcv dgram 660 radio system
        socket soc_vt_stk dgram 660 radio system
        socket soc_vt_svc dgram 660 radio system
        user system
        group system camera graphics inet net_admin net_raw media sdcard_rw radio sdcard_r media_rw
        ioprio rt 4
 

Attachments

Last edited:

linuxsociety

Senior Member
Dec 18, 2010
431
349
0
Southern Kentucky
i dont know about paste bin. i mean i have heard the name but never used it. here is the contents in code boxes.

LineageOS boot init.project.rc

Code:
# MTK project .rc configure

import init.mt6735.usb.rc

on init
    mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw
    mkdir /storage/usbotg 0700 root root

on post-fs-data

#
# Connectivity related device nodes & configuration (begin)
#

#/dev/ttyMT2 for Connectivity BT/FM/GPS usage
    chmod 0660 /dev/ttyMT2
    chown system system /dev/ttyMT2


# STP, WMT, GPS, FM and BT Driver
#   insmod /system/lib/modules/mtk_hif_sdio.ko
#   insmod /system/lib/modules/mtk_stp_wmt.ko
#   insmod /system/lib/modules/mtk_stp_uart.ko
#   insmod /system/lib/modules/mtk_stp_gps.ko
#   insmod /system/lib/modules/mtk_stp_bt.ko
#   insmod /system/lib/modules/mtk_fm_drv.ko
#   insmod /system/lib/modules/mtk_wmt_wifi.ko


# Create char device file for WMT, GPS, BT, FM, WIFI
#    mknod /dev/stpwmt c 190 0;
#    mknod /dev/stpgps c 191 0;
#    mknod /dev/stpbt  c 192 0;

#    chmod 0660 /dev/stpwmt
#    chown system system /dev/stpwmt

#    chmod 0660 /dev/wmtdetect
#    chown system system /dev/wmtdetect

    mknod /dev/wmtWifi c 153 0
    chmod 0660 /dev/wmtWifi
    chown system system /dev/wmtWifi

#Camera
    chmod 0660 /dev/MAINAF
    chown system camera /dev/MAINAF

    chmod 0660 /dev/MAINAF2
    chown system camera /dev/MAINAF2

    chmod 0660 /dev/SUBAF
    chown system camera /dev/SUBAF

    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF

    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF

    chmod 0660 /dev/AD5820AF
    chown system camera /dev/AD5820AF

	chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF

#SMB
    chown system system /proc/smb/ScreenComm
    chmod 0660 /proc/smb/ScreenComm

# BT
#    chmod 0660 /dev/stpbt
#    chown bluetooth radio /dev/stpbt

# GPS
#    chown gps gps /dev/stpgps
    chown gps gps /sys/class/gpsdrv/gps/pwrctl
    chown gps gps /sys/class/gpsdrv/gps/suspend
    chown gps gps /sys/class/gpsdrv/gps/state
    chown gps gps /sys/class/gpsdrv/gps/pwrsave
    chown gps gps /sys/class/gpsdrv/gps/status
#    chmod 0660 /dev/stpgps

# WiFi
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wpa_supplicant 0770 wifi wifi
    chown wifi wifi /data/misc/wifi

#Define device for ATCID
    chmod 660 /dev/ttyGS0
    chown system /dev/ttyGS0
    chmod 660 /dev/ttyGS1
    chown system /dev/ttyGS1

#Disable for one Single loader
# Load WiFi Driver
#   insmod /system/lib/modules/wlan_mt.ko

# Char device for BT 3.0 HS
    mknod /dev/ampc0 c 151 0
    chown bluetooth bluetooth /dev/ampc0
    chmod 0660 /dev/ampc0

# for gesture
    chown system system /sys/devices/mx_tsp/gesture_control
    chown system system /sys/devices/mx_tsp/gesture_data

# for notification light
    chown system system /sys/devices/mx_leds/leds_mode

#FLYME_EDIT:[email protected] Permissions add for power saving mode {@
#Permissions for power saving mode
        chown system system /sys/power/power_mode
        chmod 0660 /sys/power/power_mode
#@}

#
# Connectivity related device nodes & configuration (end)
#

# Encrypt phone function
    setprop vold.post_fs_data_done 1

#
# Connectivity related services (Begin)
#

service atci_service /system/bin/atci_service
	socket atci-service stream 660 radio system
	socket atci-serv-fw stream 660 radio system
	user root
        disabled
	group radio system
service atcid-daemon-u /system/bin/atcid
	user system
	group radio system media
	disabled
	oneshot

service atcid-daemon-e /system/bin/atcid
	user root
	group radio system
	disabled
	oneshot

on early_property:ro.build.type=eng
start atci_service
start atcid-daemon-e
service audio-daemon /system/bin/audiocmdservice_atci
    class main
    socket atci-audio stream 660 media system
    user media
    group nvram media system sdcard_rw
    disabled
    oneshot

service wmtLoader /system/bin/wmt_loader
    user root
    group root
   class core
    oneshot


service conn_launcher /system/bin/6620_launcher -p /system/etc/firmware/
    user system
    group system
    class core

#
# Connectivity related services (End)
#
zen rom working camera init.project.rc 100% match to stock version

Code:
# MTK project .rc configure

import init.mt6735.usb.rc

on init
    mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw
    mkdir /storage/usbotg 0700 root root

on post-fs-data

#
# Connectivity related device nodes & configuration (begin)
#

#/dev/ttyMT2 for Connectivity BT/FM/GPS usage
    chmod 0660 /dev/ttyMT2
    chown system system /dev/ttyMT2


# STP, WMT, GPS, FM and BT Driver
#   insmod /system/lib/modules/mtk_hif_sdio.ko
#   insmod /system/lib/modules/mtk_stp_wmt.ko
#   insmod /system/lib/modules/mtk_stp_uart.ko
#   insmod /system/lib/modules/mtk_stp_gps.ko
#   insmod /system/lib/modules/mtk_stp_bt.ko
#   insmod /system/lib/modules/mtk_fm_drv.ko
#   insmod /system/lib/modules/mtk_wmt_wifi.ko


# Create char device file for WMT, GPS, BT, FM, WIFI
#    mknod /dev/stpwmt c 190 0;
#    mknod /dev/stpgps c 191 0;
#    mknod /dev/stpbt  c 192 0;

#    chmod 0660 /dev/stpwmt
#    chown system system /dev/stpwmt

#    chmod 0660 /dev/wmtdetect
#    chown system system /dev/wmtdetect

    mknod /dev/wmtWifi c 153 0
    chmod 0660 /dev/wmtWifi
    chown system system /dev/wmtWifi

#Camera
    chmod 0660 /dev/MAINAF
    chown system camera /dev/MAINAF

    chmod 0660 /dev/MAINAF2
    chown system camera /dev/MAINAF2

    chmod 0660 /dev/SUBAF
    chown system camera /dev/SUBAF

    chmod 0660 /dev/GAF001AF
    chown system camera /dev/GAF001AF

    chmod 0660 /dev/DW9714AF
    chown system camera /dev/DW9714AF

    chmod 0660 /dev/AD5820AF
    chown system camera /dev/AD5820AF

	chmod 0660 /dev/BU64745GWZAF
    chown system camera /dev/BU64745GWZAF
    chmod 0660 /dev/IMX258_CAM_CAL_DRV
    chown system camera /dev/IMX258_CAM_CAL_DRV

#SMB
    chown system system /proc/smb/ScreenComm
    chmod 0660 /proc/smb/ScreenComm

# BT
#    chmod 0660 /dev/stpbt
#    chown bluetooth radio /dev/stpbt

# GPS
#    chown gps gps /dev/stpgps
    chown gps gps /sys/class/gpsdrv/gps/pwrctl
    chown gps gps /sys/class/gpsdrv/gps/suspend
    chown gps gps /sys/class/gpsdrv/gps/state
    chown gps gps /sys/class/gpsdrv/gps/pwrsave
    chown gps gps /sys/class/gpsdrv/gps/status
#    chmod 0660 /dev/stpgps

# WiFi
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wpa_supplicant 0770 wifi wifi
    chown wifi wifi /data/misc/wifi

#Define device for ATCID
    chmod 660 /dev/ttyGS0
    chown system /dev/ttyGS0
    chmod 660 /dev/ttyGS1
    chown system /dev/ttyGS1

#Disable for one Single loader
# Load WiFi Driver
#   insmod /system/lib/modules/wlan_mt.ko

# Char device for BT 3.0 HS
    mknod /dev/ampc0 c 151 0
    chown bluetooth bluetooth /dev/ampc0
    chmod 0660 /dev/ampc0
    chmod 0666 /dev/sensors_state

#
# Connectivity related device nodes & configuration (end)
#

    
    chmod 0666 /dev/exm0

on init
    # Refer to http://source.android.com/devices/tech/storage/index.html
    # It said, "Starting in Android 4.4, multiple external storage devices are surfaced to developers through
    #           Context.getExternalFilesDirs(), Context.getExternalCacheDirs(), and Context.getObbDirs().
    #           External storage devices surfaced through these APIs must be a semi-permanent part of the device (such as an SD card slot in a battery compartment).
    #           Developers expect data stored in these locations to be available over long periods of time."
    # Therefore, if the target doesn't support sd hot-plugging (Ex: the SD card slot in a battery compartment), we need to export SECONDARY_STORAGE in 'boot' section
    #
    # export SECONDARY_STORAGE /storage/sdcard1

service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbotg /storage/usbotg
    class late_start
    disabled


#service fingerprintd /system/bin/fingerprintd
#    class late_start
#    user system
#service gx_fpd /system/bin/gx_fpd
#    class late_start
#    user root
#    group root system

#
# Connectivity related services (Begin)
#

service atci_service /system/bin/atci_service
	socket atci-service stream 660 radio system
	socket atci-serv-fw stream 660 radio system
	user root
        disabled
	group radio system
service atcid-daemon-u /system/bin/atcid
	user system
	group radio system media
	disabled
	oneshot

service atcid-daemon-e /system/bin/atcid
	user root
	group radio system
	disabled
	oneshot

on early_property:ro.build.type=eng
start atci_service
start atcid-daemon-e
service audio-daemon /system/bin/audiocmdservice_atci
    class main
    socket atci-audio stream 660 media system
    user media
    group nvram media system sdcard_rw
    disabled
    oneshot

service wmtLoader /system/bin/wmt_loader
    user root
    group root
   class core
    oneshot


service conn_launcher /system/bin/6620_launcher -p /system/etc/firmware/
    user system
    group system
    class core

#
# Connectivity related services (End)
#

#
# vtservice
#
service vtservice /system/bin/vtservice
        class main
        socket soc_vt_tcv dgram 660 radio system
        socket soc_vt_stk dgram 660 radio system
        socket soc_vt_svc dgram 660 radio system
        user system
        group system camera graphics inet net_admin net_raw media sdcard_rw radio sdcard_r media_rw
        ioprio rt 4
Fair enough, I have a diff applied here:

Code:
$ diff -uN0 lineage.init.project.rc stock.init.project.rc 
--- lineage.init.project.rc	2017-04-21 21:10:34.569610971 -0500
+++ stock.init.project.rc	2017-04-21 21:11:49.373610258 -0500
@@ -65,0 +66,2 @@
+    chmod 0660 /dev/IMX258_CAM_CAL_DRV
+    chown system camera /dev/IMX258_CAM_CAL_DRV
@@ -104,14 +106 @@
-
-# for gesture
-    chown system system /sys/devices/mx_tsp/gesture_control
-    chown system system /sys/devices/mx_tsp/gesture_data
-
-# for notification light
-    chown system system /sys/devices/mx_leds/leds_mode
-
-#FLYME_EDIT:[email protected] Permissions add for 
-power saving mode {@
-#Permissions for power saving mode
-        chown system system /sys/power/power_mode
-        chmod 0660 /sys/power/power_mode
-#@}
+    chmod 0666 /dev/sensors_state
@@ -123,2 +112,33 @@
-# Encrypt phone function
-    setprop vold.post_fs_data_done 1
+    
+    chmod 0666 /dev/exm0
+
+on init
+    # Refer to http://source.android.com/devices/tech/storage/index.html
+    # It said, "Starting in Android 4.4, multiple external storage 
+devices are surfaced to developers through
+    #           Context.getExternalFilesDirs(), 
+Context.getExternalCacheDirs(), and Context.getObbDirs().
+    #           External storage devices surfaced through these APIs 
+must be a semi-permanent part of the device (such as an SD card slot in 
+a battery compartment).
+    #           Developers expect data stored in these locations to be 
+available over long periods of time."
+    # Therefore, if the target doesn't support sd hot-plugging (Ex: the 
+SD card slot in a battery compartment), we need to export 
+SECONDARY_STORAGE in 'boot' section
+    #
+    # export SECONDARY_STORAGE /storage/sdcard1
+
+service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d 
+/mnt/media_rw/usbotg /storage/usbotg
+    class late_start
+    disabled
+
+
+#service fingerprintd /system/bin/fingerprintd
+#    class late_start
+#    user system
+#service gx_fpd /system/bin/gx_fpd
+#    class late_start
+#    user root
+#    group root system
@@ -173,0 +194,13 @@
+
+#
+# vtservice
+#
+service vtservice /system/bin/vtservice
+        class main
+        socket soc_vt_tcv dgram 660 radio system
+        socket soc_vt_stk dgram 660 radio system
+        socket soc_vt_svc dgram 660 radio system
+        user system
+        group system camera graphics inet net_admin net_raw media 
+sdcard_rw radio sdcard_r media_rw
+        ioprio rt 4
Can you see the difference in that patch of the lineage vs stock? The two lines you mentioned are of the most importance, the other lines didn't come out exactly right due to some word wrapping or something going on in the "code" box used on xda. Needless to say those IMX permissions need set, we also need to verify proper permissions are set in the other init files for other camera nodes and files.

I've created a diff patch of the entire differences of the contexts of the ramdisk, and they are in no way the same. The diff patch contains 5,000+ lines so there are quite a few files differet. Im almost certain that the camera issue resides in these differences. I'm just wondering where the 14.1/lineage ramdisk mods have came from and why. The why part of that is where commits on github really come in handy. Anyway here is the file of the entire differences (minus any binary files that differ, when the binaries differ the patch specifies it)

https://gist.github.com/godmachine81/3e5bffa14b4b06d41d5db470961d54ea

Search the gist for the term 'camera' and you'll see some interesting results especially the + (stock) lines.

This command:
Code:
$ grep -i camera /tmp/lineage-vs-stock.diff |wc -l
27
shows there are 27 lines containing the term camera (ignoring case sensitivity) from the entire stock vs lineage ramdisk contents all of which are DIFFERENCES (thats ommitting the common occurances)
 
Last edited: