Jump to content

  1. 0
  2. 0
  3. 0/5

Rate this Topic

* * * * *
17 votes

Timur's Kernel - USB ROM - Most popular thread on Rootzwiki

  • This topic is locked

kodiack99

kodiack99

Android Lover

  • 107 posts

Posted 16 January 2013 - 03:23 PM #201

A little update on my "dead USB port" issue. One of the things I wanted to test was to flash the bootloader. I read somewhere that the bootloader holds a few protections... don't ask, cause I don't know what those are and how it works.

Anyway... flashed the bootloader, it's still unlocked but guess what... USB port is alive and kicking!! :lol:

Now... not that it's important, just out of curiosity. Can anyone explain this to me?


Your N7 is haunted..call a priest!
  • 0 Likes

iceman_jkh

iceman_jkh

Android Lover

  • 150 posts

Posted 16 January 2013 - 03:36 PM #202

I've just received my Hifimediy Sabre USB DAC.
If my otg cable arrives today I should be able to do some testing for you.

http://www.ebay.com....4-/140847495065

I'll be using the fixed installation kernel, but which room should I use?
Like others on here, I'll be using my N7 as my car audio centre. I therefore would need hot plug usb (hdd, audio) and GPS, wifi and BT.
Any suggestions or things I should stay away from?
Cheers

Edited by iceman_jkh, 16 January 2013 - 03:46 PM.

  • 0 Likes

dcplaya

dcplaya

Android Beginner

  • 332 posts

Posted 16 January 2013 - 04:04 PM #203

I have included 4 dmesg logs below. The first 2 are when the music plays as expected after a disconnect (This includes pausing music before disconnect) and the last 2 are the problem child. The DAC not working after a power loss with no pause beforehand.

Simulate power loss after pausing music
<6>[ 8484.762413] Switched to NOHz mode on CPU #3
<4>[ 8484.962464] inok_isr_work_f lastOtg=1 lastExternalPower=1 lastChargeSlaveDevices=0 postSleep=0
<4>[ 8484.962631] inok_isr_work_function lost external power in host mode; fixed_install_mode: do not charge slave devices
<4>[ 8484.963489] smb347_configure_otg disable host mode
<4>[ 8484.965366] inok_isr_work_function make device aware it is now discharging
<6>[ 8484.965495] cable_type_detect()
<6>[ 8484.965561] INOK=H no power
<4>[ 8484.965622] ========================================================
<4>[ 8484.965736] battery_callback  usb_cable_state = 0
<4>[ 8484.965799] ========================================================
<4>[ 8484.965935] battery_callback cable_wake_lock 5 sec...
<4>[ 8484.965941]  
<6>[ 8484.966119] elan-ktf3k 1-0010: Update power source to 0
<4>[ 8484.966486] inok_isr_work_function done
<5>[ 8484.967635] bq27541_get_capacity = 92% ret= 91
<5>[ 8484.968627] bq27541_get_psp voltage_now= 4119000 uV
<5>[ 8484.969452] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8484.970289] bq27541_get_psp status: Discharging ret= 0x0101

Regain power (used pause before disconnect)
<6>[ 8541.202444] usb 2-1: new high speed USB device number 6 using tegra-ehci
<6>[ 8541.234860] usb 2-1: New USB device found, idVendor=050d, idProduct=0017
<6>[ 8541.236065] usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
<6>[ 8541.236730] usb 2-1: Product: USB 2.0 Hub [MTT]
<6>[ 8541.246175] hub 2-1:1.0: USB hub found
<6>[ 8541.246562] hub 2-1:1.0: 7 ports detected
<6>[ 8541.523686] usb 2-1.2: new full speed USB device number 7 using tegra-ehci
<6>[ 8541.567568] usb 2-1.2: New USB device found, idVendor=08bb, idProduct=2902
<6>[ 8541.567848] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>[ 8541.568004] usb 2-1.2: Product: USB Audio CODEC
<6>[ 8541.568269] usb 2-1.2: Manufacturer: Burr-Brown from TI			  
<6>[ 8541.583993] input: Burr-Brown from TI			   USB Audio CODEC  as /devices/platform/tegra-ehci.0/usb2/2-1/2-1.2/2-1.2:1.3/input/input13
<6>[ 8541.585227] keychord: using input dev Burr-Brown from TI			   USB Audio CODEC  for fevent
<6>[ 8541.587338] generic-usb 0003:08BB:2902.000B: input: USB HID v1.00 Device [Burr-Brown from TI			   USB Audio CODEC ] on usb-tegra-ehci.0-1.2/input3
<4>[ 8541.632610] inok_isr_work_f lastOtg=0 lastExternalPower=0 lastChargeSlaveDevices=0 postSleep=0
<6>[ 8541.632900] cable_type_detect()
<6>[ 8541.633049] INOK=L
<5>[ 8541.633585] smb347_charger: [cable_type_detect] Reg39 : 0x10
<5>[ 8541.633978] smb347_charger: [cable_type_detect] Reg3F : 0x83
<5>[ 8541.634246] smb347_charger: [cable_type_detect] USB_IN
<5>[ 8541.634629] smb347_charger: [cable_type_detect] Reg3E : 0x0e
<6>[ 8541.634898] Cable: host mode charging
<4>[ 8541.635041] ========================================================
<4>[ 8541.635188] battery_callback  usb_cable_state = 1
<4>[ 8541.635451] ========================================================
<4>[ 8541.635597] battery_callback cable_wake_lock 5 sec...
<4>[ 8541.635605]  
<6>[ 8541.636528] elan-ktf3k 1-0010: Update power source to 1
<4>[ 8541.637889] inok_isr_work_function external power available, start host mode
<4>[ 8541.638893] smb347_configure_otg enable host mode
<4>[ 8541.640234] inok_isr_work_function external power available lastOtgState=1
<6>[ 8541.672646] usb 2-1.7: new full speed USB device number 8 using tegra-ehci
<5>[ 8541.690985] bq27541_get_capacity = 92% ret= 91
<5>[ 8541.694486] bq27541_get_psp voltage_now= 4060000 uV
<5>[ 8541.695346] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8541.696035] bq27541_get_psp status: Charging ret= 0x0101
<6>[ 8541.708675] usb 2-1.7: New USB device found, idVendor=10c4, idProduct=a01a
<6>[ 8541.708794] usb 2-1.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>[ 8541.708905] usb 2-1.7: Product: CarPc JoyCon Exr
<6>[ 8541.708965] usb 2-1.7: Manufacturer: ChangJack
<6>[ 8541.713116] input: ChangJack CarPc JoyCon Exr as /devices/platform/tegra-ehci.0/usb2/2-1/2-1.7/2-1.7:1.0/input/input14
<6>[ 8541.713326] keychord: using input dev ChangJack CarPc JoyCon Exr for fevent
<6>[ 8541.713446] generic-usb 0003:10C4:A01A.000C: input: USB HID v1.01 Keyboard [ChangJack CarPc JoyCon Exr] on usb-tegra-ehci.0-1.7/input0
<6>[ 8541.721377] input: ChangJack CarPc JoyCon Exr as /devices/platform/tegra-ehci.0/usb2/2-1/2-1.7/2-1.7:1.1/input/input15
<6>[ 8541.721658] keychord: using input dev ChangJack CarPc JoyCon Exr for fevent
<6>[ 8541.721779] generic-usb 0003:10C4:A01A.000D: input: USB HID v1.11 Device [ChangJack CarPc JoyCon Exr] on usb-tegra-ehci.0-1.7/input1
<4>[ 8541.752428] cpu_up(1)+
<7>[ 8541.780299] tegra CPU: force EDP limit 1200000 kHz
<4>[ 8541.780829] CPU1: Booted secondary processor
<6>[ 8541.782392] Switched to NOHz mode on CPU #1
<4>[ 8541.794877] cpu_up(1)-
<4>[ 8541.852444] cpu_up(2)+
<4>[ 8541.869704] CPU2: Booted secondary processor
<4>[ 8541.871485] cpu_up(2)-
<6>[ 8541.872403] Switched to NOHz mode on CPU #2

Music playing, and then a disconnect
<7>[ 8643.203751] tegra CPU: force EDP limit 1200000 kHz
<4>[ 8643.204331] CPU1: Booted secondary processor
<6>[ 8643.212400] Switched to NOHz mode on CPU #1
<4>[ 8643.215709] cpu_up(1)-
<4>[ 8645.482527] cpu_down(1)+
<4>[ 8645.494782] stop_machine_cpu_stop smp=0
<4>[ 8645.494805] stop_machine_cpu_stop smp=1
<5>[ 8645.497803] CPU1: shutdown
<4>[ 8645.503211] cpu_down(1)-
<4>[ 8647.482691] cpu_up(1)+
<4>[ 8647.507489] CPU1: Booted secondary processor
<4>[ 8647.512093] cpu_up(1)-
<6>[ 8647.512461] Switched to NOHz mode on CPU #1
<4>[ 8649.882408] cpu_up(2)+
<4>[ 8649.893544] CPU2: Booted secondary processor
<4>[ 8649.894266] cpu_up(2)-
<6>[ 8649.902378] Switched to NOHz mode on CPU #2
<6>[ 8650.828330] usb 2-1: USB disconnect, device number 6
<6>[ 8650.828639] usb 2-1.2: USB disconnect, device number 7
<6>[ 8650.953161] usb 2-1.7: USB disconnect, device number 8
<4>[ 8651.422486] inok_isr_work_f lastOtg=1 lastExternalPower=1 lastChargeSlaveDevices=0 postSleep=0
<4>[ 8651.422614] inok_isr_work_function lost external power in host mode; fixed_install_mode: do not charge slave devices
<4>[ 8651.423368] smb347_configure_otg disable host mode
<4>[ 8651.425282] inok_isr_work_function make device aware it is now discharging
<6>[ 8651.425354] cable_type_detect()
<6>[ 8651.425419] INOK=H no power
<4>[ 8651.425531] ========================================================
<4>[ 8651.425594] battery_callback  usb_cable_state = 0
<4>[ 8651.425705] ========================================================
<4>[ 8651.425769] battery_callback cable_wake_lock 5 sec...
<4>[ 8651.425772]  
<6>[ 8651.425974] elan-ktf3k 1-0010: Update power source to 0
<4>[ 8651.426337] inok_isr_work_function done
<5>[ 8651.427385] bq27541_get_capacity = 93% ret= 92
<5>[ 8651.428095] bq27541_get_psp voltage_now= 4127000 uV
<5>[ 8651.428797] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8651.429550] bq27541_get_psp status: Not charging ret= 0x0100
<4>[ 8651.982480] cpu_up(3)+
<4>[ 8651.987842] CPU3: Booted secondary processor
<4>[ 8651.989622] cpu_up(3)-
<6>[ 8651.992502] Switched to NOHz mode on CPU #3
<5>[ 8653.423319] bq27541_get_psp status: Discharging ret= 0x0101
<5>[ 8653.424276] bq27541_get_psp voltage_now= 4047000 uV
<5>[ 8653.425425] bq27541_get_capacity = 93% ret= 92
<5>[ 8653.426540] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8653.429296] bq27541_get_capacity = 93% ret= 92
<5>[ 8653.430546] bq27541_get_psp voltage_now= 4047000 uV
<5>[ 8653.431617] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8653.433028] bq27541_get_psp status: Discharging ret= 0x0101
<4>[ 8654.582535] cpu_down(1)+
<4>[ 8654.585752] stop_machine_cpu_stop smp=1
<4>[ 8654.585781] stop_machine_cpu_stop smp=0
<4>[ 8654.585804] stop_machine_cpu_stop smp=3
<4>[ 8654.585824] stop_machine_cpu_stop smp=2
<5>[ 8654.589719] CPU1: shutdown
<4>[ 8654.594469] cpu_down(1)-
<4>[ 8656.582533] cpu_down(2)+
<4>[ 8656.585193] stop_machine_cpu_stop smp=2
<4>[ 8656.585215] stop_machine_cpu_stop smp=0
<4>[ 8656.585236] stop_machine_cpu_stop smp=3
<5>[ 8656.588899] CPU2: shutdown
<4>[ 8656.594008] cpu_down(2)-

The re connection
<7>[ 8682.414499] tegra CPU: force EDP limit 1200000 kHz
<4>[ 8682.415018] CPU1: Booted secondary processor
<4>[ 8682.416356] cpu_up(1)-
<6>[ 8682.422380] Switched to NOHz mode on CPU #1
<4>[ 8684.592543] cpu_down(1)+
<4>[ 8684.594878] stop_machine_cpu_stop smp=1
<4>[ 8684.594899] stop_machine_cpu_stop smp=0
<5>[ 8684.598558] CPU1: shutdown
<4>[ 8684.603903] cpu_down(1)-
<6>[ 8687.972524] usb 2-1: new high speed USB device number 9 using tegra-ehci
<6>[ 8688.004831] usb 2-1: New USB device found, idVendor=050d, idProduct=0017
<6>[ 8688.005547] usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
<6>[ 8688.005932] usb 2-1: Product: USB 2.0 Hub [MTT]
<6>[ 8688.013438] hub 2-1:1.0: USB hub found
<6>[ 8688.014671] hub 2-1:1.0: 7 ports detected
<4>[ 8688.192428] cpu_up(1)+
<4>[ 8688.218950] CPU1: Booted secondary processor
<6>[ 8688.222443] Switched to NOHz mode on CPU #1
<4>[ 8688.223582] cpu_up(1)-
<6>[ 8688.293201] usb 2-1.2: new full speed USB device number 10 using tegra-ehci
<6>[ 8688.337621] usb 2-1.2: New USB device found, idVendor=08bb, idProduct=2902
<6>[ 8688.337898] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>[ 8688.338048] usb 2-1.2: Product: USB Audio CODEC
<6>[ 8688.338308] usb 2-1.2: Manufacturer: Burr-Brown from TI			  
<6>[ 8688.364441] input: Burr-Brown from TI			   USB Audio CODEC  as /devices/platform/tegra-ehci.0/usb2/2-1/2-1.2/2-1.2:1.3/input/input16
<6>[ 8688.364985] keychord: using input dev Burr-Brown from TI			   USB Audio CODEC  for fevent
<6>[ 8688.365123] generic-usb 0003:08BB:2902.000E: input: USB HID v1.00 Device [Burr-Brown from TI			   USB Audio CODEC ] on usb-tegra-ehci.0-1.2/input3
<4>[ 8688.402513] inok_isr_work_f lastOtg=0 lastExternalPower=0 lastChargeSlaveDevices=0 postSleep=0
<6>[ 8688.402645] cable_type_detect()
<6>[ 8688.402716] INOK=L
<5>[ 8688.403148] smb347_charger: [cable_type_detect] Reg39 : 0x10
<5>[ 8688.403429] smb347_charger: [cable_type_detect] Reg3F : 0x83
<5>[ 8688.403562] smb347_charger: [cable_type_detect] USB_IN
<5>[ 8688.403835] smb347_charger: [cable_type_detect] Reg3E : 0x0e
<6>[ 8688.403967] Cable: host mode charging
<4>[ 8688.404035] ========================================================
<4>[ 8688.404100] battery_callback  usb_cable_state = 1
<4>[ 8688.404219] ========================================================
<4>[ 8688.404284] battery_callback cable_wake_lock 5 sec...
<4>[ 8688.404288]  
<6>[ 8688.404494] elan-ktf3k 1-0010: Update power source to 1
<4>[ 8688.404820] inok_isr_work_function external power available, start host mode
<4>[ 8688.405288] smb347_configure_otg enable host mode
<5>[ 8688.406939] bq27541_get_capacity = 93% ret= 92
<4>[ 8688.407716] inok_isr_work_function external power available lastOtgState=1
<5>[ 8688.408117] bq27541_get_psp voltage_now= 4068000 uV
<5>[ 8688.411618] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8688.412481] bq27541_get_psp status: Charging ret= 0x0101
<6>[ 8688.442615] usb 2-1.7: new full speed USB device number 11 using tegra-ehci
<6>[ 8688.478598] usb 2-1.7: New USB device found, idVendor=10c4, idProduct=a01a
<6>[ 8688.478728] usb 2-1.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>[ 8688.478846] usb 2-1.7: Product: CarPc JoyCon Exr
<6>[ 8688.478911] usb 2-1.7: Manufacturer: ChangJack
<6>[ 8688.483728] input: ChangJack CarPc JoyCon Exr as /devices/platform/tegra-ehci.0/usb2/2-1/2-1.7/2-1.7:1.0/input/input17
<6>[ 8688.483997] keychord: using input dev ChangJack CarPc JoyCon Exr for fevent
<6>[ 8688.484130] generic-usb 0003:10C4:A01A.000F: input: USB HID v1.01 Keyboard [ChangJack CarPc JoyCon Exr] on usb-tegra-ehci.0-1.7/input0
<6>[ 8688.493494] input: ChangJack CarPc JoyCon Exr as /devices/platform/tegra-ehci.0/usb2/2-1/2-1.7/2-1.7:1.1/input/input18
<6>[ 8688.493838] keychord: using input dev ChangJack CarPc JoyCon Exr for fevent
<6>[ 8688.493976] generic-usb 0003:10C4:A01A.0010: input: USB HID v1.11 Device [ChangJack CarPc JoyCon Exr] on usb-tegra-ehci.0-1.7/input1
<4>[ 8690.292412] cpu_up(2)+
<4>[ 8690.313873] CPU2: Booted secondary processor
<6>[ 8690.322383] Switched to NOHz mode on CPU #2
<4>[ 8690.324673] cpu_up(2)-
<5>[ 8690.403018] bq27541_get_psp status: Charging ret= 0x0100
<5>[ 8690.403668] bq27541_get_psp voltage_now= 4095000 uV
<5>[ 8690.404363] bq27541_get_capacity = 93% ret= 92
<5>[ 8690.405010] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8690.406384] bq27541_get_capacity = 93% ret= 92
<5>[ 8690.407090] bq27541_get_psp voltage_now= 4095000 uV
<5>[ 8690.408196] bq27541_get_psp temperature= 200 (0.1�XC)
<5>[ 8690.408903] bq27541_get_psp status: Charging ret= 0x0100
<4>[ 8692.892835] cpu_down(1)+
<4>[ 8692.906149] stop_machine_cpu_stop smp=1
<4>[ 8692.906174] stop_machine_cpu_stop smp=2
<4>[ 8692.906193] stop_machine_cpu_stop smp=0
<5>[ 8692.910192] CPU1: shutdown
<4>[ 8692.915257] cpu_down(1)-
<4>[ 8694.892533] cpu_down(2)+
<4>[ 8694.894889] stop_machine_cpu_stop smp=0
<4>[ 8694.894912] stop_machine_cpu_stop smp=2
<5>[ 8694.899317] CPU2: shutdown
<4>[ 8694.906102] cpu_down(2)-

I dont notice any difference between the two. Maybe someone else will?
  • 0 Likes

AnyHertz

AnyHertz

Member

  • 29 posts

Posted 16 January 2013 - 04:47 PM #204

Sorry for misunderstanding - the freeze happened after deep sleep without slave devices attached. I did not try deep sleep with attached devices.
  • 0 Likes

dcplaya

dcplaya

Android Beginner

  • 332 posts

Posted 16 January 2013 - 04:49 PM #205

Sorry for the double post but I figured this should be in a separate post.

When I disconnect power while music is playing and then reconnect power, music obviously does not play. But if I kill (via adb) process

PID		  PR	  CPU%	  S		 #THR	 VSS			  RSS		 PCY		UID				 Name
20376	  1		  0%		  S		   20	   681112K		44860K	  fg		u0_a96	   com.google.android.music:ui

It kills the Google Music UI. I then can open it back up and music plays again via the DAC!

If I am using Pandora instead of Google Music, I have to kill the Pandora process and it comes back.

So it seems like the OS is not releasing something when a power loss to the DAC occurs. I dont know if there is a way to fix that via the kernel or not though.

Edited by dcplaya, 16 January 2013 - 04:56 PM.

  • 0 Likes

OP Timur

Timur

Android Master

Posted 16 January 2013 - 05:03 PM #206

A-ha! Pausing playback before sudden power loss and killing the music app afterwards both will lead to a new USB DAC session being create when you hit play.

Edit: The critical moment is not right after power loss, when DAC is already off and N7 is still pumping data. The really critical moment comes, when the tablet will wake up from sleep, still pumping data (thinking nothing really has changed), while the DAC has lost all it's state.

Edit 2: So what does this mean? For now, it means, that in case of a power loss, you really should pause music playback, before restarting an external DAC. Based on dcplaya's findings, it has become clear, why this actually works. In parallel, let's also find a more general solution to handle situations, in which a DAC will loose it's mind state.

Edited by Timur, 17 January 2013 - 02:10 AM.

  • 0 Likes

Rezl

Rezl

Average Android

  • 2 posts

Posted 16 January 2013 - 10:53 PM #207

Timur, this is amazing. Thank you for all your work!

Here's a brief overview of my setup and what I used it for:
I’m building a small robot containing a Nexus 7 and Makey Makey for a transmedia gaming interface. The Nexus 7 sits where the robots face would be. The Makey Makey is housed inside and connected to various circuits throughout his body.

Players will activate content within the robot by inserting various NFC-cubes inside his head. Players will control or interact with the robot by touching his different body parts and completing individual circuits connected to the Makey Makey.

I’m will also allow players to “check out” the robot so they can adventure and search for cubes elsewhere. I intend to keep the robot connected to power source when stationary, and an external battery pack when mobile. This should allow the Makey Makey to remain an active input and keep the device powered on longer ventures.

The robot would not have been mobile and setup not possible without this kernel. I’m now more eager to complete the project.

Thanks again!

Edited by Rezl, 16 January 2013 - 10:54 PM.

  • 0 Likes

Kookie_Monster

Kookie_Monster

Android Master

  • 593 posts

Posted 17 January 2013 - 02:11 AM #208

Timur, this is amazing. Thank you for all your work!

Here's a brief overview of my setup and what I used it for:

I’m building a small robot containing a Nexus 7 and Makey Makey for a transmedia gaming interface. The Nexus 7 sits where the robots face would be. The Makey Makey is housed inside and connected to various circuits throughout his body.

Players will activate content within the robot by inserting various NFC-cubes inside his head. Players will control or interact with the robot by touching his different body parts and completing individual circuits connected to the Makey Makey.

I’m will also allow players to “check out” the robot so they can adventure and search for cubes elsewhere. I intend to keep the robot connected to power source when stationary, and an external battery pack when mobile. This should allow the Makey Makey to remain an active input and keep the device powered on longer ventures.

The robot would not have been mobile and setup not possible without this kernel. I’m now more eager to complete the project.

Thanks again!



Very very interesting. Would you be kind and share a video once the project is running? I'd like to see that in action!

Thanks ;)
  • 0 Likes
In-Dash Nexus 7 Project | Mod Shop

Samsung Galaxy SIII LTE 16Gb »» ROM: Stock Android 4.1.2 (Root) »» Kernel: Stock
Asus Transformer TF101 16Gb »» ROM: EOS4 Nightlies »»»»»»»»»»» Kernel: KATKernel
Google Nexus 7 32Gb »»»»»»»»»» ROM: Timur's USBROM »»»»»»»»» Kernel: Timur's Kernel

OP Timur

Timur

Android Master

Posted 17 January 2013 - 02:19 AM #209

Very very interesting. Would you be kind and share a video once the project is running? I'd like to see that in action!

Thanks ;)


Same here. Very interesting! Please keep us updated on this project. A video would be nice.
  • 0 Likes

iceman_jkh

iceman_jkh

Android Lover

  • 150 posts

Posted 17 January 2013 - 03:00 AM #210

I've just received my Hifimediy Sabre USB DAC.
If my otg cable arrives today I should be able to do some testing for you.
http://www.ebay.com....4-/140847495065


Hifimediy Sabre USB DAC is recognised by the N7 using Timur's kernel. And the audio plays - sounds great!
  • 0 Likes