yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
I'm guessing that they get a back lux reading from the back MAX86915 sensor. They definitely can calculate proximity from the back HRM sensor, it's very accurate in fact. The TCS3407 apppears to be exclusively on the front.

BTW, did you notice that when running Hardware Info, if you bring anything reflective too close to the back, the red LED to measure blood turns on. This, no doubt, would register as "brightness" to the back sensor, which would be confusing if you're figuring out lux. The second value for the back HRM sensor then goes to big values when the red LED is on, if you hold your finger in front of the sensor, you'll see your heartrate oscillate. Which is pretty cool.

If you place the back of the phone against black vinyl plastic, it seems to not trigger the red LED. You may find this useful.

I notice that most of the MAX86915 raw values are zero, so either one needs to activate to AOSP that MDX86915 RGB sensor (easiest), or maybe by activating the camera or something the raw values for HRM would become non-zero.

Given that stock does provide a rear lux sensor to the standard Android API, a bit of trial and error swapping shared libraries between this build and stock may activate the rear lux sensor.

Installing opengapps installs a bunch of DRM support. I don't watch DRM encumbered content, so I can't say any more about if those work right or not.

Oh definitely please do check my S10 experience on the S10 variants first. And thank you.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ctrej:
Well, yes and no. I took a look at teardown photos and the S10 and S10+ do only have one sensor next to the LED, so the heart rate sensor must double as a light sensor. The S10e on the other hand does not have a heart rate sensor and appears to have the same light sensor like the one on the front instead. Take a look at these to pictures (S10e on top, S10 bottom): https://d3nevzfk7ii3be.cloudfront.net/igi/FVuMUjjIYIMuEUp2.full and https://d3nevzfk7ii3be.cloudfront.net/igi/bpbmTOdBUZdBjdrG.full

So yeah, this means two different drivers are required which makes it even more complicated.

The heart rate sensor knows when the one of the LEDs is turned on (it's only on for a few 100us at a time) and software could easily pause updating the brightness value. Unlike the TCS3707 the MAX86915 has a similiar part which has a public datasheet available: https://datasheets.maximintegrated.com/en/ds/MAX86916.pdf Surprisingly it only has one light sensor build in which is sensitive to all wavelengths, so it must use different code for conversion into lux and will be a bit less accurate than the TCS3707. (Fun fact: that heart rate sensor costs 6$ ea. in 1000 qty. which makes it one of the most expensive sensors I've ever seen in a consumer device - so no wonder it is excluded in the S10e)
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Lav64:
You may need to use Gapps Nano for Android Auto. Pico may prevent some Google apps from working it seems.

https://github.com/opengapps/opengapps/wiki/Nano-Package
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] :
Thanks for the tip! I will try it the next days :)
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
I don't know if you noticed it in the datasheet, but there is an ambient light cancellation sensor which specifically adjusts the normal sensor for brightness. They called it the ALC. By default, it automatically corrects the normal sensor, but it can be flipped into a pure lux measurement mode by writing a register.

I mention this because you can find the MAX86917 at /sys/devices/virtual/sensors/hrm_sensor, and it appears to expose its registers and its readings there. So if you write, as root, the values as the datasheet says to the right places, in theory it'll start exposing lux measurements. It's worth a try, anyway.

Strictly speaking, it is the additional cost over a cheaper sensor. The TCS3707 goes for $1.15 or so, so they chose to spend $4.45 for a heart rate sensor, though it is medical grade, according to its datasheet.

Seems a bit wasted to me. As much as the thing is cool, it's not particularly useful. BTW you may also wish to add to the FAQ the app "Heart Rate Analyzer" (https://play.google.com/store/apps/details?id=com.microcadsystems.serge.heartrateanalyzer&hl=en) which is a completely free, no adverts, standalone, 100% pure Samsung sensors based heart rate and SpO2 app. Lets you save out your measurements of heart rate, oxygen saturation, arterial stiffness etc, and build a history of them. Works great on this LO RC2. Just remember not to press your finger too hard on the sensor, else you'll get readings which suggest you are very ill!
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ctrej:
Take a look at the block diagram, there is only one photodiode to measure the light. All the ALC does is "substract" the sensor value before pulsing the LED from the value when the LED is active. You can turn off this feature to measure the ambient light, but you have to turn it on again in order to take a heart rate/ SpO2 measurement. This is tricky, because the proximity detection (=finger detection) is affected as well. Even then it's not a "pure lux measurement" because a) it outputs only the ADC count and b) the spectral response of the silicon photodiode does not match the human eye. All I want to say is: it's complicated, the sensor doesn't spit out usable values directly, it needs good software to work properly.

The filepath is a good find. I've opened a few files for other sensor, but they don't seem to be register values, but more like some high-level abstraction of the real HW driver. All-in-all I'm not hopeful to implement a rear light sensor from scratch, especially not without impacting the HRM. It might be possible to use Samsung's drivers somehow, but I wouldn't bet on it either.

Yeah, your right with the cost. It can be a good feature if you're feeling sick and want to estimate how bad it is. Perception of one's own vitals can be skewed, especially when your sick. Thanks for the recommendation, the app seems fine and I'll add it to the FAQ as well.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
I am literally not an expert on this, but I believe LineageOS implements a driver shim system. So, basically, you can wrap up the sensors reported by AOSP with custom tweaks or synthesised sensors. You can also offer new (faked) ones. Obviously, here, LO would want to duplicate, exactly, the additional rear lux sensor reported by stock.

I would assume that the ADC count won't be linear, so you'd need to apply an appropriate transformation to it. But, to be honest, there is a brute force technique here too: Sit in a dark room with a single light source. Face the phone to the light source. Take the lux reading from the front sensor. Flip it round. Take the ADC count. Do that for ten or twenty distances from the light source. Hack together a low quality interpolated mapping function. It'll be good enough to get the screen brightness to be approximately right, which is all we really care about here.

Another approach again is to write a little program for stock which compares the ADC count to the rear lux sensor reported, and from that autogenerates a map of 1024 values or so. Anyway, you get the idea.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
If you find out how to patch it. Have a python script do it or a sed command, then we could apply it in extract-utils.sh ...
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
See my post earlier listing the sensors in the S10e. The code we use to get sensors connected up to Androids is here:

https://github.com/LineageOS/android_hardware_samsung/blob/lineage-17.1/hidl/sensors/Sensors.cpp

In line 136 you see how we patch the proximity sensor to get it working in LineageOS. I think AOSP only supports one light sensor. A second would need to be wired in the framework.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Frank65:
Other questestion: Is there an plan, to dedelope Lineage also for the Samsung S20 ?
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
Please find in the attached zip file a binary patch (.bsdiff) and a objdump patch (.diff) to show the differences in the ARM32 disassembly, in case the binary patch ever fails and a new one must be derived. Changes:

1. In _ZN7android29ExynosCameraMetadataConverter49m_createScalerAvailableStreamConfigurationsOutputEPKNS_26ExynosCameraSensorInfoBaseEPNS_6VectorIiEE@@Base, we do NOT take two branches based on the presumably zero contents of offsets #24 and #28.

2. In _ZN7android29ExynosCameraMetadataConverter40m_createScalerAvailableMinFrameDurationsEPKNS_26ExynosCameraSensorInfoBaseEPNS_6VectorIxEE@@Base, we similarly do NOT take the branch based on the presumably zero contents of offset #24.

To test, in TWRP I took the original libexynoscamera3.so from my phone from /vendor/lib. I applied the binary patch. I copied back the patched file. I rebooted.

You should immediately notice the difference! In OpenCamera, now the front camera is overexposed. Colours are good, but a bit too bright. I also tried zgcam, now the front camera works, also overexposed. I also tried idan's gcam 5.1 for RAW front cameras, that also works, but only on first execute. The next time you run it it crashes, and keeps crashing. So I cannot recommend that gcam 5.1 over the one I already did.

If you do decide to apply this patch by default, I'd recommend backing off the default exposure for the front camera a bit. I'd also get someone more into photography to give it more testing, and perhaps to suggest a default exposure for RAW front camera so it matches non-RAW front camera.

I haven't ported the patch to the arm64 libexynoscamera3.so. I'm out of time today, but I'll look into that tomorrow. No idea how many 64 bit camera apps there are mind you, but completeness is a virtue.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
I just discovered the same issue in play store. I'm looking into it. I think we miss a property. I don't have your lag issues, but if you can send a logcat I can take a look. See th eFAQ.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
I think I know what the problem with the Play Store is. Building new ROM. I can send you the build prop if it is working.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
[MENTION=6039803]BratoMo225[/MENTION] I've fixed it. It would be great if could confirm it.

Attached to this post is a build prop you need to put on the device. If you enable adb root in the Devoloper Options you can push it using:

adb root
adb shell mount -o remount,rw /vendor
adb push build.prop.txt /vendor/build.prop

Then reboot the device. Go to the App Settings of the Play Store -> Storage & Cache -> Clear storage. That should fix it.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
I will upload BETA 0.1
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
I've uploaded BETA0.1.

For S10 and S10+ we are working on upstreaming the in-screen fingerprint reader.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] :
Very nice! If you need details from the the stock ROM @ S10+ leave a message!
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Porcupine1:
[MENTION=4297219]modpunk[/MENTION] Brother i need some advice so in your free time please help. Thank you for everything. I think about rooting my s10e but i got android 10 and march update (waiting for the oficial april) so i need to ask about this rooting method is it still actual? -> https://topjohnwu.github.io/Magisk/install.html#samsung-system-as-root and after this i can flash twrp by your guaide right? -> https://xdaforums.com/galaxy-s10/sa...covery-twrp-3-3-1-0-s10e-update-2020-t4067765 So sorry for my noob questions but i prefer ask than o my god i brick my device. once again thanks so much
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Keule-Tm:
Word has it that Ivan has access to Sammy's developer toolkit for building drivers etc, which is why he a) includes the vbmeta.img in his zip, and b) isn't allowed to open the sources for it.

I've never read that from him, but others mentioned it. It would be great of course if both projects joined forces.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
You know that vbmeta image is a verfied boot image. It comes with signed signatures to verify that the images haven't been altered. If he would ship a valid vbmeta, you wouldn't be able to flash TWRP nor gapps!

I don't know the reason why Ivan doesn't want to share his source code. It is possible that he doesn't want that people come take his source code and build ****ty Android ROM number X. Yes, this will happen with our source code, but hey that's Android, it's open source the bad way not the GPL way :(

I'm building the ROM in the first place for me and [MENTION=4063475]derf elot[/MENTION] as I want a stable and secure Android I can trust. We both moved from Sony XZ1 Compact to the S10e so we can still work together.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
Why do you need root? I think we can provide a boot.img with magisk, however we probably need to find building it in a clean way.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] angela5246:
Glad the you both moved. Once this is stable - do you consider getting it an official LOS build?
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Porcupine1:
Thank you for your time bro. I need root only for one thing = Adaway with multiple blocking hosts.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
Firefox -> uBlock Origin?
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Porcupine1:
Better better, because now i see Netguard in paid version has place for blocking host by url and also block access for internet for apps so yay. Now I need only twrp so i just need to do step by step by your quaide and i will be in home. Thanks for your work with Lineage and I hope soon or later your builds will be official. Thank you so so much friend
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Keule-Tm:
I've got some apps which I'd like to access my home network but nothing else. Some other apps need access to the internet, but please not my home network, thanks. So I need a full-blown firewall solution; I settled for AFWall, which needs root access.

Furthermore, I'd like to block adds for apps with internet access (not only browser).

TL;DR: my whole setup is based on root access. A ROM without it wouldn't tick all boxes, as secure as it might be otherwise. So yes, I would use this one only with Magisk (which should be the easiest solution).

Edit: fixed quote.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
We discussed a solution but it will take a few days till we have a new kernel ready.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Keule-Tm:
Take the time you need. No pressure, my device runs on Ivan's ROM for the time being. When you're ready I'll reconsider.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] jean_michmich:
No I didn't perform a format data as far as i remember So let's say it's my fault :)

Because of this issue i came back to Ivan Meler's version....And below are my comments :

1/

I repeat that MIRACAST is not working.

2/

When I try to use me smartphone as a 3G Access Point through USB...it crashes. Maybe i'm the only one. Try on your side

3/

And last but not least for me :

If someone steal your smartphone, the probability the thief is IT ignorant is huge and he will not know how to reboot or hard reset the smartphone (the buttons combo is not trivial)

But the probability, he tries to mute the phone or to shut it down is huge....Normal behavior of a thief i would say.

It would be good if when the screen is locked :

- No Possibility to decrease the volume : You can still call your phone and try to hear the ringbell (in case the thief is still near you)

- No Access to the QuickStatus toolbar : No possibility to switch Off Data, No possibility to switch to Airplane mode (Otherwise all apps "locate/find my phone" are useless)

- No Access to the Power-Off menu (Otherwise all apps "locate/find my phone" are useless)

Unlocking the phone should be first needed for these actions.

If you take a look at spezi77 for Pixel 1, it was done quite well (except for Volume AFAIK)

The Samsung layer also well manage it.

To my opinion this option is a must have.

That's all for me. Goodluck and one day I will be a linux expert even better than you ;)

.....Before leaving, people who don't have access to some applications in the Google Play Store, should use AuroraStore.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Dn7o/:
Thank you both! I am running the LOS17 from ivan on my S10e, but am missing the security features. I will switch to your image for sure.

Also +1 on trying to make this the official LOS project for S10(e). This way "****ty Android ROM" won't be such an issue I guess.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
This is something you should request from LineageOS -> https://gitlab.com/LineageOS/issues/android
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
Would it be straightforward to make the single AOSP light sensor be max(front lux sensor, back lux sensor)?
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
Note there are 3 phones and 3 different versions of libexynoscamera3.so. So I have no idea for which one this patch is.

So looking a the diff the following lines should do the trick:

sed 's#\xf1\xb8\x08\x01\xd1\xe9\x98\x06\x9d\x09\x46\x56#\xf1\xb8\x08\x01\xd1\xe9\x20\x01\x9d\x09\x46\x56#' -i libexynoscamera3.so
sed 's#\xf0\xa4\xec\xda\x98\x07\xb1\xa0\x20\x22\x90\x0b#\xf0\xa4\xec\xda\x20\x01\xb1\xa0\x20\x22\x90\x0b#' -i libexynoscamera3.so
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
I dunno what you mean exactly I can only speak for S10e. For that I just exchanged the sensor so that the calibrated one is used.

https://review.lineageos.org/c/LineageOS/android_hardware_samsung/+/281437
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
The binary diff should be just like a text diff i.e. adaptable to different binaries. I generated the diff by comparing patched binaries for multiple libexynoscamera3.so from multiple Exynos devices. They were all very similar.

You're missing the third replacement there.

Because the first has a branch offset immediately before it, and the second and third a branch offset immediately after it, and both branch offsets are included in your sed script, the entropic chances of missubstitution are low. I'd guard it though by firstly ensuring all three sequences to be replaced exist in the file, and if not, error out.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
I'm looking for a bash friendly solution which doesn't require special tools.

Well we could do a sha1sum on the file, then run sed and check if it changed afterwards.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
bsdiff has a pypi package, if that's any help. Also 'apt install bsdiff' works.

That wouldn't capture if only one of the sed's worked, but not the others. The reason I mentioned doing an explicit check is because sed's exit code is success whether it finds the regex or not. So you do need to explicitly grep or find or whatever each original sequence in turn, otherwise you end up doing a silent partial patch if the shared library ever changed much in the future, which is very hard to debug.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] modpunk:
Searching for the pattern 0xd1e92001 doesn't find anything. In the libexynoscamera3.so from S10e (ctf3)
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ned14:
Can you point me at the URL for all the libexynoscamera3.so editions that you use?

In theory, it should be just a case of a sufficiently flexible regex for sed. Shouldn't be too hard to make.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] raggatip:
Hi everyone,

I'm running the version 2020-06-17 | BETA3 of this ROM. I cannot find Glove Mode and distinctly remember it being on my device whilst on the stock rom. Can anyone advise where it is or confirm that it is missing for me please? Is it missing from the later releases as well?

Thanks in advance..
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Keule-Tm:
Look in [Settings > Display > Extended] and toggle "High touch sensitivity".
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] raggatip:
Within the Display section there's no 'Extended' option. There's 'Advanced' but even within that section there's no 'High Touch Sensitivity'.

That is the area I remember it being within under stock but no such options now. I'm on a Samsung S10e if that makes any difference.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Keule-Tm:
Ah. I'm on Ivan's ROM, here you can find it (obviously it should have been 'Advanced'; my lang ist German, so it reads 'Erweitert', which would translate to both).
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] Lav64:
Having an issue with the search button (ie. bixby button).

(Currently on RC2 with Gapps Nano)

From the buttons menu (Settings > system > buttons) I can get short press action to work only. Long press action will not work for any of the available actions.
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] ctrej:
I could reproduce this issue. Thanks for reporting it!
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] hyperfekt:
Same thing here. This really is a problem, phone is nigh unusable without. Everything else seems to work well for now, great job!
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] charliebigpot:
EDIT: solved - after several wipes (I was using "advanced wipe" and selected everything) I tried with "format data" and got back into the phone.

I made kind of a mess.. I wanted to flash the latest update coming from beta2:

- went into recovery

- read the instructions and saw the bit about the "86400 seconds".

- tried to reboot to system to remove the pin but somehow it just kept on rebooting into recovery.

- wiped everything (dalvik/cache/data/internal storage/system/vendor).

- flashed to the latest TWRP 3.4.0.0.

- booted into TWRP, which btw, still asks for the password to decrypt (which is the old pin).

- Flashed the latest rom.

- Still get the "86400 seconds" error.

Restarting the phone allows me to re-enter the pin code, it's not like I actually have to wait for a day it seems.

What now?
[Samsung Galaxy S10/S10+/S10 5G/E Cross Device Deve] fishnetfancy:
Thank you so much for the work you've put in and this detailed post. Unfortunately, the camera above crashes immediately on my S10+ running RC2. I will work my way through the FAQ and report back if I can find a fix.

Edit: I can't get this camera to work at all. After looking through the FAQ above there were no pointers applicable to my setup. If you have any hints on how to get this to work on RC2 that would be amazing. One thing I am not sure about: is the role of GMSCore. Is this part of the MicroG package included with this ROM? Or could that be the reason why the above GCam crashes?