Browse Source

hdmi fallback

main
Hendrik Langer 6 years ago
parent
commit
3ad09fad4d
  1. 2
      README.md
  2. 12
      raspberry-environment/display.py
  3. BIN
      windows-snapshot-tool/bin/freeze.exe
  4. 6
      windows-snapshot-tool/src/main.cpp

2
README.md

@ -51,6 +51,8 @@ echo "dtoverlay=dwc2" >> /boot/config.txt
echo "dtoverlay=gpio-poweroff,gpiopin=5,active_low" >> /boot/config.txt echo "dtoverlay=gpio-poweroff,gpiopin=5,active_low" >> /boot/config.txt
sed -i /boot/config.txt -e "s/^hdmi_force_hotplug=1$/hdmi_force_hotplug=1$/"
echo "libcomposite" >> /etc/modules echo "libcomposite" >> /etc/modules
apt purge plymouth apt purge plymouth

12
raspberry-environment/display.py

@ -214,12 +214,14 @@ if __name__ == '__main__':
#os_echo(g+"functions/rndis.usb0/os_desc/interface.rndis/compatible_id", "RNDIS") #os_echo(g+"functions/rndis.usb0/os_desc/interface.rndis/compatible_id", "RNDIS")
#os_echo(g+"functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id", "5162001") #os_echo(g+"functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id", "5162001")
# subprocess.run(['tvservice', '-p'], shell=False, check=False) fallback_str = b'state 0x12000a [HDMI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive\n'
# subprocess.run(['fbset', '-fb', '/dev/fb0', '-depth', '16'], shell=False, check=False) p = subprocess.Popen(['tvservice', '-s'], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
_stdout, _stderr = p.communicate()
if (len(_stdout) > 0 and _stdout == fallback_str):
subprocess.run(['tvservice', '--explicit="CEA 16 HDMI"'], shell=False, check=False)
subprocess.run(['fbset', '-fb', '/dev/fb0', '-depth', '16'], shell=False, check=False)
subprocess.run(['fbset', '-fb', '/dev/fb0', '-depth', '32'], shell=False, check=False)
#tvservice -p
# tvservice -e "DMT 82"
# fbset -g 1920 1080 1920 1080 16
def callback(paths): def callback(paths):
# if paths: # if paths:

BIN
windows-snapshot-tool/bin/freeze.exe

Binary file not shown.

6
windows-snapshot-tool/src/main.cpp

@ -274,8 +274,8 @@ void doScreenshot()
CaptureImage(Hwnd, L"screenshot.png"); CaptureImage(Hwnd, L"screenshot.png");
} else { } else {
WCHAR filename[128]; WCHAR filename[128];
wcsncpy(filename, path, sizeof(filename)); wcsncpy(filename, path, _countof(filename)-1);
wcsncpy(filename, L"screenshot.png", sizeof(filename)); wcsncat(filename, L"screenshot.png", _countof(filename) - wcslen(filename) -1);
CaptureImage(Hwnd, filename); CaptureImage(Hwnd, filename);
} }
@ -321,7 +321,7 @@ void getRaspiStorage(LPWSTR out) {
if (GetVolumeInformationW(drive, volumeName, ARRAYSIZE(volumeName), &serialNumber, &maxComponentLen, &fileSystemFlags, fileSystemName, ARRAYSIZE(fileSystemName))) if (GetVolumeInformationW(drive, volumeName, ARRAYSIZE(volumeName), &serialNumber, &maxComponentLen, &fileSystemFlags, fileSystemName, ARRAYSIZE(fileSystemName)))
{ {
if (wcscmp(L"SCREENSHOTS", volumeName)==0) { // ToDo if (wcscmp(L"SCREENSHOTS", volumeName)==0) { // ToDo
wcsncpy(out, drive, sizeof(out)); wcsncpy(out, drive, 10); // ToDo
} }
} }
} }

Loading…
Cancel
Save