We have several threads where users want to force a display mode, which is not detected by LE. To my knowledge, there is no way.
Posts by Da Flex
-
-
-
PS: Ich weiss nicht, welche add-ons Du schon installiert hast. Für die verwendete Python-GPIO-Bibliothek braucht man das add-on "Raspberry Pi Tools".
Evtl. kann es sein, dass autostart.sh und/oder volume_regulator.py mit chmod +x <Dateiname> ausführbar gemacht werden müssen.
Du kannst autostart.sh testen, indem Du es direkt vom SSH-Terminal mit /storage/.config/autostart.sh aufrufst.
-
der Befehl für Volume +- ist
kodi-send --action="VolumeUp"
kodi-send --action="VolumeDown"
Das macht es einfacher. Dann fällt die umständliche Abfrage der bisherigen Lautstärke weg.
Der Code müsste dann so aussehen (mit extra Button-Definition des Reglers zum Stumm schalten):
Python
Display More#!/usr/local/bin/python3 import RPi.GPIO as GPIO from KY040 import KY040 import os import time # Lautstärke ändern, wenn der ky-040 gedreht wird def rotaryChange(direction): if direction == 1: os.system("kodi-send --action='VolumeUp'") else: os.system("kodi-send --action='VolumeDown'") # Funktion ausführen, wenn der ky-040 gedrückt wird def switchPressed(): os.system("kodi-send --action='Mute'") if __name__ == "__main__": CLOCKPIN = 5 DATAPIN = 6 SWITCHPIN = 13 GPIO.setmode(GPIO.BCM) ky040 = KY040(CLOCKPIN, DATAPIN, SWITCHPIN, rotaryChange, switchPressed) ky040.start() try: while True: time.sleep(0.05) finally: ky040.stop() GPIO.cleanup()Installation:
- Ordner für das Python-Script anlegen: mkdir /storage/scripts
- Script-Datei erstellen: > /storage/scripts/volume_regulator.py
- Code einfügen und speichern
- Python-Bibliothek KY040.py aus dem Start-Posting in den gleichen Ordner kopieren
- Script beim Start von LE ausführen, dazu Inhalt von /storage/.config/autostart.sh wie folgt:
-
Wie ist das mit Zeile 9-11 ?
Das Kommando zum Setzen der Lautstärke erwartet eine Angabe in Prozent (relevant für Code-Zeilen 18 und 20).
Beispiel: Lautstärke auf 80% mit Bildschirm-Ausgabe zur visuellen Bestätigung (Option "true"):
Es muss also vorher die bereits eingestellte Lautstärke in Prozent ermittelt werden. Das geht per JSON-Anfrage:
Codecurl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"Application.GetProperties\", \"params\" : { \"properties\" : [ \"volume\", \"muted\" ] }, \"id\" : 1 }" http://libre-elec:8080/jsonrpcErgebnis der JSON-Anfrage:
Problem: Das Ergebnis muss noch geparsed werden, um nur die Zahl 80 (%) zu bekommen.
Verwende also statt Zeile 9-11 das genannte Kommando, und eine Regular Expression, mit der Du vom JSON-Ergebnis zum Prozentwert konvertierst. Dann den Step-Wert vom Regler addieren oder subtrahieren. Das Ergebnis wie gezeigt per kodi-send übergeben.
Probiere die Kommandos im SSH-Terminal aus, bevor Du sie in Dein Python-Script übernimmst.
-
-
Mach' es so, wie CvH geschrieben hat, also per os.system und kodi-send. amixer geht nicht.
-
Looks like the LE server was offline:
Code2019-09-14 19:21:59.191 T:140409242113792 ERROR: ## LibreELEC Addon ## oe::load_url(http://releases.libreelec.tv/releases.json) ## ERROR: (URLError(error(110, 'Connection timed out'),)) 2019-09-14 19:21:59.191 T:140409242113792 ERROR: Traceback (most recent call last): File "/var/lib/jenkins/LE/build2/workspace/Generic/build.LibreELEC-Generic.x86_64-9.0.2/LibreELEC-settings-37e206b712a46213522a567a408382f5f082502a/.install_pkg/usr/share/kodi/addons/service.libreelec.settings/oe.py", line 270, in load_url File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen File "/usr/lib/python2.7/urllib2.py", line 429, in open File "/usr/lib/python2.7/urllib2.py", line 447, in _open File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open URLError: <urlopen error [Errno 110] Connection timed out>You can switch add-on updates to manual as a workaround.
-
I assume you want to attach it to a running LE machine.
LE can handle different file systems. They will be auto-detected and auto-mounted by LE.
If you have an external HDD, and occasionally want to attach it to a Windows PC, too, format as NTFS.
If it's for LE only, format as EXT4.
-
Use a bootable USB stick with an OS specialized for device checking. Your HTPC can probably boot from stick.
GParted LIve can check and repair partitions. Especially it can leave bad blocks out when reformatting a partition.
Be sure to make an LE backup before you try to repair anything.
-
Evarything fine now, but didn't really understand why the german language was disabled in my case...
Checking the device for errors still can't hurt. If you haven't changed the settings, there must be a different cause for the error.
-
I still can't see a graphics problem resulting into bad blocks on a storage problem. But anything is possible, I guess.
When a texture has partially been stored in bad blocks, then the texture can't be loaded by Kodi.
-
Isn't 9.1.X the only version that runs on the Pi4?
Yes. I'm using an RPi 3B+, and had the safe mode error a couple of times with LE 9.1.x.
That's why I suggest 9.0.x for all RPi lower than version 4.
-
It's right, because they made an upload error before.
LE 9.1.x was wrongly sorted into the 9.0.x branch. Now it's on a new branch, which means 9.0.2 is the latest on the 9.0.x branch.
My suggestion is to "update" to 9.0.2, because 9.1.x has known errors (occasionally goes into safe mode without a cause).
-
So... How are incorrect internal memory pointers & segmentation faults exactly causing broken (external) storage devices? It sounds like a big leap to me.
schlucke and me are referencing to this part of the log file:
CodeProgram terminated with signal SIGSEGV, Segmentation fault. #0 0x0000000000b0d8f0 in CGLTexture::DestroyTextureObject() ()My interpretation is that a graphical element (CGL texture) of LE can't be loaded. Because it was loaded many times before, I came to the conclusion above.
-
Those errors are typical for broken storage devices. Check your LE installation device (bad blocks etc.).
-
It's not what you're asking for, but an HDMI audio extractor can deliver analogue audio, too. It's a pretty universal tool, and you'll avoid any driver issues.
-
mmh can not find the artwork disable function
First entry at the Artwork menu should be about "fanart". Disable that.