imx8mplus dev board yocto image psplash shows dual image on mipi dsi touch display - linux-device-driver

I was trying boot yocto image with custom boot logo on imx8mplus (compulab bsp) dev board with touch display interfaced via mipi dsi port, the procedure was simple, created bbappend for psplash recipe and located custom boot logo. The boot logo was coming up but it was showing double images of custom logo. The boot logo supposed to show as single image full screen on display.
The display resolution is 1280x800 .
the fbset output of target board is
mode "720x600-0"
# D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
geometry 720 600 1024 1200 32
timings 0 0 0 0 0 0 0
accel true
rgba 8/16,8/8,8/0,0/0
endmode
My Finding:
The display resolution and fbset mode values are different.
How can I change display resolution atleast for psplash while compiling yocto ?
Display Psplash Image
Tried to boot custom logo with help of psplash on yocto. But the psplash boot logo displayed as two while booting up. boot logo double issue

Related

libvips - generate tiles starting from specific zoom level and specific coordinates

I am using windows cli version libvips. I want to generate map tiles for leaflet from image 8000px x 6000px. This image is old map of my town, and I want to display it on my website, but I am stuck on generating tiles.
How to tell libvips to generate tiles from zoom level 10 to 15. With command
dzsave input.jpg outputdir --layout google
I receive tiles from zoom level 0 to 5.
And second question.
How to set bounds of my map? Generated tiles from above command cover the whole world.
The libvips CLI lets you run any save operation (like jpegsave, tiffsave or dzsave) as part of the write step of a command. You select the saver with the filename suffix and you can pass any parameters in square brackets at the end of the filename (be careful not to use any spaces).
So these two commands do the same thing:
vips jpegsave x.jpg y.jpg --Q 90
vips copy x.jpg x.jpg[Q=90]
The copy command will run jpegsave for you (it sees the .jpg suffix) and set Q to 90.
You can select dzsave with the .dz suffix. If your image is 50,000 x 50,000 pixels, you can save just the centre 50% with:
vips crop my-huge-map.jpg x.dz[layout=google] 12500 12500 25000 25000
I'm not sure what you mean by "layers 10 to 15". Do you only want the low-res layers? Just do a shrink by eg. 16 before running dzsave.

How to change resolution in 'Raspberry Pi OS' to a custom resolution

So I'm trying to implement the following resolution: 1920x127
What I have tried so far:
Option 1-
Added the following to /boo/config.txt file :
hdmi_ignore_edid=0xa5000080
hdmi_cvt=1920 127 60
hdmi_group=2
hdmi_mode=8
Following the Raspberry Pi documentation: https://www.raspberrypi.org/documentation/configuration/config-txt/video.md
This doesn't sets the resolution to 1920x127. But if I use for example 1920x1080 it does change the resolution accordingly.
So this process works but not for my current need.
Option 2-
Added the following to /boot/cmdline.txt file:
video=HDMI-A-1:1920x127M#60
So the file looks like this:
console=serial0,115200 video=HDMI-A-1:1920x127M#60 console=tty1 root=PARTUUID=156bada3-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
And just as the first solution it doesn't work with 1920x127 but it does with 1920x1080.
Now, this solution does not work alone. It needs the following
Create the file /usr/share/X11/xorg.conf.d/screen-resolution.conf and paste:
Section "Screen"
Identifier "Screen0"
Device "Card0"
SubSection "Display"
Modes "1920x127"
EndSubSection
EndSection
But still, with 1920x127 the X server goes to 1024x768 but if I set up both files with 1920x1080 the X server ran at 1920x1080
End of option 2
So checking the xrandr command I can see that it says:
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 7680 x 7680
The minimum is 320x200. So the minimum resolution I was able to set was 1920x240.
Now, about the Monitors.
Everything I have tried have been in 2 monitors:
1- ViewSonic VX2776
2- Custom made monitor that should support *1920x127*
So. Solution 1 and 2 in the Monitor 1 works with resolution 1920x1080 and 1920x240, it looks stretched but the Monitor shows something.
It does not work with resolution *1920x127. Meaning that it goes to default 1024x768.
In the Monitor 2, the solution 1 does not work, it always goes to default 1024x768. But solution 2 it works with 1920x1080 and 1920x320. Note the "320", because the 1920x240 it works, meaning that the X servers startx at 1920x240 but the monitor indicates "resolution not supported".
I have tried force 1920x127 with xrandr:
cvt 1920 127 60
xrandr --newmode "1920x127_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode HDM-1 1920x127_60.00
xrandr --output HDMI-1 --mode 1920x127
(Not actual used code, just an example)
And after this, the monitor goes off, like there is no output. And after set the resolution back to the default one, the monitor goes on.
So, basically the question is: How to set up a resolution below the minimum shown from xrandr 320x200?
Note: The makers of the monitor show to me the monitor working at 1920x127 with their own SBC with a Rock chip on Android.

how to compress apk size in unity3d

I am making a simple test game in unity3d using c#, the size of the apk of my game is 70 MB.I have reduced the resolution of each and ever sprites, but its still 58 MB, how do i compress the game so that the apk file is of the least possible size.
Apart from following this short guide by Unity themselves, there are a couple things to keep in mind:
Files which are not used or dependent on are removed by Unity when building.
Textures, music and videos take up most of the size. Sound files should ideally be .mp3 format (otherwise .wav for very short clips).
I would recommend you go through the link above and properly analyse Editor.log as it provides valuable information to trim the build size.
You can also choose to set the Device filter to Arm7. This will exclude certain devices, but I believe the number is quite small and it does minimize the apk size a bit. (This is located in Player Setting -> Other Settings -> Device Filter). You could try a build and see how much it would reduce it by and decide whether it was worth it.
Some Info on device filter: http://answers.unity3d.com/questions/971648/device-filter-to-arm-7-only.html
Additionally, if you look in your editor build file you can find information on what is taking up the majority of space in your build (it is a long log so you'll have to search for the right parts). There should be a part in it after you do a build that will list how much space things are taking up. It will be followed by a list of the assets from largest to smallest so you can identify particular assets that may be too large.
E.g.
Build Report
Uncompressed usage by category:
Textures 81.1 mb 92.0%
Meshes 0.0 kb 0.0%
Animations 17.1 kb 0.0%
Sounds 0.0 kb 0.0%
Shaders 90.0 kb 0.1%
Other Assets 549.9 kb 0.6%
Levels 338.3 kb 0.4%
Scripts 993.0 kb 1.1%
Included DLLs 5.1 mb 5.8%
File headers 33.1 kb 0.0%
Complete size 88.2 mb 100.0%
How to find editor file: https://docs.unity3d.com/Manual/LogFiles.html
One most effective and important change for reduce image size is
Set your image size square and
Set unity suggested pixels.(32, 64, 128, 256, 512, 1024, 2048, 4096, 8192)
If your image size is 567x890 pixels then set this image in a 1024x1024 pixels background transparent blank image and save it as a png file.
Then in unity inspector set this image as a sprite and slice it by sprite editor.
This process will make your image size reduce minimum 20%.
Example image and changes given below.
Before: resolution 567x890 pixel, size 1.9MB
After: resolution 1024x1024 pixel, size 1.3MB
Result: size 0.6MB reduced, almost 32%.
Image file Link: https://drive.google.com/file/d/0B9zkzr6JdNYlaHhqcDVUSk9KNjA/view
It is also good to set texture / sprite compression format.
Check this website:
https://docs.unity3d.com/Manual/class-TextureImporterOverride.html
Most texture compression format needs image in power of 2 resolution (128, 256, 512, 1024, 2048). Resolutions 4096 and 8192 may not work on some android devices.
For example texture with no alpha in 1024x1024 resolution using RGB ETC2 compressions takes about 0,5MB in memory. Image 1280x800 with compression format RGB 16bit takes 2MB.

How can I avoid that Github rotates my jpg in my readme.md?

I have added a image reference in my readme.md on github. The picture is a portrait format photo, but when I view it on the github page the picture is rotated.
I have tried clone the repo to a new location to confirm that the picture is indeed still portrait as expected in the repo.
The image part of the readme.md:
Here is a picture of the hardware setup. ![picture of the hardware setup](HelloButtonModule.jpg)
This is the affected github repo
Update
Now I am really baffled I tried to simplify the problem in a new repo, but the picture shows up unrotated as (originally) expected.
Update
I have created a repo with an exact copy of the picture. Then the picture is rotated.
You could try simply opening the file and then re-saving it. You may need to rotate 360 degrees before you save, however, this should work.
If you are on a Debian based distro, you can use exiftran.
sudo apt-get install exiftran
exiftran -ai *.jpg
This will automatically rotate all the .jpg files based on their exif data.
I ran
git clone https://github.com/steenhulthin/HelloButtonModule/
cd HelloButtonModule/
exif HelloButtonModule.jpg
and this produced:
EXIF tags in 'HelloButtonModule.jpg' ('Motorola' byte order):
--------------------+----------------------------------------------------------
Tag |Value
--------------------+----------------------------------------------------------
Image Width |4128
Image Length |2322
Manufacturer |SAMSUNG
Model |GT-I9505
Orientation |Top-left
X-Resolution |72
Y-Resolution |72
Resolution Unit |Inch
Software |I9505XXUDMH8
Date and Time |2013:10:16 23:22:57
YCbCr Positioning |Centred
Image Width |512
Image Length |288
Compression |JPEG compression
Orientation |Right-top
X-Resolution |72
Y-Resolution |72
Resolution Unit |Inch
Exposure Time |1/33 sec.
F-Number |f/2.2
Exposure Program |Normal programme
ISO Speed Ratings |100
Exif Version |Exif Version 2.2
Date and Time (Origi|2013:10:16 23:22:57
Date and Time (Digit|2013:10:16 23:22:57
Components Configura|Y Cb Cr -
Shutter Speed |5.06 EV (1/33 sec.)
Aperture |2.28 EV (f/2.2)
Brightness |2.44 EV (18.56 cd/m^2)
Exposure Bias |0.00 EV
Maximum Aperture Val|2.28 EV (f/2.2)
Metering Mode |Centre-weighted average
Light Source |Unknown
Flash |Flash did not fire
Focal Length |4.2 mm
Maker Note |98 bytes undefined data
User Comment |METADATA-START
FlashPixVersion |FlashPix Version 1.0
Colour Space |sRGB
Pixel X Dimension |4128
Pixel Y Dimension |2322
Sensing Method |One-chip colour area sensor
As you can see, the Orientation tag says top left. This means the EXIF data won't make a difference to the rotation, i.e. the image will appear the same on your computer and on Github.
I then ran
git clone https://github.com/steenhulthin/githubreadmeimagerotation2
cd githubreadmeimagerotation2/
exif HelloButtonModule.jpg
And I got:
EXIF tags in 'HelloButtonModule.jpg' ('Intel' byte order):
--------------------+----------------------------------------------------------
Tag |Value
--------------------+----------------------------------------------------------
Image Width |4128
Image Length |2322
Manufacturer |SAMSUNG
Model |GT-I9505
Orientation |Right-top
X-Resolution |72
Y-Resolution |72
Resolution Unit |Inch
Software |I9505XXUDMH8
Date and Time |2013:10:16 23:22:57
YCbCr Positioning |Centred
Image Width |512
Image Length |288
Compression |JPEG compression
Orientation |Right-top
X-Resolution |72
Y-Resolution |72
Resolution Unit |Inch
Exposure Time |1/33 sec.
F-Number |f/2.2
Exposure Program |Normal programme
ISO Speed Ratings |100
Exif Version |Exif Version 2.2
Date and Time (Origi|2013:10:16 23:22:57
Date and Time (Digit|2013:10:16 23:22:57
Components Configura|Y Cb Cr -
Shutter Speed |5.06 EV (1/33 sec.)
Aperture |2.28 EV (f/2.2)
Brightness |2.44 EV (18.56 cd/m^2)
Exposure Bias |0.00 EV
Maximum Aperture Val|2.28 EV (f/2.2)
Metering Mode |Centre-weighted average
Light Source |Unknown
Flash |Flash did not fire
Focal Length |4.2 mm
Maker Note |98 bytes undefined data
User Comment |METADATA-START
FlashPixVersion |FlashPix Version 1.0
Colour Space |sRGB
Pixel X Dimension |4128
Pixel Y Dimension |2322
Sensing Method |One-chip colour area sensor
Here the orientation says Right-top which means the right top corner of the image is currently in the top left corner. Github does not honor this information, so your image is displayed incorrectly.
I then ran exiftran -ai HelloButtonModule.jpg and this fixed the problem. There is a fork here https://github.com/texasflood/githubreadmeimagerotation2 which shows the correct rotation for the image.
If you are on Windows, IrfanView might work, courtesy of this question: https://superuser.com/questions/36645/how-to-rotate-images-automatically-based-on-exif-data
I think this is caused by github's missing support for the EXIF "Orientation" tag.
Github shows the image data as they are contained in the JPEG file, which is the orientation in which they have been captured by the camera photo sensor. Additionally, the JPEG file includes an EXIF tag "Orientation" containing the value "right, top", which indicates that the image data are not to be interpreted as they are, but that the right side should actually be up. Apparently, github does not honor this tag.
The image in your second repository is not identical to the first one, but seems to have been edited to add the red arrow and text. My guess is that the editor interpreted the "Orientation" tag during loading, and then saved the image data in rotated form and with an "Orientation" tag value of "top, left".
For more information, see e.g. JPEG Rotation and EXIF Orientation.
I still don't understand why this happens (#A.Donda's explanation sound plausible), but I found a solution.
I resized the picture to 50% of the original and picture is no longer rotated.
I would still be happy to know if there are alternatives to resizing though.

Image sizing issues (not fitting proportionally)

I created a 8.5x11.0 inches image # a 300dpi setting in photoshop.
When i go to use this as a background image in report designer the image looks hugeee.
It's not fitting within the 8.5x11.0 page.
Is there a way to resize this image correctly so that it will fit correctly within a 8.5x11.0 letter size page?
Thanks in advance,
with the information you gave, i believe your problem is problably in the group Size/dpi
You saved an image of size 8,5 x 11 inches # 300 Dpi (dots per inch) that calculates to aproximately an image of 2550 x 3300 pixels.
Now if your "report designer" software looks only at the size in pixels and assumes a dpi value diferent then the one you used, say for example 72 dpi, your 2550 x 3300 pixels image would actually be something like 45,8 x 35.4 inches.
So, my advice is, find out what are the characteristics your solftware is especting, aparently it is not 300dpi.
If you canĀ“t find the information, try commonly used dpis like 72dpi or 150dpi.