How can I change the monitor resolution on a Banana Pro? - banana-pi

I'd like to change the resolution of my monitor, connected via HDMI from a Banana Pro.
I get a list of available monitor resolutions by the following command:
cat /sys/class/graphics/fb0/modes
and then pick one of them that I want to use, say:
D:1280x720p-50
(1280x720p, 50 Hz refresh rate)
I've edited the /etc/rc.local file to include
echo D:1280x720p-50 > /sys/class/graphics/fb0/mode
Saved the file, rebooted - no change from the default resolution.

I figured this out with a bit of tinkering.
Remove the SD card with the linux image on it, and stick it into a computer that can read it.
Open up the uEnv.txt file to edit it.
Change this
disp.screen0_output_mode=EDID:1280x720p50
to this
disp.screen0_output_mode=1280x720p50
The EDID argument tells the kernel to try and use the monitor's settings to determine a resolution. Removing it forces your selected resolution to be used.
For some reason, this defaulted to a really low resolution for my screen with the Banana Pro.

Related

Issues with IntelliJ on a 4K screen

I splurged and bought one of those high definition 4K screens. More specifically, the Dell UltraSharp 4k UP3216Q 31.5", combined with a new PC running Windows 10.
When the computer occasionally reboots, it goes into a mode where when I load IntelliJ, it shows the following error message:
8:16 PM You may need to manually configure the HiDPI mode to prevent UI scaling issues. See the troubleshooting guide.
The interesting thing is that when it's running in this mode, I actually like the way IntelliJ looks. I like it because it's running in true sharp 4K mode, and at the same time, all the fonts are large enough to be legible, and not require a magnetic resonance microscope or a monocle to make out the letters.
However, other times, when the system boots up, I do not get that error, meaning everything is functioning normally, but in that case, all the fonts are so tiny as to be illegible. It literally hurts my eyes to look at it, and the only alternatives I have left at that point is to either drop down from 3840x2160 into 1920x1080, or to go into the settings, and start increasing the font sizes, which is annoying. Not to mention that if I drop down into 1920x1080 mode, then the quality of what I am looking at degrades, everything starts looking pixelated...
Is there anything that can be done to stabilize the situation on these new 4K screens so that IntelliJ looks normal?
Try this:
Help > Edit Custom VM Options:
-Dsun.java2d.uiScale.enabled=true
More information can be found here:
https://intellij-support.jetbrains.com/hc/en-us/articles/115001260010-Troubleshooting-IDE-scaling-DPI-issues-on-Windows
If that does not help create a ticket in the JetBrains issue tracker: https://youtrack.jetbrains.com/
They are usually very responsive.
Another possibility is that you have the Windows UI scaling value for the screen set to a non-integral value in display settings. This messed me up, I had the setting to 175%, while the default is 200%. Intellij (and many other applications) will not scale properly if that is set to a non-integral scaling value.
As soon as I switch this back to 200% Intellij scales perfectly.
I fix this problem after setted env variable IDEA_JDK_64 to jdk path in windows 10

STM32F407 memory layout

I am trying to use Percepio trace lib for FreeRTOS in Snapshot recorder mode.
After compilation and running it on my discovery board I need to somehow dump entire RAM to file.
I've started ST-LINK utility but I am puzzled on how to dump entire RAM.
Could some give hint on that matter?
You can find the memory layout on page 71 of the STM32F407xx Rev8 datasheet.
As ejohnso49 pointed out the SRAM of this chip is not contiguous. So you need address them twice (green and yellow area in the picture) to read out the whole data.
In STM32 ST-LINK Utility connect to device and enter 0x20000000 for address (start of SRAM, first section). For size enter 0x20000 0x30000 (128kB 192kB).
Now you can see the contents of the RAM in the window. For dumping the current view either click on the save icon or in the file menu on Save file as.
Do this also for the other CCM RAM section if you want.

Setting custom LiveView whitebalance values

Using EDSDK, I want to programmatically set the white balance (RGGB) values of the LiveView stream, and also for the white balance in both JPG (and RAW) images coming from the cam directly. The process of manual white balancing liveview and off-camera images is not completely clear to me and is not really clear in the EDSDK manual.
Through trial and error, I worked my way through calibrating LiveView by issuing the kEdsCameraCommand_DoClickWBEvf command with coordinates on a grey card. This seems to affect liveview all right:
Liveview switches to "ClickWB" (-1) white balance setting
Camera settings remain unchanged: it doesn't change the as-shot values of the camera.
Note that the "manual WB" icon on the camera disappears when setting to "ClickWB", something appears to be wrong.
Apparently, Canon's EOS utility does things slightly different. Using some tracing and polling of PTP events I see that:
Clicking Whitebalance sends a similar ClickWB command to camera.
When clicking "Apply to shot images" sends a command to camera
The camera White Balance stays on value 6 ("Manual","White Point" or "White Paper" depending on the context).
Liveview is also affected as it switches to 6.
Trace shows evidence of "CPtpCamera::TranslateMWb" command, as if there is a command to set the user balance.
The 'raw' White Balance coefficients can apparently be retrieved as EOS displays a warning about the coefficients not being ok.
For RAW images, I worked around white balancing by storing white balance coefficients from a RAW of grey card, and re-applying these coefficients when converting a new image (without grey card) to TIFF. This does not affect the on-camera JPGs, as-shot White Balance and cannot be recovered after reset.
I am stuck when disconnecting/reconnecting camera and (programmatically) apply the previously calibrated or stored WB values. Is this possible, and if so, how do I copy the original white balance values. Anyone here who has experience in manual WBing with EDSDK, care to share the type/order of sharing?
Note:
Canon provides no official technical support whatsoever for the EDSDK
older SDKs were reported to include commands (e.g. in 2.5 kEdsPropID_UserWhiteBalanceData). There must be a replacement for this?
--- update Dec 17 2014 ---
I am currently (indirectly) in "official" contact with Canon's EDSDK developers and currently there is no official way of setting in-camera custom white balance through the EDSDK.

Windows 8, Print to PostScript printer to file

Am I missing something stupid simple?
I have a new Windows 8 machine... 64-bit.
From an app on my old machine, I generate report output to a "Generic PostScript Printer" which is configured to be sent out to FILE (not LPT, COM, TCP/IP).
While trying the app, it fails to generate the output to the text file provided.
So, I'm taking my application out of the equation. I just go to control panel, pick this printer and tell the Windows printer dialog to do a test print. It comes up with a dialog to enter the file name and I put it into a folder that I have full permissions to... It fails... I even tried as "Administrator" to remove any possible "permission" issues and it still fails.
What am I missing on something that should otherwise be so simple, that even MS dialog / test print doesn't work.
To clarify what I DID do..
Control Panel - get to devices / printers
Add Printer -- clicked on the "printer not found"
Radio for "Add a local printer or network printer..." -- next
Use an existing port -- FILE: (Print to File) -- next
Manufacturer - Generic -- Printers - Generic XPS Class Driver (A) -- next
(used the driver already installed since I tried previously) -- next
Printer name: -- left alone by default of "Generic Color XPS Class Driver (A) -- next
Do not share this printer -- next
Print a test page -- dialog defaults to "Libraries\Documents\", I entered myTest.prn -- Save
It APPEARS to generate the file... however, it only creates the file as a zero-byte size
UPDATE... While digging and struggling, I actually opened a support ticket with Microsoft. They have confirmed that this specific process IS a bug and will be working on a patch (to be delivered with other patches when ready).
ANOTHER UPDATE !
Apparently, the machine I bought from DELL only had Windows 8 BASIC version. Through many support calls back and forth, it is a specific issue when trying to use certain printer drivers (such as Microsoft PS Color Printer -- for Post-Script output), from the default drivers provided with new machines with Windows installed.
OUR WORK AROUND.
For grins, I ultimately went out to HP's website (how common are HP printers :), and downloaded the printer driver for a 2500 LaserJet and install THAT version of PostScript printer. After installing that, and trying the output, I can generate the output to a textfile without problem... even when default setting is to LPT1: and being redirected to an output text file for postscript content.
So, ultimately, issue resolved by using ANOTHER Vendor's printer driver for postscript printing and I'm good to go.

How to listen to Screen Captures

Is it possible for me to listen to listen to OSX's built in screencapturing so I can handle the files myself rather than osx doing it?
There are a few options.
Just use Ctrl-Cmd-Shift-3 or 4 instead of Cmd-Shift-3 or 4. This does not save the file to the desktop, instead it saves the data in the clipboard/pasteboard. I don't know where's the official mention of this, but here is one. Then you can get the data through NSPasteboard, see here.
You can use FSEvents to be notified whenever a file is created in a specified folder. Then you can rename the screenshot file soon after it was saved to the desktop by the system. Note that the file name of the screenshot depends on the language environment you choose in System Preferences. So, be very careful if you want to make your program work on a non-English machine.
If you just programmatically take the screenshot, you can use the command line tool screencapture, see the man page.
Of course you can hack into the system and take over the handling of Cmd-Shift-3,4, as Snapz Pro does, for example. You know what you're doing if you choose that way.