[Q] NFC problems in CM12-based mods with klte/g900f - Galaxy S 5 Q&A, Help & Troubleshooting

Hi,
the mod threads for the various cm12 builds claim that NFC is working, and there are also several user replies with reports that it works fine. Yet it doesn't work correctly for me, and at least some others: The device reports that NFC is working, I can activate and deactivate it, but accessing cards only works partially or not at all. The funny thing is that after flashing cm12, restoring an old cm11 nandroid backup does not restore NFC functionality. It doesn't matter if I do a clean install/full wipe. With Lollipop TW roms (I've tried XtreStoLite), NFC works fine.
I'll try to keep this top post up to date. Last update: 2015/03/15
We've found the issue that caused the major part of the problems. A configuration file must be adapted to the latest firmware. (update.zip version) This fix has been accepted upstream and is included in nightlies starting from 20150316.
There are cards/tags that still don't work, but do with stock, though. I've tested:
German eID (works)
Mifare Ultralight (works)
Beam (works)
EMV (works)
Mifare Classic (e.g. German "Mensacard", membership card from gym / McFit, ..) does not work. See below for debug output of libncf-nci.

Hi there,
I have exactly the same problem. NFC doesn't work for me neither. My device is a G900F from Germany, bought via Amazon using Euphoria OS which is based on CM12.
Ah, and just to get that straight, european G900F is klte without any other letters, right?

This post is obsolete: The problem is very likely not kernel-driver related.
I investigated a bit if the Kernel could be the problem. For this, I took the amplitude_rw kernel (based on Samsung's, but available from github) and Ktoonsez's version of the CM12 kernel . Both use the same version of the pn547 driver. The nfc-nci driver differs, but it doesn't make any difference if I copy the files over from the Samsung-based version and recompile. (The driver is disabled in the CM kernel by default anyway, I tried to enable it, of course. If I additionaly copy the related .so files from the Samsung rom that doesn't change anything either.) Continuing to investigate the differences, I noticed that the other difference is that the CM kernel has a hack that prevents the bcm2079x from being loaded on non-900P/I variants. I removed that line and noticed that the probe function of the driver did not complain that the device was missing, though from the looks of the code it would if it wasn't there. With that in mind, I tried to copy the bcm2079x firmware, configuration and .so files from a CM12 sprint build, but that didn't resolve the problem either.
More info: I've also compiled Ktoonsez's kernel with NFC_DEBUG set, and enabled the dynamic debug output for the driver. Doesn't look helpful to me, but for the sake of completeness:
Code:
<7>[ 967.651230] pn547_dev_open : 10,60
<6>[ 967.662071] pn547_dev_ioctl power on, irq=1
<6>[ 967.762268] pn547_dev_ioctl power off, irq=0
<6>[ 967.884563] pn547_dev_ioctl power on, irq=1
<6>[ 967.887970] pn547 : + w
<7>[ 967.888021] pn547_dev_write : writing 4 bytes.
<6>[ 967.889048] pn547 : - w
<7>[ 967.889159] pn547_dev_read : reading 3 bytes. irq=0
<6>[ 967.889218] pn547 : + r
<6>[ 967.889264] pn547: wait_event_interruptible : in
<6>[ 967.918905] pn547 : call
<6>[ 967.919127] pn547 : h
<6>[ 967.919655] pn547: i2c_master_recv
<7>[ 967.919741] pn547_dev_read : reading 3 bytes. irq=1
<6>[ 967.919793] pn547 : + r
<6>[ 967.920168] pn547: i2c_master_recv
<6>[ 967.921893] pn547 : + w
<7>[ 967.921938] pn547_dev_write : writing 3 bytes.
<6>[ 967.922314] pn547 : - w
<6>[ 967.922474] pn547 : call
<7>[ 967.922664] pn547_dev_read : reading 3 bytes. irq=1
<6>[ 967.922709] pn547 : + r
<6>[ 967.923138] pn547: i2c_master_recv
.. etc ..
<6>[ 998.860380] pn547: i2c_master_recv
<6>[ 998.873274] pn547_dev_ioctl power off, irq=0
During the log, I've had an NFC test application open and an NFC tag close to the device.
Last, I tried to check what's the problem with copying Samsung's files. If I use their NfcNci.adb, logcat throws
Code:
E/AndroidRuntime( 2655): FATAL EXCEPTION: main
E/AndroidRuntime( 2655): Process: com.android.nfc, PID: 2655
E/AndroidRuntime( 2655): java.lang.NoSuchMethodError: No static method isProductShip()I in class Landroid/os/Debug; or its super classes (declaration of 'android.os.Debug' appears in /system/framework/framework.jar)
E/AndroidRuntime( 2655): at com.android.nfc.NfcService.<clinit>(NfcService.java:164)
E/AndroidRuntime( 2655): at com.android.nfc.NfcApplication.onCreate(NfcApplication.java:61)
E/AndroidRuntime( 2655): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
E/AndroidRuntime( 2655): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
E/AndroidRuntime( 2655): at android.app.ActivityThread.access$1600(ActivityThread.java:147)
E/AndroidRuntime( 2655): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
E/AndroidRuntime( 2655): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 2655): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 2655): at android.app.ActivityThread.main(ActivityThread.java:5256)
E/AndroidRuntime( 2655): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 2655): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 2655): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
E/AndroidRuntime( 2655): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)

After doing some more digging, I discovered that running
Code:
setprop nfc.nxp_log_level_global 3
as root enables tons of debug messages.
Maybe it's the firmware
Obsolete: This is unlikely. Its only Mifare cards that don't work, and the protocols are, as far as I can see, implemented in the userland library.
I noticed that after enabling NFC, one of the logcat outputs is
Code:
D/NxpHal ( 1081): FW version for FW file = 0x118
D/NxpHal ( 1081): FW version from device = 0x8011f
D/NxpHal ( 1081): FW image older than device's, skip update
Maybe this helps. (Could anyone with working NFC check which FW their device has? Should work the same way: Run setprop.. as root, enable NFC, search logcat output for the FW info, then reset the log level to 0.)
Mifare cards
I further noticed that holding a Mifare card near the antenna does trigger a reaction:
Code:
D/NxpTml ( 2317): PN547 - I2C Read successful.....
D/NxpNciR ( 2317): len = 23 > 61051401808000FF010904000454566739010800000000
D/NxpTml ( 2317): PN547 - Posting read message.....
D/NxpHal ( 2317): read successful status = 0x0
D/NxpHal ( 2317): NxpNci: RF Interface = MIFARE
D/NxpHal ( 2317): NxpNci: Protocol = MIFARE
D/NxpHal ( 2317): NxpNci: Mode = A Passive Poll
D/NxpExtns( 2317): const CNfcParam* CNfcConfig::find(const char*) const found MIFARE_READER_ENABLE=(0x1)
D/NxpTml ( 2317): PN547 - Write requested.....
D/NxpTml ( 2317): PN547 - Invoking I2C Write.....
D/NxpTml ( 2317): PN547 - Read requested.....
D/NxpTml ( 2317): PN547 - Invoking I2C Read.....
D/NxpNciX ( 2317): len = 7 > 20020401800100
D/NxpTml ( 2317): PN547 - I2C Write successful.....
D/NxpTml ( 2317): PN547 - Posting Fresh Write message.....
D/NxpTml ( 2317): PN547 - Tml Writer Thread Running................
D/NxpHal ( 2317): write successful status = 0x0
D/NxpTml ( 2317): PN547 - I2C Read successful.....
D/NxpNciR ( 2317): len = 4 > 40020106
D/NxpTml ( 2317): PN547 - Posting read message.....
D/NxpHal ( 2317): read successful status = 0x0
D/NxpHal ( 2317): > Deinit workaround for LLCP set_config 0x0 0x0 0xa
D/NxpHal ( 2317): phNxpNciHal_print_res_status: response status =STATUS_OK
D/NxpTml ( 2317): PN547 - Read requested.....
D/NxpTml ( 2317): PN547 - Invoking I2C Read.....
But nothing ever shows up in an NFC test app and I have to deactivate and reactivate NFC at this point to scan any of the working smartcards. So likely something in the mifare reader code does not work.

No NFC for me either

Running yesterday's nightly 20150310 on klte, no NFC either.

Any news? I have a SM-G900F and am unable to read NFC tags since updating to CM12 (now using 20150313).

My NFC was gone too after I updated to the latest nightly yesterday. It appears that copying the firmware file and configuration from XtreStoLite fixed that, and that I'm back to the situation I described in the top post again now. I'll attach both files (in one archive). They should be placed in the according directories in the /system partition, i.e.
etc/libnfc-nxp.conf -> /system/etc/libnfc-nxp.conf
system/vendor/firmware/libpn547_fw.so -> system/vendor/firmware/libpn547_fw.so
Could you test if copying them & rebooting (partially) restores NFC for you, too? (This should be possible with a file manager like X-Plore) If you don't want to use my archive, download XtreStoLite and extract the same files from their zip. Flashing CM should restore the original files in any case.

FirebirdDE said:
My NFC was gone too after I updated to the latest nightly yesterday. It appears that copying the firmware file and configuration from XtreStoLite fixed that, and that I'm back to the situation I described in the top post again now. I'll attach both files (in one archive). They should be placed in the according directories in the /system partition, i.e.
etc/libnfc-nxp.conf -> /system/etc/libnfc-nxp.conf
system/vendor/firmware/libpn547_fw.so -> system/vendor/firmware/libpn547_fw.so
Could you test if copying them & rebooting (partially) restores NFC for you, too? (This should be possible with a file manager like X-Plore) If you don't want to use my archive, download XtreStoLite and extract the same files from their zip. Flashing CM should restore the original files in any case.
Click to expand...
Click to collapse
Hey, that actually worked! I tried with an NFC reader app, and my nfc tag popped up right away.

So now we're missing only flashable zip
I will try this one and if it will work, I will try my scripting luck
And here it is, enjoy

I believe that it might suffice to update the configuration file. According to the logs, at least on my phone, the firmware file isn't used anyway.

FirebirdDE said:
My NFC was gone too after I updated to the latest nightly yesterday. It appears that copying the firmware file and configuration from XtreStoLite fixed that, and that I'm back to the situation I described in the top post again now. I'll attach both files (in one archive). They should be placed in the according directories in the /system partition, i.e.
etc/libnfc-nxp.conf -> /system/etc/libnfc-nxp.conf
system/vendor/firmware/libpn547_fw.so -> system/vendor/firmware/libpn547_fw.so
Could you test if copying them & rebooting (partially) restores NFC for you, too? (This should be possible with a file manager like X-Plore) If you don't want to use my archive, download XtreStoLite and extract the same files from their zip. Flashing CM should restore the original files in any case.
Click to expand...
Click to collapse
WOHOOOO! Thank you very much. My klte's NFC stopped working after flashing some alpha CM12. Some days ago I flashed cm-12-20150310-NIGHTLY-klte and the NFC problem remained. Now I replaced /etc/libnfc-nxp.conf with the config file you attached and NFC is working again.

Great! I've submitted this upstream, hopefully they'll accept this. It would be good to get feedback from someone who didn't experience any NFC issues in the first place, though, to make sure that this does not break NFC for anyone.

How awesome. NFC is really stable too and I think we have found the fix. I belive that many galaxy s5 CM12 users will be happy

Seems like the fix will be in the next nightly, too.

Still some Problems
Hello,
first at all thanks for your research!
I installed your fix for the NFC (tried both zip and "self" copy) but NFC is not working correct:
* sometimes when enable/disable NFC i get a sound (not allways)
* When i scan a tag (the first time after enabling nfc) i get a sound for scanning, but NFC TagInfo and Tagstand Writer did not recognize the tag.
* Sometimes NFC TagInfo by NXP is working but one one time... (hard to explain, often the scanning works when i open the settings?)
* The Scanning works only once till i deaktivate/active NFC
I used the the fix with cyanogenmod nightly 14-03-2015 and now with the Unofficial build [ROM] CyanogenMod 12.0 | Android 5.0 Lollipop | [03/13/2015]
Also installed the latest Xposed framwork and SELinux "Permissive" ...
Any ideas?
Thanks in advance

Which variant do you have? (I, and afaik all others that reported here, have a g900f)
What kind of NFC tag do you try to scan? (As I've already written in the top post, Mifare Classic does not work.)
The relevant logcat (see a few posts up, I've posted a setprop-command that enables debug output) would also be interesting.
Btw., the only sound I get is for the recognition of a NFC chip and its removal. Enabling/disabling makes no sound whatsoever.

FirebirdDE said:
Which variant do you have? (I, and afaik all others that reported here, have a g900f)
What kind of NFC tag do you try to scan? (As I've already written in the top post, Mifare Classic does not work.)
The relevant logcat (see a few posts up, I've posted a setprop-command that enables debug output) would also be interesting.
Btw., the only sound I get is for the recognition of a NFC chip and its removal. Enabling/disabling makes no sound whatsoever.
Click to expand...
Click to collapse
What i forgot i have G900F
Sometimes i really got sound for enable/disable!?!
Hard to tell you what type of NFC tag i use, bacuse i cannot read them at all.
I tried
* a writable tag from androidbands.com
* a company card
* a skiing card
I will try to logcat later this day....

FirebirdDE said:
Which variant do you have? (I, and afaik all others that reported here, have a g900f)
What kind of NFC tag do you try to scan? (As I've already written in the top post, Mifare Classic does not work.)
The relevant logcat (see a few posts up, I've posted a setprop-command that enables debug output) would also be interesting.
Btw., the only sound I get is for the recognition of a NFC chip and its removal. Enabling/disabling makes no sound whatsoever.
Click to expand...
Click to collapse
Here is a loccat (created with logcat extrem app - currently no adb available for me)
Actions:
Activate NFC // Scann androidbrands.com Tag // Deactivate NFC
Looks like problems with the "libpn547_fw":
Code:
Line 191: D/NxpFwDnld( 447): @@@/system/vendor/firmware/libpn547_fw.so
Line 193: E/NxpFwDnld( 447): NULL handler : unable to load the library file, specify correct path
Line 199: E/NxpFwDnld( 447): Image extraction Failed - invalid imginfo or imginfolen!!
Line 201: E/NxpFwDnld( 447): Error loading libpn547_fw !!
Line 209: E/NxpHal ( 447): Wrong FW Version >>> Firmware download not allowed
The file exists in "/system/vendor/firmware/libpn547_fw.so" with "rw-rw----"

ostauss said:
Here is a loccat (created with logcat extrem app - currently no adb available for me)
Actions:
Activate NFC // Scann androidbrands.com Tag // Deactivate NFC
Looks like problems with the "libpn547_fw":
Code:
Line 191: D/NxpFwDnld( 447): @@@/system/vendor/firmware/libpn547_fw.so
Line 193: E/NxpFwDnld( 447): NULL handler : unable to load the library file, specify correct path
Line 199: E/NxpFwDnld( 447): Image extraction Failed - invalid imginfo or imginfolen!!
Line 201: E/NxpFwDnld( 447): Error loading libpn547_fw !!
Line 209: E/NxpHal ( 447): Wrong FW Version >>> Firmware download not allowed
The file exists in "/system/vendor/firmware/libpn547_fw.so" with "rw-rw----"
Click to expand...
Click to collapse
changed permissions to "rw-rw-r--" looks like lib is correctly loaded, but scanned androidbands.com Tag still not recognized by TagInfo...

Related

[Q] Phone randomly vibrates

Hi!
I have a problem with my phone that it randomly vibrates with no notification what so ever, even after doing a full wipe and flashing new ROM.
Lets start with some info:
GT-i9505
Danvdh Google Play ROM 4.4.4 (Pure nexus version)
GoogyMax3_GE 1.1.6 Kernel
I have Xposed Framwork installed
I have "Show all app that don't respond" in Developer options, still no errors have popped up.
No app which i've seen send vibration without notification when an update occurs.
I've tried to trace the source with logcat but havent really gotten any far.
Using the app aLogcat ROOT i often get the message:
Code:
E/AndroidRuntime(xxxxx): cannot open customer xml file
E/memtrack(same numbers): couldn't load memtrack module (no such file or directory)
E/Android.os.Debug(same numbers): failed to load memtrack module: -2
If i have the logging up and running in the app and then press Home button (Which takes me to Apex Launcher) i often get 2 quick vibrations
If i then start aLogcat ROOT again, i sometimes get another vibration followed by either
Code:
I/DEBUG (26414): Build fingerprint: 'samsung/jgedlteue/jgedlte:4.4.4/KTU84P.S001/140602:user/release-keys
or
Code:
E/LightSensor ( 1010): Light old sensor_state 1, new sensor_state : 1 en : 0
However, it seems most often related to I/DEBUG (26414): Build fingerprint: 'samsung/jgedlteue/jgedlte:4.4.4/KTU84P.S001/140602:user/release-keys
It's kinda getting frustrating and nothing i've Googled have seem to have provided the answer, most answers are something in line of Facebook messenger, repeat notification functions (For example vibration every 5 mins for sms, etc).
It happened more often before i wiped phone, which i then had Danvdh GPE rom, but 4.4.2 version instead, and ktoonez kernel. Apps were mostly same.
Following caused 2 vibrations 2 times:
Code:
I/DEBUG (26830): Build fingerprint: 'samsung/jgedlteue/jgedlte:4.4.4/KTU84P.S001/140602:user/release-keys'
I/DEBUG (26830): Build fingerprint: 'samsung/jgedlteue/jgedlte:4.4.4/KTU84P.S001/140602:user/release-keys'
E/LocSvc_eng( 1010): D/void loc_eng_deferred_action_thread(void*):1627] received msg_id = LOC_ENG_MSG_INJECT_LOCATION context = 0x8012add0
E/LocSvc_adapter( 1010): I/<--- void globalRespCb(locClientHandleType, uint32_t, locClientRespIndUnionType, void*) line 115 QMI_LOC_INJECT_POSITION_REQ_V02
E/LocSvc_api_v02( 1010): D/loc_free_slot:298]: freeing slot 0
E/Watchdog( 1010): [email protected] 194
E/AndroidRuntime(27295): cannot open customer xml file
E/memtrack(27295): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug(27295): failed to load memtrack module: -2
I/DEBUG (26830): Build fingerprint: 'samsung/jgedlteue/jgedlte:4.4.4/KTU84P.S001/140602:user/release-keys'
I/DEBUG (26830): Build fingerprint: 'samsung/jgedlteue/jgedlte:4.4.4/KTU84P.S001/140602:user/release-keys'
E/AndroidRuntime(27396): cannot open customer xml file
E/memtrack(27396): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug(27396): failed to load memtrack module: -2
Does anyone have ANY clue on how to fix this, or what might be causing it.
Anyone have any similar findings?
Thanks in advance
I have same problem!
If I remove Xposed Framework the random vibrations no longer appear, but it is very useful for me!
I opened a thread in Xposed Framework General -> here
Hi, ive got the same problem, random vibration 1 to 3 time, im running on the same
Rom with xposed installed. Anyone know any fix for that? Thank you

[Q] Warning and errors in logcat with HOB7/i9505

Hi!
My logcat is full of lines like the following:
Code:
04-03 11:38:09.692 W/SurfaceFlinger(280): Fail to Open /sys/devices/platform/gpusysfs/fps
04-03 11:38:09.702 E/SMD (19000): smd Interface open failed errno is 2 -1
04-03 11:38:10.442 E/Diag_Lib(20120): Diag_LSM_Init: Failed to open handle to diag driver, error = 2
04-03 11:38:10.452 E/auditd (2317): In denial and Property audit_ondenial is set to 1
04-03 11:38:10.452 W/ContextImpl(873): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1699 com.android.server.SEDenialService$AuditFileObserver.onEvent:76 android.os.FileObserver$ObserverThread.onEvent:122 android.os.FileObserver$ObserverThread.observe:-2 android.os.FileObserver$ObserverThread.run:85
These are being generated continuously, all the time.
Any idea what those might be?
Thank you!
Hi. I'm getting the same on XXUOBH7 5.0.2
No idea what they are, but if your S4 is working properly they aren't something you should be worrying about. Enjoy your phone.
I have these aswell, and the device seems to have poor battery life and poor performance!
OB7 what....?
Problems with custom built ROM belong in respective thread.
Seems like this one is a double post (which is not really appreciated by XDA )
http://forum.xda-developers.com/showthread.php?p=59864728
It's always a good start to be as specific as possible whether it's ROM, kernel or modem OB7 to narrow down the issue.

sensors (acceleration gyroscope orientation etc) issues, nv data dump request

Hello,
i got a D802 phone which apparently has some sensors disabled in some way. When apps try to use them (so the system see them as existent) they fail or crash.
here some example log:
-Orientation:
Code:
W/OrientationEventListener( 957): Cannot detect sensors. Invalid disable
-Calibration:
Code:
E/AndroidRuntime( 7456): java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.Sensor.getType()' on a null object reference
E/AndroidRuntime( 7456): at com.qualcomm.sensors.sensortest.SensorID$SensorTyp e.getSensorType(SensorID.java:61)
E/AndroidRuntime( 7456): at com.android.settings.lge.MotionSensorCalibration$C alThreadRunnable.run(MotionSensorCalibration.java: 228)
E/AndroidRuntime( 7456): at java.lang.Thread.run(Thread.java:818)
-Gravity:
Code:
I/SensorManager(14094): registerListenerImpl() [Sensor: LGE Gravity Sensor, Rate: 200000, SensorEventListener: [email protected]] by com.kfodor.MySensors.SensorView.registerSensorListener():735
D/sensors_hal_SAM( 949): batch:sensor(android.sensor.gravity) handle:29 freq:1 report_rate:1 max:1.000000 min:0.000000
D/sensors_hal_Gravity( 949): enable: handle=29
D/sensors_hal_Gravity( 949): enable: handle=29, freq=1 report_rate=1 batch_rate=0 batched=0 wakeup 0
D/sensors_hal_Gravity( 949): enable: handle=29 synchronous req
I/sensors_hal_SAM( 949): sendEnableReq:sensor(android.sensor.gravity) Sending enable to svc no:20
E/Sensors ( 474): sns_acm_mr.c(776):Request made to disabled service
E/Sensors ( 474): sns_main.c(1331):Error writing request. sns_err 3 error 0 qmi_err 0
E/sensors_hal_Gravity( 949): processResp: Msg 2; Result: 1, Error: 3
D/sensors_hal_Gravity( 949): enable: Received Response: 1
-Acceleration:
Code:
I/sensors_hal_SAM( 949): sendEnableReq:sensor(android.sensor.linear_acceleration) Sending enable to svc no:20
E/Sensors ( 474): sns_acm_mr.c(776):Request made to disabled service
E/Sensors ( 474): sns_main.c(1331):Error writing request. sns_err 3 error 0 qmi_err 0
E/sensors_hal_LinearAccel( 949): processResp: Msg 2; Result: 1, Error: 3
-Rotation:
Code:
I/sensors_hal_SAM( 949): sendEnableReq:sensor(android.sensor.rotation_vector) Sending enable to svc no:18
E/Sensors ( 474): sns_acm_mr.c(776):Request made to disabled service
E/Sensors ( 474): sns_main.c(1331):Error writing request. sns_err 3 error 0 qmi_err 0
E/sensors_hal_RV( 949): processResp: Msg 2; Result: 1, Error: 3
I/SensorManager(14094): removeAllSensors() [Sensor: LGE Rotation Vector Sensor] by com.kfodor.MySensors.SensorView.registerSensorListener():732
I followed a lot of paths to find a solution, different distributions and full revert to all available stock versions. no way.
As my last trial I want to try to compare my NV data with a working one to search for some misconfigured parameter.
I found a great guide on how to access and extract all NV parameters and save to a text file, here:
http://www.droidviews.com/how-to-bac...imei-on-lg-g2/
As you can see, the guide is for changing IMEI, but the application permit to dump all parameters to a file.
I ask some good man to send me his dump. or i can send mine and get the differences. Because this file contains sensitive data, they should be removed (IMEI, S/N, MAC) even if i am not interested in stealing ids!
I have a D802 32GB.
thank you to everyone, hope to receive some useful feedback!.
Fabio T

[Omni 5.1][Nexus 5] Homemade fails to boot; QSEECOM, librpmb.so

After a dealing with selling my house and moving into a new one, I've finally got my build system back together and connected to the Internet. This Ubuntu machine has been successfully building OmniROM 4.x for a couple devices and 5.1 for Nexus 5 for some time, but now I have a puzzle.
The "nightly" version of OmniROM boots and runs fine on the hardware. However, when I try to boot the "homemade" version of 5.1, it fails to get very far in the process. I've already pulled down a fresh repo, installed the factory drivers from https://developers.google.com/android/nexus/drivers (originally 5.1 LMY48B, but now have also tried fresh copies of 5.1 LMY48M) and everything appears to build properly.
Looking at the two logcat outputs, the earliest hints of error seem to be the inability to load a key library
NIGHTLY:
Code:
03-31 16:27:29.726 D/QSEECOMD: ( 179): qseecom listener services process entry PPID = 1
03-31 16:27:29.726 E/QSEECOMD: ( 179): Listener: index = 0, hierarchy = 0
03-31 16:27:29.733 D/QSEECOMD: ( 179): Init dlopen(librpmb.so, RTLD_NOW) succeeds
03-31 16:27:29.733 D/QSEECOMD: ( 179): Init::Init dlsym(g_FSHandle rpmb_init_service) succeeds
HOMEMADE:
Code:
03-31 15:07:02.586 E/QSEECOMD: ( 176): Listener: index = 0, hierarchy = 0
03-31 15:07:02.586 E/QSEECOMD: ( 176): Init dlopen(librpmb.so, RLTD_NOW) is failed....
03-31 15:07:02.586 E/QSEECOMD: ( 176): ERROR: RPMB_INIT failed, shall not start listener services
That stanza, or one very similar is spattered throughout the homemade logcat.
Looking at the homemade version, "find / -name librpmb.so" returns nothing.
For the nightly version, it is found at /system/lib/librpmb.so
I don't see it in the output directory, but it is in the vendor source directory
Code:
[email protected]:~/devel/build/hammerhead-5.1/out/target/product/hammerhead$ find . -name librpmb.so
[email protected]:~/devel/build/hammerhead-5.1/out/target/product/hammerhead$ find $ANDROID_BUILD_TOP/vendor -name librpmb.so
/home/jeff/devel/build/hammerhead-5.1/vendor/qcom/hammerhead/proprietary/librpmb.so
Digging further, vendor/qcom/hammerhead/device-partial.mk does not include librpbm.so (but does, for example, include qseecomd)
I don't see anything in vendor/qcom/hammerhead/ that would copy over librpmb.so
Looking at the installed nightly rom, /system/lib/librpmb.so is there (and has the same md5 as that from the qcom driver distributions)
Has anyone seen this before? Any suggestions on resolution? (other than the obvious, "Well, just edit the qcom device-partial.mk")
I'm sort of stuffed on doing any dev work until I can get a working baseline build again...
Thanks,
Jeff
jeffsf said:
After a dealing with selling my house and moving into a new one, I've finally got my build system back together and connected to the Internet. This Ubuntu machine has been successfully building OmniROM 4.x for a couple devices and 5.1 for Nexus 5 for some time, but now I have a puzzle.
The "nightly" version of OmniROM boots and runs fine on the hardware. However, when I try to boot the "homemade" version of 5.1, it fails to get very far in the process. I've already pulled down a fresh repo, installed the factory drivers from https://developers.google.com/android/nexus/drivers (originally 5.1 LMY48B, but now have also tried fresh copies of 5.1 LMY48M) and everything appears to build properly.
Looking at the two logcat outputs, the earliest hints of error seem to be the inability to load a key library
NIGHTLY:
Code:
03-31 16:27:29.726 D/QSEECOMD: ( 179): qseecom listener services process entry PPID = 1
03-31 16:27:29.726 E/QSEECOMD: ( 179): Listener: index = 0, hierarchy = 0
03-31 16:27:29.733 D/QSEECOMD: ( 179): Init dlopen(librpmb.so, RTLD_NOW) succeeds
03-31 16:27:29.733 D/QSEECOMD: ( 179): Init::Init dlsym(g_FSHandle rpmb_init_service) succeeds
HOMEMADE:
Code:
03-31 15:07:02.586 E/QSEECOMD: ( 176): Listener: index = 0, hierarchy = 0
03-31 15:07:02.586 E/QSEECOMD: ( 176): Init dlopen(librpmb.so, RLTD_NOW) is failed....
03-31 15:07:02.586 E/QSEECOMD: ( 176): ERROR: RPMB_INIT failed, shall not start listener services
That stanza, or one very similar is spattered throughout the homemade logcat.
Looking at the homemade version, "find / -name librpmb.so" returns nothing.
For the nightly version, it is found at /system/lib/librpmb.so
I don't see it in the output directory, but it is in the vendor source directory
Code:
[email protected]:~/devel/build/hammerhead-5.1/out/target/product/hammerhead$ find . -name librpmb.so
[email protected]:~/devel/build/hammerhead-5.1/out/target/product/hammerhead$ find $ANDROID_BUILD_TOP/vendor -name librpmb.so
/home/jeff/devel/build/hammerhead-5.1/vendor/qcom/hammerhead/proprietary/librpmb.so
Digging further, vendor/qcom/hammerhead/device-partial.mk does not include librpbm.so (but does, for example, include qseecomd)
I don't see anything in vendor/qcom/hammerhead/ that would copy over librpmb.so
Looking at the installed nightly rom, /system/lib/librpmb.so is there (and has the same md5 as that from the qcom driver distributions)
Has anyone seen this before? Any suggestions on resolution? (other than the obvious, "Well, just edit the qcom device-partial.mk")
I'm sort of stuffed on doing any dev work until I can get a working baseline build again...
Thanks,
Jeff
Click to expand...
Click to collapse
Weird. I still haven't gotten completely back from vacation (have a friend visiting now) so I haven't built Omni in a while...
I'll try to build it when they leave, not sure when that will be though.
@XpLoDWilD and @maxwen - Could this potentially be one of those weird messes where our source trees have an issue but the build server hasn't properly synced? This wouldn't be the first time we've had a "why the hell didn't this break months ago" issues like some issues @Jakew02 had last winter.
More digging reveals that between 5.0 (LRX21O) and 5.1.1 (LMY48M) the following files appear to be added (all in 5.1.0 LMY47D aka 1743759):
vendor/qcom/hammerhead/proprietary/librpmb.so
vendor/qcom/hammerhead/proprietary/libssd.so
vendor/qcom/hammerhead/proprietary/qmi_fw.conf​
On the other hand, vendor/qcom/hammerhead/device-partial.mk has apparently not changed since at least LRX21O
fgrep suggests that libssd.so is referenced in qseecomd (as is librpmb.so)
jeffsf said:
More digging reveals that between 5.0 (LRX21O) and 5.1.1 (LMY48M) the following files appear to be added (all in 5.1.0 LMY47D aka 1743759):
vendor/qcom/hammerhead/proprietary/librpmb.so
vendor/qcom/hammerhead/proprietary/libssd.so
vendor/qcom/hammerhead/proprietary/qmi_fw.conf​
On the other hand, vendor/qcom/hammerhead/device-partial.mk has apparently not changed since at least LRX21O
fgrep suggests that libssd.so is referenced in qseecomd (as is librpmb.so)
Click to expand...
Click to collapse
Better use the DonkeyCoyote repo, at least this is what Jenkins does afaik: https://github.com/DonkeyCoyote/proprietary_vendor_lge/tree/android-5.1/hammerhead
golden-guy said:
Better use the DonkeyCoyote repo, at least this is what Jenkins does afaik: https://github.com/DonkeyCoyote/proprietary_vendor_lge/tree/android-5.1/hammerhead
Click to expand...
Click to collapse
Didn't realize he wasn't... librpmb was added with https://github.com/DonkeyCoyote/pro...mmit/1a71e5c4d257c4883e1dea461fd893df13e0413c
AOSP's official binary blob distros often are missing stuff that is necessary for some capabilities and CAN be found in the factory images.
We don't mention DC in any official documentation for legal liability reasons... We probably need to update the extract-files scripts for ALL of our devices...

[Guide]Enable Adopted Sdcard In any CM based roms

Want adopted sd enabled in the latest cm based custom rom for our dear moto e
Here is a temporary workaround
Firstly this was done by making use of a guide found in ashwin007's thread called
[ROM][OFFICIAL][condor] CyanogenMod 13 for Moto E 2014
Page 134 by millerscout.
In that guide youll find 11 steps to follow.
Now you'll just have to make small changes to two of the steps
Step 2. Change to whatever MM CM based rom you want and
Step 10. to the MM CM based rom you have chosen.
Now I usually keep these things to myself but for some time now I've noticed a lot of persons keep asking in the threads if adopted sd card is working. C'mon guys Its annoying. Despite the answers being yes at times its only after I've wiped my phone and install the latest rom I find out that adopted sd card is not working and corrupts my sd card. The guide by millerscout is a simple workaround I found for this small problem and with my added input it could work with other cm based marshmallow roms. Ive never tried it with AOSP or any other marshmallow based roms only CM.
That's it now enjoy the latest mm cm based roms with adopted sd until it as been officially fixed by ashwin007 :highfive:
Disclaimer: The instructions are pretty straightforward. Read and follow the instructions to reap your reward. With that said I will not be responsible for any fumes leaking from your phone
I could testify it
Just done it yesterday, using cm13 20160113 instead of temasek unoficial build
1. Factory reset using twrp
2. Clean flash cm13 20160113 and gapps
3. Wipe cache n dalvik cache, don't know if it is necessary, it just habits
4. Reboot system, finish setup wizard, set up sdcard as internal
5. Reboot to twrp
6. Flash newest cm13 build, i use 20160224 yesterday
7. Wipa cache n dalvik cache
8. Reboot system, sdcard as internal still working fine
I heard that aospb n orionos has sdcard as internal worked too
Thanks to @ehrans and @millerscout for the tricks
didnt worked for me with ressurection
any other way i can use..??really frustrated with the storage running out msg
I've Successfully formatted my sd card as internal but having a serious problem..when i connect my phone to the computer, it doesn't show my sd card for transfering the backup files to my phone.. what to do now ?? Any help Guyss ??
Edit : I've restarted my phone also but still doesn't helped..
Hello everyone. I've been hearing a lot of users reporting issues with adopted SD on condor. It worls fine on otus, so it is evidently a condor specific issue. I don't yet have the device, so I can't test and debug the issue myself at the moment. However, if someone coulld share logs of trying to format the SD card as internal on the latest nightly, that would be helpful. In particular, I want to see the logcat and dmesg output during the SD card formatting process.
A few word of advice on capturing logs: It's usually more helpful to capture a log of just doing the action of interest rather than providing a log from bootup till an hour after reproducing the issue. The way I usually do this on Linux or Mac is to start adb logcat on a shell, let it spew out everything, then clear the terminal, do the action of interest, let it complete, then hit Ctrl-C to stop logcat. Then copy paste the terminal contents into a file. For dmesg, just copy paste the last n secomds showing the relevant operation.
squid2 said:
Hello everyone. I've been hearing a lot of users reporting issues with adopted SD on condor. It worls fine on otus, so it is evidently a condor specific issue. I don't yet have the device, so I can't test and debug the issue myself at the moment. However, if someone coulld share logs of trying to format the SD card as internal on the latest nightly, that would be helpful. In particular, I want to see the logcat and dmesg output during the SD card formatting process.
A few word of advice on capturing logs: It's usually more helpful to capture a log of just doing the action of interest rather than providing a log from bootup till an hour after reproducing the issue. The way I usually do this on Linux or Mac is to start adb logcat on a shell, let it spew out everything, then clear the terminal, do the action of interest, let it complete, then hit Ctrl-C to stop logcat. Then copy paste the terminal contents into a file. For dmesg, just copy paste the last n secomds showing the relevant operation.
Click to expand...
Click to collapse
please find attached dmesg.txt
Ansh2000 said:
please find attached dmesg.txt
Click to expand...
Click to collapse
Thanks for the log. The associated logcat would also be helpful, but from what I see in the dmesg, a couple things jumped out to me.
It looks like the f2fs formatting utility (mkfs.f2fs) crashes, and subsequent attempts crash further:
Code:
[ 2413.240089,0] mmcblk1: p1
[ 2414.518112,1] mmcblk1: p1 p2
[ 2414.969437,1] Core dump to |/system/bin/coredump mkfs.f2fs 8800 1457156718 pipe failed
...
[ 2462.808252,1] mmcblk1: unknown partition table
[ 2464.031938,0] mmcblk1: p1 p2
[ 2464.556586,0] Core dump to |/system/bin/coredump mkfs.f2fs 8996 1457156767 pipe failed
The big question would be why it crashes. The logcat may give more hints as to this. One thing I did notice is that there are an awful lot of untrusted_app selinux denials. One should usually not grant additional permission to untrusted_app. However, I'm curious if SELinux is causing issues for you. One thing worth trying would be to make selinux permissive (run "setenforce 0" as root) before trying to format the card. If that makes formatting work, then we'd know for sure that it's an SELinux related issue. However, this is just a wild guess, and the issue may be something completely unrelated.
squid2 said:
Thanks for the log. The associated logcat would also be helpful, but from what I see in the dmesg, a couple things jumped out to me.
It looks like the f2fs formatting utility (mkfs.f2fs) crashes, and subsequent attempts crash further:
Code:
[ 2413.240089,0] mmcblk1: p1
[ 2414.518112,1] mmcblk1: p1 p2
[ 2414.969437,1] Core dump to |/system/bin/coredump mkfs.f2fs 8800 1457156718 pipe failed
...
[ 2462.808252,1] mmcblk1: unknown partition table
[ 2464.031938,0] mmcblk1: p1 p2
[ 2464.556586,0] Core dump to |/system/bin/coredump mkfs.f2fs 8996 1457156767 pipe failed
The big question would be why it crashes. The logcat may give more hints as to this. One thing I did notice is that there are an awful lot of untrusted_app selinux denials. One should usually not grant additional permission to untrusted_app. However, I'm curious if SELinux is causing issues for you. One thing worth trying would be to make selinux permissive (run "setenforce 0" as root) before trying to format the card. If that makes formatting work, then we'd know for sure that it's an SELinux related issue. However, this is just a wild guess, and the issue may be something completely unrelated.
Click to expand...
Click to collapse
logcat
@squid2 http://forum.cyanogenmod.org/topic/...-sd-as-internal-storage-then-says-sd-corrupt/
does this seems legit? and if it would works (it works acc. to users in cm12.1 forum) how to execute it?
see the post made by socram8888
can anyone confirm at all if running the command "mkfs.f2fs /dev/block/dm-0" in terminal emulator would do the job? without having to format card using january nightly
booo159159 said:
@squid2 http://forum.cyanogenmod.org/topic/...-sd-as-internal-storage-then-says-sd-corrupt/
does this seems legit? and if it would works (it works acc. to users in cm12.1 forum) how to execute it?
see the post made by socram8888
can anyone confirm at all if running the command "mkfs.f2fs /dev/block/dm-0" in terminal emulator would do the job? without having to format card using january nightly
Click to expand...
Click to collapse
The mkfs.f2fs /dev/block/dm-0 is the command that is failing when trying to format through the wizard. Maybe it works properly when invoked manually. It's worth a try. Let me know what happens when you try it. Be sure to run it as root.
@Ansh2000 Thanks for the logcat. The relevant problem that repeats in the logcat is this crash in mkfs.f2fs:
Code:
03-05 12:09:15.017 192 200 D vold : Resolved auto to f2fs
03-05 12:09:15.017 192 200 V vold : /system/bin/mkfs.f2fs
03-05 12:09:15.017 192 200 V vold : /dev/block/dm-0
--------- beginning of crash
03-05 12:09:15.121 6320 6320 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x6 in tid 6320 (mkfs.f2fs)
03-05 12:09:15.122 231 231 I DEBUG : property debug.db.uid not set; NOT waiting for gdb.
03-05 12:09:15.122 231 231 I DEBUG : HINT: adb shell setprop debug.db.uid 100000
03-05 12:09:15.122 231 231 I DEBUG : HINT: adb forward tcp:5039 tcp:5039
03-05 12:09:15.206 231 231 I SELinux : SELinux: Loaded file_contexts contexts from /file_contexts.
03-05 12:09:15.209 706 1108 W NativeCrashListener: Couldn't find ProcessRecord for pid 6320
03-05 12:09:15.210 231 231 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-05 12:09:15.210 231 231 E DEBUG : AM write failed: Broken pipe
03-05 12:09:15.210 231 231 F DEBUG : Build fingerprint: 'motorola/condor_retaildsds/condor_umtsds:5.1/LPC23.13-34.8/12:user/release-keys'
03-05 12:09:15.210 231 231 F DEBUG : Revision: '0'
03-05 12:09:15.210 231 231 F DEBUG : ABI: 'arm'
03-05 12:09:15.210 231 231 F DEBUG : pid: 6320, tid: 6320, name: mkfs.f2fs >>> /system/bin/mkfs.f2fs <<<
03-05 12:09:15.210 231 231 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6
03-05 12:09:15.221 231 231 F DEBUG : r0 b6d2e1c0 r1 00000006 r2 b7b770c8 r3 b7b770d8
03-05 12:09:15.222 231 231 F DEBUG : r4 b6d2e1c0 r5 b6d2e1c0 r6 b7b770c8 r7 00000000
03-05 12:09:15.222 231 231 F DEBUG : r8 00000036 r9 b6f4fff4 sl b6f001a4 fp 00000006
03-05 12:09:15.222 231 231 F DEBUG : ip 00000000 sp bea446c0 lr 000007c0 pc b6ef3368 cpsr 60070030
03-05 12:09:15.236 231 231 F DEBUG :
03-05 12:09:15.236 231 231 F DEBUG : backtrace:
03-05 12:09:15.237 231 231 F DEBUG : #00 pc 00001368 /system/lib/libf2fs.so (utf8_to_utf16+31)
03-05 12:09:15.237 231 231 F DEBUG : #01 pc 0000f843 /system/lib/libutils.so
03-05 12:09:15.237 231 231 F DEBUG : #02 pc 0000f897 /system/lib/libutils.so (android::String16::String16(char const*)+22)
03-05 12:09:15.237 231 231 F DEBUG : #03 pc 0001fa41 /system/lib/libbinder.so
03-05 12:09:15.341 231 231 F DEBUG :
03-05 12:09:15.341 231 231 F DEBUG : Tombstone written to: /data/tombstones/tombstone_00
03-05 12:09:15.344 192 200 I mkfs.f2fs: mkfs.f2fs terminated by signal 11
03-05 12:09:15.344 706 733 I BootReceiver: Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
03-05 12:09:15.344 192 200 E vold : private:179_66 failed to format: No such device or address
You can see that the crash is happening in some string conversion code (invokations via utf8_to_utf16). I'm not yet sure why this crash is happening, but at least we now know what the crash is. One wild and probably incorrect guess is that it has something to do with differences between the condor fstab and otus fstab (such as the dual f2fs and ext4 userdata support, different mount flags).
BTW: Just to be sure, @Ansh2000, your internal storage userdata partition is formatted as f2fs and not ext4?
@squid2 formatted with f2fs.
Thanks @squid2 for taking your time out and looking at this condor specific issue. Thanks a bunch
@squid2 the partition formats successfully but still in the setting, it shows the sd card as corrupted even after a reboot. again trying to format through wizard and still unable to use.
FYI I had permissive selinux, and yes i ran it as root
and I use ext4 only, I never migrated to f2fs
EDIT: i made a mistake, this command would only work through the stock kernel, while i was using custom kernel. And flashing the kernel after making the sd card internal wont work either.
I mean the sd card would format. But only will be usable as internal through stock kernel
So i guess we'll have to wait until @rainforce279 brings some updates
squid2 said:
The mkfs.f2fs /dev/block/dm-0 is the command that is failing when trying to format through the wizard. Maybe it works properly when invoked manually. It's worth a try. Let me know what happens when you try it. Be sure to run it as root.
It is not working says mkfs.f2fs not found.
Click to expand...
Click to collapse
cm13 20160113
from where i can get cm13 20160113 build. bcoz it's not available on official site...
can u plz provide the link...
rajeev20 said:
from where i can get cm13 20160113 build. bcoz it's not available on official site...
can u plz provide the link...
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=65406771&postcount=1338
:laugh::laugh:
squid2 said:
Thanks for the log. The associated logcat would also be helpful, but from what I see in the dmesg, a couple things jumped out to me.
It looks like the f2fs formatting utility (mkfs.f2fs) crashes, and subsequent attempts crash further:
Code:
[ 2413.240089,0] mmcblk1: p1
[ 2414.518112,1] mmcblk1: p1 p2
[ 2414.969437,1] Core dump to |/system/bin/coredump mkfs.f2fs 8800 1457156718 pipe failed
...
[ 2462.808252,1] mmcblk1: unknown partition table
[ 2464.031938,0] mmcblk1: p1 p2
[ 2464.556586,0] Core dump to |/system/bin/coredump mkfs.f2fs 8996 1457156767 pipe failed
The big question would be why it crashes. The logcat may give more hints as to this. One thing I did notice is that there are an awful lot of untrusted_app selinux denials. One should usually not grant additional permission to untrusted_app. However, I'm curious if SELinux is causing issues for you. One thing worth trying would be to make selinux permissive (run "setenforce 0" as root) before trying to format the card. If that makes formatting work, then we'd know for sure that it's an SELinux related issue. However, this is just a wild guess, and the issue may be something completely unrelated.
Click to expand...
Click to collapse
even if we somehow get adopted working on the roms which gives corrupted sd card error ....another error arises that is when we update apps that is on sd card the updated app comes on internal and when we try to move that app to sd card again ,phone soft reboots and app still remains on internal.
I'm on bliss 6.0 tried all the methods get error 255 I like m but if can't get SD fixed I'm going back to 5.1.1

Categories

Resources