[DEVONLY] LineageOS 16

Search This thread

HandyMenny

Senior Member
Aug 19, 2013
63
40
@HandyMenny, could you please comment?

Thank you.

Hello. I'm glad your temp root is making progress. Unfortunately
I'm not that experienced. I'm just lucky.

I have never used directly the serial port. I can tell you that on xz1 with android 9, Sony has somewhat blocked all diagnostic interfaces, I managed to understand that enabling them during the boot make them usable (this is the purpose of that module). As for the interfaces I can tell you that the "diag" is the one mainly used by qpst/qxdm/scat/NSG software, qxdm can read a lot from this interface. rmnet allows your PC to use the phone as an usb modem and is used by the PDC tool, "serial" or "serial_cdev" replies to the AT commands.

Inviato dal mio G8341 utilizzando Tapatalk
 
Last edited:
  • Like
Reactions: nussbaum and j4nn

j4nn

Senior Member
Jan 4, 2012
1,237
2,453
@HandyMenny, thank you for the info and your pr in the scat project - just tested it, looks very interesting.
@derf elot, I guess this diag stuff may be quite useful for debugging modem or lte problems in general.
As I got it running in linux now, let me post some info to get it working:
  • to enable diag (at least in case of oreo) it seems to be sufficient to do
    Code:
    setprop persist.usb.eng 1
    setprop sys.usb.config rndis,adb
    setprop sys.usb.config mtp,adb
    (when sys.usb.config property changes, it takes value of persist.usb.eng property to enable the 'eng' usb interfaces)
  • to run scat tool with xz1c one can use following command
    Code:
    # in case of mtp,adb:
    ./scat.py -t qc -u -v 0x0fce -p 0x5146 -i 4
    # in case of rndis,adb:
    ./scat.py -t qc -u -v 0x0fce -p 0xd146 -i 5
  • it is possible to access the modem from linux - i've patched qcserial kernel driver for it (patch attached) - it seems the serial interface monitors both ways of modem control line as you can sometimes see some AT commands entered by fw or something and their responses, while it allows to enter AT commands and get their responses - use minicom for example with ttyUSB0
    Code:
    ATI
    
    Manufacturer: SONY
    Model: G8441
    Revision: 1307-7511_47.1.A.8.49
    SVN: 19
    IMEI: xxx
    +GCAP: +CGSM
    
    OK
  • with the patched qcserial driver, one can also use ttyUSB2 with scat, instead of direct usb interface access:
    Code:
    # this works (with the patched qcserial) regardless mtp vs rndis mode:
    ./scat.py -t qc -s /dev/ttyUSB2
    getting something like this (did not try to capture into pcap and view it yet):
    Code:
    Radio 0: LTE NCell: # cells 3
    Radio 0: Neighbor cell 0: PCI  83, RSRP -102.69, RSSI -86.94
    Radio 0: Neighbor cell 1: PCI 391, RSRP -113.06, RSSI -87.25
    Radio 0: Neighbor cell 2: PCI  76, RSRP -114.62, RSSI -87.69
    Radio 0: LTE SCell: EARFCN 1849, PCI  26, Measured RSRP -106.06, Measured RSSI -77.38
     scat.qualcommparser (parse_lte_mac_rach_response) WARNING: Unsupported RACH response version 03
     scat.qualcommparser (parse_lte_mac_rach_response) WARNING: Unsupported RACH response version 03
    Radio 0: LTE SCell: EARFCN 1849, PCI  83, Measured RSRP -104.00, Measured RSSI -71.50
    Radio 0: LTE SCell: EARFCN 1849, PCI  83, Measured RSRP -104.69, Measured RSSI -77.00
  • there is a serial interface that I could not get anything out of, with my patch of desktop kernel it is represented as ttyUSB1 (with mtp diag mode it is interface 3, with rndis it is number 4) - it might provide nmea gps stuff under some unknown circumstances as I am guessing from /vendor/bin/init.usbmode.product.sh script (using 'echo "\$GPS_START" > /dev/ttyUSB1' present in the qcserial kernel driver source code does not work, it soft hangs actually)
 

Attachments

  • qcserial-add-support-for-sony-xperia-xz1-compact.patch
    3.3 KB · Views: 41
Last edited:

derf elot

Senior Member
May 7, 2011
868
1,879
@HandyMenny, thank you for the info and your pr in the scat project - just tested it, looks very interesting.
@derf elot, I guess this diag stuff may be quite useful for debugging modem or lte problems in general.
As I got it running in linux now, let me post some info to get it working:
  • to enable diag (at least in case of oreo) it seems to be sufficient to do
    Code:
    setprop persist.usb.eng 1
    setprop sys.usb.config rndis,adb
    setprop sys.usb.config mtp,adb
    (when sys.usb.config property changes, it takes value of persist.usb.eng property to enable the 'eng' usb interfaces)
  • to run scat tool with xz1c one can use following command
    Code:
    # in case of mtp,adb:
    ./scat.py -t qc -u -v 0x0fce -p 0x5146 -i 4
    # in case of rndis,adb:
    ./scat.py -t qc -u -v 0x0fce -p 0xd146 -i 5
  • it is possible to access the modem from linux - i've patched qcserial kernel driver for it (patch attached) - it seems the serial interface monitors both ways of modem control line as you can sometimes see some AT commands entered by fw or something and their responses, while it also allows to enter a command and get the response - use minicom for example with ttyUSB0
    Code:
    ATI
    
    Manufacturer: SONY
    Model: G8441
    Revision: 1307-7511_47.1.A.8.49
    SVN: 19
    IMEI: xxx
    +GCAP: +CGSM
    
    OK
  • with the patched qcserial driver, one can also use ttyUSB2 with scat, instead of direct usb interface access:
    Code:
    # this works (with the patched qcserial) regardless mtp vs rndis mode:
    ./scat.py -t qc -s /dev/ttyUSB2
    getting something like this (did not try to capture into pcap and view it yet):
    Code:
    Radio 0: LTE NCell: # cells 3
    Radio 0: Neighbor cell 0: PCI  83, RSRP -102.69, RSSI -86.94
    Radio 0: Neighbor cell 1: PCI 391, RSRP -113.06, RSSI -87.25
    Radio 0: Neighbor cell 2: PCI  76, RSRP -114.62, RSSI -87.69
    Radio 0: LTE SCell: EARFCN 1849, PCI  26, Measured RSRP -106.06, Measured RSSI -77.38
     scat.qualcommparser (parse_lte_mac_rach_response) WARNING: Unsupported RACH response version 03
     scat.qualcommparser (parse_lte_mac_rach_response) WARNING: Unsupported RACH response version 03
    Radio 0: LTE SCell: EARFCN 1849, PCI  83, Measured RSRP -104.00, Measured RSSI -71.50
    Radio 0: LTE SCell: EARFCN 1849, PCI  83, Measured RSRP -104.69, Measured RSSI -77.00
  • there is a serial interface that I could not get anything out of, with my patch of desktop kernel it is represented as ttyUSB1 (with mtp diag mode it is interface 3, with rndis it is number 4) - it might provide nmea gps stuff under some unknown circumstances as I am guessing from /vendor/bin/init.usbmode.product.sh script (using 'echo "\$GPS_START" > /dev/ttyUSB1' present in the qcserial kernel driver source code does not work, it soft hangs actually)

Nice info, thanks! :)
 

j4nn

Senior Member
Jan 4, 2012
1,237
2,453
edited the post#102: strike out a nonsense about monitoring both ways of modem serial interface - that observation about AT commands appearing automatically entered must have been caused by something in desktop linux, possibly some autodetect stuff probing for a modem on new ttyUSBx device
 

foresto

Senior Member
Feb 13, 2010
152
51
twrp no longer builds correctly

@derf elot, I can confirm that with your local manifest (together with your previous hint) twrp can be built easily within omni minimal tree.
Thank you.

I wish I could confirm this, but I cannot. I guess something must have changed in the repositories since you guys last had this working, because it doesn't work now.

After several days of experimenting, I finally got a build to complete, using these steps:

EDIT 2020-06-03: I have more refined build instructions now, detailed in this post[url].

However, when I put the phone in fastboot mode and run fastboot boot recovery.img , the phone gets stuck at a white Sony screen. It reminds me of what
@j4nn described [url=https://forum.xda-developers.com/xperia-xz1-compact/development/devonly-lineageos-16-t3859664/post79170831#post79170831]in this post.

@derf elot, or anyone else, can you help, please? I asked for help a few days ago in the TWRP thread, but @modpunk hasn't responded.
 
Last edited:

Top Liked Posts