-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to run Crankshaft in Portrait Mode #403
Comments
It looks like theoretically it can be done. https://support.google.com/androidauto/thread/8844203?hl=en. Not sure if Crankshaft supports it though, will have to do more digging. |
It can be done, the trick is to do overscan on the output. Here is the rough idea on how to do it (screenRatio is the actual display ratio and the remoteRatio is the ratio of the video stream):
|
Hmm, so say if the screen resolution is 480x800, then AA running on the phone will send out a 1920x1080 feed, but with the interface only occupying a 480x800 part of it, or something similar? |
@abraha2d - Sorry I've updated the previous answer with more details. I'll try to explain the logic a bit better. Let's say the screen is 600x1200 (800x480 is a standard resolution so it's easy to get confused).
Let's try to understand it, So now we look at the video setup line:
Basically we told Android Auto to add a margin of 960px. AA will split this into 2 and will add a margin of 480px to on the left and 480px on the right, so the video send by Android will be 1280x720 but will have 2 huge black bars on the left and right, and the content in the middle will actually be 360px720px. Our screen is 1200 px tall, to so we stretch the video to match that height. This means we enlarge the video with a factor of (1200/720=1.66). Since we enlarge the whole video with 1.66 the middle box where the actual stuff is displayed will be 3601.66/720*1.66 = 600/1200 Hope this makes more sens now. |
That makes a lot of sense, so simple. Makes you wonder why these OEMs can't be bothered to implement something similar... I'll try implementing this to work with crankshaft, and testing with portrait 480x800 resolution (as that's the only touchscreen I have). Maybe I'll also see how it'll work with a nice 1050x1680, but I won't be able to test touch input. |
Hi - Does this actually scale and distort the Andriod Auto projection, or does it still appear correct? |
I stumbled across this thread and it seems to be exactly what I was looking for, but I don't know where the code belongs. Can someone point me in the direction needed to implement it? |
Hey @abraha2d, any luck with implementing this to work with crankshaft? |
AA now supports vertical screen as well, no need to do tricks.... |
Is this something new? I couldn't get portrait (vertical) to work under 2022-09-11-crankshaft-ng-66525ef? Android auto just stretched the screen. I couldn't get it to resize to a portrait resolution |
Roughly november/december last year, but protobuf needs to be adjusted
enum VideoCodecResolutionType {
VIDEO_800x480 = 1;
VIDEO_1280x720 = 2;
VIDEO_1920x1080 = 3;
VIDEO_2560x1440 = 4;
VIDEO_3840x2160 = 5;
VIDEO_720x1280 = 6;
VIDEO_1080x1920 = 7;
VIDEO_1440x2560 = 8;
VIDEO_2160x3840 = 9;
}
enum VideoFrameRateType {
VIDEO_FPS_60 = 1;
VIDEO_FPS_30 = 2;
}
Emil Borconi Szedressy
Sent from my mobile device, please excuse any typos
…On Sun, Apr 16, 2023, 22:20 rschulz29 ***@***.***> wrote:
AA now supports vertical screen as well, no need to do tricks....
Is this something new? I couldn't get portrait (vertical) to work under
2022-09-11-crankshaft-ng-66525ef? Android auto just stretched the screen. I
couldn't get it to resize to a portrait resolution
—
Reply to this email directly, view it on GitHub
<#403 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFDYPGIYAUMDDQH3QIECZ3XBRA75ANCNFSM4KT5REBA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hmm interesting, have been experiencing horizontal screen compression and assumed it could be related to this thread... E.g. a 16x10 screen ratio, squeezed to 16x9. The screen displays correctly by Windows and Raspberry Pi, when configured with the correct screen information. Is there a particular version of Android (or Android auto) where this was resolved? |
8.something
You still need to use letterbox cropping to make the content fitt correctly
but you can use now the vertical resolutions.
Just requests the next up resolution compared to your screen and add
margins that will make it very easy to use
Emil Borconi Szedressy
Sent from my mobile device, please excuse any typos
…On Mon, Apr 17, 2023, 02:31 Thomas Eleff ***@***.***> wrote:
Hmm interesting, have been experiencing horizontal screen compression and
assumed it could be related to this thread... E.g. a 16x10 screen ratio,
squeezed to 16x9. The screen displays correctly by Windows and Raspberry
Pi, when configured with the correct screen information.
Is there a particular version of Android (or Android auto) where this was
resolved?
—
Reply to this email directly, view it on GitHub
<#403 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFDYPCUPE6LS4RNHNMCUTLXBR6OJANCNFSM4KT5REBA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hey @borconi , thanks for all the info. I am new to crankshaft and android, so am unsure how to resolve this myself. If there is a write up available, I'd love to take a look. Otherwise, I appreciate the input and will live with my slightly ovular icons ha |
Each implementation is different, Im not a C person I did dev in
Java/android so can't help too much on how to achieve video cropping in
crankshaft directly
Emil Borconi Szedressy
Sent from my mobile device, please excuse any typos
…On Mon, Apr 17, 2023, 17:31 Thomas Eleff ***@***.***> wrote:
Hey @borconi <https://github.com/borconi> , thanks for all the info. I am
new to crankshaft and android, so am unsure how to resolve this myself. If
there is a write up available, I'd love to take a look.
Otherwise, I appreciate the input and will live with my slightly ovular
icons ha
—
Reply to this email directly, view it on GitHub
<#403 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFDYPDS2GRJH3HKQRVDWXDXBVH4NANCNFSM4KT5REBA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
According to my personal testing, the old value was incorrect i.e. _720p_p doesnt' give me portrait video. Instead, using enum values from [1] instead which seems to correspond to my testing. [1]: opencardev/crankshaft#403 (comment)
Hi there,
I am helping out a friend to setup crankshaft in his car.
I got everything working in general, but his car has a special setup where the touchscreen is installed in portrait mode, not in landscape mode.
I was wondering if it is possible to run crankshaft in portrait mode, and how I would do that.
Thank you & Best Regards
The text was updated successfully, but these errors were encountered: