Custom screen resolution for Android on Raspberry Pi 3 - raspberry-pi

I am using a 7" TFT LCD Display (1024x600) with the Raspberry Pi 3 and I can not make it work with that screen resolution. It looks like it is zoomed in.
I know that there are a bunch of topics about this issue in and out stackoverflow, and I have tried to edit the config.txt as much as I could, never getting different results. (BTW: I got it working with Raspian really easily editing the config.txt, but it does not work for android for some reason).
I used this Android image, and this is how my config.txt looks like:
hdmi_force_hotplug=1
hdmi_drive=2
hdmi_group=2
hdmi_mode=87
hdmi_cvt 1024 600 60
Framebuffer_width=1024
Framebuffer_height=600
disable_overscan=1
config_hdmi_boost=5
kernel=zImage
device_tree=bcm2710-rpi-3-b.dtb
dtparam=audio=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=vc4-kms-v3d,cma-256
initramfs ramdisk.img 0x01f00000
mask_gpu_interrupt0=0x400
avoid_warnings=2
gpu_mem=256
enable_uart=1
I would really appreciate some insight on this.
PS: I tried different resolutions with the hdmi_group and hdmi_mode, according to this RPi article, but the image remains the same.

So I finally got it working by trial and error, and I posted the answer in the RaspberryPi Stackexchange site as suggested. Case closed for now.

I had the same 'zoomed in' effect using Android Studio (React-Native) with an 800*480 HDMI screen (Waveshare 5-inch). When I used Dimensions, within the app, to get the screen size, it returned approx 530 * 300, which had the additional effect of changing the bucket size for images being copied over from the assets folder. My solution, found after some considerable time, was from Dokter_Bibber at this link. It did not give me precisely the same display as my 800*480 Android-Studio-emulator that I was using to develop my page, but pleasingly close.
Quoting from the link:
Start Console window and type :
adb shell wm size 800x480
---AND (186.59 ppi calculated here : https://www.sven.de/dpi/ 4)
adb shell wm density 187
THEN (reboot the device)
adb reboot

Related

Touch screen panel using LVDS interface

Hi i am thinking to connect a 14 inch or bigger lcd touch screen with my discovery boards. Currently i have stm32f4 and stm32f7 discovery boards.
Currently i am aware of different methods to connect them. But i am most interested in LTDC. I have tried using old protocols like Motorola 6800 Parralel RGB. But Touch screens of bigger size and bigger resolution available on Alibaba for example does not support them.
Please correct me in my understanding if i am wrong that for bigger screen size and bigger resolution old protocols like Motorola 6800 , Intel® 8080 bus and SPI protocol wont work. Because bigger touch screens found in market does not have them.
Will Parallel RGB connection be able to work with bigger screen. If yes can u give me a link for that.
The devices i see are coming with lvds connection. Will they be able to work with stm32 discovery kits. If yes than how.
Finally can u suggest me some good working tutorials for them apart of datasheet.
Thank You !!!
Yes, RGB can be used to drive larger display panels. However, you will need to convert the signal to LVDS.
Assuming you are using the STM32756G-EVAL you could link the LCD modules connector (CN20) to J1 and J2 (depending whether your display panel is single or dual LVDS) of Texas Instruments’ LDI demo kit Transmitter board http://www.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=snlu036a

Autohotkey: Adapting full-screen images from 1080p to 4k display?

TL;DR
An absolute AHK neophyte asks: How do you tweak an AHK script so that a full-screen image can display properly on a 4k monitor (considering the script was originally written for a 1080p resolution)?
Here's the program I'm trying to fix:
https://www.dropbox.com/s/sbypodhincq6jnm/Install%20God%27s%20Presence?dl=0
Full version of the question:
Hi! I have a little AHK script that executes a very simple task: it displays an image across the entire screen for 30 seconds every 30 minutes.
It worked well for my old 1080p display, but recently I switched to a 4k one and the image now occupies just a small corner of the screen.
So I wondered if you could help: How can I get the image to display full-screen on my new 4k device?
I have a hunch this should be easy to fix if one just tweaks a few numbers here and there, but that's all I know. I've searched around in the AHK forums, but strangely I can't seem to find an answer for this specific little problem. So I apologize I can't offer more info!
Here's the program I'm trying to fix:
https://www.dropbox.com/s/sbypodhincq6jnm/Install%20God%27s%20Presence?dl=0

Getting Retina Screen Resolution on Macs with HiDPI in Unity

I am making a custom Unity Editor GUI window and I just want it to stay and the exact center of the screen. Surprisingly, this is harder than I thought it would be on Macs.
This is my code:
....
windowRect.center = new Rect(0, 0, Screen.currentResolution.width, Screen.currentResolution.height).center;
....
The problem is, on a 5K iMac, which has a native resolution of 5120*2880, by default the macOS uses HiDPI to scale everything to 2560*1440. In Unity, Screen.currentResolution returns 5120*2880 without considering HiDPI scaling, but I need that sweet scaled resolution.
I've tried other functions as well. Display.main.systemWidth returns 1920 instead of 5120 or 2560.
Is there a way to do this? Or am I just out of luck? I am using Unity 2018.1.9f1.
Also, if there is a way to get the size of the whole Unity Editor Window(not the game window), I would be fine with it. Thanks in advance!
In Editor, Screen.currentResolution show the resolution of game window. You can enable Maximize On Play to use the maximized window resolution.
And if you deploy to MacOS app, it should be the 5K resolution correctly.
This in an old thread, but in case someone is still wondering, I found out that the highest resolution returned by Screen.resolutions on a retina device is the « magic » resolution. It’s the one that you see in the device settings as « Looks like X x Y ».
This is not mentioned in the doc as far as I could see, so I am not certain in can be relied upon in the long run, but it’s the case currently with Unity 2018.3.
Not quite the same as centre of the screen, but I was having a similar issue and solved it using:
EditorGUIUtility.GetMainWindowPosition().center;

Images showing in simulator but not on the iPhone device

So when I run the application from the device the pictures show up and everything works great. However, when I move to the device I run in about 10 out of 38 pictures that don't show up. I am pulling the names for the images from an sqlite database and I already checked and the names are correct, case and everything. I checked the bundle and the images are correctly in there.
Does memory play into effect in this? I am not really sure what else could cause this to happen??
Thanks!
Solution:
The files somehow were not saved properly and were unable to be opened by say photoshop or paint even. So with the files not being able to be open they weren't showing up... Thanks for the help everyone!
First thing to check is the case of the strings you're using to refer to the resources. The iPhone is case sensitive, but the simulator is not.
Oops, just seen that you checked the case. Better log all your UIImage creation calls then!
The simulator accepts a wider range of image formats. Sometimes you had a specific file type that the device cannot display. Double check the 10 files looking for some difference from the others ones.
Yes, memory absolutely plays into this. Check your UIImage creation calls and make sure they dont return empty. Also, check to see if youre getting memory warnings in the console window.
Generally, if in-memory size was the culprit, your application would crash with a low memory error on the device. However, it seems like the images just don't display.
One other thing that can be going wrong is the size of the images. UIViews on the iPhone can only have dimensions smaller than the maximum texture size supported by the GPU. Apple states that this is 1024 x 1024, but I've found it to be more like 2048 x 2048 on even the original model iPhone. You may be creating a view for some of these images that exceeds this size in one dimension, but your Mac has a larger maximum texture size on its GPU and so it displays fine in the Simulator.
Apparently the iPhone caches the launch screens. So in my case, I had to reboot my iPhone before being able to see the image.

Capture specific-sized images with an Ubuntu command-line program

I am currently working on a project and would like to know if you heard of any command-line tools that lets your webcam take specific-sized images? I found some but none of them works.
In my case, I'd need to capture 1600x1200 pictures.
I was able to use uvccapture -m -x640 -y480 -oimage.jpg.
If your webcam supports 1600x1200, then this method might work. When I try anything more than 640x480, uvccapture prints:
format asked unavailable get width 640 height 480