From 3ad09fad4d8ee3b18644951ec4939a90362f8b43 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 24 Jul 2018 15:42:31 +0200 Subject: [PATCH] hdmi fallback --- README.md | 2 ++ raspberry-environment/display.py | 12 +++++++----- windows-snapshot-tool/bin/freeze.exe | Bin 401237 -> 401414 bytes windows-snapshot-tool/src/main.cpp | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 24e8f50..df5fe65 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ echo "dtoverlay=dwc2" >> /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 apt purge plymouth diff --git a/raspberry-environment/display.py b/raspberry-environment/display.py index 8932704..e457221 100644 --- a/raspberry-environment/display.py +++ b/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/sub_compatible_id", "5162001") -# subprocess.run(['tvservice', '-p'], shell=False, check=False) -# subprocess.run(['fbset', '-fb', '/dev/fb0', '-depth', '16'], shell=False, check=False) + fallback_str = b'state 0x12000a [HDMI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive\n' + 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): # if paths: diff --git a/windows-snapshot-tool/bin/freeze.exe b/windows-snapshot-tool/bin/freeze.exe index 49bd256d25d59ded757d6f572ce3c936d15b48c7..3f4bd51437262d1eb26dc40730ec3ad345af34aa 100755 GIT binary patch delta 13364 zcmb_i3tUvy)<65qIXWofAPC4y9s{VL4T@l;HX`^=(JY_I!$(@Cr1+>yfr%!8iXCm) zjTFt)%8Jq&G^{DDtn9|^nwOFajSQ1Y&B|LQ-+!GmGcwut-P`xO=l5It@n4U<_S*Zb zz30HkuZ663hE%Nac{_U2G^tRP7HrrsT#op9!>7G`M)*pSR3%A`bk7DgSj$QZ*X$xh z9k57}_UO!F#vCo1 zVzhK(0>sGc{;CNkojCvH4VL$=UCkvr*YOOv4#11XD zLtxiEE@^XVW-ZSY&o-SC(S}p^PKH&Hiu3^K61%lWI`jz4a2qboJiIn@2mIVtqy4SJ z1F^*}qqZllIT&w^E?4^I+RUm_7%C04Zkw+y?ATjO)Sl=V66bWAsbSk^!UR?`^Bi0A zaGDorpLUEDwc3@ANhlM2lR`^eTIOv$M%k@_r4wNqN_E;jzDc4|+v1zxU+;26S(|x` zd26)ezKNK*-05MFudVGA*|E+&|80fZE1eR>a_v;7o+y3&Mqy)2^0NhOblcDeVk<|r zzxoXp$FxuUdWj>N(z#z!zQ+nX!_krz>;=d+xH<0N?$c&=?j=gJb)B#Ob80_yPJmjN zC0^8N>6Vxt9?vV@J#=g7S1VcuAaH9l8!>A0?5oY&wQ@^ZQMJnri#`c~VzYKbmlEoh8nKPk>A**QPYH#b9h}12varHuDsUF{VWC_cKct$iSo=*_{uA0)@RbfQ5fT%Noi&ivy4a^ zEbaBKQE;QNYd4Xl{nB-e7@!RgN*VcoxYY2w!2Wv|5$F>^J+5yvt^b#eTY_&CA8PA^ z!^C3k+2BMmQ~M{%6PhU`E%*n2ee;|RTA6uKoZW2Xmgdj2@gcp%japGixOiTxM7dwv zA2L)_Yrlmg*!m+vNTFq!zxPIey*le$<=sOS6|Hdvh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7h5-4+t=UOHh>vhN z8hH!|{ruOo_Z9&;?1sDyBmo*8F0HqLjB;DYb_<|-w=w(x$VRv3FUjfLBdW(OFz9I- l)wW^y@1mP%7a)l)FYXIt@(0DEz3n9TcqZ7kAk;%s{vQa9;pPAU diff --git a/windows-snapshot-tool/src/main.cpp b/windows-snapshot-tool/src/main.cpp index 7645e83..21bc0a7 100644 --- a/windows-snapshot-tool/src/main.cpp +++ b/windows-snapshot-tool/src/main.cpp @@ -274,8 +274,8 @@ void doScreenshot() CaptureImage(Hwnd, L"screenshot.png"); } else { WCHAR filename[128]; - wcsncpy(filename, path, sizeof(filename)); - wcsncpy(filename, L"screenshot.png", sizeof(filename)); + wcsncpy(filename, path, _countof(filename)-1); + wcsncat(filename, L"screenshot.png", _countof(filename) - wcslen(filename) -1); CaptureImage(Hwnd, filename); } @@ -321,7 +321,7 @@ void getRaspiStorage(LPWSTR out) { if (GetVolumeInformationW(drive, volumeName, ARRAYSIZE(volumeName), &serialNumber, &maxComponentLen, &fileSystemFlags, fileSystemName, ARRAYSIZE(fileSystemName))) { if (wcscmp(L"SCREENSHOTS", volumeName)==0) { // ToDo - wcsncpy(out, drive, sizeof(out)); + wcsncpy(out, drive, 10); // ToDo } } }