HDMI out has been a highly requested feature, but one that has barely ever worked in the liftime of the S5.
What we currently know:
Stock gallery can output video/audio over hdmi
Stock music can output audio over hdmi
A multimedia dock is required
Both apps can output while displaying something seperate on the device screen[!]
The techincal parts:
Stock gallery depends on libcom_cooliris_hdmi.so
Stock music depends on libcom_oem_hdmi.so
Stock in this definition refers to the stock included gallery/music on stock streak roms, the HDMI out is NOT included in standard 2.2/2.3 AOSP(?)
Stock gallery is com.cooliris.media (Gallery3d.apk) which is available as source though AOSP(?) and the included one is different from the (previously available) one on the android market.
Stock music is com.android.music (Music.apk) is just the AOSP music player with hdmi out added.
Next week or so I am going to attempt to isolate the lines in music.apk that allow it to output audio and hopefully this will at least allow us to consistantly output audio over hdmi.
Also, this is entirely different from the HDMI out on the S7/S10 as they simply use the built in functionality of the Tegra2, which can natively output hdmi. The major difference is that they seem to only be able to mirror video while the screen is on while the S5 can independently ouput.
The S5 is potentially more powerful then the S7/S10 at outputting over hdmi (under the massive assumption that it can output more then just decoded audio video)
IF HDMI out only works on the S5 by taking decoded streams sent to the mediaserver it will NEVER be able to be used for HDMI for anything but what it can already do.
IF I am able to isolate the hdmi out I will likely need the assistance of a app dev, as I dont have any experience actually building apps. Reversing apps and making apps are independent of eachother.
http://www.engadget.com/2011/11/22/xbounds-adds-hdmi-mirroring-to-android-phones-lets-you-kill-th/
This might make your app obsolete when it gets released because it will work for all android phones, however only if the price comes down a bit cause seems a bit steep for what they are predicting.
That requires external hardware, if it requires someone to port it to a specific device I seriously doubt the s5 would ever get it.
Just as much I have absolutely no reason to buy another block to get hdmi out, I already have a multimedia dock. It also works over wifi and I dont expect I'd want it for that reason even if someone gave me one for free
Thats true Manii.......and it would be great to have all vid and audio output in hdmi
Sent from my Dell Streak using xda premium
Code:
com\android\music\albumbrowseractivity$albumlistadapter.smali - A couple constants
com\android\music\albumbrowseractivity.smali - A couple constants/functions
com\android\music\artistalbumbrowseractivity$artistalbumlistadapter.smali - A couple constants/one function
com\android\music\artistalbumbrowseractivity.smali - A couple constants/functions, checks presense of ro.build.FEATURE_HDMI_VIDEOOUT
com\android\music\audiopreview$2.smali - A couple constants/one function
com\android\music\audiopreview$previewplayer.smali - A couple functions
com\android\music\audiopreview.smali - A couple constants/functions
com\android\music\createplaylist$2.smali - A couple constants
com\android\music\createplaylist.smali - A couple constants
com\android\music\deleteitems$1.smali - Not present in dell
com\android\music\deleteitems$2.smali - Not present in dell
com\android\music\deleteitems.smali - Many functions
com\android\music\hdmiaudioactivity$1.smali - HDMI specific functions
com\android\music\hdmiaudioactivity$2.smali - HDMI specific functions
com\android\music\hdmiaudioactivity$3.smali - HDMI specific functions
com\android\music\hdmiaudioactivity$4.smali - HDMI specific functions
com\android\music\hdmiaudioactivity$5.smali - HDMI specific functions
com\android\music\hdmiaudioactivity.smali - HDMI specific functions
com\android\music\imediaplaybackservice$stub$proxy.smali - Many functions
com\android\music\imediaplaybackservice$stub.smali - HDMI specific functions added
com\android\music\imediaplaybackservice.smali - HDMI specific functions added
com\android\music\mediaappwidgetprovider.smali - HDMI specific functions added
com\android\music\mediabuttonintentreciever$1.smali - Not present in dell
com\android\music\mediabuttonintentreciever.smali - Many functions
com\android\music\mediapickeractivity$picklistadapter.smali - A couple constants
com\android\music\mediapickeractivity.smali - A couple constants
com\android\music\mediadisplaybackactivity$10.smali - One function
com\android\music\mediaplaybackactivity$11.smali - Many functions
com\android\music\mediaplaybackactivity$12$1.smali - Not present in dell
com\android\music\mediaplaybackactivity$12.smali - Many functions
com\android\music\mediaplaybackactivity$13$1.smali - Many functions
com\android\music\mediaplaybackactivity$13.smali - Many functions
com\android\music\mediaplaybackactivity$14.smali - Not present in AOSP
com\android\music\mediaplaybackactivity$15.smali - Not present in AOSP
com\android\music\mediaplaybackactivity$2.smali - Many functions
com\android\music\mediaplaybackactivity$4.smali - One function
com\android\music\mediaplaybackactivity$5.smali - One function
com\android\music\mediaplaybackactivity$6.smali - One function
com\android\music\mediaplaybackactivity$7.smali - One function
com\android\music\mediaplaybackactivity$9.smali - One function
com\android\music\mediaplaybackactivity$albumarthandler.smali - A couple functions
com\android\music\mediaplaybackactivity.smali - Many functions
com\android\music\mediaplaybackservice$1.smali - Many functions
com\android\music\mediaplaybackservice$10.smali - Not present in AOSP
com\android\music\mediaplaybackservice$11.smali - Not present in AOSP
com\android\music\mediaplaybackservice$2.smali - A couple costants/functions
com\android\music\mediaplaybackservice$4.smali - A couple functions
com\android\music\mediaplaybackservice$5.smali - Many functions
com\android\music\mediaplaybackservice$6.smali - HDMI specific functions
com\android\music\mediaplaybackservice$7.smali - HDMI specific functions
com\android\music\mediaplaybackservice$8.smali - HDMI specific functions
com\android\music\mediaplaybackservice$9.smali - HDMI specific functions
com\android\music\mediaplaybackservice$handler.smali - HDMI specific functions
com\android\music\mediaplaybackservice$hdmiworker.smali - HDMI specific functions
com\android\music\mediaplaybackservice$multiplayer$1.smali - A couple functions
com\android\music\mediaplaybackservice$multiplayer$2.smali - Many functions
com\android\music\mediaplaybackservice$multiplayer.smali - HDMI specific functions added
com\android\music\mediaplaybackservice$servicestub.smali - A couple functions
com\android\music\mediaplaybackservice.smali - HDMI specific functions added
com\android\music\musicbrowseractivity.smali - A couple constants
com\android\music\musicpicker$tracklistadapter.smali - A couple constants
com\android\music\musicpicker.smali - A couple constants/functions
com\android\music\musicutils$4.smali - HDMI specific functions "com.android.music.musicservicecommand.hdmi"
com\android\music\musicutils.smali - A couple constants/functions
com\android\music\playlistbrowseractivity$playlistlistadapter.smali - A couple constants
com\android\music\playlistbrowseractivity.smali - A couple constants/functions
com\android\music\querybrowseractivity$querylistadapter.smali - A couple constants
com\android\music\querybrowseractivity.smali - A couple functions
com\android\music\renameplaylist.smali - A couple constants
com\android\music\scanningprocess.smali - A couple constants
com\android\music\touchinterceptor.smali - A couple constants/functions
com\android\music\trackbrowseractivity$tracklistadapter.smali - A couple constants
com\android\music\trackbrowseractivity.smali - A couple constants/functions
com\android\music\verticaltextspinner.smali - A couple constants
com\android\music\videobrowseractivity.smali - A couple functions
com\android\music\weekselector.smali - A couple constants
I believe 90% of the relevent code is isolated into the ones marked -HDMI specific functions/added, there's many other changes, but most of them are changing of static constants and things possibly to make music.apk itself work better on the display.
Beyond the hdmi specific code the majority of it is shuffling code into sub-files/classes.
The HDMI enabling code is only a couple hundred lines, while the entirety of the modifications are <1000 lines of code.
The version compared: stock SD244 music.apk vs Nexus1's 2.3.3/GRI40 music.apk as SD 244 is based on GRI40.
The SD244 one is based on the stock dell one, it may in fact be the stock dell one from 2.2 or something, regardless it's not relevent.
It might be possible to make a hdmi audio output enabling app with just this code, the music and gallery apks use different libs when it comes to hdmi, the music one may only work with audio out.
The limitation of the music player not having any controls during hdmi out is likely a limitation of the player itself and not the outputting.
The stock one also lists specific codecs available vs the n1's which lists all audio types. It might be a limitation that the lib can only output streams it can hw accelerate, which means it's potentially a massive limitation of the hdmi out.
If this is the case it may only be viable to output music and not generic sound/video.
libcom_oem_hdmi.so
Well, afaik Java can call external libs (got no Java exp, sorry)
Anyway, quick peek at libcom_oem_hdmi.so:
All operations seems to go via
/dev/graphics/fb1, then MediaServer is notified.
Most probably simpler way would be to write an app that would enable and disable hdmi standalone. And this should work as hdmi is done in external chip.
Both funcs (enable and disable hdmi) take NO parameter, so it should be easy to reimplement.
Got no personal interest, but following code might give some ideas:
Code:
.text:00000678 ; isHdmiConnected(void)
.text:00000678 EXPORT _Z15isHdmiConnectedv
.text:00000678 _Z15isHdmiConnectedv ; CODE XREF: sub_728:loc_73Ep
.text:00000678 PUSH.W {R4-R8,LR}
.text:0000067C LDR R4, =(_GLOBAL_OFFSET_TABLE_ - 0x688)
.text:0000067E LDR R0, =(hdmi_ptr - 0x10F8)
.text:00000680 MOV.W R8, #0
.text:00000684 ADD R4, PC
.text:00000686 LDR R7, =(aDevGraphicsFb1 - 0x692)
.text:00000688 LDR R5, =(aLogtagFailedTo - 0x694)
.text:0000068A MOVS R2, #2
.text:0000068C LDR R3, [R4,R0]
.text:0000068E ADD R7, PC ; "/dev/graphics/fb1"
.text:00000690 ADD R5, PC ; "LOGTAG: Failed to open /dev/graphics/fb"...
.text:00000692 STRB R2, [R3]
.text:00000694
.text:00000694 loc_694 ; CODE XREF: isHdmiConnected(void)+46j
.text:00000694 MOVS R1, #2
.text:00000696 MOV R0, R7
.text:00000698 BLX sub_598
.text:0000069C CMP.W R0, #0xFFFFFFFF
.text:000006A0 MOV R6, R0
.text:000006A2 BNE loc_6FC
.text:000006A4 MOVS R1, #0
.text:000006A6 MOVS R0, #6
.text:000006A8 MOV R2, R5
.text:000006AA ADD.W R8, R8, #1
.text:000006AE BLX sub_58C
.text:000006B2 MOVW R0, #0x2710
.text:000006B6 BLX sub_5A4
.text:000006BA CMP.W R8, #0xA
.text:000006BE BNE loc_694
.text:000006C0 MOVS R0, #6
.text:000006C2 MOVS R1, #0
.text:000006C4 MOV R2, R5
.text:000006C6 MOVS R4, #0
.text:000006C8 BLX sub_58C
.text:000006CC B loc_6F6
.text:000006CE ; ---------------------------------------------------------------------------
.text:000006CE
.text:000006CE loc_6CE ; CODE XREF: isHdmiConnected(void)+96j
.text:000006CE BEQ loc_6DC
.text:000006D0 LDR R2, =(aLogtagCanTRetr - 0x6DA)
.text:000006D2 MOVS R0, #6
.text:000006D4 MOVS R1, #0
.text:000006D6 ADD R2, PC ; "LOGTAG: Can't retrieve hdmiInfo!"
.text:000006D8 BLX sub_58C
.text:000006DC
.text:000006DC loc_6DC ; CODE XREF: isHdmiConnected(void):loc_6CEj
.text:000006DC LDR.W R12, =(hdmi_ptr - 0x10F8)
.text:000006E0 LDR.W R2, [R4,R12]
.text:000006E4 LDRB R1, [R2]
.text:000006E6 CMP R1, #1
.text:000006E8 BEQ loc_6EE
.text:000006EA MOVS R4, #0
.text:000006EC B loc_6F0
.text:000006EE ; ---------------------------------------------------------------------------
.text:000006EE
.text:000006EE loc_6EE ; CODE XREF: isHdmiConnected(void)+70j
.text:000006EE ; isHdmiConnected(void)+94j
.text:000006EE MOVS R4, #1
.text:000006F0
.text:000006F0 loc_6F0 ; CODE XREF: isHdmiConnected(void)+74j
.text:000006F0 MOV R0, R6
.text:000006F2 BLX sub_5B0
.text:000006F6
.text:000006F6 loc_6F6 ; CODE XREF: isHdmiConnected(void)+54j
.text:000006F6 MOV R0, R4
.text:000006F8 POP.W {R4-R8,PC}
.text:000006FC ; ---------------------------------------------------------------------------
.text:000006FC
.text:000006FC loc_6FC ; CODE XREF: isHdmiConnected(void)+2Aj
.text:000006FC LDR.W LR, =(hdmi_ptr - 0x10F8)
.text:00000700 LDR R1, =0xC0046D09
.text:00000702 LDR.W R2, [R4,LR]
.text:00000706 BLX sub_5BC
.text:0000070A CMP R0, #0
.text:0000070C BGT loc_6EE
.text:0000070E B loc_6CE
.text:0000070E ; End of function isHdmiConnected(void)
.text:0000070E
.text:0000070E ; ---------------------------------------------------------------------------
.text:00000710 dword_710 DCD 0xC0046D09 ; DATA XREF: isHdmiConnected(void)+88r
.text:00000714 off_714 DCD _GLOBAL_OFFSET_TABLE_ - 0x688
.text:00000714 ; DATA XREF: isHdmiConnected(void)+4r
.text:00000718 off_718 DCD hdmi_ptr - 0x10F8 ; DATA XREF: isHdmiConnected(void)+6r
.text:00000718 ; isHdmiConnected(void):loc_6DCr ...
.text:0000071C off_71C DCD aDevGraphicsFb1 - 0x692
.text:0000071C ; DATA XREF: isHdmiConnected(void)+Er
.text:0000071C ; "/dev/graphics/fb1"
.text:00000720 off_720 DCD aLogtagFailedTo - 0x694
.text:00000720 ; DATA XREF: isHdmiConnected(void)+10r
.text:00000720 ; "LOGTAG: Failed to open /dev/graphics/fb"...
.text:00000724 off_724 DCD aLogtagCanTRetr - 0x6DA
.text:00000724 ; DATA XREF: isHdmiConnected(void)+58r
.text:00000724 ; "LOGTAG: Can't retrieve hdmiInfo!"
.text:00000728
.text:00000728 ; =============== S U B R O U T I N E =======================================
.text:00000728
.text:00000728
.text:00000728 sub_728 ; DATA XREF: .data:0000113Co
.text:00000728 PUSH {R4,LR}
.text:0000072A LDR R2, [R0]
.text:0000072C LDR R1, =(aComAndroidMusi - 0x734)
.text:0000072E LDR R3, [R2,#0x18]
.text:00000730 ADD R1, PC ; "com/android/music/MediaPlaybackService"
.text:00000732 BLX R3
.text:00000734 MOV R4, R0
.text:00000736 CBNZ R0, loc_73E
.text:00000738 LDR R2, =(aLogtagCanTFind - 0x73E)
.text:0000073A ADD R2, PC ; "LOGTAG: Can't find com/android/music/Me"...
.text:0000073C B loc_74E
.text:0000073E ; ---------------------------------------------------------------------------
.text:0000073E
.text:0000073E loc_73E ; CODE XREF: sub_728+Ej
.text:0000073E BL _Z15isHdmiConnectedv ; isHdmiConnected(void)
.text:00000742 MOV R4, R0
.text:00000744 CBZ R0, loc_74A
.text:00000746 MOVS R4, #1
.text:00000748 B loc_756
.text:0000074A ; ---------------------------------------------------------------------------
.text:0000074A
.text:0000074A loc_74A ; CODE XREF: sub_728+1Cj
.text:0000074A LDR R2, =(aLogtagIshdmico - 0x750)
.text:0000074C ADD R2, PC ; "LOGTAG: isHdmiConnected fail"
.text:0000074E
.text:0000074E loc_74E ; CODE XREF: sub_728+14j
.text:0000074E MOVS R0, #6
.text:00000750 MOV R1, R4
.text:00000752 BLX sub_58C
.text:00000756
.text:00000756 loc_756 ; CODE XREF: sub_728+20j
.text:00000756 MOV R0, R4
.text:00000758 POP {R4,PC}
.text:00000758 ; End of function sub_728
.text:00000758
.text:00000758 ; ---------------------------------------------------------------------------
.text:0000075A DCW 0xBF00
.text:0000075C off_75C DCD aComAndroidMusi - 0x734 ; DATA XREF: sub_728+4r
.text:0000075C ; "com/android/music/MediaPlaybackService"
.text:00000760 off_760 DCD aLogtagCanTFind - 0x73E ; DATA XREF: sub_728+10r
.text:00000760 ; "LOGTAG: Can't find com/android/music/Me"...
.text:00000764 off_764 DCD aLogtagIshdmico - 0x750 ; DATA XREF: sub_728:loc_74Ar
.text:00000764 ; "LOGTAG: isHdmiConnected fail"
.text:00000768
.text:00000768 ; =============== S U B R O U T I N E =======================================
.text:00000768
.text:00000768
.text:00000768 ; enableHdmi(void)
.text:00000768 EXPORT _Z10enableHdmiv
.text:00000768 _Z10enableHdmiv ; CODE XREF: sub_808:loc_81Ep
.text:00000768 PUSH.W {R4-R8,LR}
.text:0000076C LDR R4, =(_GLOBAL_OFFSET_TABLE_ - 0x778)
.text:0000076E LDR R0, =(hdmi_ptr - 0x10F8)
.text:00000770 MOV.W R8, #0
.text:00000774 ADD R4, PC
.text:00000776 LDR R7, =(aDevGraphicsFb1 - 0x782)
.text:00000778 LDR R5, =(aLogtagFailedTo - 0x784)
.text:0000077A MOVS R2, #2
.text:0000077C LDR R3, [R4,R0]
.text:0000077E ADD R7, PC ; "/dev/graphics/fb1"
.text:00000780 ADD R5, PC ; "LOGTAG: Failed to open /dev/graphics/fb"...
.text:00000782 STRB R2, [R3]
.text:00000784
.text:00000784 loc_784 ; CODE XREF: enableHdmi(void)+46j
.text:00000784 MOVS R1, #2
.text:00000786 MOV R0, R7
.text:00000788 BLX sub_598
.text:0000078C CMP.W R0, #0xFFFFFFFF
.text:00000790 MOV R6, R0
.text:00000792 BNE loc_7DE
.text:00000794 MOVS R1, #0
.text:00000796 MOVS R0, #6
.text:00000798 MOV R2, R5
.text:0000079A ADD.W R8, R8, #1
.text:0000079E BLX sub_58C
.text:000007A2 MOVW R0, #0x2710
.text:000007A6 BLX sub_5A4
.text:000007AA CMP.W R8, #0xA
.text:000007AE BNE loc_784
.text:000007B0 MOVS R0, #6
.text:000007B2 MOVS R1, #0
.text:000007B4 MOV R2, R5
.text:000007B6 MOVS R4, #0
.text:000007B8 BLX sub_58C
.text:000007BC B loc_7D8
.text:000007BE ; ---------------------------------------------------------------------------
.text:000007BE
.text:000007BE loc_7BE ; CODE XREF: enableHdmi(void)+82j
.text:000007BE IT EQ
.text:000007C0 MOVEQ R4, R0
.text:000007C2 BEQ loc_7D2
.text:000007C4 LDR R2, =(aLogtagCanTRetr - 0x7D0)
.text:000007C6 MOVS R0, #6
.text:000007C8 MOVS R1, #0
.text:000007CA MOVS R4, #0
.text:000007CC ADD R2, PC ; "LOGTAG: Can't retrieve hdmiInfo!"
.text:000007CE BLX sub_58C
.text:000007D2
.text:000007D2 loc_7D2 ; CODE XREF: enableHdmi(void)+5Aj
.text:000007D2 ; enableHdmi(void)+86j
.text:000007D2 MOV R0, R6
.text:000007D4 BLX sub_5B0
.text:000007D8
.text:000007D8 loc_7D8 ; CODE XREF: enableHdmi(void)+54j
.text:000007D8 UXTB R0, R4
.text:000007DA POP.W {R4-R8,PC}
.text:000007DE ; ---------------------------------------------------------------------------
.text:000007DE
.text:000007DE loc_7DE ; CODE XREF: enableHdmi(void)+2Aj
.text:000007DE LDR R1, =(hdmi_ptr - 0x10F8)
.text:000007E0 LDR R2, [R4,R1]
.text:000007E2 LDR R1, =0xC0046D0A
.text:000007E4 BLX sub_5BC
.text:000007E8 CMP R0, #0
.text:000007EA BLE loc_7BE
.text:000007EC MOVS R4, #1
.text:000007EE B loc_7D2
.text:000007EE ; End of function enableHdmi(void)
.text:000007EE
.text:000007EE ; ---------------------------------------------------------------------------
.text:000007F0 dword_7F0 DCD 0xC0046D0A ; DATA XREF: enableHdmi(void)+7Ar
.text:000007F4 off_7F4 DCD _GLOBAL_OFFSET_TABLE_ - 0x778
.text:000007F4 ; DATA XREF: enableHdmi(void)+4r
.text:000007F8 off_7F8 DCD hdmi_ptr - 0x10F8 ; DATA XREF: enableHdmi(void)+6r
.text:000007F8 ; enableHdmi(void):loc_7DEr
.text:000007FC off_7FC DCD aDevGraphicsFb1 - 0x782 ; DATA XREF: enableHdmi(void)+Er
.text:000007FC ; "/dev/graphics/fb1"
.text:00000800 off_800 DCD aLogtagFailedTo - 0x784 ; DATA XREF: enableHdmi(void)+10r
.text:00000800 ; "LOGTAG: Failed to open /dev/graphics/fb"...
.text:00000804 off_804 DCD aLogtagCanTRetr - 0x7D0 ; DATA XREF: enableHdmi(void)+5Cr
.text:00000804 ; "LOGTAG: Can't retrieve hdmiInfo!"
.text:00000808
.text:00000808 ; =============== S U B R O U T I N E =======================================
.text:00000808
.text:00000808
.text:00000808 sub_808 ; DATA XREF: .data:00001130o
.text:00000808 PUSH {R4,LR}
.text:0000080A LDR R2, [R0]
.text:0000080C LDR R1, =(aComAndroidMusi - 0x814)
.text:0000080E LDR R3, [R2,#0x18]
.text:00000810 ADD R1, PC ; "com/android/music/MediaPlaybackService"
.text:00000812 BLX R3
.text:00000814 MOV R4, R0
.text:00000816 CBNZ R0, loc_81E
.text:00000818 LDR R2, =(aLogtagCanTFind - 0x81E)
.text:0000081A ADD R2, PC ; "LOGTAG: Can't find com/android/music/Me"...
.text:0000081C B loc_82E
.text:0000081E ; ---------------------------------------------------------------------------
.text:0000081E
.text:0000081E loc_81E ; CODE XREF: sub_808+Ej
.text:0000081E BL _Z10enableHdmiv ; enableHdmi(void)
.text:00000822 MOV R4, R0
.text:00000824 CBZ R0, loc_82A
.text:00000826 MOVS R4, #1
.text:00000828 B loc_836
.text:0000082A ; ---------------------------------------------------------------------------
.text:0000082A
.text:0000082A loc_82A ; CODE XREF: sub_808+1Cj
.text:0000082A LDR R2, =(aLogtagEnablehd - 0x830)
.text:0000082C ADD R2, PC ; "LOGTAG: enableHdmi fail"
.text:0000082E
.text:0000082E loc_82E ; CODE XREF: sub_808+14j
.text:0000082E MOVS R0, #6
.text:00000830 MOV R1, R4
.text:00000832 BLX sub_58C
.text:00000836
.text:00000836 loc_836 ; CODE XREF: sub_808+20j
.text:00000836 MOV R0, R4
.text:00000838 POP {R4,PC}
.text:00000838 ; End of function sub_808
.text:00000838
.text:00000838 ; ---------------------------------------------------------------------------
.text:0000083A DCW 0xBF00
.text:0000083C off_83C DCD aComAndroidMusi - 0x814 ; DATA XREF: sub_808+4r
.text:0000083C ; "com/android/music/MediaPlaybackService"
.text:00000840 off_840 DCD aLogtagCanTFind - 0x81E ; DATA XREF: sub_808+10r
.text:00000840 ; "LOGTAG: Can't find com/android/music/Me"...
.text:00000844 off_844 DCD aLogtagEnablehd - 0x830 ; DATA XREF: sub_808:loc_82Ar
.text:00000844 ; "LOGTAG: enableHdmi fail"
.text:00000848
.text:00000848 ; =============== S U B R O U T I N E =======================================
.text:00000848
.text:00000848
.text:00000848 ; disableHdmi(void)
.text:00000848 EXPORT _Z11disableHdmiv
.text:00000848 _Z11disableHdmiv ; CODE XREF: sub_8E8:loc_8FEp
.text:00000848 PUSH.W {R4-R8,LR}
.text:0000084C LDR R4, =(_GLOBAL_OFFSET_TABLE_ - 0x858)
.text:0000084E LDR R0, =(hdmi_ptr - 0x10F8)
.text:00000850 MOV.W R8, #0
.text:00000854 ADD R4, PC
.text:00000856 LDR R7, =(aDevGraphicsFb1 - 0x862)
.text:00000858 LDR R5, =(aLogtagFailedTo - 0x864)
.text:0000085A MOVS R2, #2
.text:0000085C LDR R3, [R4,R0]
.text:0000085E ADD R7, PC ; "/dev/graphics/fb1"
.text:00000860 ADD R5, PC ; "LOGTAG: Failed to open /dev/graphics/fb"...
.text:00000862 STRB R2, [R3]
.text:00000864
.text:00000864 loc_864 ; CODE XREF: disableHdmi(void)+46j
.text:00000864 MOVS R1, #2
.text:00000866 MOV R0, R7
.text:00000868 BLX sub_598
.text:0000086C CMP.W R0, #0xFFFFFFFF
.text:00000870 MOV R6, R0
.text:00000872 BNE loc_8BE
.text:00000874 MOVS R1, #0
.text:00000876 MOVS R0, #6
.text:00000878 MOV R2, R5
.text:0000087A ADD.W R8, R8, #1
.text:0000087E BLX sub_58C
.text:00000882 MOVW R0, #0x2710
.text:00000886 BLX sub_5A4
.text:0000088A CMP.W R8, #0xA
.text:0000088E BNE loc_864
.text:00000890 MOVS R0, #6
.text:00000892 MOVS R1, #0
.text:00000894 MOV R2, R5
.text:00000896 MOVS R4, #0
.text:00000898 BLX sub_58C
.text:0000089C B loc_8B8
.text:0000089E ; ---------------------------------------------------------------------------
.text:0000089E
.text:0000089E loc_89E ; CODE XREF: disableHdmi(void)+82j
.text:0000089E IT EQ
.text:000008A0 MOVEQ R4, R0
.text:000008A2 BEQ loc_8B2
.text:000008A4 LDR R2, =(aLogtagCanTRetr - 0x8B0)
.text:000008A6 MOVS R0, #6
.text:000008A8 MOVS R1, #0
.text:000008AA MOVS R4, #0
.text:000008AC ADD R2, PC ; "LOGTAG: Can't retrieve hdmiInfo!"
.text:000008AE BLX sub_58C
.text:000008B2
.text:000008B2 loc_8B2 ; CODE XREF: disableHdmi(void)+5Aj
.text:000008B2 ; disableHdmi(void)+86j
.text:000008B2 MOV R0, R6
.text:000008B4 BLX sub_5B0
.text:000008B8
.text:000008B8 loc_8B8 ; CODE XREF: disableHdmi(void)+54j
.text:000008B8 UXTB R0, R4
.text:000008BA POP.W {R4-R8,PC}
.text:000008BE ; ---------------------------------------------------------------------------
.text:000008BE
.text:000008BE loc_8BE ; CODE XREF: disableHdmi(void)+2Aj
.text:000008BE LDR R1, =(hdmi_ptr - 0x10F8)
.text:000008C0 LDR R2, [R4,R1]
.text:000008C2 LDR R1, =0xC0046D0E
.text:000008C4 BLX sub_5BC
.text:000008C8 CMP R0, #0
.text:000008CA BLE loc_89E
.text:000008CC MOVS R4, #1
.text:000008CE B loc_8B2
.text:000008CE ; End of function disableHdmi(void)
.text:000008CE
.text:000008CE ; ---------------------------------------------------------------------------
.text:000008D0 dword_8D0 DCD 0xC0046D0E ; DATA XREF: disableHdmi(void)+7Ar
.text:000008D4 off_8D4 DCD _GLOBAL_OFFSET_TABLE_ - 0x858
.text:000008D4 ; DATA XREF: disableHdmi(void)+4r
.text:000008D8 off_8D8 DCD hdmi_ptr - 0x10F8 ; DATA XREF: disableHdmi(void)+6r
.text:000008D8 ; disableHdmi(void):loc_8BEr
.text:000008DC off_8DC DCD aDevGraphicsFb1 - 0x862 ; DATA XREF: disableHdmi(void)+Er
.text:000008DC ; "/dev/graphics/fb1"
.text:000008E0 off_8E0 DCD aLogtagFailedTo - 0x864
.text:000008E0 ; DATA XREF: disableHdmi(void)+10r
.text:000008E0 ; "LOGTAG: Failed to open /dev/graphics/fb"...
.text:000008E4 off_8E4 DCD aLogtagCanTRetr - 0x8B0
.text:000008E4 ; DATA XREF: disableHdmi(void)+5Cr
.text:000008E4 ; "LOGTAG: Can't retrieve hdmiInfo!"
.text:000008E8
.text:000008E8 ; =============== S U B R O U T I N E =======================================
.text:000008E8
.text:000008E8
.text:000008E8 sub_8E8 ; DATA XREF: .data:00001124o
.text:000008E8 PUSH {R4,LR}
.text:000008EA LDR R2, [R0]
.text:000008EC LDR R1, =(aComAndroidMusi - 0x8F4)
.text:000008EE LDR R3, [R2,#0x18]
.text:000008F0 ADD R1, PC ; "com/android/music/MediaPlaybackService"
.text:000008F2 BLX R3
.text:000008F4 MOV R4, R0
.text:000008F6 CBNZ R0, loc_8FE
.text:000008F8 LDR R2, =(aLogtagCanTFind - 0x8FE)
.text:000008FA ADD R2, PC ; "LOGTAG: Can't find com/android/music/Me"...
.text:000008FC B loc_90E
.text:000008FE ; ---------------------------------------------------------------------------
.text:000008FE
.text:000008FE loc_8FE ; CODE XREF: sub_8E8+Ej
.text:000008FE BL _Z11disableHdmiv ; disableHdmi(void)
.text:00000902 MOV R4, R0
.text:00000904 CBZ R0, loc_90A
.text:00000906 MOVS R4, #1
.text:00000908 B loc_916
.text:0000090A ; ---------------------------------------------------------------------------
.text:0000090A
.text:0000090A loc_90A ; CODE XREF: sub_8E8+1Cj
.text:0000090A LDR R2, =(aLogtagDisableh - 0x910)
.text:0000090C ADD R2, PC ; "LOGTAG: disableHdmi fail"
.text:0000090E
.text:0000090E loc_90E ; CODE XREF: sub_8E8+14j
.text:0000090E MOVS R0, #6
.text:00000910 MOV R1, R4
.text:00000912 BLX sub_58C
.text:00000916
.text:00000916 loc_916 ; CODE XREF: sub_8E8+20j
.text:00000916 MOV R0, R4
.text:00000918 POP {R4,PC}
.text:00000918 ; End of function sub_8E8
.text:00000918
.text:00000918 ; ---------------------------------------------------------------------------
.text:0000091A DCW 0xBF00
.text:0000091C off_91C DCD aComAndroidMusi - 0x8F4 ; DATA XREF: sub_8E8+4r
.text:0000091C ; "com/android/music/MediaPlaybackService"
.text:00000920 off_920 DCD aLogtagCanTFind - 0x8FE ; DATA XREF: sub_8E8+10r
.text:00000920 ; "LOGTAG: Can't find com/android/music/Me"...
.text:00000924 off_924 DCD aLogtagDisableh - 0x910 ; DATA XREF: sub_8E8:loc_90Ar
.text:00000924 ; .text ends ; "LOGTAG: disableHdmi fail"
It's calling it though JNI (or whatever equiv it is in dalvik)
I didnt bother decompiling the native libs since I'm more interested in reading smali code then arm assembly.
Regardless it still sounds pretty simple overall, how unfortunate noone looked at this as it's been requested multiple times for a hdmi helper app
I think Meltus would help with this case.
If I could use hdmi with custom roms I would buy the dock right away.
Keep up the good work
I'm not a dock reseller , and don't have one to check, but i think it'll work.
Lubo seems to have one.
I have done extensive searching on the net on this one. Apparently, streak's GPU is not capable of HDMI mirroring. i.e. it's a hardware restriction.
Although I m not sure how reliable this information is.
Decoding/encoding in android likely never involves the GPU as that's pretty expensive, just as much the GPU in it likely isnt powerful enough anyway.
All mobile SoCs likely have a dedicated decoder ASIC to handle all the common codecs.
The question is what does the HDMI chip accept? Is it raw RGB data or simply an encoded stream?
There's a real possibility it's only the latter as currently the only thing you can output are videos/audio (which are just that, encoded streams)
If that is the case you would need to encode the screen's contents before feeding it to the HDMI chip and that may be not be an easy task (though definitely not impossible, it's not that different from what the video capture part of the camera app does, it can encode and mux at 720p in realtime/near realtime)
The Dell Axim 51v, which was released in 2005, had an 8MB 3D graphics chip and native VGA out with mirroring. It was perfect for giving presentations; like having a pocket sized laptop, which plugged directly into a data projector. To my mind, it is ridiculous that a device made six years later can't do the same. I still have my Axim 51v, now with a WinMo 6.1 ROM.
yes it can be done. although it might require too many resources and result in a lag.
TheManii, would you check this:
http://forum.xda-developers.com/showpost.php?p=26165133&postcount=3991
What am interested in: will third party app output anything to hdmi with forcefully enabled hdmi?
It's clear that player should stream to /dev/graphics/fb1 and system player libraries use it. Soft-decoded videos are not the case.
Also - will force mirroring work with the command like this:
while [ 1 == 1 ]; do cp /dev/graphics/fb0 /dev/graphics/fb1; usleep 10000; done;
Someone already got it to it before I did, I havnt been on much recently.
But try feeding into fb1 various mpeg2 streams, possibly WVGA ones of the right characteristics.
Hardware encoder chips are a lot less flexable then software en/decoders so it might be complaining about that.
Related
Dear all [especially the developers],
Is there a practical way of changing the above mentioned ROM's page pool?
Is there a tool?
I tried Latest Page Pool Changer release [V.2.21] but it doesn't behave as it should.
With JCEspi2005's help I realized it doesn't report or write the right or, at least, the reported and visible values...
How can we sort this out?
Can someone point me in the right direction?
Hang Tua, given the fact I am solely using your ROMs would you be so kind you would help me?
Click to expand...
Click to collapse
Dear all,
INTRODUCTION
With JCEspi2005 precious help and guidance and Swiftblade precious information, we both came to the conclusion that Raphael page pool change method can now be unveiled.
CONSIDERATIONS
JCEspi2005 changed a ROM's page pool to 24 and I tested it.
Result: Ok.
I changed 2 ROM's page pool and tested it.
Result: Ok.
TOOLS
A Hex editor like:
XVI32 V.2.31 ¤ Link
HexEdit V.1.03 ¤ Link
PROCEDURE [Information source: Link]
Address: 70F0
Values:
[00MB Pagepool] |00 15 A0 03 | 02 15 A0 13 | 00 10 83 E5 | DA C2 FF EB|
[12MB Pagepool] |03 15 A0 03 | 02 15 A0 13 | 00 10 83 E5 | DA C2 FF EB|
[16MB Pagepool] |10 16 A0 03 | 02 15 A0 13 | 00 10 83 E5 | DA C2 FF EB|
[18MB Pagepool] |12 16 A0 03 | 02 15 A0 13 | 00 10 83 E5 | DA C2 FF EB|
[24MB Pagepool] |18 16 A0 03 | 02 15 A0 13 | 00 10 83 E5 | DA C2 FF EB|
1. Open the OS.nb or the .NBH file with a Hex Editor
2. Search the for hex string pattern |03 15 A0 03 | 02 15 A0 13 | 00 10 83 E5 | DA C2 FF EB| [Two addresses should be found]
3. At the first address found, change the first two bytes "03 15" to "12 16" for 18MB pagepool
4. Repeat Step Nº 3 at the 2nd address found
5. Save & Exit the Hex Editor
6. If you are using the OS.nb, start cooking your new ROM with it
7. Flash the new .NBH file to your Raphael and enjoy the 18MB True Pagepool
For other pagepool sizes, change the first byte "03" to "XX" hex value corresponding to your desired pagepool in Step Nº 3 and 4. [Remember that this is hex value, i.e. "10" = 16MB, "12" = 18MB, "18" = 24MB, etc.]
Happy Page Pool changing, happy flashing and cheers!
P.S. There were some doubts about dynamic page pool [Page Pool 0] usage but after a day of testing 0 page pooled ROMs I can almost assure the there are not stability issues.
Although several more days of testing [at least 2] are needed to ensure it doesn't affect stability, by now, I can infer that it is quite stable as well as reliable.
MEMORY
Do note that your available memory will differ according to the page pool you use.
If you feel like knowing how much memory you will have available after page pool change, maybe it's time for some linear and simple arithmetics
This post will be updated as we find out about new information or outcoming issues.
Special thanks to JCEspi2005. I hope out «partnership» goes on and on
Cheers and good luck to all.
Hi there,
I've tried pagepool changer and it appears to work just as it says on the tin!
If you look on the right hand side of the windows there is a box where you can change the pagepool size. Hit the button and you'll notice that the ROM file has been changed (Check the date stamp if you don't believe me) I've checked the ROm image with a hex editor and it has change the corrct values.
Hope this helps.
WizP said:
Hi there,
I've tried pagepool changer and it appears to work just as it says on the tin!
If you look on the right hand side of the windows there is a box where you can change the pagepool size. Hit the button and you'll notice that the ROM file has been changed (Check the date stamp if you don't believe me) I've checked the ROm image with a hex editor and it has change the corrct values.
Hope this helps.
Click to expand...
Click to collapse
Attached is a little application to run in your PDA. DevHealth.exe generates a mem_X.txt file on your SD card root (let some time to do it). Inside this file you can view the real PagePool.
Can you test your changed ROM to see what changes do?
Cheers
WizP said:
Hi there,
I've tried pagepool changer and it appears to work just as it says on the tin!
If you look on the right hand side of the windows there is a box where you can change the pagepool size. Hit the button and you'll notice that the ROM file has been changed (Check the date stamp if you don't believe me) I've checked the ROm image with a hex editor and it has change the corrct values.
Hope this helps.
Click to expand...
Click to collapse
That's not the question...
The question is: Does it read and change the right addresses?
No it doesn't. JCEspi2005 created a ROM with PP12 and the referred tool reads 6.
I'll try to find a tool that correctly addresses Raphael ROMs.
Cheers.
mrvanx asked me about this thread.... yes I can confirm the pagepool changer will not work, as nk.exe dynamically sets pagepool, depending on (probably) ram size. htc niki and elf/elfin are the same deal.
this is easy to fix of course with a small assembly patch
cmonex said:
this is easy to fix of course with a small assembly patch
Click to expand...
Click to collapse
Pls guide us to the true path
cmonex said:
mrvanx asked me about this thread.... yes I can confirm the pagepool changer will not work, as nk.exe dynamically sets pagepool, depending on (probably) ram size. htc niki and elf/elfin are the same deal.
this is easy to fix of course with a small assembly patch
Click to expand...
Click to collapse
Thanks, this is just i was beleaving...
Are you planing yo make the "small" patch for us?
Following this post http://forum.xda-developers.com/showpost.php?p=2274534&postcount=1 i managed to create a modified NBH of WWE shipped ROM wirh 24Mb PagePool for someone to test it (i can't do it for now...)
The link
http://rapidshare.com/files/1488550...el_CRC_52.33.25.17_1.02.25.19_Ship_PP24Mb.rar
Report back, please...
Thanks.
cmonex said:
mrvanx asked me about this thread.... yes I can confirm the pagepool changer will not work, as nk.exe dynamically sets pagepool, depending on (probably) ram size. htc niki and elf/elfin are the same deal.
this is easy to fix of course with a small assembly patch
Click to expand...
Click to collapse
Would you be so kind you would inform us (if you can) of the addresses and values for Raphael ROM's pagepool?
Even if there is no tool yet, we can HEX edit the NBH and change it.
I am personally interested in pagepool 0 [dynamic].
Thank you in advance.
Cheers.
well, here is an example:
.text:80058220 B0 28 9F E5 LDR R2, =dword_803F6350
.text:80058224 A8 78 9F E5 LDR R7, =0xA8081064
.text:80058228 00 30 95 E5 LDR R3, [R5]
.text:8005822C 9C 88 9F E5 LDR R8, =0x52444C55
.text:80058230 94 08 9F E5 LDR R0, =aKPagePoolSize0
.text:80058234 01 0C 53 E3 CMP R3, #0x100
.text:80058238 03 15 A0 03 MOVEQ R1, #0xC00000
.text:8005823C 02 15 A0 13 MOVNE R1, #0x800000
.text:80058240 00 10 82 E5 STR R1, [R2]
.text:80058244 00 30 97 E5 LDR R3, [R7]
.text:80058248 08 00 53 E1 CMP R3, R8
.text:8005824C 01 15 A0 03 MOVEQ R1, #0x400000
.text:80058250 00 10 82 05 STREQ R1, [R2]
0x803F6350 is what the pagepool changer usually patches, this is set to 6MB by default in the nk.exe. the problem is the real pagepool will never be 6MB, this code above dynamically decides if 4, 8, or 12MB it should be. (on my raphael it went for 12MB)
the elf patch is ok, as long as the STREQ on the last line doesn't execute, if it does, then copying the elf patch is not enough. so I suggest this patch:
STR R1, [R2] -> NOP (00 00 A0 E1)
and STREQ R1, [R2] -> another NOP (00 00 A0 E1)
after this pagepool changer should work nicely, and this is easier than that patching for Elf. once you patch the nk.exe like this, it will be fine.
on top of that, an entirely cosmetic patch: you can change the R1 contents too (similar to Elf patch) so KITL log will show the right value.
P.S: my guess is it only sets it to 4MB if ULDR is loaded. so usually not of importance.
Raphael ROMs Page Pool Changing
First post updated. Do read it
Cheers.
cmonex said:
well, here is an example:
.text:80058220 B0 28 9F E5 LDR R2, =dword_803F6350
.text:80058224 A8 78 9F E5 LDR R7, =0xA8081064
.text:80058228 00 30 95 E5 LDR R3, [R5]
.text:8005822C 9C 88 9F E5 LDR R8, =0x52444C55
.text:80058230 94 08 9F E5 LDR R0, =aKPagePoolSize0
.text:80058234 01 0C 53 E3 CMP R3, #0x100
.text:80058238 03 15 A0 03 MOVEQ R1, #0xC00000
.text:8005823C 02 15 A0 13 MOVNE R1, #0x800000
.text:80058240 00 10 82 E5 STR R1, [R2]
.text:80058244 00 30 97 E5 LDR R3, [R7]
.text:80058248 08 00 53 E1 CMP R3, R8
.text:8005824C 01 15 A0 03 MOVEQ R1, #0x400000
.text:80058250 00 10 82 05 STREQ R1, [R2]
0x803F6350 is what the pagepool changer usually patches, this is set to 6MB by default in the nk.exe. the problem is the real pagepool will never be 6MB, this code above dynamically decides if 4, 8, or 12MB it should be. (on my raphael it went for 12MB)
the elf patch is ok, as long as the STREQ on the last line doesn't execute, if it does, then copying the elf patch is not enough. so I suggest this patch:
STR R1, [R2] -> NOP (00 00 A0 E1)
and STREQ R1, [R2] -> another NOP (00 00 A0 E1)
after this pagepool changer should work nicely, and this is easier than that patching for Elf. once you patch the nk.exe like this, it will be fine.
on top of that, an entirely cosmetic patch: you can change the R1 contents too (similar to Elf patch) so KITL log will show the right value.
P.S: my guess is it only sets it to 4MB if ULDR is loaded. so usually not of importance.
Click to expand...
Click to collapse
Thanks for so deep info
The procedure is like the Elfin one...
Cheers
jcespi2005 said:
Thanks for so deep info
The procedure is like the Elfin one...
Cheers
Click to expand...
Click to collapse
yeah, and who pointed that out originally?
I've tried the posted procedure for finding, and changing the Pagepool - but everytime i search for the hex string, i get no returned results. Am i doing something wrong?
I have bought an LG P500 mobile phone and was trying to use usb tethering and it didnot work. i was able to ping the mobile but nothing beyond it. Can you guys help
The details of the phone are
Model number : LG-P500
Android version : 2.2
Kernel Version : 2.6.32.9 [email protected] #1 Mon Oct 4 09:05:43 IST 2010
Build number : FRF91
Software Version : V10b-OCT-02-2010
Details of my PC are
Microsoft windows XP Professional version 2002 Service Pack 3
Here are the steps that i had taken and things i tried before reporting this
1. Installed USB drivers for the mobile on my pc
2. connected the mobile to the pc through usb cable
3. turned on the usb tethering button under tethering on mobile
4. on the laptop it shows as the following
Local Area Connectio 13
Connected,Firewalled
LG AndroidNet NDIS Ethernet Adapter #3
on the mobile it shows Tethering or hotspot Active
5. I turn on the wifi on the mobile phone (and turn off the wifi on the laptop)
6. i surf a website on mobile phone to make sure that i am connected to internet.
7. Now i open my internet explorer/firefox in my pc and try to surf the same website.
It does not open the website. for some time it says looking and then says address not found.
8. Now i open the command prompt and type ipconfig/all and i get the following
Ethernet adapter Local Area Connection 13:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : LG AndroidNet NDIS Ethernet Adapter #3
Physical Address. . . . . . . . . : 42-14-1A-50-76-BD
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.42.164
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IP Address. . . . . . . . . . . . : fe80::4014:1aff:fe50:76bd%10
Default Gateway . . . . . . . . . : 192.168.42.129
DHCP Server . . . . . . . . . . . : 192.168.42.129
DNS Servers . . . . . . . . . . . : 192.168.42.129
fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
Lease Obtained. . . . . . . . . . : Saturday, March 05, 2011 4:10:52 PM
Lease Expires . . . . . . . . . . : Saturday, March 05, 2011 5:10:52 PM
9. Now i type route PRINT
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...20 7c 8f 07 23 6b ...... Atheros AR9285 Wireless Network Adapter - Packet Scheduler Miniport
0x3 ...f0 4d a2 50 19 0b ...... Realtek PCIe GBE Family Controller #2 - Packet Scheduler Miniport
0x30005 ...42 14 1a 50 76 bd ...... LG AndroidNet NDIS Ethernet Adapter #3 - Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.42.129 192.168.42.164 25
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.42.0 255.255.255.0 192.168.42.164 192.168.42.164 25
192.168.42.164 255.255.255.255 127.0.0.1 127.0.0.1 25
192.168.42.255 255.255.255.255 192.168.42.164 192.168.42.164 25
224.0.0.0 240.0.0.0 192.168.42.164 192.168.42.164 25
255.255.255.255 255.255.255.255 192.168.42.164 2 1
255.255.255.255 255.255.255.255 192.168.42.164 192.168.42.164 1
255.255.255.255 255.255.255.255 192.168.42.164 3 1
Default Gateway: 192.168.42.129
===========================================================================
Persistent Routes:
None
10. Now i try ping 192.168.42.129 and i get
Pinging 192.168.42.129 with 32 bytes of data:
Reply from 192.168.42.129: bytes=32 time<1ms TTL=64
Reply from 192.168.42.129: bytes=32 time<1ms TTL=64
Reply from 192.168.42.129: bytes=32 time<1ms TTL=64
Reply from 192.168.42.129: bytes=32 time=3ms TTL=64
Ping statistics for 192.168.42.129:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 3ms, Average = 0ms
11. Now i try to ping forum.xda-developers.com and i get
Ping request could not find host forum.xda-developers.com. Please check the name and try again.
I'm trying to get my Countour Shuttlexpress working with usb host ( using cm7 nightlies )
I've already posted some of this in the usb-host thread but seems there is not much devs traffic there LINK
So I've decided to open a new thread hoping for some interest and maybe info for others who want to write/port their own usb-host drivers
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Eventually what I'm trying to achieve is :
Jog Wheel - Controls system/media volume
Shuttle Knob - PREV/NEXT song on PowerAmp app
Buttons - Launch Apps , Jump To Screen #n , Run Terminal Commands
That's on the basic level of things
I don't have any coding skills in Linux ( I do know some java and c/c++ And I'm a fast learner )
In the past few days I've been setting up my first developing enviorment with Ubuntu 10.04 and learned a couple of things about android coding
Lets get back to the device
For now it's recognized as an HID device , and I can use getevent to get each function specific code
But nothing is mapped to any real function on the nook
Here is some info from the nook :
DMESG Log :
Code:
<6>usb 1-1.2: new low speed USB device using musb_hdrc and address 4
<7>usb 1-1.2: skipped 1 descriptor after interface
<7>usb 1-1.2: default language 0x0409
<3>usb 1-1.2: device v0b33 p0020 is not supported
<7>usb 1-1.2: udev 4, busnum 1, minor = 3
<6>usb 1-1.2: New USB device found, idVendor=0b33, idProduct=0020
<6>usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>usb 1-1.2: Product: ShuttleXpress
<6>usb 1-1.2: Manufacturer: Contour Design
<7>usb 1-1.2: uevent
<7>usb 1-1.2: usb_probe_device
<6>usb 1-1.2: configuration #1 chosen from 1 choice
<7>usb 1-1.2: adding 1-1.2:1.0 (config #1, interface 0)
<7>usb 1-1.2:1.0: uevent
<7>usbserial_generic 1-1.2:1.0: usb_probe_interface
<7>usbserial_generic 1-1.2:1.0: usb_probe_interface - got id
<7>usbhid 1-1.2:1.0: usb_probe_interface
<7>usbhid 1-1.2:1.0: usb_probe_interface - got id
<6>input: Contour Design ShuttleXpress as /devices/platform/musb_hdrc/usb1/1-1/1-1.2/1-1.2:1.0/input/input4
<6>generic-usb 0003:0B33:0020.0001: input: USB HID v1.10 Device [Contour Design ShuttleXpress] on usb-musb_hdrc-1.2/input0
<7>drivers/usb/core/inode.c: creating file '004'
<1>##- Data length: 2
/proc/bus/input/devices
Code:
I: Bus=0003 Vendor=0b33 Product=0020 Version=0110
N: Name="Contour Design ShuttleXpress"
P: Phys=usb-musb_hdrc-1.2/input0
S: Sysfs=/devices/platform/musb_hdrc/usb1/1-1/1-1.2/1-1.2:1.0/input/input7
U: Uniq=
H: Handlers=mouse3 event7
B: EV=17
B: KEY=1fff 0 0 0 0 0 0 0 0
B: REL=180
B: MSC=10
*the logs are from different sessions
using "getevent /dev/input/event7" I captured the events and isolated them
Buttons : ( numbered from left to right )
1.
Code:
Press -
0004 0004 00090005
0001 0104 00000001
0000 0000 00000000
Release -
0004 0004 00090005
0001 0104 00000000
0000 0000 00000000
2.
Code:
Press -
0004 0004 00090006
0001 0105 00000001
0000 0000 00000000
Release -
0004 0004 00090006
0001 0105 00000000
0000 0000 00000000
3.
Code:
Press -
0004 0004 00090007
0001 0106 00000001
0000 0000 00000000
Release -
0004 0004 00090007
0001 0106 00000000
0000 0000 00000000
4.
Code:
Press -
0004 0004 00090008
0001 0107 00000001
0000 0000 00000000
Release -
0004 0004 00090008
0001 0107 00000000
0000 0000 00000000
5.
Code:
Press -
0004 0004 00090009
0001 0108 00000001
0000 0000 00000000
Release -
0004 0004 00090009
0001 0108 00000000
0000 0000 00000000
Jog Wheel :
Code:
From -
0002 0007 00000001
0000 0000 00000000
To -
0002 0007 000000ff
0000 0000 00000000
Shuttle Knob :
Code:
Full right -
0002 0008 00000007
0002 0007 00000001
0000 0000 00000000
Full left -
0002 0008 fffffff9
0002 0007 00000001
0000 0000 00000000
So , I have a few ideas on how to do it and I thought you might help me figure out the best way and guide me through it :
Using Tasker and write a script using Locale Execute plugin with getevent & other commands - Probably highly in-efficient and maybe slow?
Write an app to run in the background , intercept the events and execute commands every x ms? How much is needed for a quick response?
Write a driver ( or kernel module? ) for the device
Maybe I can use the HID driver to do that?
Port one of the sources I listed down to Android?
Another thing I haven't thought of?
I have found a couple of things that might help
powermate.c in dalingrin's kernel seems to contain some code for it but I couldn't find any real thing that it does to it besides define the device
GITHUB Link
Here are some source codes for Linux ( which I thought at first to be drivers but they seem to be handlers/applications )
https://init.linpro.no/pipermail/skolelinux.no/cinelerra/2006-March/005665.html
http://www.reynwar.net/gnuradio/epydoc/gnuradio.wxgui.powermate-pysrc.html
Can I use the code from USB Mouse support and adapt it for my own input device? will it even work on CM7 since it's built for Iconia?
I've also looked into usbled.c in the kernel , comparing it to the original code from here http://www.linuxjournal.com/article/7353
It seems pretty much the same , so maybe porting the handler is the best and easiest way?
Any help would be appreciated , in the last 3 days I've read so much on linux/android developing and still feels like I know nothing
Thanks ,
Gutz
will it work with the shuttle pro 2, too ?
There is a code for the shuttle pro and v2 as well here
http://www.reynwar.net/gnuradio/epydoc/gnuradio.wxgui.powermate-pysrc.html
Its an handler written with python , I need to find out if I can port this to Android
If I'll eventually port some of the code from there I'll try to include the v2 code aswell..
Did you get this going? Would be very interested.
oh memories
I did get this going eventually pretty easily using an app called "usb/bt joystick center"
I tried looking for it but it's not on the play store anymore , a google search did came up with some apk sources so just try them out
If you need any help pm me - I haven't touched it in years but I might remember / can dig up some old files to help
Good luck
Any news on that old topic ?
I just bought a ShuttleXpress for a Nexus in car project thinking it would be straightforward, but it seems that its not..
hassbruk said:
Any news on that old topic ?
I just bought a ShuttleXpress for a Nexus in car project thinking it would be straightforward, but it seems that its not..
Click to expand...
Click to collapse
@hassbruk I have written a driver for this, which is implemented in my controller app. Checkout my github (freshollie) for more info.
freshollie said:
@hassbruk I have written a driver for this, which is implemented in my controller app. Checkout my github (freshollie) for more info.
Click to expand...
Click to collapse
Hi Freshollie sorry to wake up this thread after so many years.. Anyway to help how to set this up in an android tablet ?
This is my "Squid Kernel" for the 2016 Moto G4 Play, codenamed harpia. It shares a common codebase with my kernels for osprey, surnia, and lux. It consists of the latest Motorola MSM8916 kernel, with all the latest changes from CodeAurora and Kernel.org merged in, along with select cherry-picks and additions of my own. Flash it using TWRP. Bug reports and contributions are welcome.
This kernel supports both the stock ROM and custom ROMs.
Disclaimer:
This is for the 2016 Moto G4 Play (harpia) only! Versions r22 and up are for Nougat ROMs with modern blobs only! Don't flash it on a previous Moto G, or surnia, or lux. This kernel is provided AS-IS, with no warranties. I am not responsible for bricking your device. Flash at your own risk.
Features:
Moderately undervolted
Updated to Linux 3.10.108
Synced with latest CodeAurora changes
Improved memory management
Improved memory caching backported from Linux 3.15
Improved storage performance
Optimized ARM crypto routines
Updated f2fs and WiFi drivers
FIOPS and BFQ I/O schedulers
Lionfish CPU governor
IntelliPlug CPU hotplug (by faux123)
KCAL MDP5 colour control (by savoca)
Improved zRAM backported from Linux 4.9
Vibration intensity control
Compiled with Linaro GCC 7.3 and optimized for Cortex A53
Stripped down and optimized configuration
Release History:
Code:
r23: August 15, 2018
- More reliable headphone detection on harpia
- Tonnes of security patches
- Updated binder
- Compiled with Linaro GCC 7.3.1
r22b: January 13, 2018
- Audio driver fixes
r22: January 11, 2018
- Security patches
- Updated camera drivers
- Stock Nougat support
- Nougat only, requires modern blobs
r21: December 6, 2017
- Updated to Linux 3.10.108
- Security patches
- Oreo support related patches
r20: August 2, 2017
- Updated to Linux 3.10.107
- Tonnes of security patches from many places
- Updated sdcardfs from Google
- Updated WiFi driver from CAF
- Compiled with Linaro GCC 6.3.1
r19: January 1, 2017
- Added support for Nougat ROMs
- Updated zRAM from Linux 4.9
- Updated (optimized) FUSE from CAF
- Kernel ASLR and many info leak fixes
- ARM PXN support for exploit mitigation
- Tons of security updates
- Some CAF updated from LA.BR.1.2.9_rb1.10
- Fixed kernel panic on VPN disconnection
- Updated compiler to Linaro GCC 6.2.1
r18: November 8, 2016
- Initial release for harpia
Downloads:
Main downloads tab
XDA:DevDB Information
Squid Kernel for Moto G4 Play, Kernel for the Moto G4 Play
Contributors
squid2
Source Code: https://github.com/sultanqasim/android_kernel_motorola_msm8916
Kernel Special Features: undervolted, lionfish, fiops, intelliplug, latest Linux and Qualcomm fixes
Version Information
Status: Stable
Current Stable Version: r23
Stable Release Date: 2018-08-15
Created 2016-11-09
Last Updated 2018-08-15
it is for all Harpia XT16XX?
mario156090 said:
it is for all Harpia XT16XX?
Click to expand...
Click to collapse
Yes, all harpia variants running all Marshmallow ROMs (stock and custom) should work with r18. A Nougat-only version will be coming later once I bring CM14.1 to this device.
I'm trying it now. No issues so far.
Just in case, how I would I could go back to stock kernel?
Frank_s_ph said:
I'm trying it now. No issues so far.
Just in case, how I would I could go back to stock kernel?
Click to expand...
Click to collapse
Flash your stock twrp backup
Sent from my Moto G Play using XDA-Developers mobile app
@squid2, Your kernel is very good, is it possible to overlock?
Just wanted to say this kernel is amazing. Not sure how accurate the seetings for the battery are but it says I have 4 days remaining at 86%. Even if its half that its still a massive improvement, thanks for your devotion and work on the g series @squid2.
You are ruling the harpia forum.
Great job
For whatever it's worth, I installed BaseMark OS II and ran a before and after test of the Nov 8 kernel. It slowed down the memory a bit. The first four columns are stock and the last four columns are with the Nov 8 kernel.
Overall 628 625 628 621 | 542 538 541 539
System 1043 1029 1062 1054 | 1028 1048 1067 1040
Memory 852 853 847 828 | 517 496 503 505
Graphics 315 315 315 313 | 305 304 299 304
Web 554 551 549 545 | 531 533 535 527
For such a big hit to the memory score, it didn't affect the rest all that much. I wonder if there isn't some boost in battery life that I'm not sure how to measure. I didn't notice much warmth from the phone while running the benchmark, but I didn't really make a good test of that. If the battery life is xx% better, then it's a choice of what you value.
Please don't take this as being negative. I really appreciate the chance to try this out. Keep going Squid! I'm dying to see the CM's going on this phone!!
Hello @squid2 sir
I can't find any undervolting commit on github
Can you help me find it ?
Sent from my Motorola Moto E using XDA Labs
Should I be seeing better battery life when compared to stock? Because it looks to be worse (higher consumption when using, like wifi browsing). Do I have to change the governor?
Also, if I switch back to stock kernel, do I have to reset something (like some settings)?
I guess that the kernel wasn't the differentiating factor, as I just got similar performance as with stock - 3 days standby and 10 hours screen on time.
nick_white said:
Should I be seeing better battery life when compared to stock? Because it looks to be worse (higher consumption when using, like wifi browsing). Do I have to change the governor?
Also, if I switch back to stock kernel, do I have to reset something (like some settings)?
Click to expand...
Click to collapse
No need for setting anything when going back to stock kernel.
I'm wondering if this kernel makes it possible to use the white battery LED as notification LED?
To me the G4 Play's only flaw is not having a notification LED, but an "battery is being charged" LED... Very odd.
yeah this would be cool
K.E. said:
I'm wondering if this kernel makes it possible to use the white battery LED as notification LED?
To me the G4 Play's only flaw is not having a notification LED, but an "battery is being charged" LED... Very odd.
Click to expand...
Click to collapse
I second this. I found it really odd how it's charging only, but not for notifications. I really would love to see if anyone could incorporate a notification light setting
Is the carging led somewhere at the bottom left of the phione? I can see something beneath the glass (looks like the proximity sensor), but mine is not lighting up when charging...
nick_white said:
Is the carging led somewhere at the bottom left of the phione? I can see something beneath the glass (looks like the proximity sensor), but mine is not lighting up when charging...
Click to expand...
Click to collapse
It's in the slightly on the bottom left side when plugged in. Surprised me the first time I installed CM after running stock for a little while, I didn't see a setting in the stock rom for it.
VPN disconnect reboot
I found a reproducible bug that causes a reboot with the r18 kernel. When using the built-in Android VPN feature the phone reboots as soon as I click disconnect. I tested with the stock kernel and it works fine, also tested with and without SuperSu. Phone is a xt1607 running stock ROM 6.0.1. The VPN type is PPTP.
Code:
<1>[ 328.175881,1] Unable to handle kernel NULL pointer dereference at virtual address 00000004
<1>[ 328.175928,1] pgd = c0004000
<1>[ 328.175946,1] [00000004] *pgd=00000000
<0>[ 328.175977,1] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
<4>[ 328.175995,1] Modules linked in:
<4>[ 328.176025,1] CPU: 1 PID: 9399 Comm: pppd Tainted: G W 3.10.104-r18-g15931b7-03706-gec43596 #2
<4>[ 328.176046,1] task: c5fa78c0 ti: dc0f4000 task.ti: dc0f4000
<4>[ 328.176081,1] PC is at ppp_unregister_channel+0x200/0x2c0
<4>[ 328.176106,1] LR is at _raw_spin_unlock_irqrestore+0x28/0x48
<4>[ 328.176129,1] pc : [<c06ca324>] lr : [<c0e1b918>] psr: 600f0013
<4>[ 328.176129,1] sp : dc0f5da0 ip : 00000091 fp : d2f00548
<4>[ 328.176153,1] r10: dfdc9a60 r9 : dfdc9a60 r8 : dee68fcc
<4>[ 328.176172,1] r7 : ccafb590 r6 : c15cdc40 r5 : e2d848cc r4 : dee68f80
<4>[ 328.176191,1] r3 : 00000004 r2 : 00000000 r1 : 00000000 r0 : 00000000
<4>[ 328.176212,1] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
<4>[ 328.176232,1] Control: 10c0383d Table: a2b2c06a DAC: 00000015
<0>[ 328.176250,1] Process pppd (pid: 9399, stack limit = 0xdc0f4238)
<0>[ 328.176268,1] Stack: (0xdc0f5da0 to 0xdc0f6000)
<0>[ 328.176299,1] 5da0: e1506400 00000000 c2a16d00 e3b61010 dfdc9a40 c06d0934 e1506400 c06d3cac
<0>[ 328.176327,1] 5dc0: dfdc9a60 00000000 dfcadf68 e3b61010 00000008 c0bc2b14 d2f00540 00000000
<0>[ 328.176356,1] 5de0: dfcadf68 c02934a8 00000000 00000000 e2fffa90 c5fa7d44 00000000 c16490b8
<0>[ 328.176384,1] 5e00: c5fa78c0 de508540 de508574 00418004 fffffdfe c015d770 c5fa78c0 002f002f
<0>[ 328.176412,1] 5e20: dc0f4000 c5fa7d64 c5fa78c0 00000001 dc0f4000 c0138c5c 00000000 00000000
<0>[ 328.176440,1] 5e40: 00000002 e1316000 002f002f c0e1e388 c5fa78c0 56e80405 e131601c dc0f5ee8
<0>[ 328.176468,1] 5e60: fffffdfe c013a76c dc0f4000 00000009 c29d4000 dc0f5ee8 c0f01c48 c014d950
<0>[ 328.176497,1] 5e80: 603d2b40 0000004c c151d290 da5e4ec0 c15e1064 da5e53c4 418004fc 00040005
<0>[ 328.176525,1] 5ea0: 00040006 dc0f5ed4 c25ee300 dc0f4000 dc0f5fb0 c151c408 dc0f5ed4 dc0f5ee8
<0>[ 328.176554,1] 5ec0: b6d980f8 b6d980fc fffffdfe c01111a4 0000000a c0e1b418 0000000a c0e1b918
<0>[ 328.176582,1] 5ee0: 0000000a c013d950 00000009 00000000 00000000 00000000 00000000 00000000
<0>[ 328.176610,1] 5f00: c151c408 fffffdfe 00000000 be86a810 00000008 00000000 dc0f4000 c02ac660
<0>[ 328.176638,1] 5f20: dc0f5f4c 00000000 be86a840 00000000 be86a8c0 000006bf 00000807 310fd355
<0>[ 328.176666,1] 5f40: 00000000 000006bf 30898980 00000807 310fd355 000006bf 30898980 000006bf
<0>[ 328.176696,1] 5f60: 2a78fbd9 000006bf 2a78fbd9 56e80405 c010db64 dc0f4000 dc0f4000 dc0f4000
<0>[ 328.176724,1] 5f80: dc0f5fb0 c010db64 dc0f4000 00000000 b6fc7d54 c01116c0 be86a810 00000000
<0>[ 328.176752,1] 5fa0: 000006bf 0000014f c010db64 c010da28 00000008 be86a840 00000000 be86a8c0
<0>[ 328.176780,1] 5fc0: be86a810 00000000 000006bf 0000014f be86a840 00000008 b6f7fbd1 b6fc7d54
<0>[ 328.176808,1] 5fe0: be86a808 be86a7f8 b6d704c9 b6d980f8 40070010 00000008 00000000 00252522
<4>[ 328.176853,1] [<c06ca324>] (ppp_unregister_channel) from [<c06d0934>] (pppox_unbind_sock+0x1c/0x28)
<4>[ 328.176892,1] [<c06d0934>] (pppox_unbind_sock) from [<c06d3cac>] (pppopns_release+0xe0/0x118)
<4>[ 328.176926,1] [<c06d3cac>] (pppopns_release) from [<c0bc2b14>] (sock_close+0x24/0xac)
<4>[ 328.176961,1] [<c0bc2b14>] (sock_close) from [<c02934a8>] (____fput+0x98/0x224)
<4>[ 328.176993,1] [<c02934a8>] (____fput) from [<c015d770>] (task_work_run+0xb8/0xf4)
<4>[ 328.177031,1] [<c015d770>] (task_work_run) from [<c0138c5c>] (do_exit+0x304/0x9c0)
<4>[ 328.177061,1] [<c0138c5c>] (do_exit) from [<c013a76c>] (do_group_exit+0x38/0xb0)
<4>[ 328.177093,1] [<c013a76c>] (do_group_exit) from [<c014d950>] (get_signal_to_deliver+0x324/0x668)
<4>[ 328.177127,1] [<c014d950>] (get_signal_to_deliver) from [<c01111a4>] (do_signal+0x9c/0x458)
<4>[ 328.177162,1] [<c01111a4>] (do_signal) from [<c01116c0>] (do_work_pending+0x74/0xbc)
<4>[ 328.177194,1] [<c01116c0>] (do_work_pending) from [<c010da28>] (work_pending+0xc/0x20)
<0>[ 328.177223,1] Code: e5940064 e2803004 f57ff05b f5d3f000 (e1932f9f)
<4>[ 328.177947,3] ---[ end trace 55110d0257cc6671 ]---
just found these commits - maybe this can be adapted to harpia?
https://review.cyanogenmod.org/#/c/144769/
https://review.cyanogenmod.org/#/c/144770/
https://review.cyanogenmod.org/#/c/144768/
K.E. said:
I'm wondering if this kernel makes it possible to use the white battery LED as notification LED?
To me the G4 Play's only flaw is not having a notification LED, but an "battery is being charged" LED... Very odd.
Click to expand...
Click to collapse
Hello everyone,
I own Wetek Play. I've been playing with software update, but it seems that it went into a bootloop. I conected serial monitor and i get following logs:
HHH
BootFrom SPI
ucl decompress
decompress false
/home/alex/uboot-wetek/arch/arm/cpu/aml_meson/common/firmware/loaduboot.cload_uboot0x0000007f⸮EEEE I3000000032940xf3001103;77520EEEE I400000004294_M6_BL1_3431>2534313
TE : 77476
BT : 22:19:13 Jan 15 2016
CPU clock is 1200MHz
wait pll-0x03 target is 0204 now it is 0x00000203
DDR clock is 516MHz with Low Power & 2T mode
DDR training :
DX0DLLCR:40000000
DX0DQTR:ffffffff
DX0DQSTR:3db05001
DX1DLLCR:40000000
DX1DQTR:ffffffff
DX1DQSTR:3db05001
DX2DLLCR:40000000
DX2DQTR:ffffffff
DX2DQSTR:3db05001
DX3DLLCR:40000000
DX3DQTR:ffffffff
DX3DQSTR:3db05001
Stage 00 Result 00000000
Stage 01 Result 00000000
Stage 02 Result 00000000
Stage 03 Result 00000000
DDR init use : 42463 us
HHH
BootFrom SPI
ucl decompress
decompress false
/home/alex/uboot-wetek/arch/arm/cpu/aml_meson/common/firmware/loaduboot.cload_uboot0x0000007f⸮EEEE I3000000032940xf3001103;77520EEEE I400000004294_M6_BL1_3431>2534313
TE : 77476
BT : 22:19:13 Jan 15 2016
CPU clock is 1200MHz
ait pll-0x03 target is 0204 now it is 0x00000203
DDR clock is 516MHz with Low Power & 2T mode
DDR training :
DX0DLLCR:40000000
DX0DQTR:ffffffff
DX0DQSTR:3db05001
DX1DLLCR:40000000
DX1DQTR:ffffffff
DX1DQSTR:3db05001
DX2DLLCR:40000000
DX2DQTR:ffffffff
DX2DQSTR:3db05001
DX3DLLCR:40000000
DX3DQTR:ffffffff
DX3DQSTR:3db05001
Stage 00 Result 00000000
Stage 01 Result 00000000
Stage 02 Result 00000000
Stage 03 Result 00000000
DDR init use : 42464 us
and so on...
The device does not react to "upgrade" button and SD card inserted.
Can anyone help me what should I do to unbrick my Wetek?
Thank you in advance.