[Q] GT-I9205 Bluetooth failed to turn on - Omni Q&A

Hi currently im building omnirom for GT-I9205,
Im having some issue with the bluetooth,
i can confirm the bluetooth will work in this device (work on CM11 base source).
here is my logcat, hoping someone will point me to correct direction
Code:
D/BluetoothManagerService( 914): BluetoothServiceConnection: com.android.bluetooth.btservice.AdapterService
D/BluetoothManagerService( 914): Message: 40
D/BluetoothManagerService( 914): MESSAGE_BLUETOOTH_SERVICE_CONNECTED: 1
---
D/BluetoothPanServiceJni( 1650): initializeNative(L110): pan
D/BluetoothTethering( 914): got CMD_CHANNEL_HALF_CONNECTED
E/BluetoothTethering( 914): Trying to set mAsyncChannel twice!
---
I/bluedroid( 1650): enable
I/bt_hci_bdroid( 1650): init
I/bt_vendor( 1650): bt-vendor : init
I/bt_hwcfg( 1650): Starting hciattach daemon
I/bt_hwcfg( 1650): try to set false
I/bt_hwcfg( 1650): Starting hciattach daemon
I/bt_hwcfg( 1650): try to set true
I/bt_hci_bdroid( 1650): bt_hc_worker_thread started
I/qcom-bluetooth( 3318): /system/etc/init.qcom.bt.sh: init.qcom.bt.sh config =
I/qcom-bluetooth( 3324): /system/etc/init.qcom.bt.sh: Transport : smd
I/qcom-bluetooth( 3325): /system/etc/init.qcom.bt.sh: ** Bluedroid stack **
I/qcom-bluetooth( 3332): /system/etc/init.qcom.bt.sh: Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM)
I/qcom-bluetooth( 3333): /system/etc/init.qcom.bt.sh: Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3>
I/qcom-bluetooth( 3334): /system/etc/init.qcom.bt.sh: LE Power Class: Ignored. Default(2) used (1-CLASS1/2-CLASS2/3-CUSTOM)
I/qcom-bluetooth( 3335): /system/etc/init.qcom.bt.sh: LE Power Class: To override, Before turning BT ON; setprop qcom.bt.le_dev_pwr_class <1 or 2 or 3>
I/qcom-bluetooth( 3340): /system/etc/init.qcom.bt.sh: Bluetooth QSoC firmware download succeeded,
I/qcom-bluetooth( 3341): /system/etc/init.qcom.bt.sh: ** Bluedroid stack **
I/bt_hwcfg( 1650): bluetooth satus is on
I/bt_userial_vendor( 1650): Done intiailizing UART
I/bt_userial_vendor( 1650): Done intiailizing UART
E/bt_userial( 1650): userial_open: wrong numbers of open fd in vendor lib [2]!
E/bt_userial( 1650): userial_open: HCI UART expects only one open fd
I/bt_vendor( 1650): Bluetooth Firmware and smd is initialized
I/GKI_LINUX( 1650): gki_task_entry: gki_task_entry task_id=0 [BTU] starting
I/bt-btu ( 1650): btu_task pending for preload complete event
I/bt-btu ( 1650): btu_task received preload complete event
I/ ( 1650): BTE_InitTraceLevels -- TRC_HCI
I/ ( 1650): BTE_InitTraceLevels -- TRC_L2CAP
I/ ( 1650): BTE_InitTraceLevels -- TRC_RFCOMM
I/ ( 1650): BTE_InitTraceLevels -- TRC_AVDT
I/ ( 1650): BTE_InitTraceLevels -- TRC_AVRC
I/ ( 1650): BTE_InitTraceLevels -- TRC_A2D
I/ ( 1650): BTE_InitTraceLevels -- TRC_BNEP
I/ ( 1650): BTE_InitTraceLevels -- TRC_BTM
I/ ( 1650): BTE_InitTraceLevels -- TRC_GAP
I/ ( 1650): BTE_InitTraceLevels -- TRC_PAN
I/ ( 1650): BTE_InitTraceLevels -- TRC_SDP
I/ ( 1650): BTE_InitTraceLevels -- TRC_GATT
I/ ( 1650): BTE_InitTraceLevels -- TRC_SMP
I/ ( 1650): BTE_InitTraceLevels -- TRC_BTAPP
I/ ( 1650): BTE_InitTraceLevels -- TRC_BTIF
W/qdhwcomposer( 215): Excessive delay reading vsync: took 3945 ms vsync_period 33 ms
D/BluetoothAdapterState( 1650): CURRENT_STATE=PENDING, MESSAGE = ENABLE_TIMEOUT, isTurningOn=true, isTurningOff=false
E/BluetoothAdapterState( 1650): Error enabling Bluetooth
i think the problem is most likely due to >> userial_open: wrong numbers of open fd in vendor lib [2]!
what exactly is "fd"?

Related

[for devs][info] Eclair boot log

Code:
D/ ( 1123): MOTO_PUPD: mot_boot_mode
D/ ( 1123): MOTO_PUPD: cid_recover_boot=0x00
D/ ( 1123): MOTO : pwr_rsn = POWERUPREASON : 0x00004000
D/ ( 1123): MBM_VERSION : 0x00008089
D/ ( 1123): MBM_LOADER_VERSION : 0x000005a0
D/ ( 1123): FLAT_DEV_TREE_ADDRESS : 0xffffffff
D/ ( 1123): BATTERY_STATUS_AT_BOOT : 0x0001
D/ ( 1123): CID_RECOVER_BOOT : 0x00
D/ ( 1123):
D/ ( 1123): MOTO_PUPD: powerup_reason=0x00004000
D/ ( 1123): MOTO_PUPD: mot_boot_mode 12m: 0
I/vold ( 1126): Android Volume Daemon version 2.0
I/DEBUG ( 1127): debuggerd: Aug 4 2010 22:34:36
I/DBVC ( 1129): atvc_pal_production_part: start
I/DBVC ( 1129): atvc_pal_init_factory_state: start
I/DBVC ( 1129): atvc_pal_init_factory_state: determined out of factory state
I/DBVC ( 1129): atval_pal_read_datablock: enter
I/DBVC ( 1129): atval_pal_read_datablock: getting size of datablock
I/DBVC ( 1129): atval_pal_read_datablock: exit
I/DBVC ( 1129): atval_enforce_android_policy: validation failed. all disabled.
I/DBVC ( 1129): read handset resource access flags:
I/DBVC ( 1129): 0x00000000
I/DBVC ( 1129): atval_setup_properties: valid datablock - setting flags
I/usbd ( 1136): main(): Start usbd - version 1.2
I/usbd ( 1136): main(): Initializing uevent_socket
I/usbd ( 1136): main(): Initializing usb_device_mode
I/usbd ( 1136): main(): Initializing usbd socket
I/usbd ( 1136): usbd_get_cable_status(): cable_type = usb
I/usbd ( 1136):
I/usbd ( 1136): usbd_get_cable_status(): current usb_online = 1
I/usbd ( 1136): main(): Initial Cable State = Cable Attached
I/usbd ( 1136): main(): get event from usb_device_fd
I/usbd ( 1136): main(): devbuf: none:adb_enable:none
I/usbd ( 1136): rc: 20 usbd_curr_cable_status: 0
I/usbd ( 1136): main(): pcSwitchbuf = none
I/usbd ( 1136): main(): adbEnablebuf: adb_enable
I/usbd ( 1136): main(): length = 5
I/usbd ( 1136): main(): enubuf: none
E/vold ( 1126): Unable to chdir to /sys/class/mmc_host/mmc0/slot_name (Not a directory)
E/vold ( 1126): Error bootstrapping card '/sys/class/mmc_host/mmc0/slot_name' (Not a directory)
I/vold ( 1126): New MMC card 'USD ' (serial 1286609949) added @ /devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:b368
I/DBVC ( 1129): atval_enforce_android_policy: finalize the properties
I/DBVC ( 1129): atval_finalize_properties: START
I/DBVC ( 1129): atval_finalize_properties: parse property file
I/DBVC ( 1129): atval_finalize_properties: rename
I/vold ( 1126): Disk (blkdev 179:0), 15661056 secs (7647 MB) 3 partitions
I/vold ( 1126): New blkdev 179.0 on media USD , media path /devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:b368, Dpp 3
I/vold ( 1126): Partition (blkdev 179:1), 13625344 secs (6653 MB) type 0xb
I/vold ( 1126): New blkdev 179.1 on media USD , media path /devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:b368, Dpp 2
I/vold ( 1126): Partition (blkdev 179:2), 1114112 secs (544 MB) type 0x83
I/vold ( 1126): New blkdev 179.2 on media USD , media path /devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:b368, Dpp 1
I/vold ( 1126): Partition (blkdev 179:3), 919552 secs (449 MB) type 0x82
I/vold ( 1126): New blkdev 179.3 on media USD , media path /devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:b368, Dpp 0
I/vold ( 1126): Evaluating dev '/devices/platform/mmci-omap-hs.0/mmc_host/mmc0/mmc0:b368/block/mmcblk0' for mountable filesystems for '/sdcard'
I/vold ( 1126): Aborting start of /sdcard (bootstrap = 1)
I/vold ( 1126): Volmgr not ready to handle device
D/vold ( 1126): Bootstrapping complete
W/bplogd ( 1139): -WARNING- main(): BP datalogging is not allowed. bplog_property=0.
W/bplogd ( 1139): -WARNING- main(): Access token is required to allow it.
I/usbd ( 1136): process_usb_uevent_message(): cable type: usb
I/usbd ( 1136): process_usb_uevent_message(): USB online
I/usbd ( 1136): main(): Cable Status Changed, need to notify Cable Status to App
I/usbd ( 1136): main(): get event from usb_device_fd
I/usbd ( 1136): main(): devbuf: none:none:get_desc
I/usbd ( 1136): rc: 18 usbd_curr_cable_status: 0
I/usbd ( 1136): main(): pcSwitchbuf = none
I/usbd ( 1136): main(): adbEnablebuf: none
I/usbd ( 1136): main(): length = 9
I/usbd ( 1136): main(): enubuf: get_desc
I/usbd ( 1136): main(): received get_descriptor, enum in progress
I/usbd ( 1136): process_usb_uevent_message(): cable type: usb
I/usbd ( 1136): process_usb_uevent_message(): USB online
I/usbd ( 1136): main(): Spurious Cable Event, Ignore
I/usbd ( 1136): main(): get event from usb_device_fd
I/usbd ( 1136): main(): devbuf: none:none:enumerated
I/usbd ( 1136): rc: 20 usbd_curr_cable_status: 0
I/usbd ( 1136): main(): pcSwitchbuf = none
I/usbd ( 1136): main(): adbEnablebuf: none
I/usbd ( 1136): main(): length = 11
I/usbd ( 1136): main(): enubuf: enumerated
I/usbd ( 1136): main(): recieved enumerated
I/usbd ( 1136): main(): usbd_app_fd = -1
I/BATTD ( 1135): Battd USB INSERT = Success
I/BATTD ( 1135): Battd Init = Success
I/BATTD ( 1135): RTC Log SBCM Init=1335521694664
I/BATTD ( 1135): SBCM_GLUE: UNABLE TO OPEN FILE /config/public/batt_offset_data
I/BATTD ( 1135): SBCM_GLUE: BATT DATA READ - SUCCESS
I/BATTD ( 1135): SBCM_GLUE: BATT DATA READ - SUCCESS
I/BATTD ( 1135): SBCM_GLUE: BATT DATA READ - SUCCESS
I/BATTD ( 1135): SBCM_GLUE: BATT DATA RETRIVAL SUCCESS
I/BATTD ( 1135): SBCM_GLUE: CutOff Threshold is 3200 mV
I/BATTD ( 1135): SBCM_GLUE_EVENT_INIT=Initialization
I/BATTD ( 1135): SBCM_GLUE ****Battery Phasing start ****
I/BATTD ( 1135): SBCM_GLUE offset_batti = -2
I/BATTD ( 1135): SBCM_GLUE slope_batti = 128
I/BATTD ( 1135): SBCM_GLUE offset_chrgi = -3
I/BATTD ( 1135): SBCM_GLUE slope_chrgi = 123
I/BATTD ( 1135): SBCM_GLUE offset_battp = 4
I/BATTD ( 1135): SBCM_GLUE slope_battp = 128
I/BATTD ( 1135): SBCM_GLUE offset_bp = 0
I/BATTD ( 1135): SBCM_GLUE slope_bp = 128
I/BATTD ( 1135): SBCM_GLUE offset_battt = 1
I/BATTD ( 1135): SBCM_GLUE slope_battt = 128
I/BATTD ( 1135): SBCM_GLUE offset_chrgv = 1
I/BATTD ( 1135): SBCM_GLUE slope_chrgv = 127
I/BATTD ( 1135): SBCM_GLUE ****Battery Phasing end ****
I/BATTD ( 1135): SBCM_GLUE temp safe = 328
I/BATTD ( 1135): SBCM_GLUE temp warn = 333
I/BATTD ( 1135): SBCM_GLUE temp cool = 338
I/BATTD ( 1135): SBCM_GLUE temp phased safe raw = 0x59
I/BATTD ( 1135): SBCM_GLUE temp phased warn raw = 0x4b
I/BATTD ( 1135): SBCM_GLUE temp phased cool raw = 0x3f
I/BATTD ( 1135): SBCM_GLUE temp safe unphased raw = 0x58
I/BATTD ( 1135): SBCM_GLUE temp warn unphased raw = 0x4a
I/BATTD ( 1135): SBCM_GLUE temp cool unphased raw = 0x3e
I/BATTD ( 1135): Coulomb Counter Enabled=1
I/BATTD ( 1135): SBCM_ALGORITHM_task_handler()return=686979
I/BATTD ( 1135): while(SBCM_GLUE_atod_pending)=2
I/BATTD ( 1135): SBCM_ALGORITHM_task_handler()return=0xA7BBD
I/BATTD ( 1135): while(SBCM_GLUE_atod_pending)=4
I/BATTD ( 1135): File /data/battd/cc_data opened!
I/BATTD ( 1135): Value from cc file Percentage = 802962722
I/BATTD ( 1135): SBCM_ALGORITHM_task_handler()return=0xA7B81
I/BATTD ( 1135): Timeout=10
I/BATTD ( 1135): Event from SBCM Driver=Batt Detection Interrupt
I/BATTD ( 1135): SBCM_GLUE ****Battery BRT Read ****
I/SSM ( 1167): Signals
I/SSM ( 1167): Sockets
E/SSM ( 1167): Failed open; status=-1 / errno=-2
D/panic_daemon( 1170): Bind socket is successful
D/panic_daemon( 1170): Listen of GKI-panic_daemon socket is successful
W/panic_daemon( 1170): /data/panic exists.
W/panic_daemon( 1170): /data/panic/apr exists.
I/usbd ( 1136): process_usb_uevent_message(): cable type: usb
I/usbd ( 1136): process_usb_uevent_message(): USB online
I/usbd ( 1136): main(): Spurious Cable Event, Ignore
I/ ( 1178): Main_fmradioserver::ServiceManager: 0xae20
I/FMRadioStackService( 1178): FMRadioStackService created
I/FMRadioStackService( 1178): onFirstRef:: run thread to power on bt device
D/AndroidRuntime( 1141):
D/AndroidRuntime( 1141): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 1141): CheckJNI is OFF
I/AndroidRuntime( 1141): JNI options: '-Xjniopts:warnonly'
D/dalvikvm( 1141): Precise GC configured ON
D/dalvikvm( 1141): creating instr width table
I/SSM ( 1167): fd_ipc=7
E/SSM ( 1167): Open device :/dev/input/even error!
E/SSM ( 1167): Open device :/dev/input/even error!
E/SSM ( 1167): Open device :/dev/input/even error!
E/SSM ( 1167): Open device :/dev/input/even error!
E/SSM ( 1167): Open device :/dev/input/even error!
E/SSM ( 1167): Open device :/dev/input/even error!
E/SSM ( 1167): Open device :/dev/input/even error!
E/SSM ( 1167): Couldn't find or open input driver (No such file or directory)
E/SSM ( 1167): Failed to open descriptor for input device driver for flip; errno=-2
W/SSM ( 1167): No input driver device interface
I/SSM ( 1167): fd_ssd=10
I/SSM ( 1167): fd_pmp=11
I/SSM ( 1167): fd_uevents=12
I/SSM ( 1167): Done: SSMGR Daemon Initialized
I/SSM ( 1167): capacity 0
I/SSM ( 1167): PA Boost - Battery TOO LOW
I/ ( 1142): ServiceManager: 0xae30
D/AudioHardwareMot( 1142): AudioMgr:mixer fd = 7, errno = Unknown error: 0
D/AudioMgrIPC( 1142): AudioMgr:IPC: Inside am_aipcm_init
D/AudioMgrIPC( 1142): AudioMgr:IPC: Inside am_aipcm_init-mux_txrx_fd= 8, errno = Unknown error: 0
D/AudioMgrIPC( 1142): AudioMgr:IPC: Read thread spawned
D/AudioPostProcessor( 1142): AudioMgr:AudioPostProcessor()
D/AudioPostProcessor( 1142): AudioMgr:No debug parameters in /data; checking ro.product.name
D/AudioPostProcessor( 1142): AudioMgr:ro.product.name value = STR_RTRU
D/AudioPostProcessor( 1142): AudioMgr:/system/bin/ap_gain.bin file size is 50371
D/AudioPostProcessor( 1142): AudioMgr:Read format version 0x308, content version 0000 from /system/bin/ap_gain.bin
D/AudioMgrIPC( 1142): AudioMgr:am_aipcm_read_thread called
D/AudioMgrIPC( 1142): AudioMgr:Setting Select ipc_fd
D/AudioPostProcessor( 1142): AudioMgr:Successfully parsed parameters from /system/bin/ap_gain.bin
D/AudioMsgHandler( 1142): The new thread spawned successfully
D/AudioHardwareMot( 1142): AudioMgr:setMode(NORMAL)
I/CameraService( 1142): CameraService started: pid=1142
D/AudioMsgHandler( 1142): server_fd = 10
D/AudioHardwareMot( 1142): AudioMgr:AudioHardwareMot::openOutputStream enter
D/AudioHardwareMot( 1142): AudioMgr:AudioHardwareMot: AudioStreamOutMot
D/AudioHardwareMot( 1142): AudioMgr:AudioStreamOutMot::set(0xafb0, 2, 0, 0 0)
I/BATTD ( 1135): SBCM_GLUE ****BRT SUCCESS****
I/BATTD ( 1135): BM_BATT_DATA: status valid
I/BATTD ( 1135): BM_BATT_DATA: uid valid
I/BATTD ( 1135): BM_BATT_DATA: family_code = 137
I/BATTD ( 1135): BM_BATT_DATA: uid_lsb = 0
I/BATTD ( 1135): BM_BATT_DATA: uid_msb = 80
I/BATTD ( 1135): BM_BATT_DATA: page_2_checksum = 0
I/BATTD ( 1135): BM_BATT_DATA: page_3_checksum = 0
I/BATTD ( 1135): BM_BATT_DATA: cpyrght_vld = 1
I/BATTD ( 1135): SBCM CORE convert_rom_data: bcap= 1390, raw= 0x8b
I/BATTD ( 1135): BATTD_SetBattCapacity BATT CAP = 182199
I/BATTD ( 1135): SBCM_GLUE BATT CAP = 1390
D/AudioHardwareMot( 1142): AudioMgr:bufSize from kernel = 8192
I/AudioFlinger( 1142): AudioFlinger's thread 0xba40 ready to run
I/BATTD ( 1135): Event from SBCM Driver=Coulomb Counter Calibration Interrupt
D/AudioHardwareMot( 1142): AudioMgr:bufSize from kernel = 8192
D/AudioHardwareMot( 1142): AudioMgr:bufSize from kernel = 8192
D/AudioHardwareMot( 1142): AudioMgr:bufSize from kernel = 8192
D/AudioHardwareMot( 1142): AudioMgr:AudioStreamOutMot::standby called
D/AudioHardwareMot( 1142): AudioMgr:AudioStreamOutMot::setParameters() routing=2
D/AudioHardwareMot( 1142): AudioMgr:set output routing 2
D/AudioHardwareMot( 1142): AudioMgr:doRouting called
D/AudioHardwareMot( 1142): AudioMgr:Routing to speaker
D/AudioHardwareMot( 1142): AudioMgr:configPostProcessor() called with accy = 0
D/AudioPostProcessor( 1142): AudioMgr:configPostProcessing() called, inputAccy= 27, outputAccy= 0, sampleRate= 44100, ringtoneMode= 0
D/AudioPostProcessor( 1142): AudioMgr:updatePostProcessor calling SuperAPI parser with:
D/AudioPostProcessor( 1142): accy=8
D/AudioPostProcessor( 1142): config=0
D/AudioPostProcessor( 1142): SE_level_index=1
D/AudioHardwareMot( 1142): AudioMgr:Gain for Input accy = 0 is 28
D/AudioHardwareMot( 1142): AudioMgr:Gain for Output accy = 0 is 11
D/AudioHardwareMot( 1142): AudioMgr:setVoiceVolume called with vol = 1.000000, converted intVol = 7
D/AudioMgrIPC( 1142): AudioMgr:am_aipcm_set_volume_req() called with vol_level = 7, vol_type = 2
D/AudioMgrIPC( 1142): AudioMgr:IPC: message sent for message id 3
D/AudioMgrIPC( 1142): AudioMgr:select returned, need to do a read
D/AudioMgrIPC( 1142): AudioMgr:[am_aipcm_read_func]:[ENTER IPC HANDLE FUNCTION], [line]:495
D/AudioMgrIPC( 1142): AudioMgr:IPC: header.data_legth is 18
D/AudioMgrIPC( 1142): AudioMgr:IPC: msg_id = 8000
D/AudioMgrIPC( 1142): AudioMgr:IPC: TAG is 0x8100
D/AudioMgrIPC( 1142): AudioMgr:IPC: Length is 0x4
D/AudioMgrIPC( 1142): AudioMgr:am_aipcm_read_func called, from BP message the tag is: 8100, msg_id is:8000
D/AudioMgrIPC( 1142): AudioMgr:IPC: TAG is 0x8101
D/AudioMgrIPC( 1142): AudioMgr:IPC: Length is 0x4
D/AudioMgrIPC( 1142): AudioMgr:IPC: Ack received for message with id = 3
I/SktdrmService( 1142): [SktdrmService] instantiate. current uid:1013
I/SktdrmService( 1142): [SktdrmService] Const.
I/BATTD ( 1135): set_charge_voltage=4200
I/BATTD ( 1135): set_charge_current=500
D/AndroidRuntime( 1141): --- registering native functions ---
I/SamplingProfilerIntegration( 1141): Profiler is disabled.
I/Zygote ( 1141): Preloading classes...
D/dalvikvm( 1141): GC freed 795 objects / 50696 bytes in 2ms
D/dalvikvm( 1141): GC freed 299 objects / 18400 bytes in 2ms
D/dalvikvm( 1141): GC freed 309 objects / 19496 bytes in 3ms
D/dalvikvm( 1141): GC freed 215 objects / 13656 bytes in 3ms
D/dalvikvm( 1141): GC freed 416 objects / 26632 bytes in 4ms
D/skia ( 1141): ------ build_power_table 1.4
D/skia ( 1141): ------ build_power_table 0.714286
D/dalvikvm( 1141): GC freed 415 objects / 28408 bytes in 4ms
D/dalvikvm( 1141): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1141): Added shared lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1141): Trying to load lib /system/lib/libexif.so 0x0
D/dalvikvm( 1141): Added shared lib /system/lib/libexif.so 0x0
D/dalvikvm( 1141): GC freed 2350 objects / 122560 bytes in 6ms
D/dalvikvm( 1141): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1141): Shared lib '/system/lib/libmedia_jni.so' already loaded in same CL 0x0
D/dalvikvm( 1141): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1141): Shared lib '/system/lib/libmedia_jni.so' already loaded in same CL 0x0
D/dalvikvm( 1141): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1141): Shared lib '/system/lib/libmedia_jni.so' already loaded in same CL 0x0
D/dalvikvm( 1141): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1141): Shared lib '/system/lib/libmedia_jni.so' already loaded in same CL 0x0
D/dalvikvm( 1141): GC freed 3790 objects / 197000 bytes in 10ms
D/dalvikvm( 1141): GC freed 463 objects / 26424 bytes in 10ms
D/dalvikvm( 1141): GC freed 294 objects / 17024 bytes in 13ms
D/dalvikvm( 1141): GC freed 204 objects / 11464 bytes in 11ms
D/dalvikvm( 1141): GC freed 172 objects / 9232 bytes in 12ms
D/dalvikvm( 1141): Trying to load lib /system/lib/libsrec_jni.so 0x0
D/dalvikvm( 1141): Added shared lib /system/lib/libsrec_jni.so 0x0
D/dalvikvm( 1141): Trying to load lib /system/lib/libsrec_jni.so 0x0
D/dalvikvm( 1141): Shared lib '/system/lib/libsrec_jni.so' already loaded in same CL 0x0
E/asset ( 1141): Looking for resource asset in '/system/framework/framework-res.apk'
E/asset ( 1141): MAS: Leave getLocalizationResFilePath ap:
D/dalvikvm( 1141): GC freed 300 objects / 34896 bytes in 15ms
D/dalvikvm( 1141): GC freed 127 objects / 24624 bytes in 17ms
D/dalvikvm( 1141): GC freed 343 objects / 38696 bytes in 22ms
D/dalvikvm( 1141): GC freed 414 objects / 25624 bytes in 18ms
D/dalvikvm( 1141): Trying to load lib /system/lib/libwebcore.so 0x0
D/dalvikvm( 1141): Added shared lib /system/lib/libwebcore.so 0x0
D/dalvikvm( 1141): GC freed 378 objects / 21600 bytes in 20ms
D/dalvikvm( 1141): GC freed 453 objects / 29144 bytes in 21ms
D/dalvikvm( 1141): GC freed 267 objects / 26528 bytes in 22ms
D/dalvikvm( 1141): GC freed 378 objects / 27048 bytes in 21ms
D/dalvikvm( 1141): GC freed 1083 objects / 91968 bytes in 26ms
D/dalvikvm( 1141): GC freed 664 objects / 35928 bytes in 26ms
D/dalvikvm( 1141): GC freed 709 objects / 41224 bytes in 24ms
D/dalvikvm( 1141): GC freed 735 objects / 40600 bytes in 35ms
D/dalvikvm( 1141): GC freed 12264 objects / 448488 bytes in 32ms
D/dalvikvm( 1141): GC freed 11289 objects / 478208 bytes in 32ms
D/dalvikvm( 1141): GC freed 9907 objects / 437592 bytes in 40ms
D/dalvikvm( 1141): GC freed 8690 objects / 494384 bytes in 33ms
D/dalvikvm( 1141): GC freed 8206 objects / 490912 bytes in 38ms
D/dalvikvm( 1141): GC freed 7956 objects / 488440 bytes in 37ms
D/dalvikvm( 1141): GC freed 7120 objects / 395192 bytes in 33ms
D/dalvikvm( 1141): GC freed 847 objects / 51408 bytes in 37ms
D/dalvikvm( 1141): GC freed 540 objects / 38872 bytes in 33ms
D/dalvikvm( 1141): GC freed 460 objects / 31216 bytes in 35ms
D/dalvikvm( 1141): GC freed 426 objects / 29600 bytes in 33ms
I/Zygote ( 1141): ...preloaded 1942 classes in 4145ms.
D/dalvikvm( 1141): GC freed 117 objects / 14848 bytes in 34ms
I/Zygote ( 1141): Preloading resources...
D/dalvikvm( 1141): GC freed 5 objects / 224 bytes in 40ms
D/dalvikvm( 1141): GC freed 187 objects / 9152 bytes in 38ms
D/dalvikvm( 1141): GC freed 140 objects / 7520 bytes in 34ms
D/dalvikvm( 1141): GC freed 250 objects / 11920 bytes in 32ms
I/Zygote ( 1141): ...preloaded 48 resources in 307ms.
I/Zygote ( 1141): ...preloaded 15 resources in 6ms.
D/dalvikvm( 1141): GC freed 112 objects / 8656 bytes in 35ms
D/dalvikvm( 1141): GC freed 227 objects / 9016 bytes in 32ms
D/dalvikvm( 1141): GC freed 24 objects / 944 bytes in 37ms
I/dalvikvm( 1141): Splitting out new zygote heap
I/dalvikvm( 1141): System server process 1390 has been created
I/Zygote ( 1141): Accepting command socket connections
D/dalvikvm( 1390): Trying to load lib /system/lib/libandroid_servers.so 0x0
D/dalvikvm( 1390): Added shared lib /system/lib/libandroid_servers.so 0x0
E/BatteryService( 1390): ttaOnlinePath not found
I/sysproc ( 1390): Entered system_init()
I/sysproc ( 1390): ServiceManager: 0x11cb20
I/SurfaceFlinger( 1390): SurfaceFlinger is starting
I/SurfaceFlinger( 1390): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
D/libEGL ( 1390): loaded /system/lib/egl/libGLES_android.so
D/libEGL ( 1390): loaded /system/lib/egl/libEGL_POWERVR_SGX530_121.so
D/libEGL ( 1390): loaded /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_121.so
D/libEGL ( 1390): loaded /system/lib/egl/libGLESv2_POWERVR_SGX530_121.so
I/SurfaceFlinger( 1390): EGL informations:
I/SurfaceFlinger( 1390): # of configs : 30
I/SurfaceFlinger( 1390): vendor : Android
I/SurfaceFlinger( 1390): version : 1.4 Android META-EGL
I/SurfaceFlinger( 1390): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_ANDROID_image_native_buffer EGL_ANDROID_swap_rectangle EGL_ANDROID_get_render_buffer
I/SurfaceFlinger( 1390): Client API: OpenGL ES
I/SurfaceFlinger( 1390): EGLSurface: 8-8-8-8, config=0x1
E/libEGL ( 1390): eglSetSwapRectangleANDROID:1743 error 3008 (EGL_BAD_DISPLAY)
I/SurfaceFlinger( 1390): flags : 00110000
I/SurfaceFlinger( 1390): OpenGL informations:
I/SurfaceFlinger( 1390): vendor : Imagination Technologies
I/SurfaceFlinger( 1390): renderer : PowerVR SGX 530
I/SurfaceFlinger( 1390): version : OpenGL ES-CM 1.1
I/SurfaceFlinger( 1390): extensions: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map GL_OES_blend_subtract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image GL_EXT_multi_draw_arrays GL_OES_required_internalformat GL_IMG_read_format GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_EXT_texture_format_BGRA8888 GL_IMG_texture_stream GL_IMG_vertex_program
I/sysproc ( 1390): System server: starting Android runtime.
I/sysproc ( 1390): System server: starting Android services.
I/SystemServer( 1390): Entered the Android system server!
I/sysproc ( 1390): System server: entering thread pool.
I/SystemServer( 1390): Entropy Service
I/SystemServer( 1390): Power Manager
I/SystemServer( 1390): Activity Manager
I/ActivityManager( 1390): Memory class: 28
D/libEGL ( 1398): loaded /system/lib/egl/libGLES_android.so
E/SurfaceFlinger( 1390): eglSwapBuffers: EGL error 0x3008 (EGL_BAD_DISPLAY)
D/libEGL ( 1398): loaded /system/lib/egl/libEGL_POWERVR_SGX530_121.so
D/libEGL ( 1398): loaded /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_121.so
D/libEGL ( 1398): loaded /system/lib/egl/libGLESv2_POWERVR_SGX530_121.so
W/UsageStats( 1390): Usage stats version changed; dropping
W/zipro ( 1398): Unable to open zip '/data/local/bootanimation.zip': No such file or directory
I/dalvikvm( 1390): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=32)
I/SystemServer( 1390): Telephony Registry
I/SystemServer( 1390): Package Manager
I/Installer( 1390): connecting...
I/installd( 1145): new connection
D/dalvikvm( 1390): GC freed 3840 objects / 208984 bytes in 127ms
I/PackageManager( 1390): Libs: javax.obex:/system/framework/javax.obex.jar com.motorola.con2vcard:/system/framework/com.motorola.con2vcard.jar android.test.runner:/system/framework/android.test.runner.jar com.motorola.android.syncml:/system/framework/com.motorola.android.syncml.jar com.google.android.gtalkservice:/system/framework/com.google.android.gtalkservice.jar com.motorola.aui:/system/framework/com.motorola.aui.jar com.motorola.android.dlna:/system/framework/com.motorola.android.dlna.jar com.motorola.atcmd.pluginMgr:/system/framework/com.motorola.atcmd.pluginMgr.jar com.motorola.atcmd.base:/system/framework/com.motorola.atcmd.base.jar com.google.android.datamessaging:/system/framework/com.google.android.datamessaging.jar com.google.android.maps:/system/framework/com.google.android.maps.jar com.motorola.android.image:/system/framework/com.motorola.android.image.jar com.motorola.android.mediasync:/system/framework/com.motorola.android.mediasync.jar com.motorola.android.camera:/system/framework/com.motorola.android.camera.jar
I/PackageManager( 1390): Features: android.hardware.wifi android.hardware.location.network android.hardware.telephony android.hardware.location android.hardware.touchscreen.multitouch android.hardware.sensor.compass android.hardware.camera android.hardware.bluetooth android.hardware.sensor.proximity android.hardware.sensor.light android.hardware.location.gps android.hardware.telephony.gsm android.hardware.camera.autofocus android.hardware.touchscreen android.hardware.sensor.accelerometer android.software.live_wallpaper android.hardware.camera.flash
D/dalvikvm( 1390): GC freed 5178 objects / 345456 bytes in 102ms
W/PackageManager( 1390): Library not found: /system/framework/com.google.android.datamessaging.jar
I/dalvikvm( 1390): Zip is good, but no classes.dex inside, and no .odex file in the same directory
W/PackageManager( 1390): Exception reading jar: /system/framework/mot-framework-res.apk
W/PackageManager( 1390): java.io.IOException: /system/framework/mot-framework-res.apk
W/PackageManager( 1390): at dalvik.system.DexFile.isDexOptNeeded(Native Method)
W/PackageManager( 1390): at com.android.server.PackageManagerService.<init>(PackageManagerService.java:527)
W/PackageManager( 1390): at com.android.server.PackageManagerService.main(PackageManagerService.java:335)
W/PackageManager( 1390): at com.android.server.ServerThread.run(SystemServer.java:116)
I/dalvikvm( 1390): Zip is good, but no classes.dex inside, and no .odex file in the same directory
W/PackageManager( 1390): Exception reading jar: /system/framework/googlelogin-client.jar
W/PackageManager( 1390): java.io.IOException: /system/framework/googlelogin-client.jar
W/PackageManager( 1390): at dalvik.system.DexFile.isDexOptNeeded(Native Method)
W/PackageManager( 1390): at com.android.server.PackageManagerService.<init>(PackageManagerService.java:527)
W/PackageManager( 1390): at com.android.server.PackageManagerService.main(PackageManagerService.java:335)
W/PackageManager( 1390): at com.android.server.ServerThread.run(SystemServer.java:116)
D/PackageManager( 1390): Scanning app dir /system/framework

[GUIDE][ICS/JB/common] Definitive FAQ for newest miui porting

I know there is a Proxuser's guide - "How to Port MIUI v4 for your device" and GREAT thread intended to eliminate porting quirks.
My goal is to collect all the experience we got in that thread, which could be helpful for new users porting newest releases of miui.
FAQ assumes questionaire, but my format will be more look like a guide but as collection, it could be treated as FAQ.
Structure will be Stage-divided to ease of use.
Stage 1. Initial port
Let's start with first moment - bases choice.
Under base I will mean rom which could be used to port miui and also miui release you choose.
Let's assume - just "Base" will mean rom for your device with ICS/JellyBean, such as Cyanogen Mod or AOKP or AOSP and their variations(I don't know if it is possible to use stock rom for porting and wouldn't recommend it), when "MIUI base" means any miui rom you prefer (my preference and advice - MIUIandroid crespo [nexus S] or MIUIandroid maguro (Galaxy Nexus) release). You could use any miui base but results will be unpredictable and may very vary from guide stands, for those cases I prepared common debugging stage, which will help to eliminate bugs I haven't listed.
MIUI for nexus S and Galaxy Nexus are now upgraded to Jelly Bean. That actually means - you couldn't use their miui bases to port ICS roms(which still under support).
For those who stuck at ICS the situation is as follows:
If version number is not crucial, you might just stick at MIUI 2.8.10 http://weedy.ca/miuiandroid/ and use old kind Nexus S/Galaxy Nexus roms. In guide I will describe steps right for you with mark "ICS-only".
If for you version number is crucial - stop reading this guide and just use PatchROM (though rom will be based on Stock rom).
There is third variant, but it needs a device with nearly same specs:
you might just replace some files in miui-supported device rom with files from your stock rom. For now that case is only tested on xperia 2011 products (play,live with walkman,ray, mini, pro, mini pro etc) - arc s [lt18i] miui base and xperia 2012 (u,p, sola etc) - S miui base.
When base choosen, start to port:
Copy unpacked base rom (so set of folders) to any folder you prefer (let's name it "MIUI"), it usually contains:
system - folder on which we will work more often
data - may contain something necessary such as first boot scripts, config files etc.
META-INF - contains certificates and signature for signcheck, updater-script(we also will work on it) update-binary (updater-script command processor)
boot.img, kernel and ramdisk packed together, touch only if kernel should be changed to something more recent or if your preference is not similar with base rom maker's, but keep in mind that you have to place modules that provided with kernel to lib/modules [or in place where .ko files are]
Starting with system:
delete:
app
framework
media
fonts
then open miui archive and extract those folders to system. Don't close archive.
Open lib folder in system to add from the same archive:
content-types.properties [for themes]
liblbesec.so [for LBE Guard - MIUI superuser]
liblocSDK_2.2.so [for baidu location service, prevents network location provider FC]
JellyBean-only:
libjni_resource_drm.so [themes DRM, actually involves download online themes screen]
Open etc folder in system to add from the same archive:
yellowpage.db [Phone calls ability]
ICS-only
telocation.td (as for nexus S and telocation.db in others) [location provider dependency]
JellyBean-only:
telocation.idf (possible new telocation.db)
go to permissions folder in etc to add:
com.nxp.mifare.xml [NFC]
miui-framework.xml [activates miui framework, near all apps won't work without that]
com.google.android.media.effects.xml [gallery]
com.google.widevine.software.drm.xml [something also related to google may affect play market]
com.google.android.maps.xml [gmaps]
Open xbin folder in system to add from the same archive:
su [replace, don't even use base one!]
invoke-as [binary with near busybox and toolbox functionality, need everywhere in system, mostly in themes and SU]
that's all about additional files. Devices which don't have NFC(Near Field Communication chip) also shouldn't have Nfc.apk in app folder!
Let's modify build.prop then, to add:
Code:
ro.build.id=MIUI
ro.build.display.id=MIUI
ro.build.version.incremental=2.x.x
ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg
ro.build.version.incremental points to MIUI you port, so specify it.
At your base you will most likely see these lines
Code:
ro.config.ringtone=
ro.config.notification_sound=
ro.config.alarm_alert=
ro.config.sms_received_sound=
ro.config.sms_delivered_sound=
are filled with ringtones that only base have, soo just change them as MIUI do have different ringtone set.
Initial port done, in system part, let's talk about Updater-script:
any release of miui you port should have that line:
Code:
set_perm(0, 0, 06755, "/system/xbin/invoke-as");
for example you have that bunch of code [which is mostly common for CM9 release]:
Code:
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 06755, "/system/bin/ip");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 06755, "/system/xbin/tcpdump");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/init.d");
So line I pointed should be somewhere there, for example:
Code:
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
[B][SIZE="4"]set_perm(0, 0, 06755, "/system/xbin/invoke-as");[/SIZE][/B]
set_perm(0, 0, 06755, "/system/xbin/tcpdump");
IF you have problems with SU, that line may help:
Code:
symlink("/system/xbin/su", "/system/bin/su");
paste it somewhere after
Code:
symlink("busybox"[B][COLOR="YellowGreen"][later big code bunch like "/system/xbin/[" etc][/COLOR][/B]
but before
Code:
unmount("/system");
Your own MIUI is now ready to be flashed, but only, if your device is SOOO near on hardware part with MIUI base
For those who didn't met that rule I prepared next parts - framework mods and common debugging and troubleshooting. See next 2 posts.
Stage 2
Recently I had an Acer Liquid MT[now bricked], which is Qualcomm S2 device(msm7x30) and my guide defines also assume you have device with Qualcomm inside. But some of guide moments[first stage is not exception] are common for most devices with other chips.
I also used Cyanogen Mod 9 as base, so some of these defines wouldn't be applicable to your porting using AOSP base.
That was on ICS, and I will count that in while describing for those who don't care about miui version and porting something before MIUI 2.8.10.
Now I have MIUI-supported Xperia Arc S. But its MIUI is based on stock rom (such a shame). So as FXP provides us CM 10, I started to port over it to bring latest and greatest of MIUI jellybean on that device. So again Qualcomm, but with stock ICS, which means lesser quirks on porting. I again will assume you are on Qualcomm but I have to say that all defines of this stage are nomore device-specific.
Returning to guide:
Stage 2. Framework mods to make it boot
Rom not booting? - that is most likely a framework issue, that is remained from Nexus S/Galaxy Nexus. But don't run to base to grab all framework and paste it to base, else you will have a base rom instead of miui
My suggestion is port.
For those who are new in apktool disassembling, I suggest to read something like that http://forum.xda-developers.com/showthread.php?t=1511730 or that http://forum.xda-developers.com/showthread.php?t=1752201 or google it to understand common principles of work.
For framework-res.apk mods we will use Connor-apktool and scripts for ease of use: http://code.google.com/p/android-apktool/downloads/list (choose only dependencies for your platform, don't replace AAPT from them). Always choose latest one!
Let's assume again:
disassemble something - usually means issuing
Code:
apktool d [[COLOR="YellowGreen"]full name of apk or jar[/COLOR]]
command on file I specify if more info not specified
assemble something - usually means issuing
Code:
apktool b [[COLOR="YellowGreen"]disassembled apk or jar folder without .apk in name or with ".out" at the end for jars[/COLOR] ]
command on file I specify
better way to assemble is drag assembled classes.dex(or resources.arsc and xmls at rest folders in case of assembling framework-res.apk) from [file you modified]/build/apk to original file, opened as archive (in windows you also have to check out a compression rate to make it the same as there were before dragging, which prompts to you as compression method like "Normal" and "Store")
smali - piece of code on dalvik bytecode language, are part of nearly any disassembled file
smali tree/just "tree"/"*.smali" - usually means set of files with the same name in the beginning but with different end(usually with $ before), for example
Code:
RIL*.smali means:
[LIST]
[*]RIL.smali
[*]RIL$1.smali
[*]RIL$RILReceiver.smali
[*]RIL$RILSender.smali
[/LIST]
Let's start with framework mods:
All frameworks are located at system/framework.
framework.jar
Mostly issues are produced there.
Disassemble framework.jar from MIUI port you are working so you will see framework.jar.out. Go to smali folder in it. Later all actions we will produce from there (except assembling).
First replace some files from your base framework.jar (fist disassemble base rom's framework.jar and move all files I will specify, replace if asked).
Listing all smali I had to replace in framework.jar:
ICS-only:
Code:
[B]android/os/Power.smali[/B]
org/codeaurora/Performance.smali
[B]android/media/MediaRecorder*.smali[/B]
android/graphics/Paint.smali
android/os/Environment.smali
android/view/HardwareCanvas.smali
[B]android/net/wifi/WifiNative.smali[/B]
Common:
Code:
android/view/Gles20*.smali (not only canvas but all with gles20 at the beginning)
[B]android/hardware/Camera*.smali[/B]
[B]android/server/BluetoothA2dpService*.smali[/B]
[B]android/content/res/PackageRedirectionMap*.smali[/B]
[B]com/android/internal/telephony/RIL*.smali[/B]
JellyBean Only:
Code:
[B]android/bluetooth/HeadsetBase*.smali[/B]
[B]com/android/internal/app/ActivityTrigger.smali[/B]
[B]android/webkit/HTML5*.smali[/B]
[B]android/webkit/SelectActionModeCallback[/B]
I highlighted those could be common for all chips, not only for Qualcomm ones.
But some of smalis are not following common rules.
The weirdest exception of that - WebviewCore. If you replace only WebViewCore tree, Gmail, Facebook, Browser, HTML viewer and all that is using this class WON'T WORK. What was my solution is to replace Webview*.smali tree, so I met all dependencies that class may work with.
ICS-only:
That class, and Sound Recorder are in need of one property from SystemProperties.smali, which is located at android/os/.
But don't run to base to take it and replace immediately as you read It have to be patched
end of ICS-only
I highlighted it as ICS-only as you will just replace it on JellyBean - it's now hard to patch, but easy to replace.
>>Common Remark about patching smalis
Patching (usually named diffing, diff, that means "find differences and eliminate them") in our context is a process of comparing two files and adding contents of one of them to another and not replacing anything. Our diff process will consist of base->miui content addition so smali we modify could live in dual life - for your base and for MIUI remained framework. For start of diff you should have both base and miui files you want to modify, and a diff tool (in windows - beyond compare,total commander, winmerge or notepad++), my preference - Meld diff viewer[really simple and visual-oriented], the only thing - it's running on linux environment and I don't know if there is a windows version. Then just open files in tool and start adding. Sometimes you have to add all entries are not present in miui one from base, sometimes you should be smart enough to mod only part which needed and nothing more and also sometimes to replace pieces of code which are actually safe to do so. That's a whole process.
>>
Example - our SystemProperties.smali:
Actually after opening you see it is full of differences from base:
http://minus.com/mbmfprmG4K/
you see those green blocks? Each of them signs a missing part of code you should add, in Meld it's just about of clicking little arrow that represents that block. As for windows tools, they should have something like "add all" and many other things could do it in a batch way.
A little piece of smartness:
that file is the only one I discovered which allow replacing .line with big code pieces, see that:
http://minus.com/mdnAholnL/
do you see ".line 126" and HUGE code block against it? you may forget about ".line 126" and copy block against it with no doubt. Note that line numbers etc could change, always check before doing something.
That line also became a dealbreaker on JellyBean, that's why we decided it would be better to just replace it. Ecample will give you a clue just about common patch process.
>>
Another file has to be modified in same way - AssetManager.smali, which is located at android/content/res.
Beware of replacing anything on it[only add, as stand before], if something went wrong, it might produce awful logcat nobody could understand so you have to re-port rom again to catch a causer.
Another interesting patch you should perform if you have different than RIL telephony class.
To determine which ril class you have, seek for following line in your build.prop:
Code:
ro.telephony.ril_class=
If you don't have such, mostly it means you are using RIL class and don't need a patch.
in my case it was:
Code:
ro.telephony.ril_class=LGEQualcommRIL
so I'll describe a process for it, pointing what is common.
All ril classes located at com/android/internal/telephony, so go to it.
LGEqualcommRIL have a single smali, so copy only that one[if your class also have another smali with the same name, for example LGEStarRIL$1.smali, copy them too], Also, unlike most classes in CM, LGEQualcommRIL have a dependency - QualcommSharedRIL, which tree you should also move to that folder near LGE one.
Classes that are also have that dependency:
LGEQualcommUiccRIL
HTCQualcommRIL
SamsungQualcommUiccRIL
Others are dervied from RIL and don't have any dependencies like that. As CM involves more and more devices, to determine what dependencies you actually need, ask source code:
Code:
public class LGEQualcommRIL extends QualcommSharedRIL implements CommandsInterface
extends means your dependency you have to also add to MIUI, if it is "RIL", go ahead and continue porting.
To make your class work instead of RIL, you should modify MIUI' PhoneFactory.smali located at the same folder in following way:
Code:
.line 136
new-instance v8, Lcom/android/internal/telephony/RIL;
invoke-direct {v8, p0, v4, v0}, Lcom/android/internal/telephony/RIL;-><init>(Landroid/content/Context;II)V
->
Code:
.line 136
new-instance v8, Lcom/android/internal/telephony/[B]LGEQualcomm[/B]RIL;
invoke-direct {v8, p0, v4, v0}, Lcom/android/internal/telephony/[B]LGEQualcomm[/B]RIL;-><init>(Landroid/content/Context;II)V
it changes a constructor of RIL class to LGEQualcommRIL class. If my lines incorrect, just type RIL in search in Phonefactory, it will show you exactly 2 defines with "RIL" involved.
Another case for patching is android/media/AudioFormat.smali.
Copy all missing lines from base to miui, it would be enough. I have decide to not replacing it coz of constructor that is differ and might one day turn into bomb.
The most complicated smali case, WebSettingsClassic. It do contains lines that should be added, also lines that should be slightly modified.
Let's try to make the process bit easier with these steps:
first of all, find those fields:
Code:
.field private mMediaPreloadEnabled
.field private mWebGLEnabled:Z
they are at the beginning of file, marked as green blocks. Attention: then there is a listing that asks you about default value, like that:
Code:
.line 91
iput-boolean v2, p0, Landroid/webkit/WebSettingsClassic;->mMediaPreloadEnabled:Z
DON'T EVEN TOUCH THEM! Even if you know what are you doing - it will fail on boot if you placed that lines in miui file.
interesting place here.. when you will search for webgl from the beginning, you will hit such block, marked as blue (incompatible):
Code:
goto/16 :goto_1
.end method
.method private native nativeIsWebGLAvailable()Z
.end method
while miui file will show just that:
Code:
goto :goto_1
and ".end method" after. "You f***n kiddng?" - will you ask.. yeah, pure cheat. Let's fix it up:
paste only:
Code:
.end method
.method private native nativeIsWebGLAvailable()Z
before ".end_method" but after "goto :goto_1", so that full block will be instantly turned to whie:
Code:
goto :goto_1
.end method
.method private native nativeIsWebGLAvailable()Z
.end method
except "goto", which will show as differ, but who cares?
After searching "webgl" on base file you will possibly see a code block starting with:
Code:
.method public declared-synchronized isWebGLAvailable()Z
add it without any thought. You should do the same with following methods:
Code:
.method public declared-synchronized setMediaPreloadEnabled(Z)V
.method public declared-synchronized setWebGLEnabled(Z)V
btw, those methods are so-called "setters" - methods in class that intended to adjust value to class field.
DON'T ADD ANYTHING ELSE, IT WILL POSSIBLY BREAK BOOTING AGAIN! You've been warned.
Framework.jar port done!
the only thing to do - assemble it.
services.jar
Unlike framework.jar, there are lesser things to do. But they are also significant for porting process.
ICS-only:
InputManager*.smali - the only thing should be replaced [and located in com/android/server/wm/].
On JellyBean it is located at com/android/server/Input ands also have to be replaced.
You may also replace usb folder, but actually those who have MTP(devices with kernel 3.0 or so, that are having new "USB gadget framework" drivers, consult with development branch for details) are in no need to do so, as for others (as of mine instance on MT development) you have to replace it. In stage 4 I will present my ways to make usb subsystem work on miui.
Also, there is a new smali on Jellybean: watchdog*.smali. Just replace whole tree of this in com/android/server/.
As for diff files, there is one: PowerManagerService.smali(may I shorten its name to PMS?)
there is no matter to diff it like others as it have too much dependencies to resolve and may cause your system crash.
ICS-only:
So, it only asks about nativeStartSurfaceFlingerOffAnimation method. but hey, PMS do have such method, but its name is nativeStartSurfaceFlingerAnimation, so without "Off"; my solution is to add "Off" to it, see that stack:
http://minus.com/lY4DiQfJ451Aq
that's where you should find you first entry (there are 2)
second entry showed there:
http://minus.com/lchMVcHtKe46T
after editing , you should see a huge block to add:
http://minus.com/lbmNygeJBs9klv
add it, and that smali is ported.
end of ICS-only
On jellybean porting it more trivial:
nativeCPUBoost is missing. You will have some defines in base file. Use search by keyword "cpuboost" in base file to determine where they are and just add them to miui one.
defines will be:
Code:
.method private static native nativeCpuBoost(I)V
-method definition.
Code:
.method public cpuBoost(I)V
-method code block.
and nothing extra.
Assemble new services.jar.out to services.jar when complete.
Done those but still not boots or boots but functions improperly? see next Stages- 3 and 4, I will enlighten all moments of debugging what's wrong and also additional tweaks for specific devices that faced problems with porting [It's just impossible to do that for each device, so there is a great thread you could always ask what's wrong if my advices didn't help].
Stage 3
Third part mostly touches cases where tuto above didn't resolved boot problems, also cases where there is no confidence 2nd stage will work/cases when people are trying to investigate themselves but mostly not xperienced in such(the most respectable case). To understand what's going on with your build it would be better to be CM/AOSP/AOKP dev, so you will most likely know where to find an answer. But if it is not about you, let me point on some moments could help.
Stage 3. Understanding logs and debugging
Yes, exactly understanding. Most likely people are going to forum and just posting logcat (that might contain common error). My goal is show you - logcat is not shuch thing you should fear to investigate!
First of all, let's assume something:
adb - powerful tool, in our case the must have thing to make a log. Article on android devs most likely describes all the moments about adb power: http://developer.android.com/tools/help/adb.html
logcat/log - one of the android advantages that allows you to debug what's going on with your system. by "make log" I will assume issuing
Code:
adb logcat >log.txt
command, last argument - log.txt is a text file with log system provided to you (you could use any name).
sometimes we need an answer about things that are going on with baseband (so-called radio). In those cases I usually asking to take radiolog. That's how it could be produced:
Code:
adb logcat -b radio >log.txt
reading it might be a pain, as terms of it are too much hardware-specific, but it anyway complies with principles I will put below.
debug/debugging - process of analyzing code which helps to eliminate bugs (that's why de-bug)
Some people experiencing problems with log, most common are:
-wrong MIUI base which prevents usb subsytem to start (nexus S base most likely allows you to use log)
-no/corrupted/wrong usb drivers on PC
-Windows :crying: most likely is about new usb subsystems etc, so advice is the only one - try on ubuntu (not working without udev rules)
-somewhat corrupted/inconsistent usb port
-lack of "persist.sys.usb.config= mass_storage,adb" in build.prop, specifically "adb" in this line.
Note: if your log only consists of:
Code:
link system/bin/sh failed: no such file or directory
or something like that, you should contact a CM dev, else, you are most likely know what happened ;]
Alright when we got a log, it consist of many many lines that are looping if your system not boots. That's why that kind of situation is sometimes called bootloop. System may repeat a error eternal time it lives, so log might be huge.
To parse what's going on there are some advice:
keywords:
search in log you got some keywords, that might be useful on debugging boot issue;
most common keywords are:
"E/" - error
"E/dalvikvm" - possibly crucial system error
"No such file or directory" - says it all
"couldn't" - android likes that, mostly shows faulty things.
"fail"/"failed" - mostly crucial error
"W/"/"warning" - says it all, but not always warn could be a boot failure cause
"exception"(especially NullPointerException) - points you that something went wrong in framework or application work
I/ tags could be also useful at debugging, but most helpful are errors and warnings.
Most common constructs:
"couldn't find native method", the most common reason of a bootloop.
For instance:
Code:
E/dalvikvm( 100): ERROR: couldn't find native method
E/dalvikvm( 100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
E/JNIHelp ( 100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
Let's parse that construct to extract parts we will fix.
First of all. smali path might be extracted from that line:
Code:
E/JNIHelp ( 100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
->
Code:
android/view/GLES20Canvas
that's it, smali we are looking for is GLES20Canvas.smali. But.. android/view.. where it is? Answer comes from android source, it took some time to analyze frameworks.. Just let's assume: all that starting with "android" in path belongs to framework,jar.
What if path doesn't contain "android" at the beginning?
Again the answer is in source. Paths like"org/" are belong to framework.jar.
"com/android/server" - services.jar (there is the same folder at framework.jar but most likely you don't need to touch it).
another place we could be mixed up:
"com/android/internal" - framework.jar
"com/android/internal/policy/impl/" - android.policy.jar
for framework.jar path ends up on internal, which represents telephony folder. policy/impl is the only android.policy.jar folder.
Other frameworks are actually not used in port as they contain core android functionality which is common.
Note about smali you found:
it might be not smali you are looking for, most likely when code points you to android functionality and widgets (control elements) like combobox or listview, it's a sign to think twice what have you done on your system to port it
it might be tree of smali(remember 2nd stage assumes?), to ease of use, always replace smali with its tree, and only if error becomes worse, think about single smali or about diff(2nd stage assumes again )
from
Code:
E/dalvikvm( 100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
we could extract a method which is missing - nStartTileRendering. In some cases only that method should be added and nothing more.
" android.content.res.Resources$NotFoundException: Resource ID #XXX"
Example:
Code:
E/AndroidRuntime( 3047): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManagerPolicy
E/AndroidRuntime( 3047): android.content.res.Resources$NotFoundException: Resource ID #0x3060008
E/AndroidRuntime( 3047): at android.content.res.Resources.getValue(Resources.j ava:1022)
E/AndroidRuntime( 3047): at android.content.res.MiuiResources.getValue(MiuiRes ources.java:56)
E/AndroidRuntime( 3047): at miui.util.ResourceMapper.resolveReference(Resource Mapper.java:9)
E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil.updateSettings(Haptic FeedbackUtil.java:109)
E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil$SettingsObserver.obse rve(HapticFeedbackUtil.java:92)
E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil.<init>(HapticFeedback Util.java:75)
E/AndroidRuntime( 3047): at com.android.internal.policy.impl.MiuiPhoneWindowMa nager.init(MiuiPhoneWindowManager.java:108)
E/AndroidRuntime( 3047): at com.android.server.wm.WindowManagerService$PolicyT hread.run(WindowManagerService.java:733)
Wrong MIUI base, mostly. Appear when something changed by previous porter (miui) which affects resources you won't have, banal link error.
" Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)"
Hope all of you heared about C language. That error is a form of C "exceptional case"(in other words - exception).
You will see if it happen:
Code:
F/libc ( 2698): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
I/DEBUG ( 130): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 130): Build fingerprint: 'tmous/htc_doubleshot/doubleshot:4.0.3/IML
74K/275847.101:user/release-keys'
I/DEBUG ( 130): pid: 2698, tid: 2698 >>> zygote <<<
I/DEBUG ( 130): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaa
d
I/DEBUG ( 130): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000
I/DEBUG ( 130): r4 00000000 r5 00000027 r6 4086fbfd r7 00000036
I/DEBUG ( 130): r8 40253f04 r9 40233a7e 10 0000904c fp 00009062
I/DEBUG ( 130): ip 4028b240 sp befcfa60 lr 401043c1 pc 40100adc cpsr 600
00030
I/DEBUG ( 130): d0 2f64696f72646e61 d1 2f746e65746e6f63
I/DEBUG ( 130): d2 657373412f736572 d3 726567616e614d74
I/DEBUG ( 130): d4 0000d4cc0000d4b1 d5 0000d4e80000d4cd
yaa.. ENORMOUS code block, build fingerprint, fatal signal and stack trace.. welcome to hell
One little thing: error is right above that block, don't even try to parse its contents, ignore it.
WE ALL DIE!!!111
yaa, series of "died" errors:
Code:
I/ServiceManager( 1478): service 'media.audio_flinger' died
I/ServiceManager( 1478): service 'media.player' died
I/ServiceManager( 1478): service 'media.camera' died
I/ServiceManager( 1478): service 'media.audio_policy' died
IGNORE them, it's a result of exception right above(no matter C exception or java one), it's better to see it instead of posting "WE ALL DIE!!!111"
"Unable to extract+optimize DEX from '/system/framework/framework.jar'" and other WTF cases
examples:
Code:
D/dalvikvm( 103): DexOpt: --- BEGIN 'framework.jar' (bootstrap=1) ---
E/dalvikvm( 172): Duplicate class definition: 'Landroid/media/MediaRecorder;'
E/dalvikvm( 172): Trouble with item 2900 @ offset 0x17a86c
E/dalvikvm( 172): Cross-item verify of section type 0006 failed
E/dalvikvm( 172): ERROR: Byte swap + verify failed
E/dalvikvm( 172): Optimization failed
W/dalvikvm( 103): DexOpt: --- END 'framework.jar' --- status=0xff00, process failed
E/dalvikvm( 103): Unable to extract+optimize DEX from '/system/framework/framework.jar'
D/dalvikvm( 103): Unable to process classpath element '/system/framework/framework.jar'
E/JNIHelp ( 103): Native registration unable to find class 'android/debug/JNITest', aborting
Code:
05-30 14:15:15.970: E/NetworkLocationRealOs(2304): no android ID; can't access encrypted cache
05-30 14:15:15.970: E/NetworkLocationRealOs(2304): java.io.IOException: no android ID; can't access encrypted cache
Code:
1012: 07-03 03:28:21.350: E/System(1538): ************ Failure starting core service
07-03 03:28:21.350: E/System(1538): java.lang.NullPointerException
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.grantPermissionsLPw(PackageManagerService.java:4299)
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.updatePermissionsLPw(PackageManagerService.java:4247)
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1170)
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:858)
07-03 03:28:21.350: E/System(1538): at com.android.server.ServerThread.run(SystemServer.java:167)
07-03 03:28:21.350: I/SystemServer(1538): Input Method Service
07-03 03:28:21.360: W/SystemServer(1538): ***********************************************
1021: 07-03 03:28:21.370: A/SystemServer(1538): BOOT FAILURE starting Input Manager Service
1022: 07-03 03:28:21.370: A/SystemServer(1538): java.lang.NullPointerException
1023: 07-03 03:28:21.370: A/SystemServer(1538): at android.app.PendingIntent.getBroadcast(PendingIntent.java:293)
1024: 07-03 03:28:21.370: A/SystemServer(1538): at com.android.server.InputMethodManagerService.<init>(InputMethodManagerService.java:548)
1025: 07-03 03:28:21.370: A/SystemServer(1538): at com.android.server.ServerThread.run(SystemServer.java:271)
1026: 07-03 03:28:21.400: E/AndroidRuntime(1538): Error reporting WTF
1027: 07-03 03:28:21.400: E/AndroidRuntime(1538): java.lang.NullPointerException
1028: 07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
1029: 07-03 03:28:21.400: E/AndroidRuntime(1538): at android.util.Log$1.onTerribleFailure(Log.java:103)
1030: 07-03 03:28:21.400: E/AndroidRuntime(1538): at android.util.Log.wtf(Log.java:278)
1031: 07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
1032: 07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.server.ServerThread.run(SystemServer.java:274)
mostly likely is about way assembling framework files. Also some of them might be just corrupted by accident. Sometimes these errors caused by wrong smali replacement or wrong diff methodology. Or it might be just banal reason - no place in system or cache partitions.
English []
Most log parts are in mere, not technician English,log might be read as little book with bright characters. Find what you are looking for and fix it..
Source code is your best friend in porting
I'd recommend to have an android source code [from internet or on your local PC] to port something that outstands of rules I listed. For example CM frameworks source could be found here: https://github.com/CyanogenMod/android_frameworks_base .
That mostly affect cases in which hardware that is not working/working but not perfect/working incorrect on MIUI but worked like a charm on base.
Any log line represents a line of code in source, that one could search and debug from there (as source is mostly common, that miui ports possibility proove). Each smali represents a java source code or its part(- subclass which signed by $), each java is in frameworks folder on source (mostly frameworks/base). Log line is a message, which formed with C rules about these rules, so you have to avoid ciphers or guess how could code represent that message. You may search guessed line in source to locate java file, or locate it manually according to smali location and my advice and search in it.
Happy debugging
Stage 4
Last part. We recently ported miui, all is great and mostly functions, But.. am I the only one or that one looks incomplete? One could make its port complete by following next stage:
Stage 4. Advanced tweaks and specific hardware fixes
USB subsystem(mass storage/tether/debugging sign)
First of all, little self - check:
you have to be on old USB Gadget framework kernel source. Those you could clarify by talking with cm dev. Also I'm not rejecting it could work for others but in slightly modified sequence.
Starting from framework-res.apk.
You have to disassemble it first, but before you use actual "apktool d", you should also issue:
Code:
apktool if framework-res.apk
that is necessary for decoding internal resources correctly.
Disassemble base and MIUI frameworks and leave base one as we will work with MIUI one and will use base as a reference.
After disassembling, let's go to res/values in it:
As old usb gadget needs old mass storage path which was applicable to gingerbread, we should add that path to strings.xml.
If you only disassembled that file, you should see something like that:
Code:
<string name="launchBrowserDefault">Launch Browser?</string>
<string name="SetupCallDefault">Accept Call?</string>
</resources>
exact line to add at the near end:
Code:
<string name="config_legacyUmsLunFile">/sys/devices/platform/usb_mass_storage/lun0/file</string>
so that you will get something like that:
Code:
<string name="launchBrowserDefault">Launch Browser?</string>
<string name="SetupCallDefault">Accept Call?</string>
<string name="config_legacyUmsLunFile">/sys/devices/platform/usb_mass_storage/lun0/file</string>
</resources>
Remark:
that case is the only applicable to devices which have old kind SD card only. Look at the framework-res on your device, it also might have different LUN file path(actually it is a file, which collects all your SD data to be mounted as usb drive), that you should always replace in mind my defines with yours to make actual usb work.
Devices with flash memory(also called EMMC or embedded SD on flash) and SD[or without SD support at all], should be treat in custom way unfortunately I don't know, consult with your device CM devs for more details. And hey, most of these devices are on new usb gadget, so don't need my guide at all
<<
After addition, save strings.xml and go to res/xml in the same framework-res.That's where you also should use base framework-res.
copy from base to miui storage_list.xml and replace when prompted. That file provides only your device-specific SD support, not nexus S or whatever miui base you use.
Assemble miui framework-res.apk and, attention! disassemble it again. That action allows you to see resource ID-s for each line exactly in manner they will be used in living rom.
Remark:
Each resource-drawable, string, boolean switcher etc is treated by its ID - personal identificator. Resources are used in other frameworks and APK to identify something necessary for them. framework-res.apk is a resource storage, which handled by android.content.res package classes like ResourceManager.
USB subsystem also uses some resource to provide to user actual USB status and right mass storage.
<<
Make sure you have both base and miui framework-res, then open both: res/values/public.xml.
Now, we could start the main part - services.jar mod
After adding line "config_legacyUmsLunFile" there will be its id in public.xml after compiling. That's why I stand you should disassemble assembled framework-res again. Remember both ID-s from base and from miui.
Also you need ID-s from both base and miui for following resources:
"stat_sys_adb" - usb debugging icon
"adb_active_notification_title" - usb debugging short message
"adb_active_notification_message" - usb debugging long message
JellyBean-specific:
"config_oemUsbModeOverride" - usb mode override flag
Remark:
public.xml is a resource dictionary, example of line:
Code:
<public type="drawable" name="stat_sys_adb" id="0x010804f8" />
means as follows: public type="drawable", drawable - mere picture for different resolution, drawn on the screen, public type subsequently is a type of resource. name="stat_sys_adb" - name of resource, that may be name of acual file or string or bool define etc. id="0x010804f8" - hexadecimal resource identifier. Important note: most resource users are treat resource name without leading zero, for example, 0x010804f8 in usb smalis presented as 0x10804f8, that fact will be necessary on finding and replacing resources(I'd call it matching process), exactly what we are going to do with USB folder smalis.
<<
Open USB folder in miui services.jar (smali/com/android/server/usb), you will see smalis, as usual. Replace its contents with those in base services.jar' usb folder.
Then we are going to match resources: each ID you found in public.xml should be bound to resource call in smali. Let's start:
we will work with miui usb folder smalis. Open UsbService.smali, now remember what id was bound to config_legacyUmsLunFile in base public.xml, for example it was 0x01040029, eliminate leading zero and search file contents for resource 0x1040029, so you will find its entry. Replace that entry with resource you got from public.xml in miui, again, without leading zero. Search for the same ID in LegacyUsbDeviceManager.smali and replace it to miui one.
If you got how that process work, remaining task is match other resource id-s that listed above (usb debugging icon, long and short message). They will be in following files
LegacyUsbDeviceManager$LegacyUsbHandler
UsbDeviceManager$UsbHandler
JellyBean-specific:
UsbDeviceManager.smali also contains necessary switch - config_oemUsbModeOverride, also match ID-s with miui framework and here you go.
USB debugging message is not so necessary as mass storage [coz if resource of mass storage file not found, you won't get usb subsystem to work].
After matching is done, assemble services.jar.
Done! USB subsystem now works.
Another moment could be necessary is to change USB tether interface device to usb0 (as Nexus S is using rndis0 instead, and base whatever you choosed may also have another tether interface)
To change it, you again need a disassembled framework-res.apk(don't forget "apktool if") In it navigate to res/values/arrays.xml.
find the following:
Code:
<string-array name="config_tether_usb_regexs">
in nexus S full block will look like that:
Code:
<string-array name="config_tether_usb_regexs">
<item>[COLOR="Orange"]rndis0[/COLOR]</item>
</string-array>
Look, I highlighted interface name for you! So the only part you should do it is just replace it to yours. Example for usb0:
Code:
<string-array name="config_tether_usb_regexs">
<item>[COLOR="Orange"]usb0[/COLOR]</item>
</string-array>
Interface name could be seen in the same file but in base rom.
By The Way, do you see
Code:
<string-array name="config_tether_wifi_regexs">
<item>[COLOR="Orange"]wl0.1[/COLOR]</item>
</string-array>
right after usb one? That is the interface for wifi tether, that you also should change to yours (one your base needed) and that is it! I saw somewhere following interface variant:
Code:
<string-array name="config_tether_wifi_regex[/B]">
<item>[COLOR="orange"]tiap//d[/COLOR]</item>
</string-array>
which is for Sony [Ericsson] devices with Texas Instruments wifi chip, just see yours in base to check this out.
in the same file you may also fix Autobrightness levels, I mean those ones:
Code:
<integer-array name="config_autoBrightnessLevels">
<integer-array name="config_autoBrightnessLcdBacklightValues">
<integer-array name="config_autoBrightnessButtonBacklightValues">
<integer-array name="config_autoBrightnessKeyboardBacklightValues">
MIUI doesn't have autobrightness tweaks so that is the only way those levels could be applied.
To fully close framework-res and don't come back no more, let's see other things you could do with it:
Minimal brightness too low
There is a bug with brightness: when you regulating it to minmal, screen comes black and won't come back until wipe.
Reason is banal - screen highlight couldn't handle so low value (in nexus S it's 10), first of all find a line at res/values/integers.xml:
Code:
<integer name="config_screenBrightnessDim">10</integer>
in most cases value "20" will be reliable, so change "10" to "20":
Code:
<integer name="config_screenBrightnessDim">20</integer>
Fix "Network won't automatically picks up"
The problem on some devices like HTC on 7x30 QC architecture, is in one little switch [res/values/bools.xml] :
Code:
<bool name="skip_restoring_network_selection">[COLOR="orange"]true[/COLOR]</bool>
just change it to "false":
Code:
<bool name="skip_restoring_network_selection">[COLOR="orange"]false[/COLOR]</bool>
and network will come up.
Fix "Deep sleep issue on some devices"
Problem reported Wildfire S users resolved by that little define [res/values/bools.xml] :
Code:
<bool name="config_bluetooth_adapter_quick_switch">[COLOR="orange"]true[/COLOR]</bool>
change it to "false":
Code:
<bool name="config_bluetooth_adapter_quick_switch">[COLOR="orange"]false[/COLOR]</bool>
and issue will be resolved.
Also, it might be interesting to check out all bools.xml defines to see if something should be changed.
Fixing wrong hardware-software keyboard relationship [auto-rotate and showing issues] (also for galaxy tab 7)
Those with built-in hardware keyboard may experiencing following issue: when hardware keyboard opened, you also see a software keyboard and when you just need a software keyboard, it won't show. Also auto-rotate won't work properly when keyboard is activated.
Seems on Galaxy Tab 7 Samsung(or maybe Cyanogen Mod?) handles software keyboard in relation of some kind of dummy hardware keyboard, so it's our case too.
ICS-only:
To fix that issue, disassemble miui android.policy.jar and navigate to smali/com/android/internal/policy/impl/PhoneWindowManager.smali
there are three constants, according to the source: 0(0x0) - lid closed, 1(0x1) - lid open, and -1(-0x1) - lid absent.
they are located after a function "GetSwitchState".
Original idea was to swap these constants so that system gets fooled about your keyboard state:
code that exists:
Code:
const/4 v1, 0x1
-> code that you will get after mod:
Code:
const/4 v1, 0x0
the same you should proceed with zero:
Code:
const/4 v1, 0x0
->
Code:
const/4 v1, 0x1
you might also have to change
Code:
const/4 v1, -0x1
->
Code:
const/4 v1, 0x1
to get rid of absent state.
another ways to fix this up:
res/values/bools.xml
change
Code:
<bool name="config_forceDisableHardwareKeyboard">[COLOR="Orange"]false[/COLOR]</bool>
->
Code:
<bool name="config_forceDisableHardwareKeyboard">[COLOR="Orange"]true[/COLOR]</bool>
as we see, it force-disables hardware keyboard so that only soft one will show up.
for devices with hardware keyboard that might also be a deal:
res/values/integers.xml
change the following two line:
Code:
<integer name="config_lidOpenRotation">90</integer>
<integer name="config_lidKeyboardAccessibility">1</integer>
Next questions will be related to various APK fixes:
before we start you need to know that all apk are depend on framework-res resources, so before you start disassembling them, let's clarify steps: "apktool if" each framework with resources you have in miui, in stock there are two:
Code:
apktool if framework-res.apk
Code:
apktool if framework-miui-res.apk
then each apk could be disassembled as usual.
Getting rid of MIUI start screen
Have you mentioned it? Ya, that annoying setup wizard.. In the end it suggests you to input your XIAOMI account which some users may never had and won't create. Keep them out of stress - get rid of that wizard!
Let me show how:
there are 2 ways, one - fully infiltrate that wizard from user's eye, second - will let you choose a language(useful in multilanguage releases) and setup wifi, then go right to homescreen.
Common moment: disassemble Provision.apk and go to smali contents - com/android/provision and choose DefaultActivity.smali
First method - codename "infiltration":
we will modify contents of "isProvisioned" method.
Kill all except "const/4 v1" and "return v1" in it, change const/4 v1 to 0x1 so you will get something like that:
Code:
.method private deviceIsProvisioned()Z
.locals 3
.prologue
const/4 v1, 0x1
return v1
.end method
actually, we are just saying to setup wizard that device is already passed its steps and don't need them anymore. So that setup wizard won't even be showed.
Second method - codename "multilang":
it is based on exploit, which is as follows: one could bypass xiaomi account prompt if before flashing miui he pull off sim card and then on setupwizard won't set up wifi. Wizard will send you to "sim not found" dialog, which then will allow one to "dismiss" account request.
Line which asks about SIM state is as follows:
Code:
invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getSimState()I
then
Code:
move-result v1
const/4 v2, 0x5
some variable now consists of returned value.
To initialte that value to fail a check, I've just changed constant value to one that telephony manager will never return: -0x5
Code:
const/4 v2, -0x5
Now its time to point fail to logical end of wizard, we are going to change label..
Code:
if-ne v1, v2, :[COLOR="DarkOrange"]cond_5[/COLOR]
if not equals v1, v2 (if (v1!=v2) in С manner ) go to label cond_5. As we stated, v1 won't be equal v2,so it will go to cond_5, which is not a place we wish to go (coz of unbelieveable hardcode). But there is a wishable place - cond_6:
Code:
invoke-direct {p0}, Lcom/android/provision/DefaultActivity;->finishSetup()V
yyyyeah, right to finish
so we are changing cond_5 to cond_6:
Code:
if-ne v1, v2, :[COLOR="DarkOrange"]cond_6[/COLOR]
that's it! In the end you will get: language selection->wifi setup->homescreen, almost briliant!
Whether you choosed first or second method - assemble apk you got after all things done.
Fixing not working mic in calls
Disassemble Phone.apk and navigate to res/values/bools.xml to change:
Code:
<bool name="send_mic_mute_to_AudioManager">[COLOR="Orange"]false[/COLOR]</bool>
->
Code:
<bool name="send_mic_mute_to_AudioManager">[COLOR="orange"]true[/COLOR]</bool>
Fixing pin code prompt on xperia devices
Disassemble Phone.apk and navigate to res/values/bools.xml to change:
Code:
<bool name="ignore_sim_network_locked_events">[COLOR="orange"]false[/COLOR]</bool>
->
Code:
<bool name="ignore_sim_network_locked_events">[COLOR="orange"]true[/COLOR]</bool>
Enabling hidden settings
Did you know that you may activate LEDs settings? Or maybe use camera key to trigger some useful functions? If not, follow the next little tuto.
Disassemble Settings.apk, navigate to bools.xml in res/values.
Activating LED settings
It would be enough to change
Code:
<bool name="has_led">[COLOR="orange"]false[/COLOR]</bool>
->
Code:
<bool name="has_led">[COLOR="orange"]true[/COLOR]</bool>
As you may got, other hidden settings are also there, I'll just list them and assume all of them needs just replacement false to true to make them activated
Multitouch gestures
Still didn't mentioned how they works, but, xiaomi wouldn't make something just for its appearence in settings.
Code:
<bool name="has_multi_touch">[COLOR="orange"]false[/COLOR]</bool>
MI button
Mi button on any device that has camera button!
What is MI button? It's a tweak that allows dedicated button to do something instead of its mere function (for example-issuing camera app as for cam button). You may adjust any app in rom to be executed, any switch from miui switchers and also trigger some actions like "menu", "call", "screen off toggle"(allows you to switch screen on and off, so possibly replace power button which is mostly weak) and "screenshot".
how to activate it? - the same:
Code:
<bool name="has_camera_key">[COLOR="orange"]false[/COLOR]</bool>
change to "true"
Dock settings
mere dock station settings dialog.
Code:
<bool name="has_dock_settings">[COLOR="orange"]false[/COLOR]</bool>
Trackball settings
for devices such as nexus one with active trackball.
Code:
<bool name="has_track_ball">[COLOR="orange"]false[/COLOR]</bool>
"Black bar" fix
more details - https://www.dropbox.com/s/6u63tozthmj6xa9/Screenshot_2012-08-07-09-49-09.png
Let's get MiuiSystemUI.apk and disassemble it.
Locate to res/values/drawables.xml and delete first line:
Code:
<item type="drawable" name="notification_header_bg">#ff000000</item>
it might vary but always contains black colour (#ff000000). Recompile modified systemUI.
Least but hope not last define for that guide, hope it will fill up with latest and greatest from MIUI devices users and porters around the world.
Cheers, L_F.
Finally Come up with great Tut.. Thanks Alot Brother
Very detailed and good written tutorial! Thanks and good job!
Thanks
AS my device bricked, you could always tell me what to replace/add on my guide, so it will look up-to-date
ADD: added Stage 3.
Done. Have something to add? Write here, I'll form a new guide branch for you. Found a mistake? Contact me.
BTW, if somebody have more time than I, It would be great you could support that guide to keep it up-to-date.
Thanks for the detailed guide. I just started porting for my device. I have one question though. Once I successfully port to one version, what are the files I need to consider for next version? I think some files I can just use from the previous port (like hardware related files). If you have any suggestions on the files I have to look for while porting next version of miui, it will be very helpful. Not sure whether I am asking the right question. Looks like once I do this I can reuse all the files for next port
raj_k_r said:
Thanks for the detailed guide. I just started porting for my device. I have one question though. Once I successfully port to one version, what are the files I need to consider for next version? I think some files I can just use from the previous port (like hardware related files). If you have any suggestions on the files I have to look for while porting next version of miui, it will be very helpful. Not sure whether I am asking the right question. Looks like once I do this I can reuse all the files for next port
Click to expand...
Click to collapse
I replace all the files from last build on next and try to boot.
If I get errors, I look if I have to replace more files or re-replace some.
what are the files I need to consider for next version? I
Click to expand...
Click to collapse
All the same, you have to repeat guide for each release coz frameworks are changing each release.
I'd form a patch kit with all smalis you want to replace and patch remaining each time.
here is my logcat
what the things need to change
assetmanager.smali ??? and/or any other things ????
Code:
$ adb logcat
I/miui ( 1113): Welcome to Android 4.0.4 /
I/miui ( 1114): .-.-.-..-..-..-..-. .-..-..---.
I/miui ( 1115): | | | || || || || | | || | \ \
I/miui ( 1116): '-'-'-''-''----''-'O'----''---'
I/miui ( 1117):
I/run-parts( 1108): dealing with default theme
I/mountext( 1129): Checking /dev/block/mmcblk0p2 for errors...
I/run-parts( 1108): e2fsck 1.41.12 (17-May-2010)
I/run-parts( 1108): /dev/block/mmcblk0p2: clean, 11/1050624 files, 132591/420099 7 blocks
I/run-parts( 1108): mount: mounting /dev/block/mmcblk0p2 on /sd-ext failed: No s uch file or directory
E/mountext( 1133): Unable to mount filesystem for /sd-ext!
I/mountext( 1136): No swap partition found.
I/apps2sd ( 1139): /sd-ext not mounted...nothing to do
I/run-parts( 1108): cp: can't stat '/system/etc/wifi/hostapd.conf': No such file or directory
I/run-parts( 1108): chown: /data/misc/wifi/hostapd.conf: No such file or directo ry
I/run-parts( 1108): chmod: /data/misc/wifi/hostapd.conf: No such file or directo ry
I/DEBUG ( 1158): debuggerd: Jul 14 2012 05:52:57
I/Vold ( 1156): Vold 2.1 (the revenge) firing up
D/Vold ( 1156): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media )
I/Netd ( 1157): Netd 1.0 starting
D/Vold ( 1156): Volume sdcard state changing 0 (No-Media) -> 2 (Pending)
D/DirectVolume( 1156): DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 1, PARTN 1
D/DirectVolume( 1156): DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 2, PARTN 2
D/Vold ( 1156): Volume sdcard state changing 2 (Pending) -> 1 (Idle-Unmounted )
E/Netd ( 1157): Unable to bind netlink socket: No such file or directory
E/Netd ( 1157): Unable to open quota2 logging socket
D/AndroidRuntime( 1161):
D/AndroidRuntime( 1161): >>>>>> AndroidRuntime START com.android.internal.os.Zyg oteInit <<<<<<
D/AndroidRuntime( 1161): CheckJNI is OFF
I/SurfaceFlinger( 1160): SurfaceFlinger is starting
I/SurfaceFlinger( 1160): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
E/qsd8k.gralloc( 1160): We support 2 buffers
I/qsd8k.gralloc( 1160): using (fd=9)
I/qsd8k.gralloc( 1160): id = msmfb31_1ffff
I/qsd8k.gralloc( 1160): xres = 480 px
I/qsd8k.gralloc( 1160): yres = 854 px
I/qsd8k.gralloc( 1160): xres_virtual = 480 px
I/qsd8k.gralloc( 1160): yres_virtual = 1708 px
I/qsd8k.gralloc( 1160): bpp = 16
I/qsd8k.gralloc( 1160): r = 11:5
I/qsd8k.gralloc( 1160): g = 5:6
I/qsd8k.gralloc( 1160): b = 0:5
I/qsd8k.gralloc( 1160): width = 76 mm (160.421051 dpi)
I/qsd8k.gralloc( 1160): height = 136 mm (159.497055 dpi)
I/qsd8k.gralloc( 1160): refresh rate = 0.00 Hz
D/CALCFPS ( 1160): DEBUG_CALC_FPS: 0
D/CALCFPS ( 1160): period: 10
D/CALCFPS ( 1160): ignorethresh_us: 500000
D/CALCFPS ( 1160): DEBUG_CALC_FPS: 0
D/CALCFPS ( 1160): period: 10
D/CALCFPS ( 1160): ignorethresh_us: 500000
D/FramebufferNativeWindow( 1160): mNumBuffers = 2
D/libEGL ( 1160): loaded /system/lib/egl/libGLES_android.so
D/libEGL ( 1160): loaded /system/lib/egl/libEGL_adreno200.so
D/libEGL ( 1160): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
D/libEGL ( 1160): loaded /system/lib/egl/libGLESv2_adreno200.so
I/AudioFlinger( 1163): Loaded primary audio interface from LEGACY Audio HW HAL ( audio)
I/AudioFlinger( 1163): Using 'LEGACY Audio HW HAL' (audio.primary) as the primar y audio interface
I/AudioFlinger( 1163): Loaded a2dp audio interface from A2DP Audio HW HAL (audio )
D/AudioHardwareInterface( 1163): setMode(NORMAL)
I/AudioHardwareQSD( 1163): Set master volume to 1.000000.
I/CameraService( 1163): CameraService started (pid=1163)
E/CameraService( 1163): Could not load camera HAL module
I/SurfaceFlinger( 1160): EGL informations:
I/SurfaceFlinger( 1160): # of configs : 35
I/SurfaceFlinger( 1160): vendor : Android
I/SurfaceFlinger( 1160): version : 1.4 Android META-EGL
I/SurfaceFlinger( 1160): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_fe nce_sync EGL_ANDROID_image_native_buffer EGL_ANDROID_image_native_buffer EGL_AND ROID_get_render_buffer
I/SurfaceFlinger( 1160): Client API: OpenGL ES
I/SurfaceFlinger( 1160): EGLSurface: 5-6-5-0, config=0x0
I/SurfaceFlinger( 1160): OpenGL informations:
I/SurfaceFlinger( 1160): vendor : Qualcomm
I/SurfaceFlinger( 1160): renderer : Adreno (TM) 200
I/SurfaceFlinger( 1160): version : OpenGL ES-CM 1.1
I/SurfaceFlinger( 1160): extensions: GL_AMD_compressed_ATC_texture GL_AMD_perfor mance_monitor GL_APPLE_texture_2D_limited_npot GL_ARB_vertex_buffer_object GL_EX T_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_ 2_10_10_10_REV GL_OES_blend_equation_separate GL_OES_blend_func_separate GL_OES_ blend_subtract GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_te xture GL_OES_depth_texture GL_OES_draw_texture GL_OES_EGL_image GL_OES_EGL_image _external GL_OES_framebuffer_object GL_OES_matrix_palette GL_OES_packed_depth_st encil GL_OES_point_size_array GL_OES_point_sprite GL_OES_read_format GL_OES_rgb8 _rgba8 GL_OES_stencil_wrap GL_OES_texture_cube_map GL_OES_texture_env_crossbar G L_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear G L_OES_texture_npot GL_OES_texture_mirrored_repeat GL_QCOM_binning_control GL_QCO M_extended_get GL_QCOM_tiled_rendering GL_AMD_compressed_3DC_texture
I/SurfaceFlinger( 1160): GL_MAX_TEXTURE_SIZE = 4096
I/SurfaceFlinger( 1160): GL_MAX_VIEWPORT_DIMS = 4096 x 4096
I/SurfaceFlinger( 1160): flags = 00200000
D/CALCFPS ( 1160): DEBUG_CALC_FPS: 0
D/CALCFPS ( 1160): period: 10
D/CALCFPS ( 1160): ignorethresh_us: 500000
D/libEGL ( 1273): loaded /system/lib/egl/libGLES_android.so
D/libEGL ( 1273): loaded /system/lib/egl/libEGL_adreno200.so
D/libEGL ( 1273): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
D/libEGL ( 1273): loaded /system/lib/egl/libGLESv2_adreno200.so
E/dalvikvm( 1161): ERROR: couldn't find native method
E/dalvikvm( 1161): Requested: Landroid/content/res/AssetManager;.splitThemePacka ge:(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
E/JNIHelp ( 1161): RegisterNatives failed for 'android/content/res/AssetManager' , aborting
F/libc ( 1161): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
I/AudioFlinger( 1163): AudioFlinger's thread 0x105c8 ready to run
W/AudioFlinger( 1163): Thread AudioOut_1 cannot connect to the power manager ser vice
I/AudioHardwareQSD( 1163): Routing audio to Speakerphone
D/AudioHardwareQSD( 1163): Switching audio device to
D/AudioHardwareQSD( 1163): Speakerphone
I/AudioPolicyService( 1163): Loaded audio policy from LEGACY Audio Policy HAL (a udio_policy)
I/DEBUG ( 1158): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** * **
I/DEBUG ( 1158): Build fingerprint: 'SEMC/LT18i_0000-0000/LT18i:4.0.3/4.1.C.0. 7/-H9_3w:user/release-keys'
I/DEBUG ( 1158): pid: 1161, tid: 1161 >>> zygote <<<
I/DEBUG ( 1158): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaa d
I/DEBUG ( 1158): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000
I/DEBUG ( 1158): r4 00000000 r5 00000027 r6 40838acd r7 00000036
I/DEBUG ( 1158): r8 401aca80 r9 4018d722 10 0000904c fp 00009062
I/DEBUG ( 1158): ip 401f7240 sp beedba60 lr 4001f881 pc 4001bbcc cpsr 600 00030
I/DEBUG ( 1158): d0 2f64696f72646e61 d1 2f746e65746e6f63
I/DEBUG ( 1158): d2 657373412f736572 d3 726567616e614d74
I/DEBUG ( 1158): d4 0000d4cc0000d4b1 d5 0000d4e80000d4cd
I/DEBUG ( 1158): d6 0000d5040000d4e9 d7 0000d5200000d505
I/DEBUG ( 1158): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 1158): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 1158): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 1158): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 1158): d16 7265747369676552 d17 207365766974614e
I/DEBUG ( 1158): d18 0000d5740000d559 d19 0000d5900000d575
I/DEBUG ( 1158): d20 0000d5ac0000d591 d21 0000d5c80000d5ad
I/DEBUG ( 1158): d22 0000d5e40000d5c9 d23 0000d6000000d5e5
I/DEBUG ( 1158): d24 0000000000000000 d25 0000000000000000
I/DEBUG ( 1158): d26 0000000000000000 d27 0000000000000000
I/DEBUG ( 1158): d28 0000000000000000 d29 0000000000000000
I/DEBUG ( 1158): d30 0000000000000000 d31 0000000000000000
I/DEBUG ( 1158): scr 60000010
I/DEBUG ( 1158):
I/AudioHardwareQSD( 1163): AudioHardware pcm playback is going to standby.
I/DEBUG ( 1158): #00 pc 00017bcc /system/lib/libc.so
I/DEBUG ( 1158): #01 pc 0000c282 /system/lib/libnativehelper.so (jn iRegisterNativeMethods)
I/DEBUG ( 1158): #02 pc 00044778 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime21registerNativeMethodsEP7_JNIEnvPKcPK15JNINativeMet hodi)
I/DEBUG ( 1158): #03 pc 0005e0a6 /system/lib/libandroid_runtime.so (_ZN7android37register_android_content_AssetManagerEP7_JNIEnv)
I/DEBUG ( 1158): #04 pc 00044884 /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): #05 pc 000448b6 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime8startRegEP7_JNIEnv)
I/DEBUG ( 1158): #06 pc 000449ac /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcS2_)
I/DEBUG ( 1158): #07 pc 00008f0a /system/bin/app_process
I/DEBUG ( 1158): #08 pc 00016bd0 /system/lib/libc.so (__libc_init)
I/DEBUG ( 1158):
I/DEBUG ( 1158): code around pc:
I/DEBUG ( 1158): 4001bbac 4623b15c 2c006824 e026d1fb b12368db \.#F$h.,..&..h# .
I/DEBUG ( 1158): 4001bbbc 21014a17 6011447a 48124798 24002527 .J.!zD.`.G.H'%. $
I/DEBUG ( 1158): 4001bbcc f7f47005 2106edda ee86f7f5 460aa901 .p.....!....... F
I/DEBUG ( 1158): 4001bbdc f04f2006 94015380 94029303 ea32f7f5 . O..S........2 .
I/DEBUG ( 1158): 4001bbec 4622a905 f7f52002 f7f4ea3c 2106edc6 .."F. ..<...... !
I/DEBUG ( 1158):
I/DEBUG ( 1158): code around lr:
I/DEBUG ( 1158): 4001f860 41f0e92d 46804c0c 447c2600 68a56824 -..A.L.F.&|D$h. h
I/DEBUG ( 1158): 4001f870 e0076867 300cf9b5 dd022b00 47c04628 gh.....0.+..(F. G
I/DEBUG ( 1158): 4001f880 35544306 37fff117 6824d5f4 d1ee2c00 .CT5...7..$h.,. .
I/DEBUG ( 1158): 4001f890 e8bd4630 bf0081f0 00028c7e 41f0e92d 0F......~...-.. A
I/DEBUG ( 1158): 4001f8a0 fb01b086 9004f602 461f4815 4615460c .........H.F.F. F
I/DEBUG ( 1158):
I/DEBUG ( 1158): memory map around addr deadbaad:
I/DEBUG ( 1158): beec7000-beedc000 [stack]
I/DEBUG ( 1158): (no map for address)
I/DEBUG ( 1158): (no map above)
I/DEBUG ( 1158):
I/DEBUG ( 1158): stack:
I/DEBUG ( 1158): beedba20 4019702a /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedba24 4b9f7e00 /dalvik-LinearAlloc (deleted)
I/DEBUG ( 1158): beedba28 4b9f75e8 /dalvik-LinearAlloc (deleted)
I/DEBUG ( 1158): beedba2c 0000002b
I/DEBUG ( 1158): beedba30 40048780 /system/lib/libc.so
I/DEBUG ( 1158): beedba34 40048718 /system/lib/libc.so
I/DEBUG ( 1158): beedba38 00000000
I/DEBUG ( 1158): beedba3c 4001f881 /system/lib/libc.so
I/DEBUG ( 1158): beedba40 00000000
I/DEBUG ( 1158): beedba44 beedba74 [stack]
I/DEBUG ( 1158): beedba48 40838acd /system/lib/libdvm.so
I/DEBUG ( 1158): beedba4c 00000036
I/DEBUG ( 1158): beedba50 401aca80 /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedba54 4001e9ed /system/lib/libc.so
I/DEBUG ( 1158): beedba58 df0027ad
I/DEBUG ( 1158): beedba5c 00000000
I/DEBUG ( 1158): #00 beedba60 1d200031
I/DEBUG ( 1158): beedba64 52010c85
I/DEBUG ( 1158): beedba68 40196926 /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedba6c 0000f2c8 [heap]
I/DEBUG ( 1158): beedba70 40196926 /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedba74 fffffbdf
I/DEBUG ( 1158): beedba78 00000036
I/DEBUG ( 1158): beedba7c 0000f2c8 [heap]
I/DEBUG ( 1158): beedba80 40196926 /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedba84 401d0285 /system/lib/libnativehelper.so
I/DEBUG ( 1158): #01 beedba88 0000f2c8 [heap]
I/DEBUG ( 1158): beedba8c 1d200031
I/DEBUG ( 1158): beedba90 0000f2c8 [heap]
I/DEBUG ( 1158): beedba94 4018dbb8 /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedba98 40196926 /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedba9c 4019365b /system/lib/libandroid_runtime.so
I/DEBUG ( 1158): beedbaa0 1d200025
I/DEBUG ( 1158): beedbaa4 4015177b /system/lib/libandroid_runtime.so
I/ServiceManager( 1155): service 'media.audio_flinger' died
I/ServiceManager( 1155): service 'media.player' died
I/ServiceManager( 1155): service 'media.camera' died
I/ServiceManager( 1155): service 'media.audio_policy' died
what the things need to change
assetmanager.smali ???
Click to expand...
Click to collapse
right you are. Read third stage, you will orient on those logs more fluently ;]
Ленс, у меня при декомпиляции frasmework.jar от miui.us(Desire HD) появляются ошибки: http://yadi.sk/d/8ylx4nI504DD
Подскажи,это нормально или нет?
Lens, mind you translate that to russian or ukrainian and share with me? My mail [email protected]
Click to expand...
Click to collapse
I'm not planning such translation in near future, sorry.
пока нет времени на подобный перевод, извините.
lens! log attached
http://sebsauvage.net/paste/?c0dc044424fe8df6#mlqLGewvWaQYfr2e/iPyiMotdNf1+oE50qBIn5IGPNA=
Hello,
Can same one help me out? My MIUI port has two mayor issue. First is sometimes my device not boot. Seems totally random for me. The logcat simple stops at a point, and it not continue the reboot process, but the boot animation just going and going. After I reboot my device it boot up without any problem... Sometimes boot up at the first time... sometimes not... Seems totally random.
Here is the log: http://pastebin.com/XVMBQS8L
As I mentioned it just stop at this and not go any further until I reset with the reset button.
My other problem with it is, after I receive an email and MIUI send a notification to the statusbar soon after it crash. And keeps crash (reboot) until I remove those notifacations. Here is the log: http://pastebin.com/Fn2zhAxL
Any idea how to fix it? Thank you very much in advance!
log attached
http://sebsauvage.net/paste/?c0dc044...E50qBIn5IGPNA=
Click to expand...
Click to collapse
that one:
Code:
E/AndroidRuntime(1305): java.lang.NoClassDefFoundError: com.android.server.CpuGovernorService
check your services.jar for CpuGovernorService I almost sure it's not there
sometimes my device not boot. Seems totally random for me. The logcat simple stops at a point, and it not continue the reboot process, but the boot animation just going and going
Click to expand...
Click to collapse
Sounds like there are codecs which faulty when talk with miui frameworks. Could you wipe out them?
after I receive an email and MIUI send a notification to the statusbar soon after it crash. And keeps crash (reboot) until I remove those notifacations.
Click to expand...
Click to collapse
yess, again faulty codecs..
Hey flytouch users, why you want miui for that MONSTER?
I could boot but it says SystemUI has stopped, updater has stopped. There is no status bar. But I can make calls, send SMS, wifi works, can apply themes. What could be the problem for SystemUI stopped error? Nowhere I could get the answer. In some thread I read that I have to copy framework-res-miui.xml to etc/permissions but I could not find this file anywhere.
Attaching the log file.

[Solved] GT-I9205 Stuck At Boot Animation

Hi,
Currently I'm compiling OmniRom for Samsung Galaxy Mega GT-I9205.
When I try to boot it for the first time, the Omni is stuck at the boot animation...
May I know what is the general failure for this particular issue? and how to solve it?
logcat F/
Code:
12-29 19:01:06.722 F/MediaProfiles( 287): frameworks/av/media/libmedia/MediaProfiles.cpp:324 CHECK(quality != -1) failed.
12-29 19:01:06.722 F/libc ( 287): Fatal signal 6 (SIGABRT) at 0x0000011f (code=-6), thread 287 (zygote)
logcat /E
Code:
12-29 19:01:07.513 E/QualcommCamera( 754): Qint android::get_number_of_cameras(): E
...
12-29 19:01:07.513 I/AudioPolicyManagerBase( 754): loadAudioPolicyConfig() loaded /system/etc/audio_policy.conf
12-29 19:01:07.523 D/ALSADevice( 754): ALSA module opened
12-29 19:01:07.533 D/AudioHardwareALSA( 754): AudioHardware: DLOPEN successful for ACDBLOADER
12-29 19:01:07.533 D/ACDB-LOADER( 754): ACDB -> ACDB_CMD_INITIALIZE
12-29 19:01:07.533 E/ ( 754): [ACDB RTC]->rtc init done!->result [0]
12-29 19:01:07.533 E/Diag_Lib( 754): actp_diag_init: call diag init function with B5F20ECD
12-29 19:01:07.533 E/Diag_Lib( 754): Diag_LSM_Init: Failed to open handle to diag driver, error = 13
12-29 19:01:07.533 E/Diag_Lib( 754): actp_diag_init: diag init failed
12-29 19:01:07.533 E/ ( 754): [ACDB ACPH]->actp diag init done!
---
I suspect the media_profiles.xml is corrupted... but nope...
anywhere this is the comparison of media_profiles.xml between
melius >> https://github.com/Grarak/android_d...mon/blob/android-4.4/media/media_profiles.xml
hammerhead >> https://github.com/omnirom/android_device_lge_hammerhead/blob/android-4.4/media_profiles.xml
Diff >> http://diffchecker.com/ghjvhy51
and the device mk file
Code:
https://github.com/Grarak/android_device_samsung_melius-common/blob/android-4.4/melius-common.mk
# Media Profile
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/media/media_profiles.xml:system/etc/media_profiles.xml
# Note: Didnt have media_codecs.xml
Code:
https://github.com/omnirom/android_device_lge_hammerhead/blob/android-4.4/device.mk
PRODUCT_COPY_FILES += \
device/lge/hammerhead/media_codecs.xml:system/etc/media_codecs.xml \
device/lge/hammerhead/media_profiles.xml:system/etc/media_profiles.xml
Try using hammerhead (or another closer similar Qcom device)'s media_codec.xml and media_profiles.xml (or remove those files)
Thank your for the suggestion... look like i have to test on hammerhead xml afterall :crying:
but b4 that,
Im hoping someone able to tell me the logcat diagnostic
coz this file is currently used in CM11 (I9205) and they didnt have issue for this particular matter
Great news...
I managed to get it working... now omnirom have another working device in his pocket
Solutions: use media codec + profile from hammerhead... media codec + profile by touchwiz wont work
---
but i still have some problem
i able to get the camera to work, but the video recording is recording black screen...

Phone freezing while calling/audio problem?

My phone is freezing while in call, neither I or my caller can hear each other while this happens.
From logcat it looks like some kid of audio problem but I don't know what is the real problem.
Could anyone better than me in logs reading tell me how the fix this or what's causing this?
Code:
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
I/FastMixerState(12846): sMaxFastTracks = 8
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
I/audioserver(12846): ServiceManager: 0xf5c18540
D/vndksupport(12846): Loading /vendor/lib/hw/[email protected] from current namespace instead of sphal namespace.
D/vndksupport(12846): Loading /vendor/lib/hw/[email protected] from current namespace instead of sphal namespace.
I/AudioFlinger(12846): Using default 3000 mSec as standby time.
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
W/APM::ConfigParsingUtils(12846): loadOutput() invalid supported devices
W/APM::ConfigParsingUtils(12846): loadInput() invalid supported devices
W/APM::ConfigParsingUtils(12846): loadInput() invalid supported devices
I/APM::ConfigParsingUtils(12846): loadAudioPolicyConfig() loaded /system/etc/audio_policy.conf
W/audio_hw_primary(12846): mixer_init: Failed to open mixer paths from /vendor/etc/mixer_paths_0.xml, retrying with legacy location
E/audio_route(12846): Control 'HPL Mixer ADCL Switch' doesn't exist - skipping
E/audio_route(12846): Control 'HPL Mixer ADCR Switch' doesn't exist - skipping
E/audio_route(12846): Control 'HPR Mixer ADCL Switch' doesn't exist - skipping
E/audio_route(12846): Control 'HPR Mixer ADCR Switch' doesn't exist - skipping
E/audio_route(12846): Control 'EP Mixer ADCL Switch' doesn't exist - skipping
E/audio_route(12846): Control 'EP Mixer ADCR Switch' doesn't exist - skipping
E/audio_route(12846): Control 'SPK Mixer ADCL Switch' doesn't exist - skipping
E/audio_route(12846): Control 'SPK Mixer ADCR Switch' doesn't exist - skipping
E/audio_route(12846): Control 'SPK Mixer ADCL Switch' doesn't exist - skipping
E/audio_route(12846): Control 'SPK Mixer ADCR Switch' doesn't exist - skipping
E/audio_route(12846): Control 'HPL Mixer ADCL Switch' doesn't exist - skipping
E/audio_route(12846): Control 'HPR Mixer ADCR Switch' doesn't exist - skipping
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
E/audio_route(12846): Control 'EP EP On' already exists in path 'fm_radio-speaker-headset'
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
V/audio_hw_voice(12846): voice_session_init: Forcing voice config: wide
E/audio_hw_primary(12846): Amplifier initialization failed
W/DeviceHAL(12846): Device 0xf5c3c400 get_master_volume: Function not implemented
W/DeviceHAL(12846): Device 0xf5c3c400 get_master_mute: Function not implemented
W/DeviceHAL(12846): Device 0xf5c3c400 set_master_volume: Function not implemented
W/DeviceHAL(12846): Device 0xf5c3c400 set_master_mute: Function not implemented
I/AudioFlinger(12846): loadHwModule() Loaded primary audio interface, handle 10
I/AudioFlinger(12846): openOutput() this 0xf5c3d000, module 10 Device 2, SamplingRate 48000, Format 0x000001, Channels 3, flags 2
I/AudioFlinger(12846): HAL output buffer size 256 frames, normal sink buffer size 768 frames
D/vndksupport(12846): Loading /vendor/lib/hw/[email protected] from current namespace instead of sphal namespace.
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
I/ViPER4Android_v2(12846): Enter EffectGetDescriptor()
I/ViPER4Android_v2(12846): EffectGetDescriptor(), uuid = 41d3c987-e6cf-11e3-a88a-11aba5d5c51b
I/BufferProvider(12846): found effect "Multichannel Downmix To Stereo" from The Android Open Source Project
I/AudioFlinger(12846): Using module 10 as the primary audio interface
W/AudioFlinger(12846): moveEffects() bad srcOutput 0
I/AudioFlinger(12846): AudioFlinger's thread 0xf4c83a00 tid=12862 ready to run
W/AudioFlinger(12846): no wake lock to update, system not ready yet
W/AudioFlinger(12846): no wake lock to update, system not ready yet
I/AudioFlinger(12846): openOutput() this 0xf5c3d000, module 10 Device 2, SamplingRate 48000, Format 0x000001, Channels 3, flags 8
I/AudioFlinger(12846): HAL output buffer size 480 frames, normal sink buffer size 960 frames
I/AudioFlinger(12846): AudioFlinger's thread 0xf4603980 tid=12865 ready to run
W/AudioFlinger(12846): no wake lock to update, system not ready yet
W/AudioFlinger(12846): no wake lock to update, system not ready yet
I/AudioFlinger(12846): AudioFlinger's thread 0xf42032c0 tid=12867 ready to run
I/bt_a2dp_hw(12846): adev_open: adev_open in A2dp_hw module
I/AudioFlinger(12846): loadHwModule() Loaded a2dp audio interface, handle 18
D/vndksupport(12846): Loading /vendor/lib/hw/audio.usb.default.so from current namespace instead of sphal namespace.
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
I/AudioFlinger(12846): loadHwModule() Loaded usb audio interface, handle 26
D/vndksupport(12846): Loading /vendor/lib/hw/audio.r_submix.default.so from current namespace instead of sphal namespace.
I/r_submix(12846): adev_open(name=audio_hw_if)
I/r_submix(12846): adev_init_check()
W/DeviceHAL(12846): Device 0xf4666640 set_master_mute: Function not implemented
I/AudioFlinger(12846): loadHwModule() Loaded r_submix audio interface, handle 34
D/r_submix(12846): adev_open_input_stream(addr=0)
D/r_submix(12846): submix_audio_device_create_pipe_l(addr=0, idx=9)
D/r_submix(12846): now using address 0 for route 9
I/AudioFlinger(12846): AudioFlinger's thread 0xf4203d80 tid=12871 ready to run
D/r_submix(12846): adev_close_input_stream()
D/r_submix(12846): submix_audio_device_release_pipe_l(idx=9) addr=0
D/r_submix(12846): submix_audio_device_destroy_pipe_l(): pipe destroyed
E/SoundTriggerHwService(12846): could not read implementation properties
D/TelephonyProvider( 3294): subIdString = 1 subId = 1
I/Telecom ( 2955): InCallController: Sending updateCall [[email protected], DIALING, com.android.phone/com.android.services.telephony.TelephonyConnectionService, tel:*********, A, childs(0), has_parent(false), [Capabilities: CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:]]: [email protected]
I/Telecom ( 2955): InCallController: Components updated: [ComponentInfo{com.android.dialer/com.android.incallui.InCallServiceImpl}]: [email protected]
I/Dialer ( 6324): CallList.onUpdateCall - [DialerCall_1, DIALING, [Capabilities: CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:], children:[], parent:null, conferenceable:[], videoState:Audio Only, mSessionModificationState:0, CameraDir:-1]
I/Dialer ( 6324): InCallPresenter.onCallListChange - Phone switching state: OUTGOING -> OUTGOING
I/Dialer ( 6324): VideoPauseController.onStateChange - hasPrimaryCallChanged: false, videoCanPause: false, isInBackground: false
I/Dialer ( 6324): InCallFragment.setSecondary - SecondaryInfo, show: false, name: null, label: null, providerLabel: null
W/ResourceType( 6324): Failure getting entry for 0x7f100292 (t=15 e=658) (error -75)
I/Dialer ( 6324): InCallFragment.setCallState - PrimaryCallState, state: 6, connectionLabel:
I/Dialer ( 6324): InCallActivity.onPrimaryCallStateChanged
I/Dialer ( 6324): InCallActivity.showMainInCallFragment - shouldShowAnswerUi: false, shouldShowVideoUi: false, didShowAnswerScreen: false, didShowInCallScreen: true, didShowVideoCallScreen: false
W/ResourceType( 6324): Failure getting entry for 0x7f100292 (t=15 e=658) (error -75)
I/Dialer ( 6324): InCallFragment.setCallState - PrimaryCallState, state: 6, connectionLabel:
I/Dialer ( 6324): InCallActivity.onPrimaryCallStateChanged
I/Dialer ( 6324): InCallActivity.showMainInCallFragment - shouldShowAnswerUi: false, shouldShowVideoUi: false, didShowAnswerScreen: false, didShowInCallScreen: true, didShowVideoCallScreen: false
I/AudioFlinger(12846): systemReady
D/PermissionCache(12846): checking android.permission.MODIFY_AUDIO_SETTINGS for uid=1000 => granted (1574 us)
E/AudioService( 2955): Audioserver started.
D/PermissionCache(12846): checking android.permission.CAPTURE_AUDIO_HOTWORD for uid=10181 => granted (340 us)
I/AudioFlinger(12846): AudioFlinger's thread 0xf3803c40 tid=12881 ready to run
I/audio_hw_primary(12846): adev_set_mode mode = 2
D/com.gsamlabs.bbm.lib.NotifyingService( 8880): ===:91:4309:41.4:1
V/audio_hw_voice(12846): prepare_voice_session: active_out_devices: 0x1
V/audio_hw_voice(12846): set_voice_session_audio_path: ril_set_call_audio_path(0)
I/rild ( 2512): type=1400 audit(0.0:1793): avc: denied { search } for name="12846" dev="proc" ino=87474 scontext=u:r:rild:s0 tcontext=u:r:audioserver:s0 tclass=dir permissive=1
I/rild ( 2512): type=1400 audit(0.0:1794): avc: denied { read } for name="cmdline" dev="proc" ino=87476 scontext=u:r:rild:s0 tcontext=u:r:audioserver:s0 tclass=file permissive=1
I/rild ( 2512): type=1400 audit(0.0:1795): avc: denied { open } for path="/proc/12846/cmdline" dev="proc" ino=87476 scontext=u:r:rild:s0 tcontext=u:r:audioserver:s0 tclass=file permissive=1
I/rild ( 2512): type=1400 audit(0.0:1796): avc: denied { getattr } for path="/proc/12846/cmdline" dev="proc" ino=87476 scontext=u:r:rild:s0 tcontext=u:r:audioserver:s0 tclass=file permissive=1
D/audio_route(12846): Apply path: voice-earpiece-wb
D/audio_route(12846): Apply path: voice-earpiece-mic-wb
V/audio_hw_voice(12846): start_voice_session: Opening voice PCMs
V/audio_hw_voice(12846): start_voice_session: pcm_config wideband
I/ActivityManager( 2955): Killing 10371:com.google.process.gapps/u0a113 (adj 906): empty #17
W/zygote ( 2955): kill(-10371, 9) failed: No such process
I/chatty ( 2955): uid=1000(system) ActivityManager identical 2 lines
W/zygote ( 2955): kill(-10371, 9) failed: No such process
I/zygote ( 2955): Successfully killed process cgroup uid 10113 pid 10371 in 135ms
E/BufferQueueProducer( 2475): [com.socialnmobile.dictapps.notepad.color.note/com.socialnmobile.colornote.activity.NoteEditor#0] disconnect: not connected (req=1)
W/libEGL (12010): EGLNativeWindowType 0xd3c7e008 disconnect failed
V/audio_hw_voice(12846): start_voice_session: enabling two mic control
F/libc (12846): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x98 in tid 12889 (reader), pid 12846 (audioserver)
I/crash_dump32(12891): type=1400 audit(0.0:1797): avc: denied { noatsecure } for scontext=u:r:audioserver:s0 tcontext=u:r:crash_dump:s0 tclass=process permissive=1
I/crash_dump32(12893): obtaining output fd from tombstoned, type: kDebuggerdTombstone
I//system/bin/tombstoned( 2515): received crash request for pid 12846
I/crash_dump32(12893): performing dump of process 12846 (target tid = 12889)
F/DEBUG (12893): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F/DEBUG (12893): AospExtended Version: 'v5.8'
F/DEBUG (12893): Build fingerprint: 'samsung/s5neoltexx/s5neolte:6.0.1/MMB29K/G903FXXU1BQC1:user/release-keys'
F/DEBUG (12893): Revision: '0'
F/DEBUG (12893): ABI: 'arm'
F/DEBUG (12893): pid: 12846, tid: 12889, name: reader >>> /system/bin/audioserver <<<
F/DEBUG (12893): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x98
F/DEBUG (12893): Cause: null pointer dereference
F/DEBUG (12893): r0 00000000 r1 00000160 r2 00000001 r3 f32dc2fc
F/DEBUG (12893): r4 00000160 r5 f5c3ca88 r6 f5c3ca58 r7 f5c3c400
F/DEBUG (12893): r8 f52993f0 r9 00000002 sl 000002c0 fp f5c3ca00
F/DEBUG (12893): ip f511fefc sp f3182880 lr f51189dc pc f50f40c4 cpsr 80070030
F/DEBUG (12893):
F/DEBUG (12893): backtrace:
F/DEBUG (12893): #00 pc 000020c4 /system/lib/libtinyalsa.so (pcm_bytes_to_frames+39)
F/DEBUG (12893): #01 pc 000079d8 /system/lib/hw/audio.primary.universal7580.so (in_read+792)
F/DEBUG (12893): #02 pc 0001f45d /system/vendor/lib/hw/[email protected] (android::hardware::audio::V2_0::implementation::(anonymous namespace)::ReadThread::threadLoop()+216)
F/DEBUG (12893): #03 pc 0000d1b9 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+144)
F/DEBUG (12893): #04 pc 00047ecf /system/lib/libc.so (__pthread_start(void*)+22)
F/DEBUG (12893): #05 pc 0001af59 /system/lib/libc.so (__start_thread+32)
W/NativeCrashListener( 2955): Couldn't find ProcessRecord for pid 12846
E//system/bin/tombstoned( 2515): Tombstone written to: /data/tombstones/tombstone_21
I/BootReceiver( 2955): Copying /data/tombstones/tombstone_21 to DropBox (SYSTEM_TOMBSTONE)
W/AudioSystem( 3132): AudioPolicyService server died!
W/AudioSystem( 2955): AudioPolicyService server died!
W/AudioSystem( 2955): AudioFlinger server died!
W/AudioSystem( 3737): AudioPolicyService server died!
W/AudioSystem( 3737): AudioFlinger server died!
W/AudioRecord( 3737): dead IAudioRecord, creating a new one from obtainBuffer()
I/ServiceManager( 2341): service 'media.audio_flinger' died
I/ServiceManager( 2341): service 'media.audio_policy' died
I/ServiceManager( 2341): service 'media.sound_trigger_hw' died
I/ServiceManager( 3737): Waiting for service media.audio_flinger...
I/ServiceManager( 2955): Waiting for service media.audio_policy...
W/BroadcastQueue( 2955): Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
W/BroadcastQueue( 2955): Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
I/ServiceManager( 3737): Waiting for service media.audio_flinger...
I/ServiceManager( 2955): Waiting for service media.audio_policy...
I/Xposed ( 3132): fsbi >> nc >> onDataChanged >> 0 > true > 75 > H+
I/ServiceManager( 3737): Waiting for service media.audio_flinger...
I/ServiceManager( 2955): Waiting for service media.audio_policy...
I/Xposed ( 3132): fsbi >> nc >> onDataChanged >> 0 > true > 50 > H+
I/ServiceManager( 3737): Waiting for service media.audio_flinger...
I/ServiceManager( 2955): Waiting for service media.audio_policy...
I/Telecom ( 2955): InCallController: Sending updateCall [[email protected], DIALING, com.android.phone/com.android.services.telephony.TelephonyConnectionService, tel:*********, A, childs(0), has_parent(false), [Capabilities: CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:]]: [email protected]
I/Telecom ( 2955): InCallController: Components updated: [ComponentInfo{com.android.dialer/com.android.incallui.InCallServiceImpl}]: [email protected]
I/Telecom ( 2955): CallsManager: setCallState DIALING -> ACTIVE, call: [[email protected], DIALING, com.android.phone/com.android.services.telephony.TelephonyConnectionService, tel:*********, A, childs(0), has_parent(false), [Capabilities: CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:]]: [email protected]

Trouble compiling 8.2.0 kernel from source for ShieldTV 2017

I am trying to compile the 8.2.0 Kernel for my Shield TV 2017. I am hoping to adding the Wireguard kernel module.
I downloaded the source linked from https://developer.nvidia.com/shield-open-source following the instructions links here https://nv-tegra.nvidia.com/gitweb/...7;hb=1a508fa42d6ae55ee0fe62a3e07559a484794108
The source code checks out fine. I set up my cross compiler by setting these environment variables
Code:
ARCH=arm64
SUBARCH=arm64
CROSS_COMPILE=/absolute/path/shield-open-source/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
I removed the CONFIG_SYSTEM_TRUSTED_KEYS="signing_key.x509" from the tegra_android_defconfig file
I then went to ~/shield-open-source/kernel/kernel-4.9 and ran
Code:
make mrproper
make tegra_android_defconfig
make -j4
There were a few warnings that got flagged as errors and caused the build to failed. I modified the make files so the warnings wouldn't be flagged as errors (ex: ccflags-y += -Wno-error=maybe-uninitialized)
There is one more error with ~/shield-open-source/hardware/nvidia/platform/t210b01/ers/kernel-dts/ers-platforms/tegra210b01-ers-common.dtsi in that it can't find <tegra210b01-cpufreq.dtsi>. I changed this to include "darcy-platforms/tegra210b01-darcy-cpufreq.dtsi"
I also added Wireguard by following the kernel instructions from https://forum.xda-developers.com/android/development/wireguard-rom-integration-t3711635
At this point I am able build the Image.gz file. I took the boot.img from the recovery images that NVidia provides and used AndroidImageKitchen (https://forum.xda-developers.com/showthread.php?t=2073775) to unpack the boot.img, swap out boot.img-Image.gz with the one Image.gz that I compiled and re-packed the boot.img I flashed this boot.img to my device using fastboot, and the device never boots.
I have some logs from the bootloop - here is the snipit that seems most relevant but I don't really know what I am looking for or how to determine what needs to change
Code:
09-12 22:00:42.120 3384 3384 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1
09-12 22:00:42.120 3384 3384 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 1
09-12 22:00:42.120 3383 3383 E Netd : cannot find interface dummy0
09-12 22:00:42.120 3383 3383 I Netd : Initializing RouteController: 1.3ms
09-12 22:00:42.120 3384 3384 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 3384 (surfaceflinger), pid 3384 (surfaceflinger)
09-12 22:00:42.120 3383 3383 D XfrmController: Sending Netlink XFRM Message: XFRM_MSG_FLUSHSA
09-12 22:00:42.120 3383 3383 D XfrmController: Sending Netlink XFRM Message: XFRM_MSG_FLUSHPOLICY
09-12 22:00:42.120 3383 3383 I Netd : Initializing XfrmController: 0.2ms
09-12 22:00:42.121 3383 3383 I Netd : Registering NetdNativeService: 0.5ms
09-12 22:00:42.122 3383 3383 I Netd : Starting CommandListener: 0.1ms
09-12 22:00:42.123 3383 3383 I Netd : Registering NetdHwService: 1.0ms
09-12 22:00:42.123 3383 3383 I Netd : Netd started in 219ms
09-12 22:00:42.132 3378 3378 D Zygote : begin preload
09-12 22:00:42.132 3378 3378 I Zygote : Installing ICU cache reference pinning...
09-12 22:00:42.132 3378 3378 I Zygote : Preloading ICU data...
09-12 22:00:42.135 3379 3379 I Zygote : Accepting command socket connections
09-12 22:00:42.138 3378 3378 I Zygote : Preloading classes...
09-12 22:00:42.140 3436 3436 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
09-12 22:00:42.140 3184 3184 I /system/bin/tombstoned: received crash request for pid 3384
09-12 22:00:42.141 3436 3436 I crash_dump64: performing dump of process 3384 (target tid = 3384)
09-12 22:00:42.143 3436 3436 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-12 22:00:42.143 3436 3436 F DEBUG : Build fingerprint: 'NVIDIA/darcy/darcy:9/PPR1.180610.011/4079208_2235.1395:user/release-keys'
09-12 22:00:42.143 3436 3436 F DEBUG : Revision: '0'
09-12 22:00:42.143 3436 3436 F DEBUG : ABI: 'arm64'
09-12 22:00:42.143 3436 3436 F DEBUG : pid: 3384, tid: 3384, name: surfaceflinger >>> /system/bin/surfaceflinger <<<
09-12 22:00:42.143 3436 3436 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
09-12 22:00:42.143 3436 3436 F DEBUG : Cause: null pointer dereference
09-12 22:00:42.143 3436 3436 F DEBUG : x0 0000000000000000 x1 0000000000000000 x2 0000000000000000 x3 00000025b1c537d0
09-12 22:00:42.143 3436 3436 F DEBUG : x4 0000000000000000 x5 0000007fe38db898 x6 0000000000000000 x7 0000000000000030
09-12 22:00:42.143 3436 3436 F DEBUG : x8 0101010101010101 x9 b72fc0062f2280b8 x10 000000005f647079 x11 0000000000000000
09-12 22:00:42.143 3436 3436 F DEBUG : x12 0000000000000001 x13 0000000000000000 x14 0000000000000001 x15 00000025b1c81a88
09-12 22:00:42.143 3436 3436 F DEBUG : x16 000000252f3b9e58 x17 00000025307de610 x18 0000000000000001 x19 00000025b1c537d0
09-12 22:00:42.143 3436 3436 F DEBUG : x20 0000000000000000 x21 0000000000000000 x22 000000252ed0c5e0 x23 0000000000000000
09-12 22:00:42.143 3436 3436 F DEBUG : x24 0000000000000001 x25 0000007fe38dbb00 x26 00000000000f4240 x27 0000007fe38dbb00
09-12 22:00:42.143 3436 3436 F DEBUG : x28 0000007fe38dba90 x29 0000007fe38db900
09-12 22:00:42.143 3436 3436 F DEBUG : sp 0000007fe38db8e0 lr 000000252f396f78 pc 00000025307de620
09-12 22:00:42.146 3378 3378 I PackageBackwardCompatibility: Loaded android.content.pm.OrgApacheHttpLegacyUpdater
Any pointers to what I am doing wrong, or how to further debug would be appreciated.
Also if there is already a kernel built with Wireguard support, a reference to that would be :good:
Hi, I've compiled kernel for Shield 2017 following your steps and I'm probably facing same issue. My boot hangs on Nvidia logo. I have a question - how you've obtained boot logs? ADB don't work from fastboot menu for me.
Hi, did you finally succeed in compiling a kernel for shield 2017 ?

Categories

Resources