Project

General

Profile

Issue #1755

GT-N7100 sensors don't work

Added by CyberLeo Kitsana about 4 years ago. Updated 3 months ago.

Status:
Feedback
Priority:
Normal
Category:
Sensors
Target version:
Start date:
10/03/2016
Due date:
% Done:

0%

Estimated time:
Resolution:
Device:
Galaxy Note 2 (N7100)
Grant:

Description

Running Replicant version 4.2.0004

The screen does not rotate when the phone is tipped, even with auto screen rotation enabled.
While in a call, the screen does not turn off/go numb when held to face, which leads to unfortunate cheek-dialing or hangups.
SatStat shows no readings for all sensors.

The sensors worked properly on the stock firmware that shipped with the phone.

Probably the same as http://redmine.replicant.us/issues/1167 but that one is closed.

Thanks!


Files

dmesg.log (127 KB) dmesg.log Output of adb shell dmesg after fresh boot CyberLeo Kitsana, 10/03/2016 11:42 AM
SatStat.png (43.6 KB) SatStat.png Screenshot of SatStat app showing no sensor readings CyberLeo Kitsana, 10/03/2016 11:42 AM
dmesg.new (130 KB) dmesg.new Output of adb shell dmesg after fresh boot with sensors functional CyberLeo Kitsana, 10/12/2016 10:40 PM
4.2-to-6.0-dmesg (122 KB) 4.2-to-6.0-dmesg From Replicant 4.2 to Replicant 6.0 (broken) CyberLeo Kitsana, 04/15/2017 06:12 AM
4.4-to-6.0-dmesg (122 KB) 4.4-to-6.0-dmesg From stock Samsung firmware to Replicant 6.0 (works) CyberLeo Kitsana, 04/15/2017 06:12 AM

Related issues

Related to Replicant - Issue #1167: Samsung Galaxy Note 2 N7100 - Screen rotation not workingClosed01/06/2015

Actions
#1

Updated by CyberLeo Kitsana about 4 years ago

Oh yeah: the screen brightness also doesn't respond to ambient brightness; but I don't use that feature, so I didn't notice right away.

#2

Updated by CyberLeo Kitsana about 4 years ago

Flashed CyanogenMod 10.1.3 to gather more information on this bug, and it fixed the problem.

This is in dmesg when the sensors don't work:

<6>[    2.049180] c3 [SSP] ssp_load_fw_bootmode
<6>[    2.049204] c3 [SSP] ssp_load_fw start!!!

This is in dmesg when the sensors do:

<6>[    1.996943] c0 [SSP] MPU Firm Rev. : Old =    92800, New =    92800
<6>[    1.997255] c0 [SSP] MCU device ID = 85, reading ID = 85
<6>[    1.997292] c0 [SSP] Sensor Posision A : 7, G : 7, M: 7, P: 0
<6>[    1.998614] c0 [SSP] FUSE ROM Data 157 , 159, 151
<6>[    2.004517] c1 input: accelerometer_sensor as /devices/virtual/input/input4
<6>[    2.005061] c1 input: gyro_sensor as /devices/virtual/input/input5
<6>[    2.005531] c1 input: pressure_sensor as /devices/virtual/input/input6
<6>[    2.006023] c1 input: light_sensor as /devices/virtual/input/input7
<6>[    2.006504] c1 input: proximity_sensor as /devices/virtual/input/input8
<6>[    2.006999] c1 [SSP]: requesting IRQ 352
<6>[    2.009829] c1 input: Unspecified device as /devices/virtual/input/input9
<6>[    2.010356] c1 wake enabled for irq 352
<6>[    2.010381] c1 [SSP]: ssp_probe - probe success!

I can 'break' the sensors again by booting the original Marshmallow kernel that came with the phone.

Since the kernel doesn't even expose the sensors when they're 'broken', and simply booting a working kernel is enough to bring them back, I suspect something in the Replicant kernel is unable to properly update the SSP device.

#3

Updated by Wolfgang Wiedmeyer over 3 years ago

Actually this is the relevant part where the firmware loading fails in Replicant:

<3>[   62.560658] c3 [SSP]: load_fw_bootmode - Unable to open firmware ssp.fw
<6>[   62.560734] c2 failed to copy MFC F/W during init
<6>[   65.355064] c0 pet_watchdog_timer_fn kicking...b86f
<3>[   66.563186] c3 [SSP]: waiting_wakeup_mcu - MCU Wakeup Timeout!!
<3>[   66.563311] c0 [SSP]: ssp_i2c_read - i2c transfer error -6! retry...
<3>[   66.573431] c0 [SSP]: ssp_i2c_read - i2c transfer error -6! retry...
<3>[   66.583534] c0 [SSP]: ssp_i2c_read - i2c transfer error -6! retry...
<3>[   66.593554] c0 [SSP]: get_firmware_rev - i2c fail -1
<6>[   66.593583] c0 [SSP] MPU Firm Rev. : Old =    99999, New =    92800
<3>[   67.591721] c0 [SSP]: waiting_wakeup_mcu - MCU Wakeup Timeout!!
<6>[   67.591839] c0 [SSP] MCU device ID = 85, reading ID = -6
<3>[   67.591870] c0 [SSP]: initialize_mcu - MCU is not working : 0xfffffffa
<3>[   67.591904] c0 [SSP]: ssp_probe - initialize_mcu failed
<3>[   67.591934] c0 [SSP]: ssp_probe - probe failed!

CyberLeo Kitsana wrote:

I can 'break' the sensors again by booting the original Marshmallow kernel that came with the phone.

Was there a Marshmallow update for the n7100? I thought KitKat was the last version released for the device by Samsung.

#4

Updated by CyberLeo Kitsana over 3 years ago

You're right. I just checked the firmware backup I made before flashing to Replicant and build.prop says it is 4.4.2.

#5

Updated by Wolfgang Wiedmeyer over 3 years ago

For Replicant 6.0, I updated the kernel drivers which should solve this issue.
You can test it with the images from this post to the mailing list:
http://lists.osuosl.org/pipermail/replicant/Week-of-Mon-20170227/001199.html

#6

Updated by Wolfgang Wiedmeyer over 3 years ago

  • Category set to Sensors
  • Status changed from New to Feedback
#7

Updated by Wolfgang Wiedmeyer over 3 years ago

  • Assignee set to CyberLeo Kitsana
#8

Updated by CyberLeo Kitsana over 3 years ago

Got a chance to try the new build this weekend. Not quite ready for primetime (hardware face button didn't work at all), but I was able to confirm that moving from the stock Samsung firmware to Replicant 6.0 did indeed work; whereas moving from Replicant 4.2 to Replicant 6.0 did not. Likewise for vice versa: going from Replicant 6.0 with working sensors to Replicant 4.2 broke the sensors again, but booting a CM10 kernel once restored functionality for Replicant 4.2.

dmesg dumps attached for Replicant kernels; nothing for CM or stock kernels, as the kernel message log is restricted on production builds.

#9

Updated by Wolfgang Wiedmeyer over 3 years ago

  • Target version set to Replicant 6.0

Did you do a factory reset before moving from Replicant 4.2 to Replicant 6.0? Looks like when going from Replicant 4.2 to Replicant 6.0, a firmware update mode is triggered and the firmware can't be found. I guess this is expected as the firmware is not available in the update folder on Replicant. Maybe the issue can be fixed if the update mode is disabled in the driver. The only question is if the newer drivers would then work with the older firmware.

It is expected that going from Replicant 6.0 to Replicant 4.2 doesn't work as the older drivers can't handle the newer firmware.

Although it is not really part of the issue, why do you think it's "not quite ready for primetime" and what is the "hardware face button"?

#10

Updated by CyberLeo Kitsana over 3 years ago

Yes, I wiped the phone completely (boot/system/cache/dalvik/data) when installing Replicant 6.0. Since merely booting the proprietary kernel (without a valid system partition) makes the sensors work, I suspect the firmware may actually be in the initramfs for the kernel rather than the system partition as with all the other firmwares (wifi, etc). My main test was whether going from stock Samsung to Replicant 6.0 would work properly, and it appears to go smoothly without having to boot alternate kernels to get the firmware update in there.

Going from Replicant 6.0 to Replicant 4.2 was just a confirmation that everything still acts as detailed in this bug when I restored my most recent backup.

As for primetime, I can be more detailed in a separate bug after I have had time to play with it more. My initial fifteen-minute impression was that almost everything worked, but there were a few app crashes (that I will grab stacktraces for as soon as I have more time) and that the physical clicky button on the front bottom center of the device does not have any effect. On Replicant 4.2, a short press returns the phone to the 'home' screen and a long press brings up a list of the previous apps for switching or closing. On Replicant 6.0, a short press does absolutely nothing and a long press just makes the phone buzz a little bit. A different proprietary Marshmallow phone to which I have access lacks the hardware button, but shows icons on the bottom of the screen instead that perform these functions, so I have no reason to believe these functions have been removed.

Thanks!

#11

Updated by CyberLeo Kitsana about 3 years ago

I finally got a chance to try this again. With the 6.0 0002 build on a factory reset phone, everything works well except for the sensors. It looks like the stock firmware has SSP MCU firmware revision 123106, which is subtly incompatible with the 123109 version expected in Replicant 6.0.

I was able to pull ssp.fw and ssp_crashed.fw from the upstream source drop and place them temporarily into /system/etc/firmware/, and after two full reboots the problem is fixed and the files could be removed. All other features work well.

#12

Updated by Kurtis Hanna about 1 year ago

  • Related to Issue #1167: Samsung Galaxy Note 2 N7100 - Screen rotation not working added
#13

Updated by Kurtis Hanna 10 months ago

Some documentation about a likely fix was written on the n7100 installation page here: https://redmine.replicant.us/projects/replicant/wiki/GalaxyNote2N7100Installation#Sensor-issues

CyberLeo's solution directly above is likely a better fix so we should keep this issue open until we document a more elegent solution.

#14

Updated by Kurtis Hanna 3 months ago

Since ssp.fw and ssp_crashed.fw are nonfree software, Replicant can't redistribute them, so CyberLeo Kitsana's solution doesn't seem to be one that our project can officially support in our documentation.

As CyberLeo Kitsana mentioned, they do seem to be available in LineageOS' android_kernel_samsung_smdk4412 firmware repo.

"Since these firmwares are non-free software, we do not recommend using them nor do we distribute them." https://redmine.replicant.us/projects/replicant/wiki/GalaxyNote2N7100LoadedFirmwares

However, the Note II sensors coprocessor, which is the AT32UC3L0128 chip on the device's logic board, already stores these proprietary firmware files in the AT32UC3L0128 chips' memory. Due to this, I believe that the FSF considers these two firmwares to be hardware instead of software.

These firmware files are only requested if the firmware version in the AT32UC3L0128 memory (probably flash) doesn't match the version number coded into the kernel. See drivers/sensorhub/stm/ssp_firmware.c

My assumption is that we should educate users on how to find out if they are using the most up to date firmware in our installation instructions before they flash Replicant. If they aren't, we should instruct them on how to upgrade to the most up-to-date firmware version before installing Replicant in order to prevent this bug from continuing to occur. A method is outlined in "this depreciated wiki" on how to update to the most up to date firmware by downloading the most up to date stock Android Note II Rom here: https://redmine.replicant.us/projects/replicant/wiki/GalaxyNote2N7100Installation#Sensor-issues This method seems to be a bit of a heavy burden on users since they have to download quite a large file and is not free software.

This same issue has been confirmed to occur on both the i317 and t889 versions of the Note II as well as the n7100. It is assumed that it can occur on the n7105 as well as all other Note II versions out there.

Also available in: Atom PDF