diff --git a/HyperDRM.manifest.json b/HyperDRM.manifest.json index b9221af..ae1255a 100644 --- a/HyperDRM.manifest.json +++ b/HyperDRM.manifest.json @@ -1,15 +1,15 @@ { "id": "org.webosbrew.histogramhyperion", - "version": "0.6.1", + "version": "0.6.2", "type": "web", "title": "HyperDRM", - "appDescription": "Ambient Light für webOS und Hyperion", + "appDescription": "Ambient lighting for webOS and Hyperion", "iconUri": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/app/icon.png", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM", "rootRequired": true, - "ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.6.1_arm.ipk", + "ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.6.2_arm.ipk", "ipkHash": { - "sha256": "164f8e18139fbd931de5999d744f0633cca8c979570727db81777ba430d41f29" + "sha256": "9de20a046176168428378346872934c1fbbee79f33f99451addd880f193892ed" }, - "ipkSize": 1163172 + "ipkSize": 1163072 } diff --git a/HyperDRM_0.6.1_arm.ipk b/HyperDRM_0.6.2_arm.ipk similarity index 91% rename from HyperDRM_0.6.1_arm.ipk rename to HyperDRM_0.6.2_arm.ipk index bc85ea8..a057c47 100644 Binary files a/HyperDRM_0.6.1_arm.ipk and b/HyperDRM_0.6.2_arm.ipk differ diff --git a/README.md b/README.md index 966b9ba..b25a96e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Only the own service is modified. No Hue, LG library, driver or firmware binarie ## Installation -The current package is [HyperDRM_0.6.1_arm.ipk](HyperDRM_0.6.1_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow. +The current package is [HyperDRM_0.6.2_arm.ipk](HyperDRM_0.6.2_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow. Elevate the installed own service through Homebrew Channel: @@ -35,15 +35,15 @@ luna-send -n 1 luna://org.webosbrew.hbchannel.service/elevateService '{"id":"org Perform elevation before first opening the app or calling its service. If the service was already started without root, elevation updates its launch permissions but does not restart the existing process: terminate only the own `histogram-service` process (verify its executable path first), then reopen the app or call start again. Closing the UI alone does not terminate the native service. -Open **HyperDRM** on the TV and select **Starten**. Hyperion's JSON server must be enabled on port 19444. The existing Hyperion LED device/output configuration remains responsible for controlling the hardware. +Open **HyperDRM** on the TV and select **Start**. Hyperion's JSON server must be enabled on port 19444. The existing Hyperion LED device/output configuration remains responsible for controlling the hardware. The internal app/service IDs remain `org.webosbrew.histogramhyperion` and `org.webosbrew.histogramhyperion.service` so existing installations and the autostart hook remain compatible. Hyperion displays the source as **HyperDRM**. After changing the LED layout, restart the service. ## Autostart -The app's **Autostart: Ein/Aus** switch controls the own hook `/var/lib/webosbrew/init.d/60-histogramhyperion`. Homebrew Channel runs it during boot after service elevation. It retries start while the TV and Hyperion initialize, with up to 120 attempts separated by five seconds. The Homebrew failsafe can suppress boot hooks. +The app's **Autostart: On/Off** switch controls the own hook `/var/lib/webosbrew/init.d/60-histogramhyperion`. Homebrew Channel runs it during boot after service elevation. It retries start while the TV and Hyperion initialize, with up to 120 attempts separated by five seconds. The Homebrew failsafe can suppress boot hooks. -**Stoppen** ends the current capture session and leaves the saved autostart preference unchanged. The hook is a symlink to `boot.sh` inside the service container. Removal leaves a harmless dangling link; the script also exits when its service target is absent. Turning autostart off removes the own hook and cancels waiting boot attempts. A foreign file or symlink at that path will not be overwritten. +**Stop** ends the current capture session and leaves the saved autostart preference unchanged. The hook is a symlink to `boot.sh` inside the service container. Removal leaves a harmless dangling link; the script also exits when its service target is absent. Turning autostart off removes the own hook and cancels waiting boot attempts. A foreign file or symlink at that path will not be overwritten. Boot log: `/var/lib/webosbrew/histogramhyperion-boot.log`. diff --git a/app/app.js b/app/app.js index d2fc8b1..07f663d 100644 --- a/app/app.js +++ b/app/app.js @@ -1,23 +1,23 @@ 'use strict'; var pending=[]; function call(method,done,data){ - if(typeof PalmServiceBridge==='undefined'){done({returnValue:false,errorText:'Diese App benötigt einen LG-TV mit installiertem nativem Dienst.'});return;} + if(typeof PalmServiceBridge==='undefined'){done({returnValue:false,errorText:'This app requires an LG TV with the native service installed.'});return;} var bridge=new PalmServiceBridge(),timer,finished=false; function finish(value){if(finished)return;finished=true;clearTimeout(timer);var i=pending.indexOf(bridge);if(i>=0)pending.splice(i,1);done(value);} - bridge.onservicecallback=function(raw){try{finish(JSON.parse(raw));}catch(e){finish({returnValue:false,errorText:'Ungültige Antwort vom Dienst'});}}; - pending.push(bridge);timer=setTimeout(function(){bridge.cancel();finish({returnValue:false,errorText:'Der Dienst antwortet nicht. Installation und Dienstprotokoll prüfen.'});},10000); + bridge.onservicecallback=function(raw){try{finish(JSON.parse(raw));}catch(e){finish({returnValue:false,errorText:'Invalid service response'});}}; + pending.push(bridge);timer=setTimeout(function(){bridge.cancel();finish({returnValue:false,errorText:'The service is not responding. Check the installation and service log.'});},10000); bridge.call('luna://org.webosbrew.histogramhyperion.service/'+method,JSON.stringify(data||{})); } function display(result){ - if(typeof result.autostart==='boolean'){var toggle=document.getElementById('autostart');toggle.setAttribute('aria-checked',String(result.autostart));toggle.textContent='Autostart: '+(result.autostart?'Ein':'Aus');} + if(typeof result.autostart==='boolean'){var toggle=document.getElementById('autostart');toggle.setAttribute('aria-checked',String(result.autostart));toggle.textContent='Autostart: '+(result.autostart?'On':'Off');} document.getElementById('error').textContent=result.errorText||result.error||''; - document.getElementById('status').textContent=result.returnValue===false?'Dienst nicht bereit':(result.running?'Aktiv':'Gestoppt')+' · '+(result.frames||0)+' bestätigte Farbausgaben'; - if(result.colorValid)document.getElementById('status').textContent+=result.spatialOutput?' · '+result.ledCount+' LEDs aus 16 Farbbereichen':' · Gesendetes RGB: '+result.outputColor.join(', '); - else if(result.returnValue!==false)document.getElementById('status').textContent+=' · Keine aktuelle Farbausgabe'; - if(result.blackBarDetection && result.running)document.getElementById('status').textContent+=result.letterboxDetected?' · Balken oben/unten erkannt':' · Vollbild-Erfassung'; - if(result.spatialInterpolation)document.getElementById('status').textContent+=' · Feine Farbübergänge'; + document.getElementById('status').textContent=result.returnValue===false?'Service unavailable':(result.running?'Running':'Stopped')+' · '+(result.frames||0)+' acknowledged color updates'; + if(result.colorValid)document.getElementById('status').textContent+=result.spatialOutput?' · '+result.ledCount+' LEDs from 16 color regions':' · Output RGB: '+result.outputColor.join(', '); + else if(result.returnValue!==false)document.getElementById('status').textContent+=' · No current color output'; + if(result.blackBarDetection && result.running)document.getElementById('status').textContent+=result.letterboxDetected?' · Top/bottom black bars detected':' · Full-screen capture'; + if(result.spatialInterpolation)document.getElementById('status').textContent+=' · Smooth color transitions'; var box=document.getElementById('regions');box.textContent=''; - (result.regions||[]).forEach(function(rgb,index){var e=document.createElement('div');e.className='swatch';e.style.backgroundColor='rgb('+rgb.join(',')+')';e.title='Histogramm '+index;box.appendChild(e);}); + (result.regions||[]).forEach(function(rgb,index){var e=document.createElement('div');e.className='swatch';e.style.backgroundColor='rgb('+rgb.join(',')+')';e.title='Histogram '+index;box.appendChild(e);}); } document.getElementById('start').onclick=function(){call('start',function(r){if(r.returnValue===false)display(r);else call('status',display);});}; document.getElementById('stop').onclick=function(){call('stop',function(){call('status',display);});}; diff --git a/app/appinfo.json b/app/appinfo.json index 5ec7645..65143aa 100644 --- a/app/appinfo.json +++ b/app/appinfo.json @@ -1 +1 @@ -{"id": "org.webosbrew.histogramhyperion", "version": "0.6.1", "vendor": "Local development", "type": "web", "main": "index.html", "title": "HyperDRM", "icon": "icon.png", "resolution": "1920x1080", "disableBackHistoryAPI": true, "largeIcon": "large-icon.png", "appDescription": "Ambient Light für webOS und Hyperion", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"} \ No newline at end of file +{"id": "org.webosbrew.histogramhyperion", "version": "0.6.2", "vendor": "Local development", "type": "web", "main": "index.html", "title": "HyperDRM", "icon": "icon.png", "resolution": "1920x1080", "disableBackHistoryAPI": true, "largeIcon": "large-icon.png", "appDescription": "Ambient lighting for webOS and Hyperion", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"} \ No newline at end of file diff --git a/app/index.html b/app/index.html index eb1a681..2a87315 100644 --- a/app/index.html +++ b/app/index.html @@ -1,8 +1,8 @@ -
HyperDRMAmbient Light für webOS und Hyperion.
Dienst wird geprüft …
- -Startet den Dienst beim TV-Boot. Stoppen beendet nur die aktuelle Sitzung.
-127.0.0.1:19444 · Priorität 149 · 10 Abfragen pro Sekunde
-Das Hyperion-Layout bestimmt Anzahl und Positionen der LEDs. Die Farben stammen aus 16 LG-Histogrammbereichen mit interpolierten Randfarben. Nach einer Layoutänderung den Dienst neu starten.
+
HyperDRMAmbient lighting for webOS and Hyperion.
Checking service …
+ +Starts the service when the TV boots. Stop ends only the current session.
+127.0.0.1:19444 · Priority 149 · 10 updates per second
+The Hyperion layout determines the number and positions of LEDs. Colors come from 16 LG histogram regions with interpolated edge colors. Restart the service after changing the LED layout.
diff --git a/native/service.c b/native/service.c index d6f9dde..ee5ee9a 100644 --- a/native/service.c +++ b/native/service.c @@ -150,7 +150,7 @@ static bool autostart(void *h,void *m,void *ctx){ static bool status(void *h,void *m,void *ctx){ (void)ctx;char json[4096],safe[512];size_t n=0; for(size_t i=0;last_error[i] && n+2