From b37cbd26d515dfcecbb47cc62b1dc68c0df20c8d Mon Sep 17 00:00:00 2001 From: AEtHeLsYn Date: Sat, 2 Apr 2016 00:04:11 +0200 Subject: [PATCH 01/14] Add color adjustment to all RBG channels * Channel adjustment config * Create RgbChannelAdjustment.h * Delete RgbChannelAdjustment.h * Create RgbChannelAdjustment.cpp * Create RgbChannelAdjustment.h * Delete RgbChannelAdjustment.cpp * Create ColorAdjustment.cpp * Delete RgbChannelAdjustment.h * Create ColorAdjustment.h * Update ColorAdjustment.h * Update ColorAdjustment.h * Update ColorAdjustment.h * Update ColorAdjustment.cpp * Update Hyperion.cpp * Update Hyperion.cpp * Update Hyperion.cpp * Update Hyperion.h * Create RgbChannelAdjustment.cpp * Create RgbChannelAdjustment.h * Create ColorAdjustment.h * Create MultiColorAdjustment.h * Update MultiColorAdjustment.h * Create MultiColorAdjustment.cpp * Delete ColorAdjustment.cpp * Delete ColorAdjustment.h * Update RgbChannelAdjustment.cpp * Update Hyperion.cpp * Update Hyperion.h * Update Hyperion.cpp * Bug fixes * Update hyperion.config.json * Add color adjustment to json server and client and adapt hyperion-remote * Change the color modification order * Minor bug fix * Create calibration Images folder * Create calibration Gamma folder * Create calibration RGB folder * Added files via upload * Delete .gitkeep * Delete .gitkeep * Added files via upload * Delete .gitkeep * Update color effect order and don't correct twice * Uploaded gradient images Former-commit-id: 8ab465e59834f12a21709a6f4546bd6808a2a495 --- config/hyperion.config.json | 25 +++ doc/calibration/Gamma/000000.png | Bin 0 -> 6159 bytes doc/calibration/Gamma/3F3F3F.png | Bin 0 -> 10670 bytes doc/calibration/Gamma/7F7F7F.png | Bin 0 -> 10669 bytes doc/calibration/Gamma/BFBFBF.png | Bin 0 -> 10670 bytes doc/calibration/Gamma/FFFFFF.png | Bin 0 -> 8642 bytes doc/calibration/Gamma/HGradient_1.png | Bin 0 -> 10866 bytes doc/calibration/Gamma/HGradient_2.png | Bin 0 -> 10862 bytes doc/calibration/Gamma/VGradient_1.png | Bin 0 -> 12174 bytes doc/calibration/Gamma/VGradient_2.png | Bin 0 -> 12032 bytes doc/calibration/RGB/blue_00007F.png | Bin 0 -> 10668 bytes doc/calibration/RGB/blue_0000FF.png | Bin 0 -> 8642 bytes doc/calibration/RGB/cyan_007F7F.png | Bin 0 -> 10668 bytes doc/calibration/RGB/cyan_00FFFF.png | Bin 0 -> 8642 bytes doc/calibration/RGB/green_007F00.png | Bin 0 -> 10668 bytes doc/calibration/RGB/green_00FF00.png | Bin 0 -> 8641 bytes doc/calibration/RGB/magenta_7F007F.png | Bin 0 -> 10668 bytes doc/calibration/RGB/magenta_FF00FF.png | Bin 0 -> 8642 bytes doc/calibration/RGB/red_7F0000.png | Bin 0 -> 10668 bytes doc/calibration/RGB/red_FF0000.png | Bin 0 -> 8641 bytes doc/calibration/RGB/yellow_7F7F00.png | Bin 0 -> 10668 bytes doc/calibration/RGB/yellow_FFFF00.png | Bin 0 -> 7964 bytes include/hyperion/ColorAdjustment.h | 22 +++ include/hyperion/Hyperion.h | 31 +++- include/utils/RgbChannelAdjustment.h | 66 +++++++ libsrc/hyperion/CMakeLists.txt | 2 + libsrc/hyperion/Hyperion.cpp | 162 +++++++++++++++++- libsrc/hyperion/MultiColorAdjustment.cpp | 124 ++++++++++++++ libsrc/hyperion/MultiColorAdjustment.h | 66 +++++++ libsrc/jsonserver/JsonClientConnection.cpp | 73 +++++++- libsrc/jsonserver/JsonClientConnection.h | 7 + libsrc/jsonserver/JsonSchemas.qrc | 1 + .../jsonserver/schema/schema-adjustment.json | 56 ++++++ libsrc/jsonserver/schema/schema.json | 2 +- libsrc/utils/CMakeLists.txt | 2 + libsrc/utils/RgbChannelAdjustment.cpp | 107 ++++++++++++ src/hyperion-remote/ColorAdjustmentValues.h | 12 ++ src/hyperion-remote/CustomParameter.h | 33 ++++ src/hyperion-remote/JsonConnection.cpp | 45 +++++ src/hyperion-remote/JsonConnection.h | 16 ++ src/hyperion-remote/hyperion-remote.cpp | 31 +++- 41 files changed, 870 insertions(+), 13 deletions(-) create mode 100644 doc/calibration/Gamma/000000.png create mode 100644 doc/calibration/Gamma/3F3F3F.png create mode 100644 doc/calibration/Gamma/7F7F7F.png create mode 100644 doc/calibration/Gamma/BFBFBF.png create mode 100644 doc/calibration/Gamma/FFFFFF.png create mode 100644 doc/calibration/Gamma/HGradient_1.png create mode 100644 doc/calibration/Gamma/HGradient_2.png create mode 100644 doc/calibration/Gamma/VGradient_1.png create mode 100644 doc/calibration/Gamma/VGradient_2.png create mode 100644 doc/calibration/RGB/blue_00007F.png create mode 100644 doc/calibration/RGB/blue_0000FF.png create mode 100644 doc/calibration/RGB/cyan_007F7F.png create mode 100644 doc/calibration/RGB/cyan_00FFFF.png create mode 100644 doc/calibration/RGB/green_007F00.png create mode 100644 doc/calibration/RGB/green_00FF00.png create mode 100644 doc/calibration/RGB/magenta_7F007F.png create mode 100644 doc/calibration/RGB/magenta_FF00FF.png create mode 100644 doc/calibration/RGB/red_7F0000.png create mode 100644 doc/calibration/RGB/red_FF0000.png create mode 100644 doc/calibration/RGB/yellow_7F7F00.png create mode 100644 doc/calibration/RGB/yellow_FFFF00.png create mode 100644 include/hyperion/ColorAdjustment.h create mode 100644 include/utils/RgbChannelAdjustment.h create mode 100644 libsrc/hyperion/MultiColorAdjustment.cpp create mode 100644 libsrc/hyperion/MultiColorAdjustment.h create mode 100644 libsrc/jsonserver/schema/schema-adjustment.json create mode 100644 libsrc/utils/RgbChannelAdjustment.cpp create mode 100644 src/hyperion-remote/ColorAdjustmentValues.h diff --git a/config/hyperion.config.json b/config/hyperion.config.json index 748781fd..62c7d70e 100644 --- a/config/hyperion.config.json +++ b/config/hyperion.config.json @@ -68,6 +68,31 @@ } } ], + "channelAdjustment" : + [ + { + "id" : "default", + "leds" : "*", + "pureRed" : + { + "redChannel" : 255, + "greenChannel" : 0, + "blueChannel" : 0 + }, + "pureGreen" : + { + "redChannel" : 0, + "greenChannel" : 255, + "blueChannel" : 0 + }, + "pureBlue" : + { + "redChannel" : 0, + "greenChannel" : 0, + "blueChannel" : 255 + } + } + ], "transform" : [ { diff --git a/doc/calibration/Gamma/000000.png b/doc/calibration/Gamma/000000.png new file mode 100644 index 0000000000000000000000000000000000000000..f4c092619af0630387ac55a95f30ad3fbef7fe59 GIT binary patch literal 6159 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}0*a(>3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-4B|^XT^vIy;@%!)VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRH*=T@_ zrVwyu7|jddU>GeNz`-zDT7rXNwE6%C1H)+HFj_c_=7rI`z%W`bjMfXI9VkdaFq#)e z^TKFe7|ja|qs?PTA{gyEgTrC8UKp(xM(c&qdSSF)7@croU>F@Xfs_QJLx|vT7;Phg zgJHCd1P+GL!eO*<7#&lEq=C`AFq#)e^TKFe7+s(>x?&BO3r713;G%#k{e{G5%pXL! U^cOEzJ_s_@)78&qol`;+0GFSwH~;_u literal 0 HcmV?d00001 diff --git a/doc/calibration/Gamma/7F7F7F.png b/doc/calibration/Gamma/7F7F7F.png new file mode 100644 index 0000000000000000000000000000000000000000..dcf7a3f6b28f027378dddd766bf800223e55e43f GIT binary patch literal 10669 zcmeI0F-yZh7>2*lT5W8L9Rw8xN8K_ynt0Miut;%n5sQP1gV@DIDB>ar`b&cT03nLt zAUG%pZjK7o#lgWM-hKBA+@CtxO}u`v`SB9h z^Qe+v?A{ixeooEdt?Xm>wYQn)#7nb@zq#I3cfNExi6&7XHE$O z(SD#qR0fby888Pg1LlA^zyd4?>jLY7ut(A+fCX591>Xa(01L1H3*<;7jg|s3RkZ?Q z6P1DUg37=iNoBwsybPEF<^T(@K&I+@02W{Y7GOchk$e+yUhp~)Ca4aa7gPqq1eM|6 Z=5QW;1<&QMzkNSbb2FsNEt4f%M}NI-`J4a% literal 0 HcmV?d00001 diff --git a/doc/calibration/Gamma/BFBFBF.png b/doc/calibration/Gamma/BFBFBF.png new file mode 100644 index 0000000000000000000000000000000000000000..f61f729782206196a590f3b48ea45ed1c5033652 GIT binary patch literal 10670 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRRa4?LPmf&C*tv zU>I#9frDYRa2PEdM#oekX<#%jjOK;WyfB&FVdQ&MBb@0N|6ZPXGV_ literal 0 HcmV?d00001 diff --git a/doc/calibration/Gamma/FFFFFF.png b/doc/calibration/Gamma/FFFFFF.png new file mode 100644 index 0000000000000000000000000000000000000000..8e5dc2d55055cb8640b0427d7b11ab86fe3f7f6d GIT binary patch literal 8642 zcmeH~y-EW?6ot>481uIlA|i`|0Usa%3+=LDCA&qUL{V(SfUq{AkS67#Hdb2NnKFe0 z^8&hPVIyK;VWIXG=`6Q!jt^mVis3K=!@%&}JKvnIH|uuZ$pf$h-)jLA5s+Taj+vEk zxHWCU>a^-L3|{8G%_JSV4Hp<*6q5G1ndgrEoenVh$YDJl_4k3&cHp_2-QCf9#frFi(^Pd z+}oQMvu-;GI0Wwe|NneuyV;kc%X}wnx%AaifNA$F$^G|_Z_Ab6|8HKE&9h&x&()M) zTc=%Hf91{My2GpfR=>add3X8WXL`n`zK74Py>eT$czucaw|Tq2?r7nA$W;?>&-)9O2a>+Yl;TTy2mR`Y%T=41Ev=dZbE z-}h_p%M94;z;-*3FoCBSTkL(1;A_V07uUX_KP{kMP5zRH@1^4Djdt0}*>PP?}L z%A3Xi4zK!K{r>Lf-RXay=^3B;9zM7B%5Bl&^(E%t=I#Ezr|{akz0Z4X%kO^l&HOL9 z`J0ve>azT~{pok!{#k$iUD#V$d&~H(_3z;WxGd&3U%2@W>tQyS=N=%DV5BU7gmy`+ooKGZI(xk9ED@XPy1#@Bd@3{ytvu z-+JA*zwQ4k%b%_Lcy)JteH|mv%RsQhl2HP}QgC7bg&Yuc2sA)tl~@wMA`A^2qsl-b zF&ZG?^e~!2z`-z@Wx&BOS~!4%VYG071jA_IFj_c_=7rI`FxqGwZAAmSV58j%P*E`2 zMuHTGqa7%4IE=QDz`-zDIDms;v~UI#9frDYRaDW8EXyGtgIE?0n(Y!D^$UHjXGCJXs04WGY+enab l80|oT!-2>)l1GJ29rMfYY;z3x`!YcqJzf1=);T3K0RU*(asB`R literal 0 HcmV?d00001 diff --git a/doc/calibration/Gamma/VGradient_1.png b/doc/calibration/Gamma/VGradient_1.png new file mode 100644 index 0000000000000000000000000000000000000000..974b087ef7454249403e1702c24e085911a00a87 GIT binary patch literal 12174 zcmb_ieNaeVrNJ7-IJ1VK97``IG zT8V9yU0EelA++@mbhaB%>L3ybm0-FOp-L4|K1G9km?#lKAR&91gyijP=Dw3)W*FYU zy?N*S&hK~5x#zv(@5jgZz4H1i1VQ-4#cue3AbiCH;j?<)T=bVGtv|ereg*H2{a`ae zWUU|w@uvh~vZCJu1d;wWK@4&U;vFeL1n^IB8l%zL`5(t72nb?f!}O1rnty%|L4^G} zZo|5*8A-#Pd;O#LE{;xSe181+d2WdGwWB9G^Sg0EVOKbnm%!{4{Y&xSSH@5|Oay;Nrxz`eH@aBUvA)T9e4 zOCmZ4;;YJ=rE3{mzqZB~SNzux*#HGu?eiD<7oR{NC*y#~V9my0m!}GglH4*K@Gk<(B++xbdM$BYoDBynS#{2|n* zZRJ_pD15qqN3I3?q@1_|^{M)LxEw6q@bb*f6n5UdEPo8Ov#oCIGT6@Mba@{ZPkLLe zE?wmPx-IU(6d5$Dtwsjra+`8$6mO??F5^lbd#(K_LQ!}+o*iR+0@YkJslZ2IY1)r(P~7mF{J=qIr7|k5 z77E0?Xc=NCVo}fXX!r^s^VYGF&&Sh^P7^(O7o0$nY1vYI z1ftBnGztv_K9|JcjdC78HOqrcv3Lz+{(LSFtbu~VFV0a!lwOeeB|f5tdurxgXjTg} zUQttIwZ0&020p7fX5^C0YyL8P(@baQJoE=gG>)BhiXx(>|FH3m22VEf&oXdCx0Ft7 zrHJVLRvEq_P(`6pCZ1-bry40yeZRriDT5}3*$Ry)8n~rUM6|NhvL75#G=ici@+~5r z03T6lKPndB#9{7dQM7|e&yED(BT5g;>0N*~$~iO8ZVbz!=w}tS2u&0slb8OnBi z9qk%9Qw0WZXZOTk@Zd!ZS2W~6kE{py*%W=J!t#_4PKH87-!cm6ps6r88Frx-8ZRAE z!=e)^A5Z{|#@Aq=d-H>I_}PG7q|XNDD73Z|D>KqOSf6X1q+qmU`N?O{lhpEpsM}az zNV)Ia$#-sG*YcRC&jf?$%Nk#YWh?0{&wTL>4IgYxKFgep&y&tx#`I$h6Fe-7VNLuQ zZ0Fd;0t!3Ttf_-wJ5?b}@USd|WdhHxnWGojcsrfq5xlq+Q{#9*=WvE z@LdO~9Hg)&6TsLTt6QKx8B8s?U05!Yct725;1id#LgYOEf`hLRr1H9nGl6e`NxJ7u zjTGT^PonpY?R8*!Z&yy>XTc;HqWNh#7~;|L+)gOO{G7feV2BN8yTK5nl6VH1TD#E* z3J5V76GMp}`f7s2gbL9RwsMfjkH#EppyaQ!TJ(64ItA@ys~H{SKZHI{H8ccG{R9o@ z?voMMfon;EK&kc?_+e*|bzBYP3`s{Ubf|>BnWS2Zp1!(&3-vN#2iS|!sTXDL--0#S z-U9W4C=x~tWfstcX%3W@6BXLBDW~Uxd3k@vw?!Sge&mC_Fa{q3m zBsrZ0pzjzsw>ddznC@MmZ^n?e^|P$Add189I4sxw@RH($PPQEP0e3>6nJ#y;LJke7 zMeZZ#&=biQ6hqdmSirKHT4v*m!zh(`h+}nMjzZwH0K41O zGJ#&Cvp==$Ne-;He>e11v@}Y_Sgoq+1AJ!pl;Z2v)n5E+&A~L}8YOb7%I>;mad4 z443eI=bZ2Ny?*DMd+LRp?8t{7eV8DK$Xz?LULuGUVuA=u34e(E=E3dGO!C*d!ksVu zjv$UdP7vY>g0Q*B-{S=F<|cxeC?JTZWdsq!eK-HwbENFbqdWKV2qLO`@h7C0d+`84 zB%R!q^~~P3#jL0Z&;jvb^$Nkt2V z!C6#v`s~dsiV!zagPS4>+)v{0kVo84>vj-};ZJ@ftHd6;^|h2tbWoUD)aU=!Jd zLypN78QU?Q>pKK8w$mu}U5$oZw8+{W5ONNKNa-_j5}Vo}Z1zKKiYsdKSq%Zsi7TJ! zJSgxK#D@L9>hOdws+mkhLB$oC&iSFX7?%F13C&;lp_VMN_4%VFG@kZDEi`&tgU_Cj z*lYtLaM92fvF#tkdR-I(b(X_2>`z3F=ZaeWFz9-&5L`L5y=-Tr?*<7hYH+S-v)S{1 z@qLQLG5`$%7Tekxeb-yz!W+C#OkIMOdec`e8t@duWFJ?12gXk!v1u#{-9ui=AO?~L z-axwL31G#R$nDc@;N?u0DD}YQs7e&3wOhUIZW*xg$+#l>5VY!Zrd#z%z$rKi^ChmF zVsr)66B9q;={_uJr6lmOrW;)0?Z^Umu@w_ot|8-=kHrE>YfrgDpI;K{WgZ<^4x&Ar zZ~r?mHCXwMi9Jw{%g3tHfcYS?{cDfn9yB`6Di;nyU3Wz3D2B=^W-SH*0WFKFoW~JX{rI|0k6h>9-9X}<#SCn=7>MS@>PGitsk1(1LfMyc$-XQAO27B zN1pu#z9e!o%%9~#gVRKI>RZ@#ax#pka;?j^xXs>}N!_+o6ql|>64WC}w(Tkus&G=|P-;Z3|# zE-U6=g#sg=`233{GB7mWDux2n?s6FLStYYvH3-1Ql0@YW-dK&P+5(QiwqeH+Yy?X9 zciJ@fV{WXh@@l8o(9kU%?xI zPA~XzD9WUs9V2YpjH?*5~P<-l`W&9mac0`&2#u&v*mcO#Nwwe?w`!TCS_c zQ}a=3^{cVl&Bip{c^z1BV;dkGps_QXg9K1rjj%NkfKd0E{_1uP58J(FDAvOa(8OnTc!1DW39;M# z6wgKfoye-hc;)y8RfXYHB6JNkU`VbjujZY^J7wk05lWKDf4QvJp?a5V2s4psG~uBS8Y_ zyX^R>AOSRSu@(;yI(??~1e}M{I#@j1AK;a!8;BtRv77i< zFN~XRS@=R49*5V;Po)sal%V%#rkC)ZH`+Sm->S*}5mz_>l3{v!fNtTn;`d~d3l8muI zTii@n1b%Tymj7d4o)#OvteAaAPvC0-YGUU_P8;6ENVc6k3VV~vc&2(TBPr$pkX~{6 z(=Ge3(SWEJr$1HqYpkp!)jrvT-+`cP(|+01k53VrtZMVXpRh*LWY28wMnxWl1&#md&soz{*Ne$1l8x${dr?G=O^6qj8YNhy-A=dEe((A6euZg=5gF z&-ilGSe&H=S|u1WX0SJ-*!PS<9DbXYCEXhca#G=JZ6FZP(pXnr=6k5qf-ik;Fi7ur zN{@eE>w7pbI*7b(d?Nq{p{QX=OM5m1XHiW+VmU{*~2pjORGschv X*)y(~!q+}o)ZF!KPS)ie1#kTqOf8>x literal 0 HcmV?d00001 diff --git a/doc/calibration/RGB/blue_00007F.png b/doc/calibration/RGB/blue_00007F.png new file mode 100644 index 0000000000000000000000000000000000000000..8ca29242b821769a765051bb71fcb2bd1524c72a GIT binary patch literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>F@_hU5w& c2bnoLPgg&ebxsLQ0Cvpx7XSbN literal 0 HcmV?d00001 diff --git a/doc/calibration/RGB/blue_0000FF.png b/doc/calibration/RGB/blue_0000FF.png new file mode 100644 index 0000000000000000000000000000000000000000..727f8cf35baf6657a93ec2ad3364adb02e41ea8b GIT binary patch literal 8642 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}0*a(>3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42t2NE{-7;ac^%JGBy}6967-Lf8Ob) zmbBf`j}*_Bu>o~4Fl^sj&j_L)XfaEH=!O@riIu{z%=Km_R*jlO*WvsFq&mXiwjUX7%eJCs|ip#7_B0K&6CmQ!D#bfw0Qt3 z4n~^?qs;?QIv8ypj5ZHI>0q>ZFxor-CWF!D!D#aUR2+;p4@R2@pmZ?WJQ!^rfYQNe z^I)`j089p>&4bbA0jM|_Z61s^4?yW)w0SVvJOHJG(dGfYn+Gi0_*Y%z%rD<;u^bcu Mp00i_>zopr08hi$bN~PV literal 0 HcmV?d00001 diff --git a/doc/calibration/RGB/cyan_007F7F.png b/doc/calibration/RGB/cyan_007F7F.png new file mode 100644 index 0000000000000000000000000000000000000000..334e191b3e73a336013559f51ad4b42bd5db85b5 GIT binary patch literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>GeNAi*$N zIE)q!qj_O8FN}_5#80|Yl3WCu#5+oc(J5b3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42t2NE{-7;ac^%JGBPOe9N5rUfBu6) zW8KMM{@CJkKurt`2l9W5f*Jda7BGSs9ugP8d=;JyFfGJp0;V~cr9gB;3nMRxb~x0) z2BH-b9hgD%1cOoSqd~{OFq&)_7)G-Uus9kmE=G&W(Q0C}iX3eoj5du%Ta}=4V6CgVCnZXfG0&3`TpVM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>F@_hU5w& c2bnoFVdQ&MBb@0AtPd*Z=?k literal 0 HcmV?d00001 diff --git a/doc/calibration/RGB/green_00FF00.png b/doc/calibration/RGB/green_00FF00.png new file mode 100644 index 0000000000000000000000000000000000000000..01e18f1254ff8bbdc9879e0696d210cb8018aa43 GIT binary patch literal 8641 zcmeI!u}Z^G7zN;S+geR+6hu&pLj)f{(ZR7PktTyhsuUcw7KFN0$l|1_=-{M_yQ3gf z`vM|5h>La#M~Z!whE!3@j86(wxe#r0HZ! z%;Zel_2~fBM!yW_fyRYKC3~P_!k)}JBEVM%xN zb!1@J*w6hZkrl}2EbxddW?8eRt z;Pfz>LcqZ=nq|PjFj_c(gJHCAfCR&6;V@b_jOK;WyudJ8FO1d;45Mu%a3UDZ3!`~q zG%rBXz-V3=%?qP>VKgs{jx>%Ay#jN==$IR|!0SCiqe*qi}qirN`FpL%skYE@s z97YR=(Y!F47e>caM^`2=jP{)&1;J<=2@(#Y9Vl=(jJA=$!7$o^0tdrr;V@b_kX})G a%-Fe5jw^Sgn(_xw@OirWxvX3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42t2NE{-7;ac^%JGBPOe9N5rUfBu6) zW8KMM{@C<$Kurt`2l9W5f*Jda7BGSs9ugP8d=;JyFfGJp0;V~cr9gB;3nMRxb~x0) z2BH-b9hgD%1cOoSqd~{OFq&)_7)G-Uus9kmE=G&W(Q0C}iX3eoj5du%Ta}=4V6CgVCnZXfG0&3`TpmdK II;Vst0FI>9KmY&$ literal 0 HcmV?d00001 diff --git a/doc/calibration/RGB/red_7F0000.png b/doc/calibration/RGB/red_7F0000.png new file mode 100644 index 0000000000000000000000000000000000000000..7dc59c7d11ec3b2317e768af5324e3214156dff2 GIT binary patch literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>F@_hU5w& c2bno3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42of%E{-7;ac^%JGBPOe9N5rUfBu6) zW8KMM{@8S&9tMU7`~QNhWMGJwya1+Ecrw7W5Ss~@=46%v(G4w(ydc`)Py-u?R!DSU z2GJ7?7BGTn4~bFjqd~{OFq&+DIdL@0j20K8MJ1?O7_BBotH{yj!D!QHv}rWjGy;_a zqfMjHo)j<{jP@c&n?|7GV083gbmRn-4n~^?qs;?QIv8ypj5ZH|$zZg3Fxor-6$hiu zgVE*zC>@M84@R2@pmZ?WJQ!^r0F%LJ^I)`j04fd!sCi&e%(&(}XTJO6Q{O?Z@O1Ta JS?83{1OQ{u)Xo3^ literal 0 HcmV?d00001 diff --git a/doc/calibration/RGB/yellow_7F7F00.png b/doc/calibration/RGB/yellow_7F7F00.png new file mode 100644 index 0000000000000000000000000000000000000000..0296764528b0606bb360452f27ad9cca22f022e8 GIT binary patch literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>GeNAi*$N zIE)q!qj_O8FN}_5#80|Yl3WCu#5+oc(J5b3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-400PiT^vIy;@%!#$je|Lz`XI@{x8$n z<+r3fDrX03VPM#63#L@QfvE{Mm_f8d5AdCjWXh#v4 z21Wy6G!RC6%cC7daCI=+TLuQhXdsLR!sw8}Xm1%@BBBi$Jh;cMqnWu?`}+)OkhG_( KpUXO@geCyAOIi;A literal 0 HcmV?d00001 diff --git a/include/hyperion/ColorAdjustment.h b/include/hyperion/ColorAdjustment.h new file mode 100644 index 00000000..0ce7f1a6 --- /dev/null +++ b/include/hyperion/ColorAdjustment.h @@ -0,0 +1,22 @@ +#pragma once + +// STL includes +#include + +// Utils includes +#include + +class ColorAdjustment +{ +public: + + /// Unique identifier for this color transform + std::string _id; + + /// The RED-Channel (RGB) adjustment + RgbChannelAdjustment _rgbRedAdjustment; + /// The GREEN-Channel (RGB) transform + RgbChannelAdjustment _rgbGreenAdjustment; + /// The BLUE-Channel (RGB) transform + RgbChannelAdjustment _rgbBlueAdjustment; +}; diff --git a/include/hyperion/Hyperion.h b/include/hyperion/Hyperion.h index 88c480d3..57440cf9 100644 --- a/include/hyperion/Hyperion.h +++ b/include/hyperion/Hyperion.h @@ -15,6 +15,7 @@ #include #include #include +#include #include // Effect engine includes @@ -28,10 +29,11 @@ class HsvTransform; class HslTransform; class RgbChannelTransform; class RgbChannelCorrection; +class RgbChannelAdjustment; class MultiColorTransform; class MultiColorCorrection; class MultiColorTemperature; - +class MultiColorAdjustment; /// /// The main class of Hyperion. This gives other 'users' access to the attached LedDevice through /// the priority muxer. @@ -135,6 +137,12 @@ public slots: /// const std::vector & getTemperatureIds() const; + /// + /// Returns the list with unique adjustment identifiers + /// @return The list with adjustment identifiers + /// + const std::vector & getAdjustmentIds() const; + /// /// Returns the ColorTransform with the given identifier /// @return The transform with the given identifier (or nullptr if the identifier does not exist) @@ -153,6 +161,12 @@ public slots: /// ColorCorrection * getTemperature(const std::string& id); + /// + /// Returns the ColorAdjustment with the given identifier + /// @return The adjustment with the given identifier (or nullptr if the identifier does not exist) + /// + ColorAdjustment * getAdjustment(const std::string& id); + /// /// Returns MessageForwarder Object /// @return instance of message forwarder object @@ -168,6 +182,9 @@ public slots: /// Tell Hyperion that the corrections have changed and the leds need to be updated void temperaturesUpdated(); + /// Tell Hyperion that the corrections have changed and the leds need to be updated + void adjustmentsUpdated(); + /// /// Clears the given priority channel. This will switch the led-colors to the colors of the next /// lower priority channel (or off if no more channels are set) @@ -208,16 +225,19 @@ public: static MultiColorTransform * createLedColorsTransform(const unsigned ledCnt, const Json::Value & colorTransformConfig); static MultiColorCorrection * createLedColorsCorrection(const unsigned ledCnt, const Json::Value & colorCorrectionConfig); static MultiColorCorrection * createLedColorsTemperature(const unsigned ledCnt, const Json::Value & colorTemperatureConfig); + static MultiColorAdjustment * createLedColorsAdjustment(const unsigned ledCnt, const Json::Value & colorAdjustmentConfig); static ColorTransform * createColorTransform(const Json::Value & transformConfig); static ColorCorrection * createColorCorrection(const Json::Value & correctionConfig); + static ColorAdjustment * createColorAdjustment(const Json::Value & adjustmentConfig); static HsvTransform * createHsvTransform(const Json::Value & hsvConfig); static HslTransform * createHslTransform(const Json::Value & hslConfig); static RgbChannelTransform * createRgbChannelTransform(const Json::Value& colorConfig); static RgbChannelCorrection * createRgbChannelCorrection(const Json::Value& colorConfig); + static RgbChannelAdjustment * createRgbChannelAdjustment(const Json::Value& colorConfig, const RgbChannel color); static LedDevice * createColorSmoothing(const Json::Value & smoothingConfig, LedDevice * ledDevice); static MessageForwarder * createMessageForwarder(const Json::Value & forwarderConfig); - + signals: /// Signal which is emitted when a priority channel is actively cleared /// This signal will not be emitted when a priority channel time out @@ -241,15 +261,18 @@ private: /// The priority muxer PriorityMuxer _muxer; - /// The transformation from corrected colors to led colors + /// The transformation from raw colors to led colors MultiColorTransform * _raw2ledTransform; /// The correction from raw colors to led colors MultiColorCorrection * _raw2ledCorrection; - /// The temperature from corrected colors to led colors + /// The temperature from raw colors to led colors MultiColorCorrection * _raw2ledTemperature; + /// The adjustment from raw colors to led colors + MultiColorAdjustment * _raw2ledAdjustment; + /// The actual LedDevice LedDevice * _device; diff --git a/include/utils/RgbChannelAdjustment.h b/include/utils/RgbChannelAdjustment.h new file mode 100644 index 00000000..4b0130bd --- /dev/null +++ b/include/utils/RgbChannelAdjustment.h @@ -0,0 +1,66 @@ +#pragma once + +// STL includes +#include + +/// Correction for a single color byte value +/// All configuration values are unsigned int and assume the color value to be between 0 and 255 +class RgbChannelAdjustment +{ +public: + /// Default constructor + RgbChannelAdjustment(); + + /// Constructor + /// @param adjustR + /// @param adjustG + /// @param adjustB + + RgbChannelAdjustment(int adjustR, int adjustG, int adjustB); + + /// Destructor + ~RgbChannelAdjustment(); + + /// @return The current adjustR value + uint8_t getadjustmentR() const; + + /// @param threshold New adjustR value + void setadjustmentR(uint8_t adjustR); + + /// @return The current adjustG value + uint8_t getadjustmentG() const; + + /// @param gamma New adjustG value + void setadjustmentG(uint8_t adjustG); + + /// @return The current adjustB value + uint8_t getadjustmentB() const; + + /// @param blacklevel New adjustB value + void setadjustmentB(uint8_t adjustB); + + /// Transform the given array value + /// @param input The input color bytes + /// @return The corrected byte value + uint8_t adjustmentR(uint8_t inputR) const; + uint8_t adjustmentG(uint8_t inputG) const; + uint8_t adjustmentB(uint8_t inputB) const; + + +private: + /// (re)-initilize the color mapping + void initializeMapping(); + +private: + /// The adjustment of R channel + int _adjustR; + /// The adjustment of G channel + int _adjustG; + /// The adjustment of B channel + int _adjustB; + + /// The mapping from input color to output color + int _mappingR[256]; + int _mappingG[256]; + int _mappingB[256]; +}; diff --git a/libsrc/hyperion/CMakeLists.txt b/libsrc/hyperion/CMakeLists.txt index a2188127..b4f53a19 100644 --- a/libsrc/hyperion/CMakeLists.txt +++ b/libsrc/hyperion/CMakeLists.txt @@ -19,6 +19,7 @@ SET(Hyperion_HEADERS ${CURRENT_SOURCE_DIR}/MultiColorTransform.h ${CURRENT_SOURCE_DIR}/MultiColorCorrection.h + ${CURRENT_SOURCE_DIR}/MultiColorAdjustment.h ${CURRENT_HEADER_DIR}/MessageForwarder.h ) @@ -32,6 +33,7 @@ SET(Hyperion_SOURCES ${CURRENT_SOURCE_DIR}/ImageToLedsMap.cpp ${CURRENT_SOURCE_DIR}/MultiColorTransform.cpp ${CURRENT_SOURCE_DIR}/MultiColorCorrection.cpp + ${CURRENT_SOURCE_DIR}/MultiColorAdjustment.cpp ${CURRENT_SOURCE_DIR}/LinearColorSmoothing.cpp ${CURRENT_SOURCE_DIR}/MessageForwarder.cpp ) diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 1d6925da..a5a85ff4 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -17,6 +17,7 @@ #include #include #include +#include // Leddevice includes #include @@ -24,6 +25,7 @@ #include "MultiColorTransform.h" #include "MultiColorCorrection.h" +#include "MultiColorAdjustment.h" #include "LinearColorSmoothing.h" // effect engine includes @@ -101,6 +103,7 @@ ColorTransform * Hyperion::createColorTransform(const Json::Value & transformCon return transform; } + ColorCorrection * Hyperion::createColorCorrection(const Json::Value & correctionConfig) { const std::string id = correctionConfig.get("id", "default").asString(); @@ -117,6 +120,30 @@ ColorCorrection * Hyperion::createColorCorrection(const Json::Value & correction return correction; } + +ColorAdjustment * Hyperion::createColorAdjustment(const Json::Value & adjustmentConfig) +{ + const std::string id = adjustmentConfig.get("id", "default").asString(); + + RgbChannelAdjustment * redAdjustment = createRgbChannelAdjustment(adjustmentConfig["pureRed"],RED); + RgbChannelAdjustment * greenAdjustment = createRgbChannelAdjustment(adjustmentConfig["pureGreen"],GREEN); + RgbChannelAdjustment * blueAdjustment = createRgbChannelAdjustment(adjustmentConfig["pureBlue"],BLUE); + + ColorAdjustment * adjustment = new ColorAdjustment(); + adjustment->_id = id; + adjustment->_rgbRedAdjustment = *redAdjustment; + adjustment->_rgbGreenAdjustment = *greenAdjustment; + adjustment->_rgbBlueAdjustment = *blueAdjustment; + + // Cleanup the allocated individual adjustments + delete redAdjustment; + delete greenAdjustment; + delete blueAdjustment; + + return adjustment; +} + + MultiColorTransform * Hyperion::createLedColorsTransform(const unsigned ledCnt, const Json::Value & colorConfig) { // Create the result, the transforms are added to this @@ -206,7 +233,7 @@ MultiColorCorrection * Hyperion::createLedColorsCorrection(const unsigned ledCnt } else if (!correctionConfig.isArray()) { - ColorCorrection * colorCorrection = createColorCorrection(colorConfig); + ColorCorrection * colorCorrection = createColorCorrection(correctionConfig); correction->addCorrection(colorCorrection); correction->setCorrectionForLed(colorCorrection->_id, 0, ledCnt-1); } @@ -280,7 +307,7 @@ MultiColorCorrection * Hyperion::createLedColorsTemperature(const unsigned ledCn } else if (!correctionConfig.isArray()) { - ColorCorrection * colorCorrection = createColorCorrection(colorConfig); + ColorCorrection * colorCorrection = createColorCorrection(correctionConfig); correction->addCorrection(colorCorrection); correction->setCorrectionForLed(colorCorrection->_id, 0, ledCnt-1); } @@ -339,6 +366,80 @@ MultiColorCorrection * Hyperion::createLedColorsTemperature(const unsigned ledCn return correction; } +MultiColorAdjustment * Hyperion::createLedColorsAdjustment(const unsigned ledCnt, const Json::Value & colorConfig) +{ + // Create the result, the transforms are added to this + MultiColorAdjustment * adjustment = new MultiColorAdjustment(ledCnt); + + const Json::Value adjustmentConfig = colorConfig.get("channelAdjustment", Json::nullValue); + if (adjustmentConfig.isNull()) + { + // Old style color transformation config (just one for all leds) + ColorAdjustment * colorAdjustment = createColorAdjustment(colorConfig); + adjustment->addAdjustment(colorAdjustment); + adjustment->setAdjustmentForLed(colorAdjustment->_id, 0, ledCnt-1); + } + else if (!adjustmentConfig.isArray()) + { + ColorAdjustment * colorAdjustment = createColorAdjustment(adjustmentConfig); + adjustment->addAdjustment(colorAdjustment); + adjustment->setAdjustmentForLed(colorAdjustment->_id, 0, ledCnt-1); + } + else + { + const QRegExp overallExp("([0-9]+(\\-[0-9]+)?)(,[ ]*([0-9]+(\\-[0-9]+)?))*"); + + for (Json::UInt i = 0; i < adjustmentConfig.size(); ++i) + { + const Json::Value & config = adjustmentConfig[i]; + ColorAdjustment * colorAdjustment = createColorAdjustment(config); + adjustment->addAdjustment(colorAdjustment); + + const QString ledIndicesStr = QString(config.get("leds", "").asCString()).trimmed(); + if (ledIndicesStr.compare("*") == 0) + { + // Special case for indices '*' => all leds + adjustment->setAdjustmentForLed(colorAdjustment->_id, 0, ledCnt-1); + std::cout << "HYPERION INFO: ColorAdjustment '" << colorAdjustment->_id << "' => [0; "<< ledCnt-1 << "]" << std::endl; + continue; + } + + if (!overallExp.exactMatch(ledIndicesStr)) + { + std::cerr << "HYPERION ERROR: Given led indices " << i << " not correct format: " << ledIndicesStr.toStdString() << std::endl; + continue; + } + + std::cout << "HYPERION INFO: ColorAdjustment '" << colorAdjustment->_id << "' => ["; + + const QStringList ledIndexList = ledIndicesStr.split(","); + for (int i=0; i 0) + { + std::cout << ", "; + } + if (ledIndexList[i].contains("-")) + { + QStringList ledIndices = ledIndexList[i].split("-"); + int startInd = ledIndices[0].toInt(); + int endInd = ledIndices[1].toInt(); + + adjustment->setAdjustmentForLed(colorAdjustment->_id, startInd, endInd); + std::cout << startInd << "-" << endInd; + } + else + { + int index = ledIndexList[i].toInt(); + adjustment->setAdjustmentForLed(colorAdjustment->_id, index, index); + std::cout << index; + } + } + std::cout << "]" << std::endl; + } + } + return adjustment; +} + HsvTransform * Hyperion::createHsvTransform(const Json::Value & hsvConfig) { const double saturationGain = hsvConfig.get("saturationGain", 1.0).asDouble(); @@ -376,6 +477,32 @@ RgbChannelCorrection* Hyperion::createRgbChannelCorrection(const Json::Value& co return correction; } +RgbChannelAdjustment* Hyperion::createRgbChannelAdjustment(const Json::Value& colorConfig, const RgbChannel color) +{ + int varR, varG, varB; + if (color == RED) + { + varR = colorConfig.get("redChannel", 255).asInt(); + varG = colorConfig.get("greenChannel", 0).asInt(); + varB = colorConfig.get("blueChannel", 0).asInt(); + } + else if (color == GREEN) + { + varR = colorConfig.get("redChannel", 0).asInt(); + varG = colorConfig.get("greenChannel", 255).asInt(); + varB = colorConfig.get("blueChannel", 0).asInt(); + } + else if (color == BLUE) + { + varR = colorConfig.get("redChannel", 0).asInt(); + varG = colorConfig.get("greenChannel", 0).asInt(); + varB = colorConfig.get("blueChannel", 255).asInt(); + } + + RgbChannelAdjustment* adjustment = new RgbChannelAdjustment(varR, varG, varB); + return adjustment; +} + LedString Hyperion::createLedString(const Json::Value& ledsConfig, const ColorOrder deviceOrder) { LedString ledString; @@ -490,6 +617,7 @@ MessageForwarder * Hyperion::getForwarder() Hyperion::Hyperion(const Json::Value &jsonConfig) : _ledString(createLedString(jsonConfig["leds"], createColorOrder(jsonConfig["device"]))), _muxer(_ledString.leds().size()), + _raw2ledAdjustment(createLedColorsAdjustment(_ledString.leds().size(), jsonConfig["color"])), _raw2ledCorrection(createLedColorsCorrection(_ledString.leds().size(), jsonConfig["color"])), _raw2ledTemperature(createLedColorsTemperature(_ledString.leds().size(), jsonConfig["color"])), _raw2ledTransform(createLedColorsTransform(_ledString.leds().size(), jsonConfig["color"])), @@ -498,6 +626,10 @@ Hyperion::Hyperion(const Json::Value &jsonConfig) : _messageForwarder(createMessageForwarder(jsonConfig["forwarder"])), _timer() { + if (!_raw2ledAdjustment->verifyAdjustments()) + { + throw std::runtime_error("HYPERION ERROR: Color adjustment incorrectly set"); + } if (!_raw2ledCorrection->verifyCorrections()) { throw std::runtime_error("HYPERION ERROR: Color correction incorrectly set"); @@ -551,6 +683,9 @@ Hyperion::~Hyperion() // delete the color temperature correction delete _raw2ledTemperature; + + // delete the color adjustment + delete _raw2ledAdjustment; // delete the message forwarder delete _messageForwarder; @@ -609,6 +744,11 @@ const std::vector & Hyperion::getTemperatureIds() const return _raw2ledTemperature->getCorrectionIds(); } +const std::vector & Hyperion::getAdjustmentIds() const +{ + return _raw2ledAdjustment->getAdjustmentIds(); +} + ColorTransform * Hyperion::getTransform(const std::string& id) { return _raw2ledTransform->getTransform(id); @@ -624,6 +764,11 @@ ColorCorrection * Hyperion::getTemperature(const std::string& id) return _raw2ledTemperature->getCorrection(id); } +ColorAdjustment * Hyperion::getAdjustment(const std::string& id) +{ + return _raw2ledAdjustment->getAdjustment(id); +} + void Hyperion::transformsUpdated() { update(); @@ -639,6 +784,11 @@ void Hyperion::temperaturesUpdated() update(); } +void Hyperion::adjustmentsUpdated() +{ + update(); +} + void Hyperion::clear(int priority) { if (_muxer.hasPriority(priority)) @@ -703,9 +853,11 @@ void Hyperion::update() const PriorityMuxer::InputInfo & priorityInfo = _muxer.getInputInfo(priority); // Apply the correction and the transform to each led and color-channel - std::vector correctedColors = _raw2ledCorrection->applyCorrection(priorityInfo.ledColors); - std::vector temperatureColors = _raw2ledTemperature->applyCorrection(correctedColors); - std::vector ledColors =_raw2ledTransform->applyTransform(temperatureColors); + // Avoid applying correction, the same task is performed by adjustment + // std::vector correctedColors = _raw2ledCorrection->applyCorrection(priorityInfo.ledColors); + std::vector adjustedColors = _raw2ledAdjustment->applyAdjustment(priorityInfo.ledColors); + std::vector transformColors =_raw2ledTransform->applyTransform(adjustedColors); + std::vector ledColors = _raw2ledTemperature->applyCorrection(transformColors); const std::vector& leds = _ledString.leds(); int i = 0; for (ColorRgb& color : ledColors) diff --git a/libsrc/hyperion/MultiColorAdjustment.cpp b/libsrc/hyperion/MultiColorAdjustment.cpp new file mode 100644 index 00000000..79ba1d21 --- /dev/null +++ b/libsrc/hyperion/MultiColorAdjustment.cpp @@ -0,0 +1,124 @@ + +// STL includes +#include + +// Hyperion includes +#include "MultiColorAdjustment.h" + +MultiColorAdjustment::MultiColorAdjustment(const unsigned ledCnt) : + _ledAdjustments(ledCnt, nullptr) +{ +} + +MultiColorAdjustment::~MultiColorAdjustment() +{ + // Clean up all the transforms + for (ColorAdjustment * adjustment : _adjustment) + { + delete adjustment; + } +} + +void MultiColorAdjustment::addAdjustment(ColorAdjustment * adjustment) +{ + _adjustmentIds.push_back(adjustment->_id); + _adjustment.push_back(adjustment); +} + +void MultiColorAdjustment::setAdjustmentForLed(const std::string& id, const unsigned startLed, const unsigned endLed) +{ + assert(startLed <= endLed); + assert(endLed < _ledAdjustments.size()); + + // Get the identified adjustment (don't care if is nullptr) + ColorAdjustment * adjustment = getAdjustment(id); + for (unsigned iLed=startLed; iLed<=endLed; ++iLed) + { + _ledAdjustments[iLed] = adjustment; + } +} + +bool MultiColorAdjustment::verifyAdjustments() const +{ + bool allLedsSet = true; + for (unsigned iLed=0; iLed<_ledAdjustments.size(); ++iLed) + { + if (_ledAdjustments[iLed] == nullptr) + { + std::cerr << "HYPERION (C.adjustment) ERROR: No adjustment set for " << iLed << std::endl; + allLedsSet = false; + } + } + return allLedsSet; +} + +const std::vector & MultiColorAdjustment::getAdjustmentIds() +{ + return _adjustmentIds; +} + +ColorAdjustment* MultiColorAdjustment::getAdjustment(const std::string& id) +{ + // Iterate through the unique adjustments until we find the one with the given id + for (ColorAdjustment* adjustment : _adjustment) + { + if (adjustment->_id == id) + { + return adjustment; + } + } + + // The ColorAdjustment was not found + return nullptr; +} + +std::vector MultiColorAdjustment::applyAdjustment(const std::vector& rawColors) +{ + // Create a copy, as we will do the rest of the adjustment in place + std::vector ledColors(rawColors); + + const size_t itCnt = std::min(_ledAdjustments.size(), rawColors.size()); + for (size_t i=0; i_rgbRedAdjustment.adjustmentR(color.red); + int RG = adjustment->_rgbRedAdjustment.adjustmentG(color.red); + int RB = adjustment->_rgbRedAdjustment.adjustmentB(color.red); + int GR = adjustment->_rgbGreenAdjustment.adjustmentR(color.green); + int GG = adjustment->_rgbGreenAdjustment.adjustmentG(color.green); + int GB = adjustment->_rgbGreenAdjustment.adjustmentB(color.green); + int BR = adjustment->_rgbBlueAdjustment.adjustmentR(color.blue); + int BG = adjustment->_rgbBlueAdjustment.adjustmentG(color.blue); + int BB = adjustment->_rgbBlueAdjustment.adjustmentB(color.blue); + + int ledR = RR + GR + BR; + int maxR = (int)adjustment->_rgbRedAdjustment.getadjustmentR(); + int ledG = RG + GG + BG; + int maxG = (int)adjustment->_rgbGreenAdjustment.getadjustmentG(); + int ledB = RB + GB + BB; + int maxB = (int)adjustment->_rgbBlueAdjustment.getadjustmentB(); + + if (ledR > maxR) + color.red = (uint8_t)maxR; + else + color.red = (uint8_t)ledR; + + if (ledG > maxG) + color.green = (uint8_t)maxG; + else + color.green = (uint8_t)ledG; + + if (ledB > maxB) + color.blue = (uint8_t)maxB; + else + color.blue = (uint8_t)ledB; + } + return ledColors; +} diff --git a/libsrc/hyperion/MultiColorAdjustment.h b/libsrc/hyperion/MultiColorAdjustment.h new file mode 100644 index 00000000..7f02b815 --- /dev/null +++ b/libsrc/hyperion/MultiColorAdjustment.h @@ -0,0 +1,66 @@ +#pragma once + +// STL includes +#include + +// Utils includes +#include + +// Hyperion includes +#include + +/// +/// The LedColorTransform is responsible for performing color transformation from 'raw' colors +/// received as input to colors mapped to match the color-properties of the leds. +/// +class MultiColorAdjustment +{ +public: + MultiColorAdjustment(const unsigned ledCnt); + ~MultiColorAdjustment(); + + /** + * Adds a new ColorAdjustment to this MultiColorTransform + * + * @param adjustment The new ColorAdjustment (ownership is transfered) + */ + void addAdjustment(ColorAdjustment * adjustment); + + void setAdjustmentForLed(const std::string& id, const unsigned startLed, const unsigned endLed); + + bool verifyAdjustments() const; + + /// + /// Returns the identifier of all the unique ColorAdjustment + /// + /// @return The list with unique id's of the ColorAdjustment + const std::vector & getAdjustmentIds(); + + /// + /// Returns the pointer to the ColorAdjustment with the given id + /// + /// @param id The identifier of the ColorAdjustment + /// + /// @return The ColorAdjustment with the given id (or nullptr if it does not exist) + /// + ColorAdjustment* getAdjustment(const std::string& id); + + /// + /// Performs the color adjustment from raw-color to led-color + /// + /// @param rawColors The list with raw colors + /// + /// @return The list with led-colors + /// + std::vector applyAdjustment(const std::vector& rawColors); + +private: + /// List with transform ids + std::vector _adjustmentIds; + + /// List with unique ColorTransforms + std::vector _adjustment; + + /// List with a pointer to the ColorAdjustment for each individual led + std::vector _ledAdjustments; +}; diff --git a/libsrc/jsonserver/JsonClientConnection.cpp b/libsrc/jsonserver/JsonClientConnection.cpp index 033f5f6d..62346623 100644 --- a/libsrc/jsonserver/JsonClientConnection.cpp +++ b/libsrc/jsonserver/JsonClientConnection.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include // project includes @@ -252,6 +253,8 @@ void JsonClientConnection::handleMessage(const std::string &messageString) handleCorrectionCommand(message); else if (command == "temperature") handleTemperatureCommand(message); + else if (command == "adjustment") + handleAdjustmentCommand(message); else handleNotImplemented(); } @@ -470,6 +473,34 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &) whitelevel.append(colorTransform->_rgbGreenTransform.getWhitelevel()); whitelevel.append(colorTransform->_rgbBlueTransform.getWhitelevel()); } + + // collect adjustment information + Json::Value & adjustmentArray = info["adjustment"]; + for (const std::string& adjustmentId : _hyperion->getAdjustmentIds()) + { + const ColorAdjustment * colorAdjustment = _hyperion->getAdjustment(adjustmentId); + if (colorAdjustment == nullptr) + { + std::cerr << "JSONCLIENT ERROR: Incorrect color adjustment id: " << adjustmentId << std::endl; + continue; + } + + Json::Value & adjustment = adjustmentArray.append(Json::Value()); + adjustment["id"] = adjustmentId; + + Json::Value & redAdjust = adjustment["redAdjust"]; + redAdjust.append(colorAdjustment->_rgbRedAdjustment.getadjustmentR()); + redAdjust.append(colorAdjustment->_rgbRedAdjustment.getadjustmentG()); + redAdjust.append(colorAdjustment->_rgbRedAdjustment.getadjustmentB()); + Json::Value & greenAdjust = adjustment["greenAdjust"]; + greenAdjust.append(colorAdjustment->_rgbGreenAdjustment.getadjustmentR()); + greenAdjust.append(colorAdjustment->_rgbGreenAdjustment.getadjustmentG()); + greenAdjust.append(colorAdjustment->_rgbGreenAdjustment.getadjustmentB()); + Json::Value & blueAdjust = adjustment["blueAdjust"]; + blueAdjust.append(colorAdjustment->_rgbBlueAdjustment.getadjustmentR()); + blueAdjust.append(colorAdjustment->_rgbBlueAdjustment.getadjustmentG()); + blueAdjust.append(colorAdjustment->_rgbBlueAdjustment.getadjustmentB()); + } // collect effect info Json::Value & effects = info["effects"] = Json::Value(Json::arrayValue); @@ -634,6 +665,47 @@ void JsonClientConnection::handleTemperatureCommand(const Json::Value &message) sendSuccessReply(); } + +void JsonClientConnection::handleAdjustmentCommand(const Json::Value &message) +{ + const Json::Value & adjustment = message["adjustment"]; + + const std::string adjustmentId = adjustment.get("id", _hyperion->getAdjustmentIds().front()).asString(); + ColorAdjustment * colorAdjustment = _hyperion->getAdjustment(adjustmentId); + if (colorAdjustment == nullptr) + { + //sendErrorReply(std::string("Incorrect transform identifier: ") + transformId); + return; + } + + if (adjustment.isMember("redAdjust")) + { + const Json::Value & values = adjustment["redAdjust"]; + colorAdjustment->_rgbRedAdjustment.setadjustmentR(values[0u].asInt()); + colorAdjustment->_rgbRedAdjustment.setadjustmentG(values[1u].asInt()); + colorAdjustment->_rgbRedAdjustment.setadjustmentB(values[2u].asInt()); + } + + if (adjustment.isMember("greenAdjust")) + { + const Json::Value & values = adjustment["greenAdjust"]; + colorAdjustment->_rgbGreenAdjustment.setadjustmentR(values[0u].asInt()); + colorAdjustment->_rgbGreenAdjustment.setadjustmentG(values[1u].asInt()); + colorAdjustment->_rgbGreenAdjustment.setadjustmentB(values[2u].asInt()); + } + + if (adjustment.isMember("blueAdjust")) + { + const Json::Value & values = adjustment["blueAdjust"]; + colorAdjustment->_rgbBlueAdjustment.setadjustmentR(values[0u].asInt()); + colorAdjustment->_rgbBlueAdjustment.setadjustmentG(values[1u].asInt()); + colorAdjustment->_rgbBlueAdjustment.setadjustmentB(values[2u].asInt()); + } + // commit the changes + _hyperion->adjustmentsUpdated(); + + sendSuccessReply(); +} void JsonClientConnection::handleNotImplemented() { @@ -712,7 +784,6 @@ void JsonClientConnection::sendMessage(const Json::Value & message, QTcpSocket * } - void JsonClientConnection::sendSuccessReply() { // create reply diff --git a/libsrc/jsonserver/JsonClientConnection.h b/libsrc/jsonserver/JsonClientConnection.h index acf58d7d..ff8da15a 100644 --- a/libsrc/jsonserver/JsonClientConnection.h +++ b/libsrc/jsonserver/JsonClientConnection.h @@ -126,6 +126,13 @@ private: /// @param message the incoming message /// void handleTemperatureCommand(const Json::Value & message); + + /// + /// Handle an incoming JSON Adjustment message + /// + /// @param message the incoming message + /// + void handleAdjustmentCommand(const Json::Value & message); /// /// Handle an incoming JSON message of unknown type diff --git a/libsrc/jsonserver/JsonSchemas.qrc b/libsrc/jsonserver/JsonSchemas.qrc index 193624ba..6556bf32 100644 --- a/libsrc/jsonserver/JsonSchemas.qrc +++ b/libsrc/jsonserver/JsonSchemas.qrc @@ -9,6 +9,7 @@ schema/schema-transform.json schema/schema-correction.json schema/schema-temperature.json + schema/schema-adjustment.json schema/schema-effect.json diff --git a/libsrc/jsonserver/schema/schema-adjustment.json b/libsrc/jsonserver/schema/schema-adjustment.json new file mode 100644 index 00000000..c6e2ba5d --- /dev/null +++ b/libsrc/jsonserver/schema/schema-adjustment.json @@ -0,0 +1,56 @@ +{ + "type":"object", + "required":true, + "properties":{ + "command": { + "type" : "string", + "required" : true, + "enum" : ["adjustment"] + }, + "adjustment": { + "type": "object", + "required": true, + "properties": { + "id" : { + "type" : "string", + "required" : false + }, + "redAdjust": { + "type": "array", + "required": false, + "items" : { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "minItems": 3, + "maxItems": 3 + }, + "greenAdjust": { + "type": "array", + "required": false, + "items" : { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "minItems": 3, + "maxItems": 3 + }, + "blueAdjust": { + "type": "array", + "required": false, + "items" : { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "minItems": 3, + "maxItems": 3 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} diff --git a/libsrc/jsonserver/schema/schema.json b/libsrc/jsonserver/schema/schema.json index 061339d1..91106162 100644 --- a/libsrc/jsonserver/schema/schema.json +++ b/libsrc/jsonserver/schema/schema.json @@ -5,7 +5,7 @@ "command": { "type" : "string", "required" : true, - "enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform", "correction", "temperature"] + "enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform", "correction", "temperature", "adjustment"] } } } diff --git a/libsrc/utils/CMakeLists.txt b/libsrc/utils/CMakeLists.txt index 8de00707..5978c2c1 100644 --- a/libsrc/utils/CMakeLists.txt +++ b/libsrc/utils/CMakeLists.txt @@ -29,6 +29,8 @@ add_library(hyperion-utils ${CURRENT_SOURCE_DIR}/RgbChannelTransform.cpp ${CURRENT_HEADER_DIR}/RgbChannelCorrection.h ${CURRENT_SOURCE_DIR}/RgbChannelCorrection.cpp + ${CURRENT_HEADER_DIR}/RgbChannelAdjustment.h + ${CURRENT_SOURCE_DIR}/RgbChannelAdjustment.cpp ${CURRENT_HEADER_DIR}/jsonschema/JsonFactory.h ${CURRENT_HEADER_DIR}/jsonschema/JsonSchemaChecker.h diff --git a/libsrc/utils/RgbChannelAdjustment.cpp b/libsrc/utils/RgbChannelAdjustment.cpp new file mode 100644 index 00000000..0c5468c7 --- /dev/null +++ b/libsrc/utils/RgbChannelAdjustment.cpp @@ -0,0 +1,107 @@ +// STL includes +#include + +// Utils includes +#include + +RgbChannelAdjustment::RgbChannelAdjustment() : + _adjustR(255), + _adjustG(255), + _adjustB(255) +{ + initializeMapping(); +} + +RgbChannelAdjustment::RgbChannelAdjustment(int adjustR, int adjustG, int adjustB) : + _adjustR(adjustR), + _adjustG(adjustG), + _adjustB(adjustB) +{ + initializeMapping(); +} + +RgbChannelAdjustment::~RgbChannelAdjustment() +{ +} + +uint8_t RgbChannelAdjustment::getadjustmentR() const +{ + return _adjustR; +} + +void RgbChannelAdjustment::setadjustmentR(uint8_t adjustR) +{ + _adjustR = adjustR; + initializeMapping(); +} + +uint8_t RgbChannelAdjustment::getadjustmentG() const +{ + return _adjustG; +} + +void RgbChannelAdjustment::setadjustmentG(uint8_t adjustG) +{ + _adjustG = adjustG; + initializeMapping(); +} + +uint8_t RgbChannelAdjustment::getadjustmentB() const +{ + return _adjustB; +} + +void RgbChannelAdjustment::setadjustmentB(uint8_t adjustB) +{ + _adjustB = adjustB; + initializeMapping(); +} + +uint8_t RgbChannelAdjustment::adjustmentR(uint8_t inputR) const +{ + return _mappingR[inputR]; +} + +uint8_t RgbChannelAdjustment::adjustmentG(uint8_t inputG) const +{ + return _mappingG[inputG]; +} + +uint8_t RgbChannelAdjustment::adjustmentB(uint8_t inputB) const +{ + return _mappingB[inputB]; +} + +void RgbChannelAdjustment::initializeMapping() +{ + // initialize the mapping + for (int i = 0; i < 256; ++i) + { + int outputR = (i * _adjustR) / 255; + if (outputR > 255) + { + outputR = 255; + } + _mappingR[i] = outputR; + } + for (int i = 0; i < 256; ++i) + { + int outputG = (i * _adjustG) / 255; + if (outputG > 255) + { + outputG = 255; + } + _mappingG[i] = outputG; + } + for (int i = 0; i < 256; ++i) + { + int outputB = (i * _adjustB) / 255; + if (outputB > 255) + { + outputB = 255; + } + _mappingB[i] = outputB; + } + + +} diff --git a/src/hyperion-remote/ColorAdjustmentValues.h b/src/hyperion-remote/ColorAdjustmentValues.h new file mode 100644 index 00000000..9aaefc7c --- /dev/null +++ b/src/hyperion-remote/ColorAdjustmentValues.h @@ -0,0 +1,12 @@ +#pragma once + +/// Simple structure to contain the values of a color transformation +struct ColorAdjustmentValues +{ + /// The value for the red color-channel + int valueRed; + /// The value for the green color-channel + int valueGreen; + /// The value for the blue color-channel + int valueBlue; +}; diff --git a/src/hyperion-remote/CustomParameter.h b/src/hyperion-remote/CustomParameter.h index af1836a6..3e7dd826 100644 --- a/src/hyperion-remote/CustomParameter.h +++ b/src/hyperion-remote/CustomParameter.h @@ -13,6 +13,7 @@ // hyperion-remote includes #include "ColorTransformValues.h" #include "ColorCorrectionValues.h" +#include "ColorAdjustmentValues.h" /// Data parameter for a color typedef vlofgren::PODParameter> ColorParameter; @@ -26,6 +27,9 @@ typedef vlofgren::PODParameter TransformParameter; /// Data parameter for color correction values (list of three values) typedef vlofgren::PODParameter CorrectionParameter; +/// Data parameter for color correction values (list of three values) +typedef vlofgren::PODParameter AdjustmentParameter; + namespace vlofgren { /// /// Translates a string (as passed on the commandline) to a vector of colors @@ -161,4 +165,33 @@ namespace vlofgren { return correction; } + + template<> + ColorAdjustmentValues AdjustmentParameter::validate(const std::string& s) throw (Parameter::ParameterRejected) + { + ColorAdjustmentValues adjustment; + + // s should be split in 3 parts + // seperators are either a ',' or a space + QStringList components = QString(s.c_str()).split(" ", QString::SkipEmptyParts); + + if (components.size() == 3) + { + bool ok1, ok2, ok3; + adjustment.valueRed = components[0].toInt(&ok1); + adjustment.valueGreen = components[1].toInt(&ok2); + adjustment.valueBlue = components[2].toInt(&ok3); + + if (ok1 && ok2 && ok3) + { + return adjustment; + } + } + + std::stringstream errorMessage; + errorMessage << "Argument " << s << " can not be parsed to 3 integer values"; + throw Parameter::ParameterRejected(errorMessage.str()); + + return adjustment; + } } diff --git a/src/hyperion-remote/JsonConnection.cpp b/src/hyperion-remote/JsonConnection.cpp index 61367104..16438b7e 100644 --- a/src/hyperion-remote/JsonConnection.cpp +++ b/src/hyperion-remote/JsonConnection.cpp @@ -322,6 +322,51 @@ void JsonConnection::setTemperature(std::string * temperatureId, ColorCorrection parseReply(reply); } +void JsonConnection::setAdjustment(std::string * adjustmentId, ColorAdjustmentValues * redAdjustment, ColorAdjustmentValues * greenAdjustment, ColorAdjustmentValues * blueAdjustment) +{ + std::cout << "Set color adjustments" << std::endl; + + // create command + Json::Value command; + command["command"] = "adjustment"; + Json::Value & adjust = command["adjustment"]; + + if (adjustmentId != nullptr) + { + adjust["id"] = *adjustmentId; + } + + if (redAdjustment != nullptr) + { + Json::Value & v = adjust["redAdjust"]; + v.append(redAdjustment->valueRed); + v.append(redAdjustment->valueGreen); + v.append(redAdjustment->valueBlue); + } + + if (greenAdjustment != nullptr) + { + Json::Value & v = adjust["greenAdjust"]; + v.append(greenAdjustment->valueRed); + v.append(greenAdjustment->valueGreen); + v.append(greenAdjustment->valueBlue); + } + + if (blueAdjustment != nullptr) + { + Json::Value & v = adjust["blueAdjust"]; + v.append(blueAdjustment->valueRed); + v.append(blueAdjustment->valueGreen); + v.append(blueAdjustment->valueBlue); + } + + // send command message + Json::Value reply = sendMessage(command); + + // parse reply message + parseReply(reply); +} + Json::Value JsonConnection::sendMessage(const Json::Value & message) { // serialize message (FastWriter already appends a newline) diff --git a/src/hyperion-remote/JsonConnection.h b/src/hyperion-remote/JsonConnection.h index 48455110..d71ff3a3 100644 --- a/src/hyperion-remote/JsonConnection.h +++ b/src/hyperion-remote/JsonConnection.h @@ -15,6 +15,7 @@ // hyperion-remote includes #include "ColorTransformValues.h" #include "ColorCorrectionValues.h" +#include "ColorAdjustmentValues.h" /// /// Connection class to setup an connection to the hyperion server and execute commands @@ -130,6 +131,21 @@ public: std::string * temperatureId, ColorCorrectionValues * temperature); + /// + /// Set the color adjustment of the leds + /// + /// @note Note that providing a NULL will leave the settings on the server unchanged + /// + /// @param adjustmentId The identifier of the correction to set + /// @param redAdjustment The red channel adjustment values + /// @param greenAdjustment The green channel adjustment values + /// @param blueAdjustment The blue channel adjustment values + void setAdjustment( + std::string * adjustmentId, + ColorAdjustmentValues * redAdjustment, + ColorAdjustmentValues * greenAdjustment, + ColorAdjustmentValues * blueAdjustment); + private: /// /// Send a json command message and receive its reply diff --git a/src/hyperion-remote/hyperion-remote.cpp b/src/hyperion-remote/hyperion-remote.cpp index 2da4ecfa..8686a540 100644 --- a/src/hyperion-remote/hyperion-remote.cpp +++ b/src/hyperion-remote/hyperion-remote.cpp @@ -81,6 +81,10 @@ int main(int argc, char * argv[]) CorrectionParameter & argCorrection = parameters.add('Y', "correction" , "Set the correction of the leds (requires 3 space seperated values between 0 and 255)"); StringParameter & argIdT = parameters.add ('z', "qualifier" , "Identifier(qualifier) of the temperature correction to set"); CorrectionParameter & argTemperature = parameters.add('Z', "temperature" , "Set the temperature correction of the leds (requires 3 space seperated values between 0 and 255)"); + StringParameter & argIdA = parameters.add ('j', "qualifier" , "Identifier(qualifier) of the adjustment to set"); + AdjustmentParameter & argRAdjust = parameters.add('R', "redAdjustment" , "Set the adjustment of the red color (requires 3 space seperated values between 0 and 255)"); + AdjustmentParameter & argGAdjust = parameters.add('G', "greenAdjustment", "Set the adjustment of the green color (requires 3 space seperated values between 0 and 255)"); + AdjustmentParameter & argBAdjust = parameters.add('B', "blueAdjustment", "Set the adjustment of the blue color (requires 3 space seperated values between 0 and 255)"); // set the default values argAddress.setDefault(defaultServerAddress.toStdString()); @@ -100,10 +104,11 @@ int main(int argc, char * argv[]) // check if at least one of the available color transforms is set bool colorTransform = argSaturation.isSet() || argValue.isSet() || argSaturationL.isSet() || argLuminance.isSet() || argThreshold.isSet() || argGamma.isSet() || argBlacklevel.isSet() || argWhitelevel.isSet(); - bool colorModding = colorTransform || argCorrection.isSet() || argTemperature.isSet(); + bool colorAdjust = argRAdjust.isSet() || argGAdjust.isSet() || argBAdjust.isSet(); + bool colorModding = colorTransform || colorAdjust || argCorrection.isSet() || argTemperature.isSet(); // check that exactly one command was given - int commandCount = count({argColor.isSet(), argImage.isSet(), argEffect.isSet(), argServerInfo.isSet(), argClear.isSet(), argClearAll.isSet(), colorModding}); + int commandCount = count({argColor.isSet(), argImage.isSet(), argEffect.isSet(), argServerInfo.isSet(), argClear.isSet(), argClearAll.isSet(), colorModding}); if (commandCount != 1) { std::cerr << (commandCount == 0 ? "No command found." : "Multiple commands found.") << " Provide exactly one of the following options:" << std::endl; @@ -127,6 +132,10 @@ int main(int argc, char * argv[]) std::cerr << " " << argCorrection.usageLine() << std::endl; std::cerr << " " << argIdT.usageLine() << std::endl; std::cerr << " " << argTemperature.usageLine() << std::endl; + std::cerr << " " << argIdA.usageLine() << std::endl; + std::cerr << " " << argRAdjust.usageLine() << std::endl; + std::cerr << " " << argGAdjust.usageLine() << std::endl; + std::cerr << " " << argBAdjust.usageLine() << std::endl; return 1; } @@ -186,6 +195,24 @@ int main(int argc, char * argv[]) argIdT.isSet() ? &tempId : nullptr, argTemperature.isSet() ? &temperature : nullptr); } + + if (colorAdjust) + { + std::string adjustId; + ColorAdjustmentValues redChannel, greenChannel, blueChannel; + + if (argIdA.isSet()) adjustId = argIdA.getValue(); + if (argRAdjust.isSet()) redChannel = argRAdjust.getValue(); + if (argGAdjust.isSet()) greenChannel = argGAdjust.getValue(); + if (argBAdjust.isSet()) blueChannel = argBAdjust.getValue(); + + connection.setAdjustment( + argIdA.isSet() ? &adjustId : nullptr, + argRAdjust.isSet() ? &redChannel : nullptr, + argGAdjust.isSet() ? &greenChannel : nullptr, + argBAdjust.isSet() ? &blueChannel : nullptr); + + } if (colorTransform) { std::string transId; From 02fef83bb8bc9df1f2b41437515ee4f8db68e3bd Mon Sep 17 00:00:00 2001 From: Rick164 Date: Sat, 2 Apr 2016 00:07:28 +0200 Subject: [PATCH 02/14] AtmoOrb smoothing additions * Updated smoothing options for AtmoOrb, can now choose between Orb external or Hyperion's internal smoothing. With skipSmoothingDif you can set the maximum allowed color difference before overriding / clearing Orb smoothing during faster color change like for instance color <-> black. * Updated inline documentation. * Fixed command type typo in AtmoOrb device. * Corrected variable spelling in AtmoOrb device. * Make smoothing also match equal values for AtmoOrb smoothing differential Former-commit-id: 3eede43c2f76fa324f0144aeac0526b8125ad149 --- libsrc/leddevice/LedDeviceAtmoOrb.cpp | 40 +++++++++++++++++---------- libsrc/leddevice/LedDeviceAtmoOrb.h | 23 ++++++++------- libsrc/leddevice/LedDeviceFactory.cpp | 31 +++++++++++---------- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/libsrc/leddevice/LedDeviceAtmoOrb.cpp b/libsrc/leddevice/LedDeviceAtmoOrb.cpp index 4ef3486d..02ea1b62 100644 --- a/libsrc/leddevice/LedDeviceAtmoOrb.cpp +++ b/libsrc/leddevice/LedDeviceAtmoOrb.cpp @@ -15,9 +15,9 @@ AtmoOrbLight::AtmoOrbLight(unsigned int id) { // Not implemented } -LedDeviceAtmoOrb::LedDeviceAtmoOrb(const std::string &output, bool switchOffOnBlack, - int transitiontime, int port, int numLeds, std::vector orbIds) : - multicastGroup(output.c_str()), switchOffOnBlack(switchOffOnBlack), transitiontime(transitiontime), +LedDeviceAtmoOrb::LedDeviceAtmoOrb(const std::string &output, bool useOrbSmoothing, + int transitiontime, int skipSmoothingDiff, int port, int numLeds, std::vector orbIds) : + multicastGroup(output.c_str()), useOrbSmoothing(useOrbSmoothing), transitiontime(transitiontime), skipSmoothingDiff(skipSmoothingDiff), multiCastGroupPort(port), numLeds(numLeds), orbIds(orbIds) { manager = new QNetworkAccessManager(); groupAddress = QHostAddress(multicastGroup); @@ -35,30 +35,40 @@ int LedDeviceAtmoOrb::write(const std::vector &ledValues) { return 0; } + // Command options: + // + // 1 = force off + // 2 = use lamp smoothing and validate by Orb ID + // 4 = validate by Orb ID + + // When setting useOrbSmoothing = true it's recommended to disable Hyperion's own smoothing as it will conflict (double smoothing) + int commandType = 4; + if(useOrbSmoothing) + { + commandType = 2; + } + // Iterate through colors and set Orb color // Start off with idx 1 as 0 is reserved for controlling all orbs at once unsigned int idx = 1; for (const ColorRgb &color : ledValues) { - // Options parameter: - // - // 1 = force off - // 2 = use lamp smoothing and validate by Orb ID - // 4 = validate by Orb ID - // - if (switchOffOnBlack && color.red == 0 && color.green == 0 && color.blue == 0) { - // Force to black + // If color difference is higher than skipSmoothingDiff than we skip Orb smoothing (if enabled) and send it right away + if ((skipSmoothingDiff != 0 && useOrbSmoothing) && (abs(color.red - lastRed) >= skipSmoothingDiff || abs(color.blue - lastBlue) >= skipSmoothingDiff || + abs(color.green - lastGreen) >= skipSmoothingDiff)) + { + // Skip Orb smoothing when using (command type 4) for (unsigned int i = 0; i < orbIds.size(); i++) { if (orbIds[i] == idx) { - setColor(idx, color, 1); + setColor(idx, color, 4); } } } else { - // Default send color + // Send color for (unsigned int i = 0; i < orbIds.size(); i++) { if (orbIds[i] == idx) { - setColor(idx, color, 4); + setColor(idx, color, commandType); } } } @@ -80,7 +90,7 @@ void LedDeviceAtmoOrb::setColor(unsigned int orbId, const ColorRgb &color, int c bytes[2] = 0xEE; // Command type - bytes[3] = 2; + bytes[3] = commandType; // Orb ID bytes[4] = orbId; diff --git a/libsrc/leddevice/LedDeviceAtmoOrb.h b/libsrc/leddevice/LedDeviceAtmoOrb.h index d425b06a..fb3733aa 100644 --- a/libsrc/leddevice/LedDeviceAtmoOrb.h +++ b/libsrc/leddevice/LedDeviceAtmoOrb.h @@ -48,21 +48,21 @@ public: /// /// @param output is the multicast address of Orbs /// - /// @param switchOffOnBlack turn off Orbs on black (default: false) - /// /// @param transitiontime is optional and not used at the moment /// + /// @param useOrbSmoothing use Orbs own (external) smoothing algorithm (default: false) + /// + /// @param skipSmoothingDiff minimal color (0-255) difference to override smoothing so that if current and previously received colors are higher than set dif we override smoothing + /// /// @param port is the multicast port. /// /// @param numLeds is the total amount of leds per Orb /// /// @param array containing orb ids /// - LedDeviceAtmoOrb(const std::string &output, bool switchOffOnBlack = - false, int transitiontime = 0, int port = 49692, int numLeds = 24, - std::vector orbIds = std::vector < unsigned int - - >()); + LedDeviceAtmoOrb(const std::string &output, bool useOrbSmoothing = + false, int transitiontime = 0, int skipSmoothingDiff = 0, int port = 49692, int numLeds = 24, + std::vector orbIds = std::vector < unsigned int>()); /// /// Destructor of this device @@ -87,12 +87,15 @@ private: /// String containing multicast group IP address QString multicastGroup; - /// Switch off when detecting black - bool switchOffOnBlack; + /// use Orbs own (external) smoothing algorithm + bool useOrbSmoothing; /// Transition time between colors (not implemented) int transitiontime; + // Maximum allowed color difference, will skip Orb (external) smoothing once reached + int skipSmoothingDiff; + /// Multicast port to send data to int multiCastGroupPort; @@ -126,4 +129,4 @@ private: /// @param bytes the byte array containing command to send over multicast /// void sendCommand(const QByteArray &bytes); -}; +}; \ No newline at end of file diff --git a/libsrc/leddevice/LedDeviceFactory.cpp b/libsrc/leddevice/LedDeviceFactory.cpp index db53cd58..43e715a5 100755 --- a/libsrc/leddevice/LedDeviceFactory.cpp +++ b/libsrc/leddevice/LedDeviceFactory.cpp @@ -246,35 +246,36 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig) } device = new LedDevicePhilipsHue(output, username, switchOffOnBlack, transitiontime, lightIds); } - else if (type == "atmoorb") - { + else if (type == "atmoorb") + { const std::string output = deviceConfig["output"].asString(); - const bool switchOffOnBlack = deviceConfig.get("switchOffOnBlack", true).asBool(); + const bool useOrbSmoothing = deviceConfig.get("useOrbSmoothing", false).asBool(); const int transitiontime = deviceConfig.get("transitiontime", 1).asInt(); + const int skipSmoothingDiff = deviceConfig.get("skipSmoothingDiff", 0).asInt(); const int port = deviceConfig.get("port", 1).asInt(); const int numLeds = deviceConfig.get("numLeds", 1).asInt(); - const std::string orbId = deviceConfig["orbIds"].asString(); + const std::string orbId = deviceConfig["orbIds"].asString(); std::vector orbIds; // If we find multiple Orb ids separate them and add to list const std::string separator (","); if (orbId.find(separator) != std::string::npos) { - std::stringstream ss(orbId); - std::vector output; - unsigned int i; - while (ss >> i) { - orbIds.push_back(i); - if (ss.peek() == ',' || ss.peek() == ' ') - ss.ignore(); - } + std::stringstream ss(orbId); + std::vector output; + unsigned int i; + while (ss >> i) { + orbIds.push_back(i); + if (ss.peek() == ',' || ss.peek() == ' ') + ss.ignore(); + } } else { - orbIds.push_back(atoi(orbId.c_str())); + orbIds.push_back(atoi(orbId.c_str())); } - device = new LedDeviceAtmoOrb(output, switchOffOnBlack, transitiontime, port, numLeds, orbIds); - } + device = new LedDeviceAtmoOrb(output, useOrbSmoothing, transitiontime, skipSmoothingDiff, port, numLeds, orbIds); + } else if (type == "file") { const std::string output = deviceConfig.get("output", "/dev/null").asString(); From 1d8b529192a5043c51124a661725e86966dbcc25 Mon Sep 17 00:00:00 2001 From: brindosch Date: Sat, 2 Apr 2016 00:41:01 +0200 Subject: [PATCH 03/14] mark deprecated values at hyperion-remote Former-commit-id: b6095d193c3d928f223839967f4debd16bc9eaa7 --- bin/service/hyperion.init.sh | 1 + src/hyperion-remote/hyperion-remote.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/service/hyperion.init.sh b/bin/service/hyperion.init.sh index fbae0156..3cd0723d 100644 --- a/bin/service/hyperion.init.sh +++ b/bin/service/hyperion.init.sh @@ -59,6 +59,7 @@ stop) PID=`cat $PIDFILE` cd $DAEMON_PATH if [ -f $PIDFILE ]; then + hyperion-remote -c black kill -HUP $PID printf "%s\n" "Ok" rm -f $PIDFILE diff --git a/src/hyperion-remote/hyperion-remote.cpp b/src/hyperion-remote/hyperion-remote.cpp index 8686a540..8cbe9e5c 100644 --- a/src/hyperion-remote/hyperion-remote.cpp +++ b/src/hyperion-remote/hyperion-remote.cpp @@ -67,18 +67,18 @@ int main(int argc, char * argv[]) SwitchParameter<> & argClear = parameters.add >('x', "clear" , "Clear data for the priority channel provided by the -p option"); SwitchParameter<> & argClearAll = parameters.add >(0x0, "clearall" , "Clear data for all active priority channels"); StringParameter & argId = parameters.add ('q', "qualifier" , "Identifier(qualifier) of the transform to set"); - DoubleParameter & argSaturation = parameters.add ('s', "saturation", "Set the HSV saturation gain of the leds"); - DoubleParameter & argValue = parameters.add ('v', "value" , "Set the HSV value gain of the leds"); + DoubleParameter & argSaturation = parameters.add ('s', "saturation", "!DEPRECATED! Will be removed soon! Set the HSV saturation gain of the leds"); + DoubleParameter & argValue = parameters.add ('v', "value" , "!DEPRECATED! Will be removed soon! Set the HSV value gain of the leds"); DoubleParameter & argSaturationL = parameters.add ('u', "saturationL", "Set the HSL saturation gain of the leds"); DoubleParameter & argLuminance = parameters.add ('m', "luminance" , "Set the HSL luminance gain of the leds"); TransformParameter & argGamma = parameters.add('g', "gamma" , "Set the gamma of the leds (requires 3 space seperated values)"); TransformParameter & argThreshold = parameters.add('t', "threshold" , "Set the threshold of the leds (requires 3 space seperated values between 0.0 and 1.0)"); - TransformParameter & argBlacklevel = parameters.add('b', "blacklevel", "Set the blacklevel of the leds (requires 3 space seperated values which are normally between 0.0 and 1.0)"); - TransformParameter & argWhitelevel = parameters.add('w', "whitelevel", "Set the whitelevel of the leds (requires 3 space seperated values which are normally between 0.0 and 1.0)"); + TransformParameter & argBlacklevel = parameters.add('b', "blacklevel", "!DEPRECATED! Will be removed soon! Set the blacklevel of the leds (requires 3 space seperated values which are normally between 0.0 and 1.0)"); + TransformParameter & argWhitelevel = parameters.add('w', "whitelevel", "!DEPRECATED! Will be removed soon! Set the whitelevel of the leds (requires 3 space seperated values which are normally between 0.0 and 1.0)"); SwitchParameter<> & argPrint = parameters.add >(0x0, "print" , "Print the json input and output messages on stdout"); SwitchParameter<> & argHelp = parameters.add >('h', "help" , "Show this help message and exit"); - StringParameter & argIdC = parameters.add ('y', "qualifier" , "Identifier(qualifier) of the correction to set"); - CorrectionParameter & argCorrection = parameters.add('Y', "correction" , "Set the correction of the leds (requires 3 space seperated values between 0 and 255)"); + StringParameter & argIdC = parameters.add ('y', "qualifier" , "!DEPRECATED! Will be removed soon! Identifier(qualifier) of the correction to set"); + CorrectionParameter & argCorrection = parameters.add('Y', "correction" , "!DEPRECATED! Will be removed soon! Set the correction of the leds (requires 3 space seperated values between 0 and 255)"); StringParameter & argIdT = parameters.add ('z', "qualifier" , "Identifier(qualifier) of the temperature correction to set"); CorrectionParameter & argTemperature = parameters.add('Z', "temperature" , "Set the temperature correction of the leds (requires 3 space seperated values between 0 and 255)"); StringParameter & argIdA = parameters.add ('j', "qualifier" , "Identifier(qualifier) of the adjustment to set"); From 8111d320e3f1574c7602cc43a6cf9a0622922145 Mon Sep 17 00:00:00 2001 From: brindosch Date: Sat, 2 Apr 2016 01:24:08 +0200 Subject: [PATCH 04/14] extend install-hyperion.sh Former-commit-id: f330c1b9d292529b82541ca7b727ec2269e1e9dc --- bin/install_hyperion.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index 40ae503a..aedafb2c 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -13,6 +13,10 @@ if [ "$1" = "WS281X" ] || [ "$2" = "WS281X" ]; then PWM=1 else PWM=0 fi +if [ "$1" = "USB" ] || [ "$2" = "USB" ]; then + USB=1 +else USB=0 +fi #Check if HyperCon is logged in as root if [ $(id -u) != 0 ] && [ $HCInstall -eq 1 ]; then @@ -231,6 +235,14 @@ elif [ $USE_SYSTEMD -eq 1 ]; then sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service systemctl -q daemon-reload + elif [ $USB -eq 1 ] && [ $OS_OSMC -eq 1 ]; then + echo '---> Modify systemd script for OSMC usage (USB Support)' + # Wait until kodi is sarted (for xbmc checker) and FIX user in case it is wrong (need root for access to USB!)! + sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service + sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service + sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service + sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service + systemctl -q daemon-reload elif [ $OS_OSMC -eq 1 ]; then echo '---> Modify systemd script for OSMC usage' # Wait until kodi is sarted (for xbmc checker) and replace user (for remote control through osmc) From 908612adf85c8f3d25109a697613672f178db3ea Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 3 Apr 2016 00:05:46 +1100 Subject: [PATCH 05/14] init scripts need to send SIGTERM not SIGHUP * Removed -HUP so the default -TERM signal is sent instead. - hyperiond only listens for TERM and INT. HUP is often used to get an exe to reread its config Changed pgrep to add '-x' so it wont partial match on the exe name. - I have multiple instances with multiple hyperiond-instance1 names - this ensures the service script only kills the right process * reversing errant change to hyperion.systemd.sh Former-commit-id: 7df14c9ab31bd808df7f286a8db89de3ac7d18bd --- bin/service/hyperion.init.sh | 5 ++--- bin/service/hyperion.systemd.sh | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/service/hyperion.init.sh b/bin/service/hyperion.init.sh index 3cd0723d..ca3f8d14 100644 --- a/bin/service/hyperion.init.sh +++ b/bin/service/hyperion.init.sh @@ -22,7 +22,7 @@ PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME case "$1" in start) - if [ $(pgrep -l $NAME |wc -l) = 1 ] + if [ $(pgrep -xl $NAME |wc -l) = 1 ] then printf "%-50s\n" "Already running..." exit 1 @@ -59,8 +59,7 @@ stop) PID=`cat $PIDFILE` cd $DAEMON_PATH if [ -f $PIDFILE ]; then - hyperion-remote -c black - kill -HUP $PID + kill $PID printf "%s\n" "Ok" rm -f $PIDFILE else diff --git a/bin/service/hyperion.systemd.sh b/bin/service/hyperion.systemd.sh index 005c0c14..c3c66255 100644 --- a/bin/service/hyperion.systemd.sh +++ b/bin/service/hyperion.systemd.sh @@ -12,4 +12,4 @@ Restart=on-failure TimeoutStopSec=10 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target From e318c9ab196a89149b6ca5cc50893ed255dc7d22 Mon Sep 17 00:00:00 2001 From: brindosch Date: Sat, 9 Apr 2016 17:55:01 +0200 Subject: [PATCH 06/14] openelec logfile support Former-commit-id: 87e4bbddaabdfb89e9843cfc9235dfcdb40bff77 --- bin/install_hyperion.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index aedafb2c..9cf8f8fb 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -207,16 +207,18 @@ if [ $USE_INITCTL -eq 1 ]; then cp -n /opt/hyperion/init.d/hyperion.initctl.sh /etc/init/hyperion.conf 2>/dev/null initctl reload-configuration elif [ $OS_OPENELEC -eq 1 ]; then + #modify all old installs with a logfile output + sed -i 's|/dev/null|/storage/logfiles/hyperion.log|g' /storage/.config/autostart.sh # only add to start script if hyperion is not present yet if [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperiond | wc -l` -eq 0 ]; then echo '---> Adding Hyperion to OpenELEC autostart.sh' - echo "/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /dev/null 2>&1 &" >> /storage/.config/autostart.sh + echo "/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh chmod +x /storage/.config/autostart.sh fi # only add hyperion-x11 to startup, if not found and x32x64 detected if [ $CPU_X32X64 -eq 1 ] && [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperion-x11 | wc -l` -eq 0 ]; then echo '---> Adding Hyperion-x11 to OpenELEC autostart.sh' - echo "DISPLAY=:0.0 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-x11 /dev/null 2>&1 &" >> /storage/.config/autostart.sh + echo "DISPLAY=:0.0 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-x11 /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh fi elif [ $USE_SYSTEMD -eq 1 ]; then echo '---> Installing systemd script' @@ -275,7 +277,7 @@ fi #Hint for the user with path to config if [ $OS_OPENELEC -eq 1 ];then HINTMESSAGE="echo Path to your configuration -> /storage/.config/hyperion.config.json" -else HINTMESSAGE="echo Path to your configuration -> /etc/hyperion.config.json" +else HINTMESSAGE="echo Path to your configuration -> /opt/hyperion/config/hyperion.config.json" fi echo '*******************************************************************************' echo 'Hyperion Installation/Update finished!' From d4dda2dcc484ed97c67efecbc0376af5a49862ff Mon Sep 17 00:00:00 2001 From: Rick164 Date: Thu, 21 Apr 2016 14:51:43 +0200 Subject: [PATCH 07/14] AtmoOrb LedDevice now only processes new color commands and skips identical, saves last send color per light id separately in Qmap. (#602) Former-commit-id: 38873e5b718c73d95111abcb10cf148f6a6ab18b --- libsrc/leddevice/LedDeviceAtmoOrb.cpp | 17 +++++++++++++++++ libsrc/leddevice/LedDeviceAtmoOrb.h | 8 ++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/libsrc/leddevice/LedDeviceAtmoOrb.cpp b/libsrc/leddevice/LedDeviceAtmoOrb.cpp index 02ea1b62..8ad5f349 100644 --- a/libsrc/leddevice/LedDeviceAtmoOrb.cpp +++ b/libsrc/leddevice/LedDeviceAtmoOrb.cpp @@ -51,7 +51,18 @@ int LedDeviceAtmoOrb::write(const std::vector &ledValues) { // Iterate through colors and set Orb color // Start off with idx 1 as 0 is reserved for controlling all orbs at once unsigned int idx = 1; + for (const ColorRgb &color : ledValues) { + // Retrieve last send colors + int lastRed = lastColorRedMap[idx]; + int lastGreen = lastColorGreenMap[idx]; + int lastBlue = lastColorBlueMap[idx]; + + // If last colors send are identical than last send return + if(lastRed == color.red && lastGreen == color.green && lastBlue == color.blue) + { + return 0; + } // If color difference is higher than skipSmoothingDiff than we skip Orb smoothing (if enabled) and send it right away if ((skipSmoothingDiff != 0 && useOrbSmoothing) && (abs(color.red - lastRed) >= skipSmoothingDiff || abs(color.blue - lastBlue) >= skipSmoothingDiff || @@ -73,9 +84,15 @@ int LedDeviceAtmoOrb::write(const std::vector &ledValues) { } } + // Store last colors send for light id + lastColorRedMap[idx] = color.red; + lastColorGreenMap[idx] = color.green; + lastColorBlueMap[idx] = color.blue; + // Next light id. idx++; } + return 0; } diff --git a/libsrc/leddevice/LedDeviceAtmoOrb.h b/libsrc/leddevice/LedDeviceAtmoOrb.h index fb3733aa..8c697af2 100644 --- a/libsrc/leddevice/LedDeviceAtmoOrb.h +++ b/libsrc/leddevice/LedDeviceAtmoOrb.h @@ -35,10 +35,10 @@ public: class LedDeviceAtmoOrb : public QObject, public LedDevice { Q_OBJECT public: - // Last color sent - int lastRed; - int lastGreen; - int lastBlue; + // Last send color map + QMap lastColorRedMap; + QMap lastColorGreenMap; + QMap lastColorBlueMap; // Multicast status bool joinedMulticastgroup; From bb9b02cf05a658eb4fcab23196d548e3a422f4ea Mon Sep 17 00:00:00 2001 From: Paulchen-Panther Date: Sun, 24 Apr 2016 17:07:31 +0200 Subject: [PATCH 08/14] get current state (active Effects) over JSON Interface (#608) * Create ActiveEffectDefinition.h * Update EffectEngine.h * Update Hyperion.h * Update Effect.h * Update EffectEngine.cpp * Update Hyperion.cpp * Update JsonClientConnection.cpp Former-commit-id: 5664b69da6893dd0d0de0e7c74c01cdcafd57310 --- include/effectengine/ActiveEffectDefinition.h | 15 +++++++++++++++ include/effectengine/EffectEngine.h | 5 +++++ include/hyperion/Hyperion.h | 5 +++++ libsrc/effectengine/Effect.h | 6 ++++++ libsrc/effectengine/EffectEngine.cpp | 17 +++++++++++++++++ libsrc/hyperion/Hyperion.cpp | 5 +++++ libsrc/jsonserver/JsonClientConnection.cpp | 14 ++++++++++++++ 7 files changed, 67 insertions(+) create mode 100644 include/effectengine/ActiveEffectDefinition.h diff --git a/include/effectengine/ActiveEffectDefinition.h b/include/effectengine/ActiveEffectDefinition.h new file mode 100644 index 00000000..345b226f --- /dev/null +++ b/include/effectengine/ActiveEffectDefinition.h @@ -0,0 +1,15 @@ +#pragma once + +// stl include +#include + +// json include +#include + +struct ActiveEffectDefinition +{ + std::string script; + int priority; + int timeout; + Json::Value args; +}; diff --git a/include/effectengine/EffectEngine.h b/include/effectengine/EffectEngine.h index c40732a1..7acb1eea 100644 --- a/include/effectengine/EffectEngine.h +++ b/include/effectengine/EffectEngine.h @@ -11,6 +11,7 @@ // Effect engine includes #include +#include // pre-declarioation class Effect; @@ -25,6 +26,8 @@ public: virtual ~EffectEngine(); const std::list & getEffects() const; + + const std::list & getActiveEffects(); static bool loadEffectDefinition(const std::string & path, const std::string & effectConfigFile, EffectDefinition &effectDefinition); @@ -54,6 +57,8 @@ private: std::list _availableEffects; std::list _activeEffects; + + std::list _availableActiveEffects; PyThreadState * _mainThreadState; }; diff --git a/include/hyperion/Hyperion.h b/include/hyperion/Hyperion.h index 57440cf9..aaf5bb87 100644 --- a/include/hyperion/Hyperion.h +++ b/include/hyperion/Hyperion.h @@ -20,6 +20,7 @@ // Effect engine includes #include +#include // Forward class declaration class LedDevice; @@ -99,6 +100,10 @@ public: /// Get the list of available effects /// @return The list of available effects const std::list &getEffects() const; + + /// Get the list of active effects + /// @return The list of active effects + const std::list &getActiveEffects(); public slots: /// diff --git a/libsrc/effectengine/Effect.h b/libsrc/effectengine/Effect.h index 8540d507..0ef49315 100644 --- a/libsrc/effectengine/Effect.h +++ b/libsrc/effectengine/Effect.h @@ -20,6 +20,12 @@ public: virtual void run(); int getPriority() const; + + std::string getScript() const { return _script; } + + int getTimeout() const {return _timeout; } + + Json::Value getArgs() const { return _args; } bool isAbortRequested() const; diff --git a/libsrc/effectengine/EffectEngine.cpp b/libsrc/effectengine/EffectEngine.cpp index f95e1822..97492a85 100644 --- a/libsrc/effectengine/EffectEngine.cpp +++ b/libsrc/effectengine/EffectEngine.cpp @@ -73,6 +73,23 @@ const std::list &EffectEngine::getEffects() const return _availableEffects; } +const std::list &EffectEngine::getActiveEffects() +{ + _availableActiveEffects.clear(); + + for (Effect * effect : _activeEffects) + { + ActiveEffectDefinition activeEffectDefinition; + activeEffectDefinition.script = effect->getScript(); + activeEffectDefinition.priority = effect->getPriority(); + activeEffectDefinition.timeout = effect->getTimeout(); + activeEffectDefinition.args = effect->getArgs(); + _availableActiveEffects.push_back(activeEffectDefinition); + } + + return _availableActiveEffects; +} + bool EffectEngine::loadEffectDefinition(const std::string &path, const std::string &effectConfigFile, EffectDefinition & effectDefinition) { #ifdef ENABLE_QT5 diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index a5a85ff4..45a2d322 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -833,6 +833,11 @@ const std::list & Hyperion::getEffects() const return _effectEngine->getEffects(); } +const std::list & Hyperion::getActiveEffects() +{ + return _effectEngine->getActiveEffects(); +} + int Hyperion::setEffect(const std::string &effectName, int priority, int timeout) { return _effectEngine->runEffect(effectName, priority, timeout); diff --git a/libsrc/jsonserver/JsonClientConnection.cpp b/libsrc/jsonserver/JsonClientConnection.cpp index 62346623..34819367 100644 --- a/libsrc/jsonserver/JsonClientConnection.cpp +++ b/libsrc/jsonserver/JsonClientConnection.cpp @@ -514,6 +514,20 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &) effects.append(effect); } + + // collect active effect info + Json::Value & activeEffects = info["activeEffects"] = Json::Value(Json::arrayValue); + const std::list & activeEffectsDefinitions = _hyperion->getActiveEffects(); + for (const ActiveEffectDefinition & activeEffectDefinition : activeEffectsDefinitions) + { + Json::Value activeEffect; + activeEffect["script"] = activeEffectDefinition.script; + activeEffect["priority"] = activeEffectDefinition.priority; + activeEffect["timeout"] = activeEffectDefinition.timeout; + activeEffect["args"] = activeEffectDefinition.args; + + activeEffects.append(activeEffect); + } // send the result sendMessage(result); From fc59df9976bc62270eee427e1b5e68e3ee41ba24 Mon Sep 17 00:00:00 2001 From: brindosch Date: Tue, 26 Apr 2016 12:27:59 +0200 Subject: [PATCH 09/14] preperation for next release and cleanup Former-commit-id: dc829ea7671584d4aaf982cadba329998a824593 --- ISSUE_TEMPLATE | 13 +- PULL_REQUEST_TEMPLATE | 2 + README.md | 6 +- bin/create_all_releases.sh | 10 +- bin/install_hyperion.sh | 117 ++--- bin/remove_hyperion.sh | 25 +- bin/scripts/install_hyperion_beta.sh | 288 +++++++++++ bin/service/hyperion.init.sh | 2 +- bin/service/hyperion.initctl.sh | 2 +- bin/service/hyperion.systemd.sh | 2 +- config/hyperion.config.json | 133 +++-- config/hyperion_x86.config.json | 453 ------------------ ...mingboard_prerelease.tar.gz.REMOVED.git-id | 1 - ...n.deps.openelec-imx6.tar.gz.REMOVED.git-id | 1 - ...on.deps.openelec-rpi.tar.gz.REMOVED.git-id | 1 - ...deps.openelec-x32x64.tar.gz.REMOVED.git-id | 1 - deploy/hyperion_imx6.tar.gz.REMOVED.git-id | 1 - deploy/hyperion_rpi.tar.gz.REMOVED.git-id | 1 - deploy/hyperion_wetek.tar.gz.REMOVED.git-id | 1 - deploy/hyperion_x32x64.tar.gz.REMOVED.git-id | 1 - doc/calibration/Gamma/000000.png | Bin 6159 -> 0 bytes doc/calibration/Gamma/3F3F3F.png | Bin 10670 -> 0 bytes doc/calibration/Gamma/7F7F7F.png | Bin 10669 -> 0 bytes doc/calibration/Gamma/BFBFBF.png | Bin 10670 -> 0 bytes doc/calibration/Gamma/FFFFFF.png | Bin 8642 -> 0 bytes doc/calibration/Gamma/HGradient_1.png | Bin 10866 -> 0 bytes doc/calibration/Gamma/HGradient_2.png | Bin 10862 -> 0 bytes doc/calibration/Gamma/VGradient_1.png | Bin 12174 -> 0 bytes doc/calibration/Gamma/VGradient_2.png | Bin 12032 -> 0 bytes doc/calibration/RGB/blue_00007F.png | Bin 10668 -> 0 bytes doc/calibration/RGB/blue_0000FF.png | Bin 8642 -> 0 bytes doc/calibration/RGB/cyan_007F7F.png | Bin 10668 -> 0 bytes doc/calibration/RGB/cyan_00FFFF.png | Bin 8642 -> 0 bytes doc/calibration/RGB/green_007F00.png | Bin 10668 -> 0 bytes doc/calibration/RGB/green_00FF00.png | Bin 8641 -> 0 bytes doc/calibration/RGB/magenta_7F007F.png | Bin 10668 -> 0 bytes doc/calibration/RGB/magenta_FF00FF.png | Bin 8642 -> 0 bytes doc/calibration/RGB/red_7F0000.png | Bin 10668 -> 0 bytes doc/calibration/RGB/red_FF0000.png | Bin 8641 -> 0 bytes doc/calibration/RGB/yellow_7F7F00.png | Bin 10668 -> 0 bytes doc/calibration/RGB/yellow_FFFF00.png | Bin 7964 -> 0 bytes 41 files changed, 438 insertions(+), 623 deletions(-) create mode 100644 bin/scripts/install_hyperion_beta.sh delete mode 100644 config/hyperion_x86.config.json delete mode 100644 deploy/hummingboard_prerelease.tar.gz.REMOVED.git-id delete mode 100644 deploy/hyperion.deps.openelec-imx6.tar.gz.REMOVED.git-id delete mode 100644 deploy/hyperion.deps.openelec-rpi.tar.gz.REMOVED.git-id delete mode 100644 deploy/hyperion.deps.openelec-x32x64.tar.gz.REMOVED.git-id delete mode 100644 deploy/hyperion_imx6.tar.gz.REMOVED.git-id delete mode 100644 deploy/hyperion_rpi.tar.gz.REMOVED.git-id delete mode 100644 deploy/hyperion_wetek.tar.gz.REMOVED.git-id delete mode 100644 deploy/hyperion_x32x64.tar.gz.REMOVED.git-id delete mode 100644 doc/calibration/Gamma/000000.png delete mode 100644 doc/calibration/Gamma/3F3F3F.png delete mode 100644 doc/calibration/Gamma/7F7F7F.png delete mode 100644 doc/calibration/Gamma/BFBFBF.png delete mode 100644 doc/calibration/Gamma/FFFFFF.png delete mode 100644 doc/calibration/Gamma/HGradient_1.png delete mode 100644 doc/calibration/Gamma/HGradient_2.png delete mode 100644 doc/calibration/Gamma/VGradient_1.png delete mode 100644 doc/calibration/Gamma/VGradient_2.png delete mode 100644 doc/calibration/RGB/blue_00007F.png delete mode 100644 doc/calibration/RGB/blue_0000FF.png delete mode 100644 doc/calibration/RGB/cyan_007F7F.png delete mode 100644 doc/calibration/RGB/cyan_00FFFF.png delete mode 100644 doc/calibration/RGB/green_007F00.png delete mode 100644 doc/calibration/RGB/green_00FF00.png delete mode 100644 doc/calibration/RGB/magenta_7F007F.png delete mode 100644 doc/calibration/RGB/magenta_FF00FF.png delete mode 100644 doc/calibration/RGB/red_7F0000.png delete mode 100644 doc/calibration/RGB/red_FF0000.png delete mode 100644 doc/calibration/RGB/yellow_7F7F00.png delete mode 100644 doc/calibration/RGB/yellow_FFFF00.png diff --git a/ISSUE_TEMPLATE b/ISSUE_TEMPLATE index e8f12f0a..b43a2f97 100644 --- a/ISSUE_TEMPLATE +++ b/ISSUE_TEMPLATE @@ -1,8 +1,9 @@ -**Please provide some information that we could help as fast as possible. -Please check the wiki in case your problem is already known/feature requested.** +BEFORE YOU OPEN A NEW ISSUE! -**1.** Used hardware and sofware (Wetek,RPi1,Rpi2,... Ubuntu 14.04(64bit),OSX,OpenELEC,OSMC,XBian,...) -**2.** Your LED device and additional hardware (if used) (WS2801,APA102,WS2812B,... connected through (direct,arduino uno,...)) -**3.** Please upload your Hyperion log to pastebin.com and insert the link. Have a look at the wiki how you get one. -**4.** Please upload your "Hyperion Configuration File" to pastebin.com and insert the link. +Search at our wiki: wiki.hyperion-project.org +Our FAQ: https://hyperion-project.org/wiki/FAQ-Frequently-Asked-Questions +And have a look at our forum: forum.hyperion-project.org +If you need help please open a new thread their! +WE PROVIDE NO SUPPORT AT GITHUB! +All misleading issues will be closed without a announcement! diff --git a/PULL_REQUEST_TEMPLATE b/PULL_REQUEST_TEMPLATE index 747a065c..8e947083 100644 --- a/PULL_REQUEST_TEMPLATE +++ b/PULL_REQUEST_TEMPLATE @@ -3,3 +3,5 @@ IMPORTANT: Please don´t commit to master, we will test your changes first at th **2.** If this changes affect the .conf file. Please provide the changed section **3.** Reference a issue (optional) +Note: For further discussions use our forum: forum.hyperion-project.org + diff --git a/README.md b/README.md index 0e1a5cb7..e8ead57c 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ HYPERION ======== -Hyperion is an opensource 'AmbiLight' implementation controlled using the RaspBerry Pi running [Raspbmc](http://www.raspbmc.com). The main features of Hyperion are: +Hyperion is an opensource 'AmbiLight' implementation supported by many devices. The main features of Hyperion are: * Low CPU load. For a led string of 50 leds the CPU usage will typically be below 1.5% on a non-overclocked Pi. * Json interface which allows easy integration into scripts. * A command line utility allows easy testing and configuration of the color transforms (Transformation settings are not preserved over a restart at the moment...). * Priority channels are not coupled to a specific led data provider which means that a provider can post led data and leave without the need to maintain a connection to Hyperion. This is ideal for a remote application (like our Android app). * HyperCon. A tool which helps generate a Hyperion configuration file. -* XBMC-checker which checks the playing status of XBMC and decides whether or not to capture the screen. +* Kodi-checker which checks the playing status of Kodi and decides whether or not to capture the screen. * Black border detector. * A scriptable effect engine. * Generic software architecture to support new devices and new algorithms easily. -More information can be found on the [wiki](https://github.com/tvdzwan/hyperion/wiki) or the [Hyperion topic](http://forum.stmlabs.com/showthread.php?tid=11053) on the Raspbmc forum. +More information can be found on the [wiki](wiki.hyperion-project.org) or the [Hyperion webpage/forum](www.hyperion-project.org). The source is released under MIT-License (see http://opensource.org/licenses/MIT). diff --git a/bin/create_all_releases.sh b/bin/create_all_releases.sh index 9f969cef..b3e5579a 100644 --- a/bin/create_all_releases.sh +++ b/bin/create_all_releases.sh @@ -1,8 +1,8 @@ #!/bin/sh # create all directly for release with -DCMAKE_BUILD_TYPE=Release -Wno-dev # Create the x64 build -mkdir build-x32x64 -cd build-x32x64 +mkdir build-x86x64 +cd build-x86x64 cmake -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. make -j 4 cd .. @@ -17,14 +17,14 @@ cd .. # Create the RPI build mkdir build-rpi cd build-rpi -cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x32x64/protoc_export.cmake -DENABLE_WS2812BPWM=ON -DENABLE_WS281XPWM=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. +cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake -DENABLE_WS2812BPWM=ON -DENABLE_WS281XPWM=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. make -j 4 cd .. # Create the WETEK build mkdir build-wetek cd build-wetek -cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x32x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON -DENABLE_AMLOGIC=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. +cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x86x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON -DENABLE_AMLOGIC=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. make -j 4 cd .. @@ -35,7 +35,7 @@ cd .. #make -j 4 #cd .. -bin/create_release.sh . x32x64 +bin/create_release.sh . x86x64 #bin/create_release.sh . x32 bin/create_release.sh . rpi bin/create_release.sh . wetek diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index 9cf8f8fb..2d657caf 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -9,14 +9,6 @@ if [ "$1" = "HyperConInstall" ] || [ "$2" = "HyperConInstall" ]; then HCInstall=1 else HCInstall=0 fi -if [ "$1" = "WS281X" ] || [ "$2" = "WS281X" ]; then - PWM=1 -else PWM=0 -fi -if [ "$1" = "USB" ] || [ "$2" = "USB" ]; then - USB=1 -else USB=0 -fi #Check if HyperCon is logged in as root if [ $(id -u) != 0 ] && [ $HCInstall -eq 1 ]; then @@ -34,24 +26,30 @@ fi #Welcome message echo '*******************************************************************************' echo 'This script will install/update Hyperion and it´s services' -echo 'Version 0.1' +echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.' echo '*******************************************************************************' -# Find out if we are on OpenElec / OSMC +# Find out if we are on OpenElec / OSMC / Raspbian OS_OPENELEC=`grep -m1 -c OpenELEC /etc/issue` OS_OSMC=`grep -m1 -c OSMC /etc/issue` +OS_RASPBIAN=`grep -m1 -c 'Raspbian\|RetroPie' /etc/issue` -# Find out if its an imx6 device +# Find out which device this script runs on CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710' /proc/cpuinfo` CPU_IMX6=`grep -m1 -c i.MX6 /proc/cpuinfo` CPU_WETEK=`grep -m1 -c Amlogic /proc/cpuinfo` CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l` -#CPU_X32=`uname -m | grep 'x86_32\|i686' | wc -l` # Check that we have a known configuration if [ $CPU_RPI -ne 1 ] && [ $CPU_IMX6 -ne 1 ] && [ $CPU_WETEK -ne 1 ] && [ $CPU_X32X64 -ne 1 ]; then echo '---> Critical Error: CPU information does not match any known releases -> abort' exit 1 fi + +#Check which RPi we are one (in case) +RPI_1=`grep -m1 -c BCM2708 /proc/cpuinfo` +RPI_2=`grep -m1 -c BCM2709 /proc/cpuinfo` +RPI_3=`grep -m1 -c BCM2710 /proc/cpuinfo` + #Check, if year equals 1970 DATE=$(date +"%Y") if [ "$DATE" -le "2015" ]; then @@ -67,7 +65,7 @@ USE_SERVICE=`which /usr/sbin/service | wc -l` # Make sure that the boblight daemon is no longer running BOBLIGHT_PROCNR=$(pidof boblightd | wc -l) if [ $BOBLIGHT_PROCNR -eq 1 ]; then - echo '---> Critical Error: Found running instance of boblight. Please stop boblight via XBMC menu before installing hyperion -> abort' + echo '---> Critical Error: Found running instance of boblight. Please stop boblight via Kodi menu before installing hyperion -> abort' exit 1 fi @@ -92,7 +90,7 @@ if [ $OS_OPENELEC -ne 1 ]; then fi #Check, if dtparam=spi=on is in place (not for OPENELEC) -if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then +if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then SPIOK=`grep '^\dtparam=spi=on' /boot/config.txt | wc -l` if [ $SPIOK -ne 1 ]; then echo '---> Raspberry Pi found, but SPI is not ready, we write "dtparam=spi=on" to /boot/config.txt' @@ -102,7 +100,7 @@ if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then fi #Check, if dtparam=spi=on is in place (just for OPENELEC) -if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then +if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then SPIOK=`grep '^\dtparam=spi=on' /flash/config.txt | wc -l` if [ $SPIOK -ne 1 ]; then mount -o remount,rw /flash @@ -113,27 +111,6 @@ if [ $PWM -ne 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then fi fi -#Check, if dtoverlay=pwm is in place (not for OPENELEC) -#if [ $PWM -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then -# PWMOK=`grep '^\dtoverlay=pwm' /boot/config.txt | wc -l` -# if [ $PWMOK -ne 1 ]; then -# echo '---> Raspberry Pi found, but PWM is not ready, we write "dtoverlay=pwm" to /boot/config.txt' -# sed -i '$a dtoverlay=pwm' /boot/config.txt -# PWMREBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtoverlay=pwm to /boot/config.txt" -# fi -#fi - -#Check, if dtoverlay=pwm is in place (just for OPENELEC) -if [ $PWM -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then - PWMOK=`grep '^\dtoverlay=pwm' /flash/config.txt | wc -l` - if [ $PWMOK -ne 1 ]; then - mount -o remount,rw /flash - echo '---> Raspberry Pi with OpenELEC found, but PWM is not ready, we write "dtoverlay=pwm" to /flash/config.txt' - sed -i '$a dtoverlay=pwm' /flash/config.txt - mount -o remount,ro /flash - PWMREBOOTMESSAGE="echo Please reboot your OpenELEC, we inserted dtoverlay=pwm to /flash/config.txt" - fi -fi #Backup the .conf files, if present echo '---> Backup Hyperion configuration(s), if present' rm -f /tmp/*.json 2>/dev/null @@ -143,10 +120,22 @@ else cp -v /opt/hyperion/config/*.json /tmp 2>/dev/null fi # Select the appropriate release -HYPERION_ADDRESS=https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy -if [ $CPU_RPI -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz +HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/release +if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_oe.tar.gz OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_oe.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_3 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_oe.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $RPI_1 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $RPI_2 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $RPI_3 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3.tar.gz elif [ $CPU_IMX6 -eq 1 ]; then HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_imx6.tar.gz OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-imx6.tar.gz @@ -154,11 +143,8 @@ elif [ $CPU_WETEK -eq 1 ]; then HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_wetek.tar.gz OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz elif [ $CPU_X32X64 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x32x64.tar.gz - OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x32x64.tar.gz -#elif [ $CPU_X32 -eq 1 ]; then -# HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x32.tar.gz -# OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x32x64.tar.gz + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x86x64.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x86x64.tar.gz else echo "---> Critical Error: Target platform unknown -> abort" exit 1 @@ -189,9 +175,6 @@ else ln -fs /opt/hyperion/bin/hyperion-v4l2 /usr/bin/hyperion-v4l2 ln -fs /opt/hyperion/bin/hyperion-dispmanx /usr/bin/hyperion-dispmanx 2>/dev/null ln -fs /opt/hyperion/bin/hyperion-x11 /usr/bin/hyperion-x11 2>/dev/null - -# Copy a link to the hyperion configuration file to /etc (-s for people who replaced the symlink with their config) - ln -s /opt/hyperion/config/hyperion.config.json /etc/hyperion.config.json 2>/dev/null fi # Restore backup of .conf files, if present @@ -229,29 +212,13 @@ elif [ $USE_SYSTEMD -eq 1 ]; then rm /etc/init.d/hyperion 2>/dev/null cp -n /opt/hyperion/init.d/hyperion.systemd.sh /etc/systemd/system/hyperion.service systemctl -q enable hyperion.service - if [ $PWM -eq 1 ] && [ $OS_OSMC -eq 1 ]; then - echo '---> Modify systemd script for OSMC usage (PWM Support)' - # Wait until kodi is sarted (for xbmc checker) and FIX user in case it is wrong (need root for access to pwm!)! - sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service - sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service - sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service - sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service - systemctl -q daemon-reload - elif [ $USB -eq 1 ] && [ $OS_OSMC -eq 1 ]; then - echo '---> Modify systemd script for OSMC usage (USB Support)' - # Wait until kodi is sarted (for xbmc checker) and FIX user in case it is wrong (need root for access to USB!)! - sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service - sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service - sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service - sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service - systemctl -q daemon-reload - elif [ $OS_OSMC -eq 1 ]; then + if [ $OS_OSMC -eq 1 ]; then echo '---> Modify systemd script for OSMC usage' - # Wait until kodi is sarted (for xbmc checker) and replace user (for remote control through osmc) + # Wait until kodi is sarted (for kodi checker) sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service - sed -i 's/User=root/User=osmc/g' /etc/systemd/system/hyperion.service - sed -i 's/Group=root/Group=osmc/g' /etc/systemd/system/hyperion.service + sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service + sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service systemctl -q daemon-reload fi elif [ $USE_SERVICE -eq 1 ]; then @@ -262,10 +229,17 @@ elif [ $USE_SERVICE -eq 1 ]; then update-rc.d hyperion defaults 98 02 fi +#chown the /config/ dir and all configs inside for hypercon config upload for non-root logins +if [ $OS_OSMC -eq 1 ]; then + chown -R osmc:osmc /opt/hyperion/config +elif [ $OS_RASPBIAN -eq 1 ]; then + chown -R pi:pi /opt/hyperion/config +fi + # Start the hyperion daemon echo '---> Starting Hyperion' if [ $OS_OPENELEC -eq 1 ]; then - /storage/.config/autostart.sh + /storage/.config/autostart.sh > /dev/null 2>&1 & elif [ $USE_INITCTL -eq 1 ]; then /sbin/initctl start hyperion elif [ $USE_SERVICE -eq 1 ]; then @@ -285,16 +259,15 @@ echo 'Please get a new HyperCon version to benefit from the latest features!' echo 'Create a new config file, if you encounter problems!' $HINTMESSAGE $REBOOTMESSAGE -$PWMREBOOTMESSAGE echo '*******************************************************************************' ## Force reboot and prevent prompt if spi is added during a HyperCon Install -if ( [ "$HCInstall" = "1" ] && [ "$CPU_RPI" = "1" ] ) && ( [ "$SPIOK" = "0" ] || [ "$PWMOK" = "0" ] ); then - echo "Rebooting now, we added dtparam=spi=on and/or dtoverlay=pwm to config.txt" +if [ $HCInstall -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then + echo "Rebooting now, we added dtparam=spi=on to config.txt" reboot exit 0 fi #Prompt for reboot, if spi added to config.txt -if ( [ "$CPU_RPI" = "1" ] ) && ( [ "$SPIOK" = "0" ] || [ "$PWMOK" = "0" ] ); then +if [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then while true do echo -n "---> Do you want to reboot your Raspberry Pi now? (y or n) :" diff --git a/bin/remove_hyperion.sh b/bin/remove_hyperion.sh index 8ce5fd38..fafd0f99 100644 --- a/bin/remove_hyperion.sh +++ b/bin/remove_hyperion.sh @@ -21,6 +21,7 @@ fi echo '*******************************************************************************' echo 'This script will remove Hyperion and it´s services' echo '-----> Please BACKUP your hyperion.config.json if necessary <-----' +echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.' echo '*******************************************************************************' #Skip the prompt if HyperCon Remove @@ -49,6 +50,9 @@ USE_SYSTEMD=`grep -m1 -c systemd /proc/1/comm` USE_INITCTL=`which /sbin/initctl | wc -l` USE_SERVICE=`which /usr/sbin/service | wc -l` +# set count for forwarder +SERVICEC=1 + # Stop hyperion daemon if it is running echo '---> Stop Hyperion, if necessary' if [ $OS_OPENELEC -eq 1 ]; then @@ -59,12 +63,19 @@ elif [ $USE_SERVICE -eq 1 ]; then /usr/sbin/service hyperion stop 2>/dev/null elif [ $USE_SYSTEMD -eq 1 ]; then service hyperion stop 2>/dev/null + while [ $SERVICEC -le 20 ]; do + service hyperion_fw$SERVICEC stop 2>/dev/null + ((SERVICEC++)) + done fi +#reset count +SERVICEC=`which /usr/sbin/service | wc -l` + #Disabling and delete service files if [ $USE_INITCTL -eq 1 ]; then echo '---> Delete and disable Hyperion initctl script' - rm -v /etc/init/hyperion.conf 2>/dev/null + rm -v /etc/init/hyperion* 2>/dev/null initctl reload-configuration elif [ $OS_OPENELEC -eq 1 ]; then # Remove Hyperion from OpenELEC autostart.sh @@ -75,12 +86,20 @@ elif [ $USE_SYSTEMD -eq 1 ]; then # Delete and disable Hyperion systemd script echo '---> Delete and disable Hyperion systemd script' systemctl disable hyperion.service - rm -v /etc/systemd/system/hyperion.service 2>/dev/null + while [ $SERVICEC -le 20 ]; do + systemctl -q disable hyperion_fw$SERVICEC.service 2>/dev/null + ((SERVICEC++)) + done + rm -v /etc/systemd/system/hyperion* 2>/dev/null elif [ $USE_SERVICE -eq 1 ]; then # Delete and disable Hyperion init.d script echo '---> Delete and disable Hyperion init.d script' update-rc.d -f hyperion remove - rm /etc/init.d/hyperion 2>/dev/null + while [ $SERVICEC -le 20 ]; do + update-rc.d -f hyperion_fw$SERVICEC remove 2>/dev/null + ((SERVICEC++)) + done + rm /etc/init.d/hyperion* 2>/dev/null fi # Delete Hyperion binaries diff --git a/bin/scripts/install_hyperion_beta.sh b/bin/scripts/install_hyperion_beta.sh new file mode 100644 index 00000000..d67c4419 --- /dev/null +++ b/bin/scripts/install_hyperion_beta.sh @@ -0,0 +1,288 @@ +#!/bin/sh +# Script for downloading and installing the latest Hyperion release + +# Make sure /sbin is on the path (for service to find sub scripts) +PATH="/sbin:$PATH" + +#Check which arguments are used +if [ "$1" = "HyperConInstall" ] || [ "$2" = "HyperConInstall" ]; then + HCInstall=1 +else HCInstall=0 +fi + +#Check if HyperCon is logged in as root +if [ $(id -u) != 0 ] && [ $HCInstall -eq 1 ]; then + echo '---> Critical Error: Please connect as user "root" through HyperCon' + echo '---> We need admin privileges to install/update your Hyperion! -> abort' + exit 1 +fi + +#Check, if script is running as root +if [ $(id -u) != 0 ]; then + echo '---> Critical Error: Please run the script as root (sudo sh ./install_hyperion.sh) -> abort' + exit 1 +fi + +#Welcome message +echo '*******************************************************************************' +echo 'This script will install/update Hyperion and it´s services' +echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.' +echo '*******************************************************************************' + +# Find out if we are on OpenElec / OSMC / Raspbian +OS_OPENELEC=`grep -m1 -c OpenELEC /etc/issue` +OS_OSMC=`grep -m1 -c OSMC /etc/issue` +OS_RASPBIAN=`grep -m1 -c 'Raspbian\|RetroPie' /etc/issue` + +# Find out which device this script runs on +CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710' /proc/cpuinfo` +CPU_IMX6=`grep -m1 -c i.MX6 /proc/cpuinfo` +CPU_WETEK=`grep -m1 -c Amlogic /proc/cpuinfo` +CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l` +# Check that we have a known configuration +if [ $CPU_RPI -ne 1 ] && [ $CPU_IMX6 -ne 1 ] && [ $CPU_WETEK -ne 1 ] && [ $CPU_X32X64 -ne 1 ]; then + echo '---> Critical Error: CPU information does not match any known releases -> abort' + exit 1 +fi + +#Check which RPi we are one (in case) +RPI_1=`grep -m1 -c BCM2708 /proc/cpuinfo` +RPI_2=`grep -m1 -c BCM2709 /proc/cpuinfo` +RPI_3=`grep -m1 -c BCM2710 /proc/cpuinfo` + +#Check, if year equals 1970 +DATE=$(date +"%Y") +if [ "$DATE" -le "2015" ]; then + echo "---> Critical Error: Please update your systemtime (Year of your system: ${DATE}) -> abort" + exit 1 +fi + +# check which init script we should use +USE_SYSTEMD=`grep -m1 -c systemd /proc/1/comm` +USE_INITCTL=`which /sbin/initctl | wc -l` +USE_SERVICE=`which /usr/sbin/service | wc -l` + +# Make sure that the boblight daemon is no longer running +BOBLIGHT_PROCNR=$(pidof boblightd | wc -l) +if [ $BOBLIGHT_PROCNR -eq 1 ]; then + echo '---> Critical Error: Found running instance of boblight. Please stop boblight via Kodi menu before installing hyperion -> abort' + exit 1 +fi + +# Stop hyperion daemon if it is running +echo '---> Stop Hyperion, if necessary' +if [ $OS_OPENELEC -eq 1 ]; then + killall hyperiond 2>/dev/null +elif [ $USE_INITCTL -eq 1 ]; then + /sbin/initctl stop hyperion 2>/dev/null +elif [ $USE_SERVICE -eq 1 ]; then + /usr/sbin/service hyperion stop 2>/dev/null +elif [ $USE_SYSTEMD -eq 1 ]; then + service hyperion stop 2>/dev/null + #many people installed with the official script and this just uses service, if both registered -> dead + /usr/sbin/service hyperion stop 2>/dev/null +fi + +#Install dependencies for Hyperion +if [ $OS_OPENELEC -ne 1 ]; then + echo '---> Install/Update Hyperion dependencies (This may take a while)' + apt-get -qq update && apt-get -qq --yes install libqtcore4 libqtgui4 libqt4-network libusb-1.0-0 ca-certificates +fi + +#Check, if dtparam=spi=on is in place (not for OPENELEC) +if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then + SPIOK=`grep '^\dtparam=spi=on' /boot/config.txt | wc -l` + if [ $SPIOK -ne 1 ]; then + echo '---> Raspberry Pi found, but SPI is not ready, we write "dtparam=spi=on" to /boot/config.txt' + sed -i '$a dtparam=spi=on' /boot/config.txt + REBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtparam=spi=on to /boot/config.txt" + fi +fi + +#Check, if dtparam=spi=on is in place (just for OPENELEC) +if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then + SPIOK=`grep '^\dtparam=spi=on' /flash/config.txt | wc -l` + if [ $SPIOK -ne 1 ]; then + mount -o remount,rw /flash + echo '---> Raspberry Pi with OpenELEC found, but SPI is not ready, we write "dtparam=spi=on" to /flash/config.txt' + sed -i '$a dtparam=spi=on' /flash/config.txt + mount -o remount,ro /flash + REBOOTMESSAGE="echo Please reboot your OpenELEC, we inserted dtparam=spi=on to /flash/config.txt" + fi +fi + +#Backup the .conf files, if present +echo '---> Backup Hyperion configuration(s), if present' +rm -f /tmp/*.json 2>/dev/null +if [ $OS_OPENELEC -eq 1 ]; then + cp -v /storage/.config/*.json /tmp 2>/dev/null +else cp -v /opt/hyperion/config/*.json /tmp 2>/dev/null +fi + +# Select the appropriate release +HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/beta +if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_oe.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_oe.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_3 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_oe.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $RPI_1 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $RPI_2 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $RPI_3 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3.tar.gz +elif [ $CPU_IMX6 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_imx6.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-imx6.tar.gz +elif [ $CPU_WETEK -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_wetek.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_X32X64 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x86x64.tar.gz + OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x86x64.tar.gz +else + echo "---> Critical Error: Target platform unknown -> abort" + exit 1 +fi + +# Get and extract the Hyperion binaries and effects +echo '---> Downloading the appropriate Hyperion release' +if [ $OS_OPENELEC -eq 1 ]; then + # OpenELEC has a readonly file system. Use alternative location + echo '---> Downloading Hyperion OpenELEC release' + curl -# -L --get $HYPERION_RELEASE | tar -C /storage -xz + echo '---> Downloading Hyperion OpenELEC dependencies' + curl -# -L --get $OE_DEPENDECIES | tar -C /storage/hyperion/bin -xz + #set the executen bit (failsave) + chmod +x -R /storage/hyperion/bin + # modify the default config to have a correct effect path + sed -i 's:/opt:/storage:g' /storage/hyperion/config/hyperion.config.json + + # /storage/.config is available as samba share. A symbolic link would not be working + false | cp -i /storage/hyperion/config/hyperion.config.json /storage/.config/hyperion.config.json 2>/dev/null +else + wget -nv $HYPERION_RELEASE -O - | tar -C /opt -xz + #set the executen bit (failsave) + chmod +x -R /opt/hyperion/bin + # create links to the binaries + ln -fs /opt/hyperion/bin/hyperiond /usr/bin/hyperiond + ln -fs /opt/hyperion/bin/hyperion-remote /usr/bin/hyperion-remote + ln -fs /opt/hyperion/bin/hyperion-v4l2 /usr/bin/hyperion-v4l2 + ln -fs /opt/hyperion/bin/hyperion-dispmanx /usr/bin/hyperion-dispmanx 2>/dev/null + ln -fs /opt/hyperion/bin/hyperion-x11 /usr/bin/hyperion-x11 2>/dev/null +fi + +# Restore backup of .conf files, if present +echo '---> Restore Hyperion configuration(s), if present' +if [ $OS_OPENELEC -eq 1 ]; then + mv -v /tmp/*.json /storage/.config/ 2>/dev/null +else mv -v /tmp/*.json /opt/hyperion/config/ 2>/dev/null +fi + +# Copy the service control configuration to /etc/int (-n to respect user modified scripts) +if [ $USE_INITCTL -eq 1 ]; then + echo '---> Installing initctl script' + cp -n /opt/hyperion/init.d/hyperion.initctl.sh /etc/init/hyperion.conf 2>/dev/null + initctl reload-configuration +elif [ $OS_OPENELEC -eq 1 ]; then + #modify all old installs with a logfile output + sed -i 's|/dev/null|/storage/logfiles/hyperion.log|g' /storage/.config/autostart.sh + # only add to start script if hyperion is not present yet + if [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperiond | wc -l` -eq 0 ]; then + echo '---> Adding Hyperion to OpenELEC autostart.sh' + echo "/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh + chmod +x /storage/.config/autostart.sh + fi + # only add hyperion-x11 to startup, if not found and x32x64 detected + if [ $CPU_X32X64 -eq 1 ] && [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperion-x11 | wc -l` -eq 0 ]; then + echo '---> Adding Hyperion-x11 to OpenELEC autostart.sh' + echo "DISPLAY=:0.0 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-x11 /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh + fi +elif [ $USE_SYSTEMD -eq 1 ]; then + echo '---> Installing systemd script' + #place startup script for systemd and activate + #Problem with systemd to enable symlinks - Bug? Workaround cp -n (overwrite never) + #Bad workaround for Jessie (systemd) users that used the official script for install + update-rc.d -f hyperion remove 2>/dev/null + rm /etc/init.d/hyperion 2>/dev/null + cp -n /opt/hyperion/init.d/hyperion.systemd.sh /etc/systemd/system/hyperion.service + systemctl -q enable hyperion.service + if [ $OS_OSMC -eq 1 ]; then + echo '---> Modify systemd script for OSMC usage' + # Wait until kodi is sarted (for kodi checker) + sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service + sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service + sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service + sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service + systemctl -q daemon-reload + fi +elif [ $USE_SERVICE -eq 1 ]; then + echo '---> Installing startup script in init.d' + # place startup script in init.d and add it to upstart (-s to respect user modified scripts) + ln -s /opt/hyperion/init.d/hyperion.init.sh /etc/init.d/hyperion 2>/dev/null + chmod +x /etc/init.d/hyperion + update-rc.d hyperion defaults 98 02 +fi + +#chown the /config/ dir and all configs inside for hypercon config upload for non-root logins +if [ $OS_OSMC -eq 1 ]; then + chown -R osmc:osmc /opt/hyperion/config +elif [ $OS_RASPBIAN -eq 1 ]; then + chown -R pi:pi /opt/hyperion/config +fi + +# Start the hyperion daemon +echo '---> Starting Hyperion' +if [ $OS_OPENELEC -eq 1 ]; then + /storage/.config/autostart.sh > /dev/null 2>&1 & +elif [ $USE_INITCTL -eq 1 ]; then + /sbin/initctl start hyperion +elif [ $USE_SERVICE -eq 1 ]; then + /usr/sbin/service hyperion start +elif [ $USE_SYSTEMD -eq 1 ]; then + service hyperion start +fi + +#Hint for the user with path to config +if [ $OS_OPENELEC -eq 1 ];then + HINTMESSAGE="echo Path to your configuration -> /storage/.config/hyperion.config.json" +else HINTMESSAGE="echo Path to your configuration -> /opt/hyperion/config/hyperion.config.json" +fi +echo '*******************************************************************************' +echo 'Hyperion Installation/Update finished!' +echo 'Please get a new HyperCon version to benefit from the latest features!' +echo 'Create a new config file, if you encounter problems!' +$HINTMESSAGE +$REBOOTMESSAGE +echo '*******************************************************************************' +## Force reboot and prevent prompt if spi is added during a HyperCon Install +if [ $HCInstall -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then + echo "Rebooting now, we added dtparam=spi=on to config.txt" + reboot + exit 0 +fi +#Prompt for reboot, if spi added to config.txt +if [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then + while true + do + echo -n "---> Do you want to reboot your Raspberry Pi now? (y or n) :" + read CONFIRM + case $CONFIRM in + y|Y|YES|yes|Yes) break ;; + n|N|no|NO|No) + echo "---> No reboot - you entered \"$CONFIRM\"" + exit + ;; + *) echo "-> Please enter only y or n" + esac + done + echo "---> You entered \"$CONFIRM\". Rebooting now..." + reboot +fi + +exit 0 \ No newline at end of file diff --git a/bin/service/hyperion.init.sh b/bin/service/hyperion.init.sh index ca3f8d14..3ed78f5b 100644 --- a/bin/service/hyperion.init.sh +++ b/bin/service/hyperion.init.sh @@ -13,7 +13,7 @@ ### END INIT INFO DAEMON=hyperiond -DAEMONOPTS="/etc/hyperion.config.json" +DAEMONOPTS="/opt/hyperion/config/hyperion.config.json" DAEMON_PATH="/usr/bin" NAME=$DAEMON diff --git a/bin/service/hyperion.initctl.sh b/bin/service/hyperion.initctl.sh index 773c6e61..58f6f79f 100644 --- a/bin/service/hyperion.initctl.sh +++ b/bin/service/hyperion.initctl.sh @@ -8,4 +8,4 @@ stop on (runlevel [!2345]) respawn -exec /usr/bin/hyperiond /etc/hyperion.config.json \ No newline at end of file +exec /usr/bin/hyperiond /opt/hyperion/config/hyperion.config.json \ No newline at end of file diff --git a/bin/service/hyperion.systemd.sh b/bin/service/hyperion.systemd.sh index c3c66255..b3503c7c 100644 --- a/bin/service/hyperion.systemd.sh +++ b/bin/service/hyperion.systemd.sh @@ -6,7 +6,7 @@ Type=simple User=root Group=root UMask=007 -ExecStart=/opt/hyperion/bin/hyperiond /etc/hyperion.config.json +ExecStart=/opt/hyperion/bin/hyperiond /opt/hyperion/config/hyperion.config.json ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure TimeoutStopSec=10 diff --git a/config/hyperion.config.json b/config/hyperion.config.json index 62c7d70e..5d549075 100644 --- a/config/hyperion.config.json +++ b/config/hyperion.config.json @@ -1,16 +1,17 @@ // Automatically generated configuration file for 'Hyperion daemon' -// Generated by: HyperCon (The Hyperion deamon configuration file builder +// Generated by: HyperCon (The Hyperion deamon configuration file builder) +// Created with HyperCon V1.02.0 (30.04.2016) { /// Device configuration contains the following fields: /// * 'name' : The user friendly name of the device (only used for display purposes) /// * 'type' : The type of the device or leds (known types for now are - /// APA102, Adalight, AmbiLed, Atmo, Hyperion-USBASP-WS2801, Hyperion-USBASP-WS2812, Lightberry, Lightpack, LPD6803, LPD8806, Multi-Lightpack, P9813, Paintpack, PhilipsHUE, PiBlaster, SEDU, file, ThinkerForge, TPM2, WS2801, WS2812b, None) + /// ---------SPI---------, APA102, WS2801, P9813, LPD6803, LPD8806, ---------PWM---------, WS2812b (just RPi1), WS281X (RPi1, RPi2, RPi3), --------OTHER--------, PhilipsHUE, AtmoOrb, PiBlaster, Tinkerforge, FadeCandy, RawHID (USB), UDP, SEDU, TPM2, USBASP-WS2801, USBASP-WS2812, ------3rd PARTY------, Adalight, AdalightAPA102, AmbiLed, Atmo, Lightpack, Multi-Lightpack, Paintpack, Test (file), None) /// * [device type specific configuration] /// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.). "device" : { - "name" : "MyPi", + "name" : "MyHyperionConfig", "type" : "ws2801", "output" : "/dev/spidev0.0", "rate" : 1000000, @@ -20,18 +21,31 @@ /// Color manipulation configuration used to tune the output colors to specific surroundings. /// The configuration contains a list of color-transforms. Each transform contains the /// following fields: - /// * 'id' : The unique identifier of the color transformation (eg 'device_1') /// * 'leds' : The indices (or index ranges) of the leds to which this color transform applies - /// (eg '0-5, 9, 11, 12-17'). The indices are zero based. /// * 'hsv' : The manipulation in the Hue-Saturation-Value color domain with the following + /// * 'channelAdjustment' + /// * 'id' : The unique identifier of the channel adjustments (eg 'device_1') + /// * 'leds' : The indices (or index ranges) of the leds to which this channel adjustment applies + /// (eg '0-5, 9, 11, 12-17'). The indices are zero based. + /// * 'pureRed'/'pureGreen'/'pureBlue' : The manipulation in the Red-Green-Blue color domain with the + /// following tuning parameters for each channel: + /// * 'temperature' + /// * 'id' : The unique identifier of the temperature (eg 'device_1') + /// * 'leds' : The indices (or index ranges) of the leds to which this temperature applies + /// (eg '0-5, 9, 11, 12-17'). The indices are zero based. + /// * 'red'/'green'/'blue' : The temperature manipulation in the Red-Green-Blue color domain with the + /// following tuning parameters for each channel: + /// * 'transform' + /// * 'id' : The unique identifier of the color transformation (eg 'device_1') + /// * 'leds' : The indices (or index ranges) of the leds to which this color transform applies + /// (eg '0-5, 9, 11, 12-17'). The indices are zero based. + /// * 'hsv' : The manipulation in the Hue-Saturation-Value color domain with the following /// tuning parameters: /// - 'saturationGain' The gain adjustement of the saturation - /// - 'valueGain' The gain adjustement of the value + /// - 'luminanceGain' The gain adjustement of the luminance /// * 'red'/'green'/'blue' : The manipulation in the Red-Green-Blue color domain with the /// following tuning parameters for each channel: /// - 'threshold' The minimum required input value for the channel to be on /// (else zero) /// - 'gamma' The gamma-curve correction factor - /// - 'blacklevel' The lowest possible value (when the channel is black) - /// - 'whitelevel' The highest possible value (when the channel is white) /// /// Next to the list with color transforms there is also a smoothing option. /// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning @@ -42,16 +56,28 @@ /// - 'updateDelay' The delay of the output to leds (in periods of smoothing) "color" : { - "correction" : + "channelAdjustment" : [ { "id" : "default", "leds" : "*", - "correctionValues" : + "pureRed" : { - "red" : 255, - "green" : 255, - "blue" : 255 + "redChannel" : 255, + "greenChannel" : 0, + "blueChannel" : 0 + }, + "pureGreen" : + { + "redChannel" : 0, + "greenChannel" : 255, + "blueChannel" : 0 + }, + "pureBlue" : + { + "redChannel" : 0, + "greenChannel" : 0, + "blueChannel" : 255 } } ], @@ -62,75 +88,40 @@ "leds" : "*", "temperatureValues" : { - "red" : 255, - "green" : 255, - "blue" : 255 + "red" : 255, + "green" : 255, + "blue" : 255 } } ], - "channelAdjustment" : - [ - { - "id" : "default", - "leds" : "*", - "pureRed" : - { - "redChannel" : 255, - "greenChannel" : 0, - "blueChannel" : 0 - }, - "pureGreen" : - { - "redChannel" : 0, - "greenChannel" : 255, - "blueChannel" : 0 - }, - "pureBlue" : - { - "redChannel" : 0, - "greenChannel" : 0, - "blueChannel" : 255 - } - } - ], "transform" : [ { "id" : "default", "leds" : "*", - "hsv" : - { - "saturationGain" : 1.0000, - "valueGain" : 1.0000 - }, "hsl" : { - "saturationGain" : 1.0000, - "luminanceGain" : 1.0000 + "saturationGain" : 1.0000, + "luminanceGain" : 1.0000 }, "red" : { - "threshold" : 0.0000, - "gamma" : 1.0000, - "blacklevel" : 0.0000, - "whitelevel" : 1.0000 + "threshold" : 0.0000, + "gamma" : 2.5000 }, "green" : { - "threshold" : 0.0000, - "gamma" : 1.0000, - "blacklevel" : 0.0000, - "whitelevel" : 1.0000 + "threshold" : 0.0000, + "gamma" : 2.5000 }, "blue" : { - "threshold" : 0.0000, - "gamma" : 1.0000, - "blacklevel" : 0.0000, - "whitelevel" : 1.0000 + "threshold" : 0.0000, + "gamma" : 2.5000 } } ], + "smoothing" : { "type" : "linear", @@ -164,7 +155,7 @@ /// * color : Set static color after boot -> set effect to "" (empty) and input the values [R,G,B] and set duration_ms NOT to 0 (use 1) instead /// * effect : The effect selected as 'boot sequence' /// * duration_ms : The duration of the selected effect (0=endless) - /// * priority : The priority of the selected effect/static color (default=0) + /// * priority : The priority of the selected effect/static color (default=990) HINT: lower value result in HIGHER priority! "effects" : { "paths" : @@ -190,20 +181,21 @@ // "forwarder" : // { // "proto" : ["127.0.0.1:19447"], -// "json" : ["127.0.0.1:19446"] +// "json" : ["127.0.0.1:19446"] // }, /// The configuration for the frame-grabber, contains the following items: /// * width : The width of the grabbed frames [pixels] /// * height : The height of the grabbed frames [pixels] /// * frequency_Hz : The frequency of the frame grab [Hz] - /// * priority : The priority + /// * priority : The priority of the frame-gabber (Default=890) HINT: lower value result in HIGHER priority! + /// * ATTENTION : Power-of-Two resolution is not supported and leads to unexpected behaviour! "framegrabber" : { - "width" : 80, - "height" : 45, + "width" : 64, + "height" : 64, "frequency_Hz" : 10.0, - "priority" : 900 + "priority" : 890 }, /// The configuration of the Kodi connection used to enable and disable the frame-grabber. Contains the following fields: @@ -242,10 +234,11 @@ }, /// The configuration of the boblight server which enables the boblight remote interface - /// * port : Port at which the boblight server is started + /// * port : Port at which the boblight server is started + /// * priority: Priority of the boblight server (Default=900) HINT: lower value result in HIGHER priority! // "boblightServer" : // { -// "port" : 19333, +// "port" : 19333, // "priority" : 900 // }, @@ -257,7 +250,7 @@ /// * height : V4L2 height to set [default=-1] /// * frameDecimation : Frame decimation factor [default=2] /// * sizeDecimation : Size decimation factor [default=8] - /// * priority : Hyperion priority channel [default=800] + /// * priority : Hyperion priority channel [default=900] /// * mode : 3D mode to use 2D/3DSBS/3DTAB (note: no autodetection) [default="2D"] /// * cropLeft : Cropping from the left [default=0] /// * cropRight : Cropping from the right [default=0] @@ -275,7 +268,7 @@ // "height" : -1, // "frameDecimation" : 2, // "sizeDecimation" : 8, -// "priority" : 800, +// "priority" : 900, // "mode" : "2D", // "cropLeft" : 0, // "cropRight" : 0, diff --git a/config/hyperion_x86.config.json b/config/hyperion_x86.config.json deleted file mode 100644 index a17801b9..00000000 --- a/config/hyperion_x86.config.json +++ /dev/null @@ -1,453 +0,0 @@ -// Automatically generated configuration file for 'Hyperion daemon' -// Generated by: HyperCon (The Hyperion deamon configuration file builder - -{ - /// Device configuration contains the following fields: - /// * 'name' : The user friendly name of the device (only used for display purposes) - /// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'ldp8806', - /// 'lpd6803', 'sedu', 'adalight', 'lightpack', 'file' and 'none') - /// * 'output' : The output specification depends on selected device. This can for example be the - /// device specifier, device serial number, or the output file name - /// * 'rate' : The baudrate of the output to the device - /// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.). - "device" : - { - "name" : "MyPi", - "type" : "adalight", - "output" : "/dev/ttyUSB0", - "rate" : 115200, - "colorOrder" : "rgb" - }, - - /// Configuration for message forwarding to other hyperions - /// protobuffer and json remote interface are forwarded to configured hosts - /// 'proto' is mostly used for video streams and 'json' for effects - /// - /// ** pay attention which port you use. use correct ports for protols ** - /// - /// * 'proto' : list of host in form of : - /// * 'json' : list of host in form of : -/// "forwarder" : -/// { -/// "proto" : [ "127.0.0.1:19445","192.168.178.88:19445" ], -/// "json" : [ "127.0.0.1:19444","192.168.178.88:19444" ] -/// }, - - - /// Color manipulation configuration used to tune the output colors to specific surroundings. - /// The configuration contains a list of color-transforms. Each transform contains the - /// following fields: - /// * 'id' : The unique identifier of the color transformation (eg 'device_1') /// * 'leds' : The indices (or index ranges) of the leds to which this color transform applies - /// (eg '0-5, 9, 11, 12-17'). The indices are zero based. /// * 'hsv' : The manipulation in the Hue-Saturation-Value color domain with the following - /// tuning parameters: - /// - 'saturationGain' The gain adjustement of the saturation - /// - 'valueGain' The gain adjustement of the value - /// * 'red'/'green'/'blue' : The manipulation in the Red-Green-Blue color domain with the - /// following tuning parameters for each channel: - /// - 'threshold' The minimum required input value for the channel to be on - /// (else zero) - /// - 'gamma' The gamma-curve correction factor - /// - 'blacklevel' The lowest possible value (when the channel is black) - /// - 'whitelevel' The highest possible value (when the channel is white) - /// - /// Next to the list with color transforms there is also a smoothing option. - /// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning - /// parameters: - /// - 'type' The type of smoothing algorithm ('linear' or 'none') - /// - 'time_ms' The time constant for smoothing algorithm in milliseconds - /// - 'updateFrequency' The update frequency of the leds in Hz - "color" : - { - "transform" : - [ - { - "id" : "default", - "leds" : "*", - "hsv" : - { - "saturationGain" : 1.0000, - "valueGain" : 1.0000 - }, - "red" : - { - "threshold" : 0.0000, - "gamma" : 1.0000, - "blacklevel" : 0.0000, - "whitelevel" : 1.0000 - }, - "green" : - { - "threshold" : 0.0000, - "gamma" : 1.0000, - "blacklevel" : 0.0000, - "whitelevel" : 1.0000 - }, - "blue" : - { - "threshold" : 0.0000, - "gamma" : 1.0000, - "blacklevel" : 0.0000, - "whitelevel" : 1.0000 - } - } - ], - "smoothing" : - { - "type" : "none", - "time_ms" : 200, - "updateFrequency" : 20.0000 - } - }, - - /// The configuration for each individual led. This contains the specification of the area - /// averaged of an input image for each led to determine its color. Each item in the list - /// contains the following fields: - /// * index: The index of the led. This determines its location in the string of leds; zero - /// being the first led. - /// * hscan: The fractional part of the image along the horizontal used for the averaging - /// (minimum and maximum inclusive) - /// * vscan: The fractional part of the image along the vertical used for the averaging - /// (minimum and maximum inclusive) - "leds" : - [ - { - "index" : 0, - "hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 1, - "hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 2, - "hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 3, - "hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 4, - "hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 5, - "hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 6, - "hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 7, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 8, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 9, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 } - }, - { - "index" : 10, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 } - }, - { - "index" : 11, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 } - }, - { - "index" : 12, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 } - }, - { - "index" : 13, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 } - }, - { - "index" : 14, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 } - }, - { - "index" : 15, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 } - }, - { - "index" : 16, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 17, - "hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 18, - "hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 19, - "hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 20, - "hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 21, - "hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 22, - "hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 23, - "hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 24, - "hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 25, - "hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 26, - "hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 27, - "hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 28, - "hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 29, - "hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 30, - "hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 31, - "hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 32, - "hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 33, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } - }, - { - "index" : 34, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 } - }, - { - "index" : 35, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 } - }, - { - "index" : 36, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 } - }, - { - "index" : 37, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 } - }, - { - "index" : 38, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 } - }, - { - "index" : 39, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 } - }, - { - "index" : 40, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 } - }, - { - "index" : 41, - "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 42, - "hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 43, - "hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 44, - "hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 45, - "hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 46, - "hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 47, - "hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 48, - "hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - }, - { - "index" : 49, - "hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 }, - "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } - } - ], - - /// The black border configuration, contains the following items: - /// * enable : true if the detector should be activated - /// * threshold : Value below which a pixel is regarded as black (value between 0.0 and 1.0) - "blackborderdetector" : - { - "enable" : true, - "threshold" : 0.01 - }, - - /// The configuration of the effect engine, contains the following items: - /// * paths : An array with absolute location(s) of directories with effects - /// * bootsequence : The effect selected as 'boot sequence' - /// * effect : name of the effect you want to start. Set to empty if no effect wanted - /// * color : switch to static color after effect is done - /// * duration_ms : duration of boot effect in ms. 0 means effect stays forever - /// * priority : priority of boot effect and static color - "effects" : - { - "paths" : - [ - "/home/dincs/projects/hyperion/effects" - ] - }, - - "bootsequence" : - { - "color" : [0,0,0], - "effect" : "Rainbow swirl fast", - "duration_ms" : 3000, - "priority" : 990 - }, - - /// The configuration for the frame-grabber, contains the following items: - /// * width : The width of the grabbed frames [pixels] - /// * height : The height of the grabbed frames [pixels] - /// * frequency_Hz : The frequency of the frame grab [Hz] -/// "framegrabber" : -/// { -/// "width" : 64, -/// "height" : 64, -/// "frequency_Hz" : 10.0, -/// "priority" : 900 -/// }, - - /// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields: - /// * xbmcAddress : The IP address of the XBMC-host - /// * xbmcTcpPort : The TCP-port of the XBMC-server - /// * grabVideo : Flag indicating that the frame-grabber is on(true) during video playback - /// * grabPictures : Flag indicating that the frame-grabber is on(true) during picture show - /// * grabAudio : Flag indicating that the frame-grabber is on(true) during audio playback - /// * grabMenu : Flag indicating that the frame-grabber is on(true) in the XBMC menu - /// * grabScreensaver : Flag indicating that the frame-grabber is on(true) when XBMC is on screensaver - /// * enable3DDetection : Flag indicating that the frame-grabber should switch to a 3D compatible modus if a 3D video is playing -// "xbmcVideoChecker" : -// { -// "xbmcAddress" : "127.0.0.1", -// "xbmcTcpPort" : 9090, -// "grabVideo" : true, -// "grabPictures" : true, -// "grabAudio" : true, -// "grabMenu" : false, -// "grabScreensaver" : true, -// "enable3DDetection" : true -// }, - - /// The configuration of the Json server which enables the json remote interface - /// * port : Port at which the json server is started - "jsonServer" : - { - "port" : 19444 - }, - - /// The configuration of the Proto server which enables the protobuffer remote interface - /// * port : Port at which the protobuffer server is started - "protoServer" : - { - "port" : 19445 - }, - - /// The configuration of the boblight server which enables the boblight remote interface - /// * port : Port at which the boblight server is started -// "boblightServer" : -// { -// "port" : 19333, -// "priority" : 900 -// }, - - "endOfJson" : "endOfJson" -} diff --git a/deploy/hummingboard_prerelease.tar.gz.REMOVED.git-id b/deploy/hummingboard_prerelease.tar.gz.REMOVED.git-id deleted file mode 100644 index 25e27e13..00000000 --- a/deploy/hummingboard_prerelease.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -63b2cc4bf190a0c0c996be6db30fcf03109c9625 \ No newline at end of file diff --git a/deploy/hyperion.deps.openelec-imx6.tar.gz.REMOVED.git-id b/deploy/hyperion.deps.openelec-imx6.tar.gz.REMOVED.git-id deleted file mode 100644 index bebbc1ba..00000000 --- a/deploy/hyperion.deps.openelec-imx6.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -198ac3d44bac13ba993069454397ad8c201d37b9 \ No newline at end of file diff --git a/deploy/hyperion.deps.openelec-rpi.tar.gz.REMOVED.git-id b/deploy/hyperion.deps.openelec-rpi.tar.gz.REMOVED.git-id deleted file mode 100644 index 1f708387..00000000 --- a/deploy/hyperion.deps.openelec-rpi.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a628a0f8dea4332995fe4f32860a114a9b48ea4b \ No newline at end of file diff --git a/deploy/hyperion.deps.openelec-x32x64.tar.gz.REMOVED.git-id b/deploy/hyperion.deps.openelec-x32x64.tar.gz.REMOVED.git-id deleted file mode 100644 index 00d28a05..00000000 --- a/deploy/hyperion.deps.openelec-x32x64.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -dcef2212c5d493fed074dc5b1e222ad9cb6098e8 \ No newline at end of file diff --git a/deploy/hyperion_imx6.tar.gz.REMOVED.git-id b/deploy/hyperion_imx6.tar.gz.REMOVED.git-id deleted file mode 100644 index 0a91a093..00000000 --- a/deploy/hyperion_imx6.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -53710fe42ce52c16b82464e0e01ca6ee6df6912c \ No newline at end of file diff --git a/deploy/hyperion_rpi.tar.gz.REMOVED.git-id b/deploy/hyperion_rpi.tar.gz.REMOVED.git-id deleted file mode 100644 index 66cb6d93..00000000 --- a/deploy/hyperion_rpi.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -89463afae2a82b597e5728ccac952669cc5efad3 \ No newline at end of file diff --git a/deploy/hyperion_wetek.tar.gz.REMOVED.git-id b/deploy/hyperion_wetek.tar.gz.REMOVED.git-id deleted file mode 100644 index 358d9c54..00000000 --- a/deploy/hyperion_wetek.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2a0699eb2d8b7b44ceee890fa106714fca2b15d0 \ No newline at end of file diff --git a/deploy/hyperion_x32x64.tar.gz.REMOVED.git-id b/deploy/hyperion_x32x64.tar.gz.REMOVED.git-id deleted file mode 100644 index d92319c2..00000000 --- a/deploy/hyperion_x32x64.tar.gz.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b0ef7e5348fb3710b3e5083a3249fac33b8119a8 \ No newline at end of file diff --git a/doc/calibration/Gamma/000000.png b/doc/calibration/Gamma/000000.png deleted file mode 100644 index f4c092619af0630387ac55a95f30ad3fbef7fe59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6159 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}0*a(>3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-4B|^XT^vIy;@%!)VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRH*=T@_ zrVwyu7|jddU>GeNz`-zDT7rXNwE6%C1H)+HFj_c_=7rI`z%W`bjMfXI9VkdaFq#)e z^TKFe7|ja|qs?PTA{gyEgTrC8UKp(xM(c&qdSSF)7@croU>F@Xfs_QJLx|vT7;Phg zgJHCd1P+GL!eO*<7#&lEq=C`AFq#)e^TKFe7+s(>x?&BO3r713;G%#k{e{G5%pXL! U^cOEzJ_s_@)78&qol`;+0GFSwH~;_u diff --git a/doc/calibration/Gamma/7F7F7F.png b/doc/calibration/Gamma/7F7F7F.png deleted file mode 100644 index dcf7a3f6b28f027378dddd766bf800223e55e43f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10669 zcmeI0F-yZh7>2*lT5W8L9Rw8xN8K_ynt0Miut;%n5sQP1gV@DIDB>ar`b&cT03nLt zAUG%pZjK7o#lgWM-hKBA+@CtxO}u`v`SB9h z^Qe+v?A{ixeooEdt?Xm>wYQn)#7nb@zq#I3cfNExi6&7XHE$O z(SD#qR0fby888Pg1LlA^zyd4?>jLY7ut(A+fCX591>Xa(01L1H3*<;7jg|s3RkZ?Q z6P1DUg37=iNoBwsybPEF<^T(@K&I+@02W{Y7GOchk$e+yUhp~)Ca4aa7gPqq1eM|6 Z=5QW;1<&QMzkNSbb2FsNEt4f%M}NI-`J4a% diff --git a/doc/calibration/Gamma/BFBFBF.png b/doc/calibration/Gamma/BFBFBF.png deleted file mode 100644 index f61f729782206196a590f3b48ea45ed1c5033652..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10670 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRRa4?LPmf&C*tv zU>I#9frDYRa2PEdM#oekX<#%jjOK;WyfB&FVdQ&MBb@0N|6ZPXGV_ diff --git a/doc/calibration/Gamma/FFFFFF.png b/doc/calibration/Gamma/FFFFFF.png deleted file mode 100644 index 8e5dc2d55055cb8640b0427d7b11ab86fe3f7f6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8642 zcmeH~y-EW?6ot>481uIlA|i`|0Usa%3+=LDCA&qUL{V(SfUq{AkS67#Hdb2NnKFe0 z^8&hPVIyK;VWIXG=`6Q!jt^mVis3K=!@%&}JKvnIH|uuZ$pf$h-)jLA5s+Taj+vEk zxHWCU>a^-L3|{8G%_JSV4Hp<*6q5G1ndgrEoenVh$YDJl_4k3&cHp_2-QCf9#frFi(^Pd z+}oQMvu-;GI0Wwe|NneuyV;kc%X}wnx%AaifNA$F$^G|_Z_Ab6|8HKE&9h&x&()M) zTc=%Hf91{My2GpfR=>add3X8WXL`n`zK74Py>eT$czucaw|Tq2?r7nA$W;?>&-)9O2a>+Yl;TTy2mR`Y%T=41Ev=dZbE z-}h_p%M94;z;-*3FoCBSTkL(1;A_V07uUX_KP{kMP5zRH@1^4Djdt0}*>PP?}L z%A3Xi4zK!K{r>Lf-RXay=^3B;9zM7B%5Bl&^(E%t=I#Ezr|{akz0Z4X%kO^l&HOL9 z`J0ve>azT~{pok!{#k$iUD#V$d&~H(_3z;WxGd&3U%2@W>tQyS=N=%DV5BU7gmy`+ooKGZI(xk9ED@XPy1#@Bd@3{ytvu z-+JA*zwQ4k%b%_Lcy)JteH|mv%RsQhl2HP}QgC7bg&Yuc2sA)tl~@wMA`A^2qsl-b zF&ZG?^e~!2z`-z@Wx&BOS~!4%VYG071jA_IFj_c_=7rI`FxqGwZAAmSV58j%P*E`2 zMuHTGqa7%4IE=QDz`-zDIDms;v~UI#9frDYRaDW8EXyGtgIE?0n(Y!D^$UHjXGCJXs04WGY+enab l80|oT!-2>)l1GJ29rMfYY;z3x`!YcqJzf1=);T3K0RU*(asB`R diff --git a/doc/calibration/Gamma/VGradient_1.png b/doc/calibration/Gamma/VGradient_1.png deleted file mode 100644 index 974b087ef7454249403e1702c24e085911a00a87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12174 zcmb_ieNaeVrNJ7-IJ1VK97``IG zT8V9yU0EelA++@mbhaB%>L3ybm0-FOp-L4|K1G9km?#lKAR&91gyijP=Dw3)W*FYU zy?N*S&hK~5x#zv(@5jgZz4H1i1VQ-4#cue3AbiCH;j?<)T=bVGtv|ereg*H2{a`ae zWUU|w@uvh~vZCJu1d;wWK@4&U;vFeL1n^IB8l%zL`5(t72nb?f!}O1rnty%|L4^G} zZo|5*8A-#Pd;O#LE{;xSe181+d2WdGwWB9G^Sg0EVOKbnm%!{4{Y&xSSH@5|Oay;Nrxz`eH@aBUvA)T9e4 zOCmZ4;;YJ=rE3{mzqZB~SNzux*#HGu?eiD<7oR{NC*y#~V9my0m!}GglH4*K@Gk<(B++xbdM$BYoDBynS#{2|n* zZRJ_pD15qqN3I3?q@1_|^{M)LxEw6q@bb*f6n5UdEPo8Ov#oCIGT6@Mba@{ZPkLLe zE?wmPx-IU(6d5$Dtwsjra+`8$6mO??F5^lbd#(K_LQ!}+o*iR+0@YkJslZ2IY1)r(P~7mF{J=qIr7|k5 z77E0?Xc=NCVo}fXX!r^s^VYGF&&Sh^P7^(O7o0$nY1vYI z1ftBnGztv_K9|JcjdC78HOqrcv3Lz+{(LSFtbu~VFV0a!lwOeeB|f5tdurxgXjTg} zUQttIwZ0&020p7fX5^C0YyL8P(@baQJoE=gG>)BhiXx(>|FH3m22VEf&oXdCx0Ft7 zrHJVLRvEq_P(`6pCZ1-bry40yeZRriDT5}3*$Ry)8n~rUM6|NhvL75#G=ici@+~5r z03T6lKPndB#9{7dQM7|e&yED(BT5g;>0N*~$~iO8ZVbz!=w}tS2u&0slb8OnBi z9qk%9Qw0WZXZOTk@Zd!ZS2W~6kE{py*%W=J!t#_4PKH87-!cm6ps6r88Frx-8ZRAE z!=e)^A5Z{|#@Aq=d-H>I_}PG7q|XNDD73Z|D>KqOSf6X1q+qmU`N?O{lhpEpsM}az zNV)Ia$#-sG*YcRC&jf?$%Nk#YWh?0{&wTL>4IgYxKFgep&y&tx#`I$h6Fe-7VNLuQ zZ0Fd;0t!3Ttf_-wJ5?b}@USd|WdhHxnWGojcsrfq5xlq+Q{#9*=WvE z@LdO~9Hg)&6TsLTt6QKx8B8s?U05!Yct725;1id#LgYOEf`hLRr1H9nGl6e`NxJ7u zjTGT^PonpY?R8*!Z&yy>XTc;HqWNh#7~;|L+)gOO{G7feV2BN8yTK5nl6VH1TD#E* z3J5V76GMp}`f7s2gbL9RwsMfjkH#EppyaQ!TJ(64ItA@ys~H{SKZHI{H8ccG{R9o@ z?voMMfon;EK&kc?_+e*|bzBYP3`s{Ubf|>BnWS2Zp1!(&3-vN#2iS|!sTXDL--0#S z-U9W4C=x~tWfstcX%3W@6BXLBDW~Uxd3k@vw?!Sge&mC_Fa{q3m zBsrZ0pzjzsw>ddznC@MmZ^n?e^|P$Add189I4sxw@RH($PPQEP0e3>6nJ#y;LJke7 zMeZZ#&=biQ6hqdmSirKHT4v*m!zh(`h+}nMjzZwH0K41O zGJ#&Cvp==$Ne-;He>e11v@}Y_Sgoq+1AJ!pl;Z2v)n5E+&A~L}8YOb7%I>;mad4 z443eI=bZ2Ny?*DMd+LRp?8t{7eV8DK$Xz?LULuGUVuA=u34e(E=E3dGO!C*d!ksVu zjv$UdP7vY>g0Q*B-{S=F<|cxeC?JTZWdsq!eK-HwbENFbqdWKV2qLO`@h7C0d+`84 zB%R!q^~~P3#jL0Z&;jvb^$Nkt2V z!C6#v`s~dsiV!zagPS4>+)v{0kVo84>vj-};ZJ@ftHd6;^|h2tbWoUD)aU=!Jd zLypN78QU?Q>pKK8w$mu}U5$oZw8+{W5ONNKNa-_j5}Vo}Z1zKKiYsdKSq%Zsi7TJ! zJSgxK#D@L9>hOdws+mkhLB$oC&iSFX7?%F13C&;lp_VMN_4%VFG@kZDEi`&tgU_Cj z*lYtLaM92fvF#tkdR-I(b(X_2>`z3F=ZaeWFz9-&5L`L5y=-Tr?*<7hYH+S-v)S{1 z@qLQLG5`$%7Tekxeb-yz!W+C#OkIMOdec`e8t@duWFJ?12gXk!v1u#{-9ui=AO?~L z-axwL31G#R$nDc@;N?u0DD}YQs7e&3wOhUIZW*xg$+#l>5VY!Zrd#z%z$rKi^ChmF zVsr)66B9q;={_uJr6lmOrW;)0?Z^Umu@w_ot|8-=kHrE>YfrgDpI;K{WgZ<^4x&Ar zZ~r?mHCXwMi9Jw{%g3tHfcYS?{cDfn9yB`6Di;nyU3Wz3D2B=^W-SH*0WFKFoW~JX{rI|0k6h>9-9X}<#SCn=7>MS@>PGitsk1(1LfMyc$-XQAO27B zN1pu#z9e!o%%9~#gVRKI>RZ@#ax#pka;?j^xXs>}N!_+o6ql|>64WC}w(Tkus&G=|P-;Z3|# zE-U6=g#sg=`233{GB7mWDux2n?s6FLStYYvH3-1Ql0@YW-dK&P+5(QiwqeH+Yy?X9 zciJ@fV{WXh@@l8o(9kU%?xI zPA~XzD9WUs9V2YpjH?*5~P<-l`W&9mac0`&2#u&v*mcO#Nwwe?w`!TCS_c zQ}a=3^{cVl&Bip{c^z1BV;dkGps_QXg9K1rjj%NkfKd0E{_1uP58J(FDAvOa(8OnTc!1DW39;M# z6wgKfoye-hc;)y8RfXYHB6JNkU`VbjujZY^J7wk05lWKDf4QvJp?a5V2s4psG~uBS8Y_ zyX^R>AOSRSu@(;yI(??~1e}M{I#@j1AK;a!8;BtRv77i< zFN~XRS@=R49*5V;Po)sal%V%#rkC)ZH`+Sm->S*}5mz_>l3{v!fNtTn;`d~d3l8muI zTii@n1b%Tymj7d4o)#OvteAaAPvC0-YGUU_P8;6ENVc6k3VV~vc&2(TBPr$pkX~{6 z(=Ge3(SWEJr$1HqYpkp!)jrvT-+`cP(|+01k53VrtZMVXpRh*LWY28wMnxWl1&#md&soz{*Ne$1l8x${dr?G=O^6qj8YNhy-A=dEe((A6euZg=5gF z&-ilGSe&H=S|u1WX0SJ-*!PS<9DbXYCEXhca#G=JZ6FZP(pXnr=6k5qf-ik;Fi7ur zN{@eE>w7pbI*7b(d?Nq{p{QX=OM5m1XHiW+VmU{*~2pjORGschv X*)y(~!q+}o)ZF!KPS)ie1#kTqOf8>x diff --git a/doc/calibration/RGB/blue_00007F.png b/doc/calibration/RGB/blue_00007F.png deleted file mode 100644 index 8ca29242b821769a765051bb71fcb2bd1524c72a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>F@_hU5w& c2bnoLPgg&ebxsLQ0Cvpx7XSbN diff --git a/doc/calibration/RGB/blue_0000FF.png b/doc/calibration/RGB/blue_0000FF.png deleted file mode 100644 index 727f8cf35baf6657a93ec2ad3364adb02e41ea8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8642 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}0*a(>3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42t2NE{-7;ac^%JGBy}6967-Lf8Ob) zmbBf`j}*_Bu>o~4Fl^sj&j_L)XfaEH=!O@riIu{z%=Km_R*jlO*WvsFq&mXiwjUX7%eJCs|ip#7_B0K&6CmQ!D#bfw0Qt3 z4n~^?qs;?QIv8ypj5ZHI>0q>ZFxor-CWF!D!D#aUR2+;p4@R2@pmZ?WJQ!^rfYQNe z^I)`j089p>&4bbA0jM|_Z61s^4?yW)w0SVvJOHJG(dGfYn+Gi0_*Y%z%rD<;u^bcu Mp00i_>zopr08hi$bN~PV diff --git a/doc/calibration/RGB/cyan_007F7F.png b/doc/calibration/RGB/cyan_007F7F.png deleted file mode 100644 index 334e191b3e73a336013559f51ad4b42bd5db85b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>GeNAi*$N zIE)q!qj_O8FN}_5#80|Yl3WCu#5+oc(J5b3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42t2NE{-7;ac^%JGBPOe9N5rUfBu6) zW8KMM{@CJkKurt`2l9W5f*Jda7BGSs9ugP8d=;JyFfGJp0;V~cr9gB;3nMRxb~x0) z2BH-b9hgD%1cOoSqd~{OFq&)_7)G-Uus9kmE=G&W(Q0C}iX3eoj5du%Ta}=4V6CgVCnZXfG0&3`TpVM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>F@_hU5w& c2bnoFVdQ&MBb@0AtPd*Z=?k diff --git a/doc/calibration/RGB/green_00FF00.png b/doc/calibration/RGB/green_00FF00.png deleted file mode 100644 index 01e18f1254ff8bbdc9879e0696d210cb8018aa43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8641 zcmeI!u}Z^G7zN;S+geR+6hu&pLj)f{(ZR7PktTyhsuUcw7KFN0$l|1_=-{M_yQ3gf z`vM|5h>La#M~Z!whE!3@j86(wxe#r0HZ! z%;Zel_2~fBM!yW_fyRYKC3~P_!k)}JBEVM%xN zb!1@J*w6hZkrl}2EbxddW?8eRt z;Pfz>LcqZ=nq|PjFj_c(gJHCAfCR&6;V@b_jOK;WyudJ8FO1d;45Mu%a3UDZ3!`~q zG%rBXz-V3=%?qP>VKgs{jx>%Ay#jN==$IR|!0SCiqe*qi}qirN`FpL%skYE@s z97YR=(Y!F47e>caM^`2=jP{)&1;J<=2@(#Y9Vl=(jJA=$!7$o^0tdrr;V@b_kX})G a%-Fe5jw^Sgn(_xw@OirWxvX3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42t2NE{-7;ac^%JGBPOe9N5rUfBu6) zW8KMM{@C<$Kurt`2l9W5f*Jda7BGSs9ugP8d=;JyFfGJp0;V~cr9gB;3nMRxb~x0) z2BH-b9hgD%1cOoSqd~{OFq&)_7)G-Uus9kmE=G&W(Q0C}iX3eoj5du%Ta}=4V6CgVCnZXfG0&3`TpmdK II;Vst0FI>9KmY&$ diff --git a/doc/calibration/RGB/red_7F0000.png b/doc/calibration/RGB/red_7F0000.png deleted file mode 100644 index 7dc59c7d11ec3b2317e768af5324e3214156dff2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>F@_hU5w& c2bno3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-42of%E{-7;ac^%JGBPOe9N5rUfBu6) zW8KMM{@8S&9tMU7`~QNhWMGJwya1+Ecrw7W5Ss~@=46%v(G4w(ydc`)Py-u?R!DSU z2GJ7?7BGTn4~bFjqd~{OFq&+DIdL@0j20K8MJ1?O7_BBotH{yj!D!QHv}rWjGy;_a zqfMjHo)j<{jP@c&n?|7GV083gbmRn-4n~^?qs;?QIv8ypj5ZH|$zZg3Fxor-6$hiu zgVE*zC>@M84@R2@pmZ?WJQ!^r0F%LJ^I)`j04fd!sCi&e%(&(}XTJO6Q{O?Z@O1Ta JS?83{1OQ{u)Xo3^ diff --git a/doc/calibration/RGB/yellow_7F7F00.png b/doc/calibration/RGB/yellow_7F7F00.png deleted file mode 100644 index 0296764528b0606bb360452f27ad9cca22f022e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10668 zcmeAS@N?(olHy`uVBq!ia0y~yU~gbxV6os}1B$%3e9#$4F%}28J29*~C-V}>VM%xN zb!1@J*w6hZkrl}2EbxddW?8eRU>GeNAi*$N zIE)q!qj_O8FN}_5#80|Yl3WCu#5+oc(J5b3=;uTjKx9jP7LeL$-D$|SkfJR z9T^xl_H+M9WCij$3p^r=85sBugD~Uq{1qt-400PiT^vIy;@%!#$je|Lz`XI@{x8$n z<+r3fDrX03VPM#63#L@QfvE{Mm_f8d5AdCjWXh#v4 z21Wy6G!RC6%cC7daCI=+TLuQhXdsLR!sw8}Xm1%@BBBi$Jh;cMqnWu?`}+)OkhG_( KpUXO@geCyAOIi;A From da3db8d0cff34bace817121c7fc0abf88bdcfe81 Mon Sep 17 00:00:00 2001 From: brindosch Date: Tue, 26 Apr 2016 12:56:16 +0200 Subject: [PATCH 10/14] cleanup Former-commit-id: 199a8d3bd4db8900c95b151e601835463e7554bb --- bin/install_hyperion.sh | 7 - bin/scripts/install_hyperion_beta.sh | 13 +- config/hyperion_x86.config.json | 430 +++++++++++++++++++++++++++ 3 files changed, 433 insertions(+), 17 deletions(-) create mode 100644 config/hyperion_x86.config.json diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index 2d657caf..df38e511 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -10,13 +10,6 @@ if [ "$1" = "HyperConInstall" ] || [ "$2" = "HyperConInstall" ]; then else HCInstall=0 fi -#Check if HyperCon is logged in as root -if [ $(id -u) != 0 ] && [ $HCInstall -eq 1 ]; then - echo '---> Critical Error: Please connect as user "root" through HyperCon' - echo '---> We need admin privileges to install/update your Hyperion! -> abort' - exit 1 -fi - #Check, if script is running as root if [ $(id -u) != 0 ]; then echo '---> Critical Error: Please run the script as root (sudo sh ./install_hyperion.sh) -> abort' diff --git a/bin/scripts/install_hyperion_beta.sh b/bin/scripts/install_hyperion_beta.sh index d67c4419..6d353f6a 100644 --- a/bin/scripts/install_hyperion_beta.sh +++ b/bin/scripts/install_hyperion_beta.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Script for downloading and installing the latest Hyperion release +# Script for downloading and installing the latest Hyperion beta # Make sure /sbin is on the path (for service to find sub scripts) PATH="/sbin:$PATH" @@ -10,22 +10,15 @@ if [ "$1" = "HyperConInstall" ] || [ "$2" = "HyperConInstall" ]; then else HCInstall=0 fi -#Check if HyperCon is logged in as root -if [ $(id -u) != 0 ] && [ $HCInstall -eq 1 ]; then - echo '---> Critical Error: Please connect as user "root" through HyperCon' - echo '---> We need admin privileges to install/update your Hyperion! -> abort' - exit 1 -fi - #Check, if script is running as root if [ $(id -u) != 0 ]; then - echo '---> Critical Error: Please run the script as root (sudo sh ./install_hyperion.sh) -> abort' + echo '---> Critical Error: Please run the script as root (sudo sh ./install_hyperion_beta.sh) -> abort' exit 1 fi #Welcome message echo '*******************************************************************************' -echo 'This script will install/update Hyperion and it´s services' +echo 'This script will install/update to the latest Hyperion BETA' echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.' echo '*******************************************************************************' diff --git a/config/hyperion_x86.config.json b/config/hyperion_x86.config.json new file mode 100644 index 00000000..4abd64db --- /dev/null +++ b/config/hyperion_x86.config.json @@ -0,0 +1,430 @@ +// Automatically generated configuration file for 'Hyperion daemon' +// Generated by: HyperCon (The Hyperion deamon configuration file builder + +{ + /// Device configuration contains the following fields: + /// * 'name' : The user friendly name of the device (only used for display purposes) + /// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'ldp8806', + /// 'lpd6803', 'sedu', 'adalight', 'lightpack', 'test' and 'none') + /// * 'output' : The output specification depends on selected device. This can for example be the + /// device specifier, device serial number, or the output file name + /// * 'rate' : The baudrate of the output to the device + /// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.). + "device" : + { + "name" : "MyPi", + "type" : "adalight", + "output" : "/dev/ttyUSB0", + "rate" : 115200, + "colorOrder" : "rgb" + }, + + /// Color manipulation configuration used to tune the output colors to specific surroundings. + /// The configuration contains a list of color-transforms. Each transform contains the + /// following fields: + /// * 'id' : The unique identifier of the color transformation (eg 'device_1') /// * 'leds' : The indices (or index ranges) of the leds to which this color transform applies + /// (eg '0-5, 9, 11, 12-17'). The indices are zero based. /// * 'hsv' : The manipulation in the Hue-Saturation-Value color domain with the following + /// tuning parameters: + /// - 'saturationGain' The gain adjustement of the saturation + /// - 'valueGain' The gain adjustement of the value + /// * 'red'/'green'/'blue' : The manipulation in the Red-Green-Blue color domain with the + /// following tuning parameters for each channel: + /// - 'threshold' The minimum required input value for the channel to be on + /// (else zero) + /// - 'gamma' The gamma-curve correction factor + /// - 'blacklevel' The lowest possible value (when the channel is black) + /// - 'whitelevel' The highest possible value (when the channel is white) + /// + /// Next to the list with color transforms there is also a smoothing option. + /// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning + /// parameters: + /// - 'type' The type of smoothing algorithm ('linear' or 'none') + /// - 'time_ms' The time constant for smoothing algorithm in milliseconds + /// - 'updateFrequency' The update frequency of the leds in Hz + "color" : + { + "transform" : + [ + { + "id" : "default", + "leds" : "*", + "hsv" : + { + "saturationGain" : 1.0000, + "valueGain" : 1.0000 + }, + "red" : + { + "threshold" : 0.0000, + "gamma" : 1.0000, + "blacklevel" : 0.0000, + "whitelevel" : 1.0000 + }, + "green" : + { + "threshold" : 0.0000, + "gamma" : 1.0000, + "blacklevel" : 0.0000, + "whitelevel" : 1.0000 + }, + "blue" : + { + "threshold" : 0.0000, + "gamma" : 1.0000, + "blacklevel" : 0.0000, + "whitelevel" : 1.0000 + } + } + ], + "smoothing" : + { + "type" : "none", + "time_ms" : 200, + "updateFrequency" : 20.0000 + } + }, + + /// The configuration for each individual led. This contains the specification of the area + /// averaged of an input image for each led to determine its color. Each item in the list + /// contains the following fields: + /// * index: The index of the led. This determines its location in the string of leds; zero + /// being the first led. + /// * hscan: The fractional part of the image along the horizontal used for the averaging + /// (minimum and maximum inclusive) + /// * vscan: The fractional part of the image along the vertical used for the averaging + /// (minimum and maximum inclusive) + "leds" : + [ + { + "index" : 0, + "hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 1, + "hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 2, + "hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 3, + "hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 4, + "hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 5, + "hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 6, + "hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 7, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 8, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 9, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 } + }, + { + "index" : 10, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 } + }, + { + "index" : 11, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 } + }, + { + "index" : 12, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 } + }, + { + "index" : 13, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 } + }, + { + "index" : 14, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 } + }, + { + "index" : 15, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 } + }, + { + "index" : 16, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 17, + "hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 18, + "hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 19, + "hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 20, + "hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 21, + "hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 22, + "hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 23, + "hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 24, + "hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 25, + "hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 26, + "hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 27, + "hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 28, + "hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 29, + "hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 30, + "hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 31, + "hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 32, + "hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 33, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 } + }, + { + "index" : 34, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 } + }, + { + "index" : 35, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 } + }, + { + "index" : 36, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 } + }, + { + "index" : 37, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 } + }, + { + "index" : 38, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 } + }, + { + "index" : 39, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 } + }, + { + "index" : 40, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 } + }, + { + "index" : 41, + "hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 42, + "hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 43, + "hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 44, + "hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 45, + "hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 46, + "hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 47, + "hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 48, + "hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + }, + { + "index" : 49, + "hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 }, + "vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 } + } + ], + + /// The black border configuration, contains the following items: + /// * enable : true if the detector should be activated + /// * threshold : Value below which a pixel is regarded as black (value between 0.0 and 1.0) + "blackborderdetector" : + { + "enable" : true, + "threshold" : 0.01 + }, + + /// The configuration of the effect engine, contains the following items: + /// * paths : An array with absolute location(s) of directories with effects + /// * bootsequence : The effect selected as 'boot sequence' + "effects" : + { + "paths" : + [ + "/home/dincs/projects/hyperion/effects" + ] + }, + + "bootsequence" : + { + "effect" : "Rainbow swirl fast", + "duration_ms" : 3000 + }, + + /// The configuration for the frame-grabber, contains the following items: + /// * width : The width of the grabbed frames [pixels] + /// * height : The height of the grabbed frames [pixels] + /// * frequency_Hz : The frequency of the frame grab [Hz] +// "framegrabber" : +// { +// "width" : 64, +// "height" : 64, +// "frequency_Hz" : 10.0 +// }, + + /// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields: + /// * xbmcAddress : The IP address of the XBMC-host + /// * xbmcTcpPort : The TCP-port of the XBMC-server + /// * grabVideo : Flag indicating that the frame-grabber is on(true) during video playback + /// * grabPictures : Flag indicating that the frame-grabber is on(true) during picture show + /// * grabAudio : Flag indicating that the frame-grabber is on(true) during audio playback + /// * grabMenu : Flag indicating that the frame-grabber is on(true) in the XBMC menu + /// * grabScreensaver : Flag indicating that the frame-grabber is on(true) when XBMC is on screensaver + /// * enable3DDetection : Flag indicating that the frame-grabber should switch to a 3D compatible modus if a 3D video is playing +// "xbmcVideoChecker" : +// { +// "xbmcAddress" : "127.0.0.1", +// "xbmcTcpPort" : 9090, +// "grabVideo" : true, +// "grabPictures" : true, +// "grabAudio" : true, +// "grabMenu" : false, +// "grabScreensaver" : true, +// "enable3DDetection" : true +// }, + + /// The configuration of the Json server which enables the json remote interface + /// * port : Port at which the json server is started + "jsonServer" : + { + "port" : 19444 + }, + + /// The configuration of the Proto server which enables the protobuffer remote interface + /// * port : Port at which the protobuffer server is started + "protoServer" : + { + "port" : 19445 + }, + + /// The configuration of the boblight server which enables the boblight remote interface + /// * port : Port at which the boblight server is started +// "boblightServer" : +// { +// "port" : 19333 +// }, + + "endOfJson" : "endOfJson" +} From ad2962bbf4c822aca7e75f8ab90ca0412c812ee0 Mon Sep 17 00:00:00 2001 From: brindosch Date: Tue, 26 Apr 2016 15:54:02 +0200 Subject: [PATCH 11/14] update install with osmc Former-commit-id: c4595324e766c6908a9da4414337a97414c4b92b --- bin/install_hyperion.sh | 6 ++++++ bin/scripts/install_hyperion_beta.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index df38e511..91e1be6e 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -123,6 +123,12 @@ elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_3 -eq 1 ]; then HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_oe.tar.gz OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_1 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_osmc.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_2 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_osmc.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_3 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_osmc.tar.gz elif [ $CPU_RPI -eq 1 ] && [ $RPI_1 -eq 1 ]; then HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz elif [ $CPU_RPI -eq 1 ] && [ $RPI_2 -eq 1 ]; then diff --git a/bin/scripts/install_hyperion_beta.sh b/bin/scripts/install_hyperion_beta.sh index 6d353f6a..5548bb0a 100644 --- a/bin/scripts/install_hyperion_beta.sh +++ b/bin/scripts/install_hyperion_beta.sh @@ -123,6 +123,12 @@ elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_3 -eq 1 ]; then HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_oe.tar.gz OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_1 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_osmc.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_2 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_osmc.tar.gz +elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_3 -eq 1 ]; then + HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_osmc.tar.gz elif [ $CPU_RPI -eq 1 ] && [ $RPI_1 -eq 1 ]; then HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz elif [ $CPU_RPI -eq 1 ] && [ $RPI_2 -eq 1 ]; then From 1e5f3cdd4a81276f68b64ba3b2ae815dbab94a2e Mon Sep 17 00:00:00 2001 From: brindosch Date: Tue, 26 Apr 2016 17:21:30 +0200 Subject: [PATCH 12/14] merged scripts Former-commit-id: 2cc8dd2ab9b5ef7a467e5c90a7ede3ca427f028d --- bin/install_hyperion.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index 91e1be6e..b3452276 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -9,6 +9,10 @@ if [ "$1" = "HyperConInstall" ] || [ "$2" = "HyperConInstall" ]; then HCInstall=1 else HCInstall=0 fi +if [ "$1" = "BETA" ] || [ "$2" = "BETA" ]; then + BETA=1 +else BETA=0 +fi #Check, if script is running as root if [ $(id -u) != 0 ]; then @@ -16,9 +20,15 @@ if [ $(id -u) != 0 ]; then exit 1 fi +#Set welcome message +if [ $BETA -eq 1 ]; then + WMESSAGE="echo This script will update Hyperion to the latest BETA" +else WMESSAGE="echo This script will install/update Hyperion ambilight" +fi + #Welcome message echo '*******************************************************************************' -echo 'This script will install/update Hyperion and it´s services' +$WMESSAGE echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.' echo '*******************************************************************************' @@ -112,8 +122,12 @@ if [ $OS_OPENELEC -eq 1 ]; then else cp -v /opt/hyperion/config/*.json /tmp 2>/dev/null fi +# Select the appropriate download path +if [ $BETA -eq 1 ]; then + HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/beta +else HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/release +fi # Select the appropriate release -HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/release if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_oe.tar.gz OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz @@ -247,16 +261,11 @@ elif [ $USE_SYSTEMD -eq 1 ]; then service hyperion start fi -#Hint for the user with path to config -if [ $OS_OPENELEC -eq 1 ];then - HINTMESSAGE="echo Path to your configuration -> /storage/.config/hyperion.config.json" -else HINTMESSAGE="echo Path to your configuration -> /opt/hyperion/config/hyperion.config.json" -fi echo '*******************************************************************************' echo 'Hyperion Installation/Update finished!' -echo 'Please get a new HyperCon version to benefit from the latest features!' -echo 'Create a new config file, if you encounter problems!' -$HINTMESSAGE +echo 'Please download the latest HyperCon version to benefit from new features!' +echo 'To create a config, follow the HyperCon Guide at our Wiki (EN/DE)!' +echo 'Wiki: wiki.hyperion-project.org Webpage: www.hyperion-project.org' $REBOOTMESSAGE echo '*******************************************************************************' ## Force reboot and prevent prompt if spi is added during a HyperCon Install From 77996fd65a8efbb67379cc2570a1e624b8ab4d76 Mon Sep 17 00:00:00 2001 From: brindosch Date: Thu, 28 Apr 2016 14:46:53 +0200 Subject: [PATCH 13/14] amlogic docu update Former-commit-id: a0293a6becf58fa9a0ee5d7162ba4d8f6b9e189d --- CompileHowto.txt | 2 + bin/scripts/install_hyperion_beta.sh | 287 ------------------------ src/hyperion-remote/hyperion-remote.cpp | 2 +- 3 files changed, 3 insertions(+), 288 deletions(-) delete mode 100644 bin/scripts/install_hyperion_beta.sh diff --git a/CompileHowto.txt b/CompileHowto.txt index 0aa3f059..7c5ecdaa 100644 --- a/CompileHowto.txt +++ b/CompileHowto.txt @@ -29,6 +29,8 @@ cmake -DCMAKE_BUILD_TYPE=Release -Wno-dev .. cmake -DENABLE_WS2812BPWM=ON -DENABLE_WS281XPWM=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. # or if you are not compiling on the raspberry pi (e.g. OrangePi) and need to disable the Dispmanx grabber and support for spi devices cmake -DENABLE_DISPMANX=OFF -DENABLE_SPIDEV=OFF -DENABLE_X11=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. +# on amlogic platforms +cmake -DENABLE_DISPMANX=OFF -DENABLE_SPIDEV=OFF -DENABLE_AMLOGIC=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. # as an alternative for the dispmanx grabber on non-rpi devices (e.g. cubox-i) you could try the framebuffer grabber cmake -DENABLE_DISPMANX=OFF -DENABLE_SPIDEV=OFF -DENABLE_FB=ON -DCMAKE_BUILD_TYPE=Release -Wno-dev .. # for OSX build you need XCode, qt4 libraries and cmake (maybe libusb too). You can use macport or homebrew(recommended) to install them: diff --git a/bin/scripts/install_hyperion_beta.sh b/bin/scripts/install_hyperion_beta.sh deleted file mode 100644 index 5548bb0a..00000000 --- a/bin/scripts/install_hyperion_beta.sh +++ /dev/null @@ -1,287 +0,0 @@ -#!/bin/sh -# Script for downloading and installing the latest Hyperion beta - -# Make sure /sbin is on the path (for service to find sub scripts) -PATH="/sbin:$PATH" - -#Check which arguments are used -if [ "$1" = "HyperConInstall" ] || [ "$2" = "HyperConInstall" ]; then - HCInstall=1 -else HCInstall=0 -fi - -#Check, if script is running as root -if [ $(id -u) != 0 ]; then - echo '---> Critical Error: Please run the script as root (sudo sh ./install_hyperion_beta.sh) -> abort' - exit 1 -fi - -#Welcome message -echo '*******************************************************************************' -echo 'This script will install/update to the latest Hyperion BETA' -echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.' -echo '*******************************************************************************' - -# Find out if we are on OpenElec / OSMC / Raspbian -OS_OPENELEC=`grep -m1 -c OpenELEC /etc/issue` -OS_OSMC=`grep -m1 -c OSMC /etc/issue` -OS_RASPBIAN=`grep -m1 -c 'Raspbian\|RetroPie' /etc/issue` - -# Find out which device this script runs on -CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710' /proc/cpuinfo` -CPU_IMX6=`grep -m1 -c i.MX6 /proc/cpuinfo` -CPU_WETEK=`grep -m1 -c Amlogic /proc/cpuinfo` -CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l` -# Check that we have a known configuration -if [ $CPU_RPI -ne 1 ] && [ $CPU_IMX6 -ne 1 ] && [ $CPU_WETEK -ne 1 ] && [ $CPU_X32X64 -ne 1 ]; then - echo '---> Critical Error: CPU information does not match any known releases -> abort' - exit 1 -fi - -#Check which RPi we are one (in case) -RPI_1=`grep -m1 -c BCM2708 /proc/cpuinfo` -RPI_2=`grep -m1 -c BCM2709 /proc/cpuinfo` -RPI_3=`grep -m1 -c BCM2710 /proc/cpuinfo` - -#Check, if year equals 1970 -DATE=$(date +"%Y") -if [ "$DATE" -le "2015" ]; then - echo "---> Critical Error: Please update your systemtime (Year of your system: ${DATE}) -> abort" - exit 1 -fi - -# check which init script we should use -USE_SYSTEMD=`grep -m1 -c systemd /proc/1/comm` -USE_INITCTL=`which /sbin/initctl | wc -l` -USE_SERVICE=`which /usr/sbin/service | wc -l` - -# Make sure that the boblight daemon is no longer running -BOBLIGHT_PROCNR=$(pidof boblightd | wc -l) -if [ $BOBLIGHT_PROCNR -eq 1 ]; then - echo '---> Critical Error: Found running instance of boblight. Please stop boblight via Kodi menu before installing hyperion -> abort' - exit 1 -fi - -# Stop hyperion daemon if it is running -echo '---> Stop Hyperion, if necessary' -if [ $OS_OPENELEC -eq 1 ]; then - killall hyperiond 2>/dev/null -elif [ $USE_INITCTL -eq 1 ]; then - /sbin/initctl stop hyperion 2>/dev/null -elif [ $USE_SERVICE -eq 1 ]; then - /usr/sbin/service hyperion stop 2>/dev/null -elif [ $USE_SYSTEMD -eq 1 ]; then - service hyperion stop 2>/dev/null - #many people installed with the official script and this just uses service, if both registered -> dead - /usr/sbin/service hyperion stop 2>/dev/null -fi - -#Install dependencies for Hyperion -if [ $OS_OPENELEC -ne 1 ]; then - echo '---> Install/Update Hyperion dependencies (This may take a while)' - apt-get -qq update && apt-get -qq --yes install libqtcore4 libqtgui4 libqt4-network libusb-1.0-0 ca-certificates -fi - -#Check, if dtparam=spi=on is in place (not for OPENELEC) -if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then - SPIOK=`grep '^\dtparam=spi=on' /boot/config.txt | wc -l` - if [ $SPIOK -ne 1 ]; then - echo '---> Raspberry Pi found, but SPI is not ready, we write "dtparam=spi=on" to /boot/config.txt' - sed -i '$a dtparam=spi=on' /boot/config.txt - REBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtparam=spi=on to /boot/config.txt" - fi -fi - -#Check, if dtparam=spi=on is in place (just for OPENELEC) -if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then - SPIOK=`grep '^\dtparam=spi=on' /flash/config.txt | wc -l` - if [ $SPIOK -ne 1 ]; then - mount -o remount,rw /flash - echo '---> Raspberry Pi with OpenELEC found, but SPI is not ready, we write "dtparam=spi=on" to /flash/config.txt' - sed -i '$a dtparam=spi=on' /flash/config.txt - mount -o remount,ro /flash - REBOOTMESSAGE="echo Please reboot your OpenELEC, we inserted dtparam=spi=on to /flash/config.txt" - fi -fi - -#Backup the .conf files, if present -echo '---> Backup Hyperion configuration(s), if present' -rm -f /tmp/*.json 2>/dev/null -if [ $OS_OPENELEC -eq 1 ]; then - cp -v /storage/.config/*.json /tmp 2>/dev/null -else cp -v /opt/hyperion/config/*.json /tmp 2>/dev/null -fi - -# Select the appropriate release -HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/beta -if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_oe.tar.gz - OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_oe.tar.gz - OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_3 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_oe.tar.gz - OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_1 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_osmc.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_2 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_osmc.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $OS_OSMC -eq 1 ] && [ $RPI_3 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_osmc.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $RPI_1 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $RPI_2 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2.tar.gz -elif [ $CPU_RPI -eq 1 ] && [ $RPI_3 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3.tar.gz -elif [ $CPU_IMX6 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_imx6.tar.gz - OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-imx6.tar.gz -elif [ $CPU_WETEK -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_wetek.tar.gz - OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz -elif [ $CPU_X32X64 -eq 1 ]; then - HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x86x64.tar.gz - OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x86x64.tar.gz -else - echo "---> Critical Error: Target platform unknown -> abort" - exit 1 -fi - -# Get and extract the Hyperion binaries and effects -echo '---> Downloading the appropriate Hyperion release' -if [ $OS_OPENELEC -eq 1 ]; then - # OpenELEC has a readonly file system. Use alternative location - echo '---> Downloading Hyperion OpenELEC release' - curl -# -L --get $HYPERION_RELEASE | tar -C /storage -xz - echo '---> Downloading Hyperion OpenELEC dependencies' - curl -# -L --get $OE_DEPENDECIES | tar -C /storage/hyperion/bin -xz - #set the executen bit (failsave) - chmod +x -R /storage/hyperion/bin - # modify the default config to have a correct effect path - sed -i 's:/opt:/storage:g' /storage/hyperion/config/hyperion.config.json - - # /storage/.config is available as samba share. A symbolic link would not be working - false | cp -i /storage/hyperion/config/hyperion.config.json /storage/.config/hyperion.config.json 2>/dev/null -else - wget -nv $HYPERION_RELEASE -O - | tar -C /opt -xz - #set the executen bit (failsave) - chmod +x -R /opt/hyperion/bin - # create links to the binaries - ln -fs /opt/hyperion/bin/hyperiond /usr/bin/hyperiond - ln -fs /opt/hyperion/bin/hyperion-remote /usr/bin/hyperion-remote - ln -fs /opt/hyperion/bin/hyperion-v4l2 /usr/bin/hyperion-v4l2 - ln -fs /opt/hyperion/bin/hyperion-dispmanx /usr/bin/hyperion-dispmanx 2>/dev/null - ln -fs /opt/hyperion/bin/hyperion-x11 /usr/bin/hyperion-x11 2>/dev/null -fi - -# Restore backup of .conf files, if present -echo '---> Restore Hyperion configuration(s), if present' -if [ $OS_OPENELEC -eq 1 ]; then - mv -v /tmp/*.json /storage/.config/ 2>/dev/null -else mv -v /tmp/*.json /opt/hyperion/config/ 2>/dev/null -fi - -# Copy the service control configuration to /etc/int (-n to respect user modified scripts) -if [ $USE_INITCTL -eq 1 ]; then - echo '---> Installing initctl script' - cp -n /opt/hyperion/init.d/hyperion.initctl.sh /etc/init/hyperion.conf 2>/dev/null - initctl reload-configuration -elif [ $OS_OPENELEC -eq 1 ]; then - #modify all old installs with a logfile output - sed -i 's|/dev/null|/storage/logfiles/hyperion.log|g' /storage/.config/autostart.sh - # only add to start script if hyperion is not present yet - if [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperiond | wc -l` -eq 0 ]; then - echo '---> Adding Hyperion to OpenELEC autostart.sh' - echo "/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh - chmod +x /storage/.config/autostart.sh - fi - # only add hyperion-x11 to startup, if not found and x32x64 detected - if [ $CPU_X32X64 -eq 1 ] && [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperion-x11 | wc -l` -eq 0 ]; then - echo '---> Adding Hyperion-x11 to OpenELEC autostart.sh' - echo "DISPLAY=:0.0 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-x11 /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh - fi -elif [ $USE_SYSTEMD -eq 1 ]; then - echo '---> Installing systemd script' - #place startup script for systemd and activate - #Problem with systemd to enable symlinks - Bug? Workaround cp -n (overwrite never) - #Bad workaround for Jessie (systemd) users that used the official script for install - update-rc.d -f hyperion remove 2>/dev/null - rm /etc/init.d/hyperion 2>/dev/null - cp -n /opt/hyperion/init.d/hyperion.systemd.sh /etc/systemd/system/hyperion.service - systemctl -q enable hyperion.service - if [ $OS_OSMC -eq 1 ]; then - echo '---> Modify systemd script for OSMC usage' - # Wait until kodi is sarted (for kodi checker) - sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service - sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service - sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service - sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service - systemctl -q daemon-reload - fi -elif [ $USE_SERVICE -eq 1 ]; then - echo '---> Installing startup script in init.d' - # place startup script in init.d and add it to upstart (-s to respect user modified scripts) - ln -s /opt/hyperion/init.d/hyperion.init.sh /etc/init.d/hyperion 2>/dev/null - chmod +x /etc/init.d/hyperion - update-rc.d hyperion defaults 98 02 -fi - -#chown the /config/ dir and all configs inside for hypercon config upload for non-root logins -if [ $OS_OSMC -eq 1 ]; then - chown -R osmc:osmc /opt/hyperion/config -elif [ $OS_RASPBIAN -eq 1 ]; then - chown -R pi:pi /opt/hyperion/config -fi - -# Start the hyperion daemon -echo '---> Starting Hyperion' -if [ $OS_OPENELEC -eq 1 ]; then - /storage/.config/autostart.sh > /dev/null 2>&1 & -elif [ $USE_INITCTL -eq 1 ]; then - /sbin/initctl start hyperion -elif [ $USE_SERVICE -eq 1 ]; then - /usr/sbin/service hyperion start -elif [ $USE_SYSTEMD -eq 1 ]; then - service hyperion start -fi - -#Hint for the user with path to config -if [ $OS_OPENELEC -eq 1 ];then - HINTMESSAGE="echo Path to your configuration -> /storage/.config/hyperion.config.json" -else HINTMESSAGE="echo Path to your configuration -> /opt/hyperion/config/hyperion.config.json" -fi -echo '*******************************************************************************' -echo 'Hyperion Installation/Update finished!' -echo 'Please get a new HyperCon version to benefit from the latest features!' -echo 'Create a new config file, if you encounter problems!' -$HINTMESSAGE -$REBOOTMESSAGE -echo '*******************************************************************************' -## Force reboot and prevent prompt if spi is added during a HyperCon Install -if [ $HCInstall -eq 1 ] && [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then - echo "Rebooting now, we added dtparam=spi=on to config.txt" - reboot - exit 0 -fi -#Prompt for reboot, if spi added to config.txt -if [ $CPU_RPI -eq 1 ] && [ $SPIOK -ne 1 ]; then - while true - do - echo -n "---> Do you want to reboot your Raspberry Pi now? (y or n) :" - read CONFIRM - case $CONFIRM in - y|Y|YES|yes|Yes) break ;; - n|N|no|NO|No) - echo "---> No reboot - you entered \"$CONFIRM\"" - exit - ;; - *) echo "-> Please enter only y or n" - esac - done - echo "---> You entered \"$CONFIRM\". Rebooting now..." - reboot -fi - -exit 0 \ No newline at end of file diff --git a/src/hyperion-remote/hyperion-remote.cpp b/src/hyperion-remote/hyperion-remote.cpp index 8cbe9e5c..c29c7eed 100644 --- a/src/hyperion-remote/hyperion-remote.cpp +++ b/src/hyperion-remote/hyperion-remote.cpp @@ -63,7 +63,7 @@ int main(int argc, char * argv[]) ImageParameter & argImage = parameters.add ('i', "image" , "Set the leds to the colors according to the given image file"); StringParameter & argEffect = parameters.add ('e', "effect" , "Enable the effect with the given name"); StringParameter & argEffectArgs = parameters.add (0x0, "effectArgs", "Arguments to use in combination with the specified effect. Should be a Json object string."); - SwitchParameter<> & argServerInfo = parameters.add >('l', "list" , "List server info"); + SwitchParameter<> & argServerInfo = parameters.add >('l', "list" , "List server info and active effects with priority and duration"); SwitchParameter<> & argClear = parameters.add >('x', "clear" , "Clear data for the priority channel provided by the -p option"); SwitchParameter<> & argClearAll = parameters.add >(0x0, "clearall" , "Clear data for all active priority channels"); StringParameter & argId = parameters.add ('q', "qualifier" , "Identifier(qualifier) of the transform to set"); From deed8066b058fa8071c48f2114f4e4bdaf2ad88b Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sat, 30 Apr 2016 00:00:33 +1000 Subject: [PATCH 14/14] Piblaster fix (#614) * Removed -HUP so the default -TERM signal is sent instead. - hyperiond only listens for TERM and INT. HUP is often used to get an exe to reread its config Changed pgrep to add '-x' so it wont partial match on the exe name. - I have multiple instances with multiple hyperiond-instance1 names - this ensures the service script only kills the right process * reversing errant change to hyperion.systemd.sh * Experimental changes to piblaster code to work how i think it should It is now assumed that the PWM pins in groups of 3 correspond to RGB channels of the led. "assignment" : "rgbrgbrgb", Would result in: //Channel number GPIO number Led channel // 0 4 0 red // 1 17 0 green // 2 18 0 blue // 4 27 1 red // 5 21 1 green // 6 22 1 blue // 7 23 2 red // 8 24 2 green // 9 25 2 blue * Ammend pwm channel mapping comments to match the code * 1st cut of the new more flexible piblaster pin mapping support it works but is still rough * removed old "assignment" handling - prints an error messaage if found and terminates fixed the switchoff method * removing iPins hard coded list of valid GPIO pins * removed iPins array for switchOff function * code cleanups input validation * Handle catching (and ignoring) SIGPIPE. You can now kill and restart pi-blaster daemon and hyperiond will gracefully recover * added a binary for testing * Added sample config and my modified pi-blaster version to support more GPIOs * moved hyperiond * removed testing binaries move sample configuration to the configs directory * re enabled device config display * removed sample configuration Former-commit-id: 95e4d4ea2fb7cb5439e8cd597883a638da61a574 --- libsrc/leddevice/LedDeviceFactory.cpp | 16 +++- libsrc/leddevice/LedDevicePiBlaster.cpp | 119 ++++++++++++++++-------- libsrc/leddevice/LedDevicePiBlaster.h | 12 ++- 3 files changed, 99 insertions(+), 48 deletions(-) diff --git a/libsrc/leddevice/LedDeviceFactory.cpp b/libsrc/leddevice/LedDeviceFactory.cpp index 43e715a5..6d737ec9 100755 --- a/libsrc/leddevice/LedDeviceFactory.cpp +++ b/libsrc/leddevice/LedDeviceFactory.cpp @@ -206,11 +206,21 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig) { const std::string output = deviceConfig.get("output", "").asString(); const std::string assignment = deviceConfig.get("assignment", "").asString(); + const Json::Value gpioMapping = deviceConfig.get("gpiomap", Json::nullValue); - LedDevicePiBlaster * devicePiBlaster = new LedDevicePiBlaster(output, assignment); - devicePiBlaster->open(); + if (assignment.length() > 0) { + std::cout << "ERROR: Sorry, the configuration syntax has changed in this version." << std::endl; + exit(EXIT_FAILURE); + } + if (! gpioMapping.isNull() ) { + LedDevicePiBlaster * devicePiBlaster = new LedDevicePiBlaster(output, gpioMapping); + devicePiBlaster->open(); - device = devicePiBlaster; + device = devicePiBlaster; + } else { + std::cout << "ERROR: no gpiomap defined." << std::endl; + exit(EXIT_FAILURE); + } } else if (type == "sedu") { diff --git a/libsrc/leddevice/LedDevicePiBlaster.cpp b/libsrc/leddevice/LedDevicePiBlaster.cpp index 9fe02a8b..dc09fe15 100644 --- a/libsrc/leddevice/LedDevicePiBlaster.cpp +++ b/libsrc/leddevice/LedDevicePiBlaster.cpp @@ -2,6 +2,11 @@ // STL includes #include #include +#include + + +// jsoncpp includes +#include // QT includes #include @@ -9,12 +14,40 @@ // Local LedDevice includes #include "LedDevicePiBlaster.h" -LedDevicePiBlaster::LedDevicePiBlaster(const std::string & deviceName, const std::string & channelAssignment) : +LedDevicePiBlaster::LedDevicePiBlaster(const std::string & deviceName, const Json::Value & gpioMapping) : _deviceName(deviceName), - _channelAssignment(channelAssignment), _fid(nullptr) { - // empty + + signal(SIGPIPE, SIG_IGN); + +// initialise the mapping tables +// -1 is invalid +// z is also meaningless +// { "gpio" : 4, "ledindex" : 0, "ledcolor" : "r" }, + #define TABLE_SZ sizeof(_gpio_to_led)/sizeof(_gpio_to_led[0]) + + for (int i=0; i < TABLE_SZ; i++ ) + { + _gpio_to_led[i] = -1; + _gpio_to_color[i] = 'z'; + } + +// walk through the json config and populate the mapping tables + for (const Json::Value& gpioMap : gpioMapping) + { + const int gpio = gpioMap.get("gpio",-1).asInt(); + const int ledindex = gpioMap.get("ledindex",-1).asInt(); + const std::string ledcolor = gpioMap.get("ledcolor","z").asString(); +// printf ("got gpio %d ledindex %d color %c\n", gpio,ledindex, ledcolor[0]); + // ignore missing/invalid settings + if ( (gpio >= 0) && (gpio < TABLE_SZ) && (ledindex >= 0) ){ + _gpio_to_led[gpio] = ledindex; + _gpio_to_color[gpio] = ledcolor[0]; // 1st char of string + } else { + printf ("IGNORING gpio %d ledindex %d color %c\n", gpio,ledindex, ledcolor[0]); + } + } } LedDevicePiBlaster::~LedDevicePiBlaster() @@ -63,15 +96,6 @@ int LedDevicePiBlaster::open(bool report) return 0; } -//Channel number GPIO number Pin in P1 header -// 0 4 P1-7 -// 1 17 P1-11 -// 2 18 P1-12 -// 3 21 P1-13 -// 4 22 P1-15 -// 5 23 P1-16 -// 6 24 P1-18 -// 7 25 P1-22 int LedDevicePiBlaster::write(const std::vector & ledValues) { // Attempt to open if not yet opened @@ -80,32 +104,47 @@ int LedDevicePiBlaster::write(const std::vector & ledValues) return -1; } - std::vector iPins = {4, 17, 18, 27, 21, 22, 23, 24, 25}; - - unsigned colorIdx = 0; - for (unsigned iPin=0; iPin= 0) && (valueIdx < (signed) ledValues.size()) ) { - case 'r': - pwmDutyCycle = ledValues[colorIdx].red / 255.0; - ++colorIdx; - break; - case 'g': - pwmDutyCycle = ledValues[colorIdx].green / 255.0; - ++colorIdx; - break; - case 'b': - pwmDutyCycle = ledValues[colorIdx].blue / 255.0; - ++colorIdx; - break; - default: - continue; - } + double pwmDutyCycle = 0.0; +// printf ("iPin %d valueIdx %d color %c\n", iPin, valueIdx, _gpio_to_color[ iPins[iPin] ] ) ; + switch (_gpio_to_color[ i ]) + { + case 'r': + pwmDutyCycle = ledValues[valueIdx].red / 255.0; + break; + case 'g': + pwmDutyCycle = ledValues[valueIdx].green / 255.0; + break; + case 'b': + pwmDutyCycle = ledValues[valueIdx].blue / 255.0; + break; + case 'w': + pwmDutyCycle = ledValues[valueIdx].red; + pwmDutyCycle += ledValues[valueIdx].green; + pwmDutyCycle += ledValues[valueIdx].blue; + pwmDutyCycle /= (3.0*255.0); + break; + default: + continue; + } - fprintf(_fid, "%i=%f\n", iPins[iPin], pwmDutyCycle); - fflush(_fid); +// fprintf(_fid, "%i=%f\n", iPins[iPin], pwmDutyCycle); + + if ( (fprintf(_fid, "%i=%f\n", i, pwmDutyCycle) < 0) + || (fflush(_fid) < 0)) { + if (_fid != nullptr) + { + fclose(_fid); + _fid = nullptr; + return -1; + } + } + } } return 0; @@ -119,13 +158,13 @@ int LedDevicePiBlaster::switchOff() return -1; } - std::vector iPins = {4, 17, 18, 21, 22, 23, 24, 25}; - - for (unsigned iPin=0; iPin= 0) { - fprintf(_fid, "%i=%f\n", iPins[iPin], 0.0); + fprintf(_fid, "%i=%f\n", i, 0.0); fflush(_fid); } } diff --git a/libsrc/leddevice/LedDevicePiBlaster.h b/libsrc/leddevice/LedDevicePiBlaster.h index 3e79856e..531372a6 100644 --- a/libsrc/leddevice/LedDevicePiBlaster.h +++ b/libsrc/leddevice/LedDevicePiBlaster.h @@ -4,6 +4,9 @@ // STL includes #include +// jsoncpp includes +#include + // Hyperion-Leddevice includes #include @@ -14,9 +17,9 @@ public: /// Constructs the PiBlaster device which writes to the indicated device and for the assigned /// channels /// @param deviceName The name of the output device - /// @param channelAssignment The RGB-Channel assignment (8 characters long) + /// @param gpioMapping The RGB-Channel assignment json object /// - LedDevicePiBlaster(const std::string & deviceName, const std::string & channelAssignment); + LedDevicePiBlaster(const std::string & deviceName, const Json::Value & gpioMapping); virtual ~LedDevicePiBlaster(); @@ -50,9 +53,8 @@ private: /// The name of the output device (very likely '/dev/pi-blaster') const std::string _deviceName; - /// String with eight characters with the rgb-channel assignment per pwm-channel - /// ('r' = red, 'g' = green, 'b' = blue, ' ' = empty) - const std::string _channelAssignment; + int _gpio_to_led[64]; + char _gpio_to_color[64]; /// File-Pointer to the PiBlaster device FILE * _fid;