How to enable HDMI Screen Rotation?

How to enable HDMI Screen Rotation?

Postby t20004571 » Sat Oct 27, 2012 10:32 pm

I have an application is portrait and need displayed through HDMI onto a screen.
The problem is MK808 always lock on Landscape, and the application will automatically scaling in to the center of the screen.
Is this a way to let the MK808 rotating to Portrait?
sorry for my poor english.

thanks.
t20004571
 
Posts: 8
Joined: Fri Oct 19, 2012 2:28 am


Re: How to enable HDMI Screen Rotation?

Postby t20004571 » Sun Oct 28, 2012 11:06 am

I have already try this app(Rotation Locker), but no use.
This my test video:
http://www.youtube.com/watch?v=C4k9tM1gog8&feature=plcp

And I want MK808 HDMI screen rotated like this video:
https://www.youtube.com/watch?v=DfbENUojgro&feature=g-hist

Anyway thanks for your app.
t20004571
 
Posts: 8
Joined: Fri Oct 19, 2012 2:28 am

Re: How to enable HDMI Screen Rotation?

Postby Compjed » Wed Nov 21, 2012 6:35 pm

Were you able to find a way to do this? I have an application I would like to use this device for, but need to have the screen and all apps set to the portrait orientation. I don't need auto switching, a software selection would work. If anyone knows how to do this, it would be a great help.

Thanks
Compjed
 
Posts: 2
Joined: Wed Nov 21, 2012 6:27 pm

Re: How to enable HDMI Screen Rotation?

Postby Finlessbob » Thu Nov 22, 2012 3:01 pm

They disabled any rotation in the latest ROMs completely! I have figured out how to turn it back on but am still testing it.
Stay tuned I may have a fix for those that want rotation. Just need time to finishing the smali code.

Bob
Finlessbob
 
Posts: 30
Joined: Wed Sep 26, 2012 11:30 am

Re: How to enable HDMI Screen Rotation?

Postby dav_id » Fri Nov 30, 2012 6:35 am

I have rotation issue with my Google music player, some time it doesn't rotate to the landscape mode.
It look like portrait mode that stretch to landscape view...it look weird..
Sometime it work perfectly, someone don't..

Any one have the same issue? & how can I force it to be in landscape?
dav_id
 
Posts: 3
Joined: Tue Nov 06, 2012 2:28 am

Re: How to enable HDMI Screen Rotation?

Postby Compjed » Fri Dec 14, 2012 11:35 am

any success with the changes you were trying to add to make this work? Please let me know how I can give your changes a try to re-enable the rotation.

Thanks,
Compjed
 
Posts: 2
Joined: Wed Nov 21, 2012 6:27 pm

Re: How to enable HDMI Screen Rotation?

Postby tomitom » Sat Dec 22, 2012 1:25 pm

Finlessbob wrote:They disabled any rotation in the latest ROMs completely! I have figured out how to turn it back on but am still testing it.
Stay tuned I may have a fix for those that want rotation. Just need time to finishing the smali code.

Bob


Hello Bob,

I would also like to have the ability to rotate the MK808 to have it in portrait instead of landscape.
Have you been able to find a solution to this ?

Thanks,
Tom.
tomitom
 
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: How to enable HDMI Screen Rotation?

Postby tomitom » Sun Dec 23, 2012 10:13 am

Hi guys,

A little update on the tests I have done so far without success :(
At least I hope it will save time to other trying to achieve the same.

- Retrieved the framework-res.apk file from the stick (in system/framework) via ES explorer in root mode (could also be done with adb)
- Used apktool to uncompile the .apk
- modify two values in "res/values/bools.xml" file from the uncompiled .apk :
<bool name="config_allowAllRotations">true</bool>
<bool name="config_reverseDefaultRotation">true</bool>
Both were set to "false" and I changed them to "true", it's mainly trial and error method as I don't know the exact underlying behaviors ..
- repack the .apk with apktool
- replace the framework-res.apk on the stick with the one modified
- reboot
- install a few "rotation app" from the market to try to force "portrait" mode

None of this worked :(

Any clue ?
Thanks,
Tom.
tomitom
 
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: How to enable HDMI Screen Rotation?

Postby Finlessbob » Sun Dec 30, 2012 3:29 pm

That wont do it. I did find the code where they disabled it. It is is services.jar.

I have it working now but just have not had time to fix one more issue about it. But I do have rotation working again :)

Stay tuned I will release something soon.

Bob
Finlessbob
 
Posts: 30
Joined: Wed Sep 26, 2012 11:30 am

Re: How to enable HDMI Screen Rotation?

Postby tomitom » Tue Jan 01, 2013 9:12 am

Finlessbob wrote:That wont do it. I did find the code where they disabled it. It is is services.jar.

I have it working now but just have not had time to fix one more issue about it. But I do have rotation working again :)

Stay tuned I will release something soon.

Bob


First of all, an happy new year to everyone ! :)

And appart from that : Bob, it's a wonderfull piece of news here ! maybe I can help ?
I have done other few tests since last time like modifying the build.prop (with fakerotation set to true and hwrotation set to 270) and replacing the launcher with one that accept home screen rotation (apex and adw).
With your bootanimation I don't get anything but with the livelogcat bootanimation it gets me to the homescreen in portrait :) ... and freeze :(

I will definitly take a look at the services.jar, maybe you can send me yours and tell me the problem you encounter so I can work on it as well ?
P.M. is good if you think it's too early for public release while with stabilize that ?

All the best,
Tom.
tomitom
 
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: How to enable HDMI Screen Rotation?

Postby tomitom » Tue Jan 01, 2013 11:37 am

Hi Bob,

I just looked at services.jar and more precisly at the the WindowManagerService, can you tell me if it's this part that needs some modifications ?
Code: Select all
.method private isTabletEnv()Z
    .registers 4

    .prologue
    const/4 v0, 0x0

    .line 6048
    const-string v1, "ro.sf.hwrotation"

    invoke-static {v1, v0}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I

    move-result v1

    rem-int/lit16 v1, v1, 0xb4

    const/16 v2, 0x5a

    if-ne v1, v2, :cond_e

    const/4 v0, 0x1

    :cond_e
    return v0
.end method


and/or

Code: Select all
.method private isWindowFakeRotation()Z
    .registers 4

    .prologue
    .line 6044
    const-string v0, "true"

    const-string v1, "ro.sf.fakerotation"

    const-string v2, "false"

    invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method


I do not know much about smali code, so I have a few guesses but not much and what could be done.

Any feedback would be really appreciated if you have time of course,
Tom.
tomitom
 
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: How to enable HDMI Screen Rotation?

Postby tomitom » Tue Jan 01, 2013 6:12 pm

Ok, forgot my last post, i was not looking at the good place, I'm now prety sure it's coming from the updateRotationUncheckedLocked method.
I still need to figure out how to modify it to allow rotation though :p
tomitom
 
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: How to enable HDMI Screen Rotation?

Postby tomitom » Wed Jan 02, 2013 6:21 pm

Hi,

That's me again (yes I know I'm answering to my own posts, but I'm not going mad on this, I promise :p)

Well, Bob, I have two words for you :
1. first one is "Thanks" for the release of the v1.6 of your Rom which is great :D
2. second one is "heeeeeeeeeeelp" :)

Well, obviously I was maybe too optimistic last time when I was sure the "problem" was coming from the method updateRotationUncheckedLocked.
I was comparing the backsmali from the WindowManagerService.smali of services.jar of a none rotating mk808 to some other jb.4.1.1 services.jar from a completly other device but for which rotation worked (I was doing with what I had at this time)

Now I'm comparing :
- On one side the one from your latest rom (1.6) for mk808 (nice touch for the remote control and power button from the status bar :D)
- On the other side the one from the very first mk808 JB rom (around the 4th of September) for which rotation is possible

For now I only spotted 2 differences in method "updateRotationUncheckedLocked", and I'm less confident the problem resides here :(

For further references the none-rotating version contains more code :
- the line "const/4 v1, 0x1" at some point after a condition and prior to "iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I"
- a block of code concerning compatibility mode :
Code: Select all
iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mIsRunningInCompatibilityMode:Z
if-eqz v0, :cond_ea
.line 5928
const/4 v0, 0x1
const/4 v2, 0x1
invoke-virtual {p0, v0, v2}, Lcom/android/server/wm/WindowManagerService;->setCompatibilityModeState(ZZ)V
.line 5930
:cond_ea


I think it's prety clear now ... I'm completly lost :p

Tom.
tomitom
 
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: How to enable HDMI Screen Rotation?

Postby Finlessbob » Fri Jan 04, 2013 9:24 pm

Here are my notes. See if you can do it :)

HOw I turned back on rotation in TV Player MK808.

In services.jar /wm/WindowManagerService.smali

Search for the 2nd instance of this:
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I



Here was the original code for cond_3 under method:
.method public updateRotationUncheckedLocked(Z)Z

:cond_3
const-string v0, "ro.sf.hwrotation"

const/4 v2, 0x0

invoke-static {v0, v2}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I

move-result v1

.line 5812
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I

if-ne v0, v1, :cond_5

iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z

if-ne v0, v8, :cond_5

.line 5814
const/4 v0, 0x0



Here is the code I chnaged it to:


:cond_3
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I

if-ne v0, v1, :cond_5

iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z

if-ne v0, v8, :cond_5

.line 5812
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I

if-ne v0, v1, :cond_5

iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z

if-ne v0, v8, :cond_5

.line 5814
const/4 v0, 0x0
Finlessbob
 
Posts: 30
Joined: Wed Sep 26, 2012 11:30 am

Re: How to enable HDMI Screen Rotation?

Postby Finlessbob » Fri Jan 04, 2013 9:28 pm

Oh and be careful with build.prop!!!! It can cause you to not boot changing sf.rotation props!

If you want to fully use sf.rotation properties you also need to edit code in policy.jar

This is the last bug I have not figured out yet.

If you figure it out, please share with me :)
I just have not had time to go after this more.

Bob
Finlessbob
 
Posts: 30
Joined: Wed Sep 26, 2012 11:30 am

Re: How to enable HDMI Screen Rotation?

Postby texbuck » Sun Jan 06, 2013 10:32 pm

This is looking real promising! Sorry Bob about chiming in on another thread.....I should have searched a little more carefully. Bob and Tom: keep up the communication, it looks to be close.

Sent from my Android using Tapatalk 2
texbuck
 
Posts: 9
Joined: Sat Dec 01, 2012 9:23 pm

Re: How to enable HDMI Screen Rotation?

Postby tomitom » Wed Jan 09, 2013 7:32 am

Finlessbob wrote:Oh and be careful with build.prop!!!! It can cause you to not boot changing sf.rotation props!

If you want to fully use sf.rotation properties you also need to edit code in policy.jar

This is the last bug I have not figured out yet.

If you figure it out, please share with me :)
I just have not had time to go after this more.

Bob


Hello Bob, thanks for the update.
I actually managed to get the rotation working only by removing the first line just after the cond_3 (corresponding to a return).
Nevertheless I didn't touch to the build.prop but I noticed the default value for ro.sf.hwrotation as change from 0 to 270 in your latest ROM, no ?

Anyhow here are the results obtained by only removing the said line :
- rotation application manage to rotate (and optionnaly lock) the screen in any position (including home of course)
- normal apps manage to rotate the screen to their desired specs
- unfortunatly (and i guess it's the point of the compatibility mode refered in one of my previous message) when the screen is locked in one orientation (i.e. "Force Portrait") applications that needs another orientation (i.e. angry bird works only in landscape) does not work :(

I guess that everythin resides here in what you want to do with the rotation, in my case I want to be in forced portrait all the time which won't work for now with landscape apps, Bob did this work with your modification ? I'm not home for a few days and won't be able to test.

Other than that, I will also take a look at the policies, Bob, can you be more precise on the bug / behavior you are experiencing so that I can see if I reproduce it and find something that might fix it ? Is it the fact that when you change the ro.sf.hwrotation value you end up with no boot ? In this case I will investigate on that :)

Tom.
tomitom
 
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: How to enable HDMI Screen Rotation?

Postby rafa3041 » Wed Jan 23, 2013 3:27 pm

Hi Timitom,

I'll be gratefull if you can help me.
Can you describe a little more changes?
I'm triying but I don't have any result.

These are that I did:

1.- I've changed original code for Bob's code:
ORIGINAL
:cond_3
const-string v0, "ro.sf.hwrotation"
const/4 v2, 0x0
invoke-static {v0, v2}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v1
.line 5812
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I
if-ne v0, v1, :cond_5
iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z
if-ne v0, v8, :cond_5
.line 5814
const/4 v0, 0x0

BOB's Code
:cond_3
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I
if-ne v0, v1, :cond_5
iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z
if-ne v0, v8, :cond_5
.line 5812
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I
if-ne v0, v1, :cond_5
iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z
if-ne v0, v8, :cond_5
.line 5814
const/4 v0, 0x0

2.- I deleted the first line after :cond_3 in BobĀ“s code. This is:

:cond_3

if-ne v0, v1, :cond_5
iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z
if-ne v0, v8, :cond_5
.line 5812
iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I
if-ne v0, v1, :cond_5
iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z
if-ne v0, v8, :cond_5
.line 5814
const/4 v0, 0x0

3.- I'v recompiled services.jar. Then I pasted file at /systems/framework/ in UG802.

4.- Finally, I've reset device and I've test with creen rotator app. Nothing changes...

Thanks.
rafa3041
 
Posts: 1
Joined: Wed Jan 23, 2013 3:12 pm

Re: How to enable HDMI Screen Rotation?

Postby grindy » Fri Feb 08, 2013 8:17 pm

i sent an email to the creator of the 'ultimate rotation control' app because his app is probably the most robust and functional...while he wouldn't tell me how his program actually worked, he did point out that when working with source code,

"if you want to modify the Android source code you should be looking at the function rotationForOrientationLw in class PhoneWindowManager (see Overrides android.view.WindowManagerPolicy.rotationForOrientationLw(...))
http://grepcode.com/file/repository.gre ... t%2Cint%29

Something else you can look into is sytem property: persist.demo.hdmirotation"

hope this helps. im still stuck trying to figure this out.
grindy
 
Posts: 17
Joined: Sat Sep 22, 2012 2:21 pm


Return to MK808

Who is online

Users browsing this forum: Google [Bot] and 2 guests