Posts by ghtester

    No problem, you don't need to put whole RPi in front. It's all about the IR LED position & power. The cable / wires to IR LED and IR sensor can be long and thin enough so it's up to you which design you select. If you plan to control just your single TV, I believe you can do it so the both IR sensors can be almost invisible, even without opening the TV box.

    Both outlined solutions should work, a relay everytime and IR if your TV can be controlled through IR Remote Control (in this case you can use RPi to send IR commands through a simple HW with IR diode to TV). I am using both methods. IR is more universal (and safe as you don't need to work with High Voltage circuits) so you can record IR commands from original IR Remote Control for any IR controlled device and then send these IR commands from RPi to devices (including but not only power on / power off).

    Only one IR Remote Control is necessary - even from your old TV - to control RPi and RPi can control your TV or another devices around (that are covered by the IR diode range).

    BTW. another quick memory leak encountered on 'client' RPi 4B/2GB (in the meantime upgraded so running LE Nightly 20220212-d9a07e9):

    top - 22:58:46 up 5:45, 1 user, load average: 1.63, 1.43, 1.31

    Tasks: 155 total, 2 running, 153 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 0.0 us, 16.7 sy, 0.0 ni, 83.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st

    MiB Mem : 1847.1 total, 37.2 free, 1605.0 used, 204.8 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 152.7 avail Mem

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

    1662 root 20 0 2076732 1.5g 84236 R 50.0 82.5 71:02.91 kodi.bin

    The memory suddenly started decreasing - about 0,5 MB per second.

    After moving Timeshift back (Left Arrow IR Remote key) it stabilized:

    top - 22:59:22 up 5:45, 1 user, load average: 1.62, 1.45, 1.32

    Tasks: 155 total, 1 running, 154 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 5.6 us, 2.8 sy, 0.6 ni, 91.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st

    MiB Mem : 1847.1 total, 753.4 free, 906.3 used, 187.4 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 853.0 avail Mem

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

    1662 root 20 0 1358388 843396 84192 D 16.9 44.6 71:12.32 kodi.bin

    I agree we are sliding to OT, so the last remark... ;)

    Regarding to relays - it is much more dangerous than IR because of a high voltage in the circuit. So be careful if you don't have an experience with this. There are some nice examples:

    Raspberry Pi power on - enable relay
    There are loads of Youtube videos on how to control a relay, but I simply want to be able to power up my Pi and let it activate a relay. Then, when I power it…
    raspberrypi.stackexchange.com
    How to Control a Relay using Raspberry Pi | Electronics Hub
    In this project, we will learn about Relay and Relay Module, interface a Relay with Raspberry Pi and see how to control a Relay using Raspberry Pi. This…
    www.electronicshub.org

    No problem, I understand your trouble, despite I did not expect the major request reason described. :)

    Please note if there's an issue with a single backlight LED, you can expect some another LEDs failing soon as well...

    BTW. I saw even so burned out backlight LED that the white folio around was burned too. So it might be even dangerous when not fixed. And the recommended fix is to replace the whole backlight if possible.

    FYI there's an example regarding to IR send / receive hardware. Of course the CR2032 battery is not necessary as the circuit can be powered from RPi. https://www.digikey.com/en/maker/blogs…-a-raspberry-pi

    The software utilities are already part of LE and it just need to be configured easily.

    Well, I am using Timeshift by default (permanently enabled) while I am watching Live TV. So it's always somehow related with the described issues. I am rarely watching recordings so all described issues are related to Live TV + DVB-T2.

    There were always issues with Timeshift but I don't know if a memory leak was there as well in past as I started discovering the issues more deeply several weeks ago. And some issues were hard to address on the same device. Now, separated to 2 devices, some issues are more visible. But it looks to me some issues (that forced me to analyzing it) appeared in recent Nightly builds with updated kernel release.

    In general, I am observing the (not just memory) issues depends on:

    - moving the Timeshift point

    - data stream speed (more often at higher data rates)

    - uptime / time of using (watching the same channel, usually several hours are needed to encounter the trouble).

    And now I can confirm the DVB-T adapter firmware reload happens due to Tvheadend 4.2 service's (unexpected) restart on 'server' RPi 4B/4GB device (without OOM killer action).

    BTW. this is a current top output on 'client' RPi 4B/2GB after almost 19 hours:

    top - 12:58:08 up 18:42, 1 user, load average: 1.69, 1.43, 1.41

    Tasks: 156 total, 1 running, 155 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 6.2 us, 3.4 sy, 0.2 ni, 90.0 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st

    MiB Mem : 1847.1 total, 963.3 free, 540.3 used, 343.4 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1203.6 avail Mem

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

    1660 root 20 0 1054956 480324 100192 D 32.1 25.4 236:23.04 kodi.bin



    After restarting (just) Kodi:

    top - 13:26:12 up 19:10, 1 user, load average: 1.61, 1.37, 1.35

    Tasks: 155 total, 1 running, 154 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 7.3 us, 3.1 sy, 0.2 ni, 89.4 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st

    MiB Mem : 1847.1 total, 1284.2 free, 237.2 used, 325.7 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1525.1 avail Mem

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

    10968 root 20 0 751632 155516 80752 D 21.5 8.2 0:17.31 kodi.bin

    The workaround is to stop using HDMI CEC ;)

    The major issue is there's almost NO compatibility between HDMI CEC capable devices, every vendor supports a different subset of HDMI CEC features and often it's a nightmare (or it's even impossible) to make it working as you wish.

    This is my experience based on long-time experimenting with 2 TV sets & LibreELEC's HDMI CEC support. Then I gave it up completely.

    So the question is what do you need from HDMI CEC.

    In my case it was just to turn on / off the TV set/display per request from LibreELEC. Even this most simple request did not work on my old LG TV as it was not possible to turn it off through HDMI CEC (the command was accepted but ignored).

    In your case TV accepts power off command but then stops receiving further HDMI CEC commands until turned on manually again. Perhaps there is a sleep command that you can use instead of power off. Also check if your TV does not offer some more deep HDMI CEC configuration.

    As I am using RPi 4B devices, the solution was to use GPIO pins for:

    1) control a relay for powering the TV/display

    2) send IR commands to TV

    A simple additional hardware (a relay, some resistors & transistors and IR diode) is necessary but it works much more universal and 100% reliable.

    btw. this is a top output after upgrade to LE 11 Nightly 20220212 after fresh boot:

    top - 18:18:26 up 2 min, 1 user, load average: 1.81, 0.97, 0.39

    Tasks: 162 total, 2 running, 160 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 4.7 us, 2.7 sy, 0.4 ni, 92.1 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st

    MiB Mem : 1847.1 total, 1294.7 free, 241.5 used, 310.9 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1522.6 avail Mem

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

    1660 root 20 0 716288 159264 81096 D 16.6 8.4 1:32.93 kodi.bin

    So it's obvious there is a memory leak somewhere/sometimes.

    The same isue on LE Nightly 20220209.

    2022-02-11 12:56:04.814 T:22439 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)

    2022-02-11 12:56:15.564 T:22439 INFO <general>: Skipped 464 duplicate messages..

    2022-02-11 12:56:15.564 T:22439 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)

    2022-02-11 12:56:25.616 T:22439 INFO <general>: Skipped 574 duplicate messages..

    2022-02-11 12:56:25.616 T:22439 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)

    2022-02-11 12:56:36.214 T:22439 INFO <general>: Skipped 453 duplicate messages..

    2022-02-11 12:56:36.214 T:22439 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)

    2022-02-11 12:56:46.255 T:22439 INFO <general>: Skipped 571 duplicate messages..

    2022-02-11 12:56:46.255 T:22439 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)

    LE:~ #

    Just encountered a quick memory exhausting on client's RPi 4B/2G while watching LiveTV (fullHD stream, H.265), running LE 11 Nightly 20220209, Tvheadend HTSP client. Tvheadend server is running on another RPi 4B/4GB with LE 11 Nightly 20220207, LAN connection.

    I am monitoring free (available) memory with a script, displaying alert on screen with free memory value when avail Mem is less than 300 MB. So if I am currently watching, I have some time to react.

    The issue happened some time after Timeshift move back (by left arrow IR Remote key push one times). I have encountered the Timeshift bar jumped somewhere but not a few seconds back as it should. Looked like the Timeshift bar was 'confused'. I let it be and kept watching.

    After several minutes the free memory fell under 300 MB and went down quickly. When it was less than 100 MB, I started pushing left and right arrows to move the Timeshift point and prevent an OOM crash. This helped freeing memory again but not to usual value:

    Now:

    top - 04:03:32 up 1 day, 6:14, 1 user, load average: 1.65, 1.66, 1.62

    Tasks: 155 total, 1 running, 154 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 3.0 us, 2.3 sy, 0.3 ni, 94.3 id, 0.0 wa, 0.0 hi, 0.2 si, 0.0 st

    MiB Mem : 1847.1 total, 806.1 free, 894.8 used, 146.2 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 860.2 avail Mem

    Usually:

    top - 18:05:47 up 1 day, 17:14, 1 user, load average: 1.47, 1.46, 1.40

    Tasks: 156 total, 2 running, 154 sleeping, 0 stopped, 0 zombie

    %Cpu(s): 9.6 us, 2.8 sy, 0.2 ni, 85.7 id, 1.7 wa, 0.0 hi, 0.0 si, 0.0 st

    MiB Mem : 1847.1 total, 906.9 free, 487.9 used, 452.3 buff/cache

    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1236.9 avail Mem


    After several minutes the memory started falling down again. Moving Timeshift point again helped, did not have time to look which app was eating the memory. But kodi.bin currently consumes 40,4% of memory which looks a quite high:

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

    1665 root 20 0 1364944 764848 79392 D 19.5 40.4 437:56.89 kodi.bin

    I was waiting but the issue did not repeat again.


    BTW. Is there any way to disable the rpivid feb10000.codec: PPS changed message, spamming the kernel log quickly for ages?

    Thanks for the reply. I don't think it's a power issue in this case as the PSU is really strong (30W) and the T230C DVB-T2 adapter is not so power hungry but I'll check. There's a short USB extension cable, maybe it could play some role - to be checked.

    I am not sure if the USB2 or USB3 port is used, to be checked in the evening and I can try to swap. Yesterday I have also updated to LE Nightly 20220207 so I'll see...

    Update - the DVB-T2 adapter was connected to USB3 port and during the night it was reinitialized again so I reconnected it to USB2 port instead.

    It looks the adapter reinitialization depends on data stream - happens more often when the video stream is 1920x1080p than with lower one.

    Update2 - the same or similar issue with DVB-T2 adapter connected to USB2 port. But also observed the situation that Timeshift got disabled on client without DVB-T2 reinitialization on server LE.

    Also encountered the same issue on client (Timeshift got disabled ) while only partial DVB-T2 adapter reinit - just the si2168 firmware was downloaded again:

    [89578.426312] si2168 22-0064: downloading firmware from file 'dvb-demod-si2168-d60-01.fw'

    [89579.552758] si2168 22-0064: firmware version: D 6.0.13

    Has anyone an idea why this happen and what could be a reason of si2168 firmware repeated download to adapter?

    Update3 - The Tvheand42's service.log is started at the same time as si2168 22-0064 firmware download is performed... So it looks like the Tvheadend service was restarted?

    So I have configured one RPi 4B/4GB as Tvheadend Server (LE 11 Nightly 20220130). There's Tvheadend 4.2 (10.80.4.126) running and Tvheadend HTSP Client disabled.

    Another RPi 4b/2GB (LE 11 Nightly 20220206) acts as client - Tvheadend HTSP Client reconfigured to connect the remote Tvheadend Server on first RPi 4B/4GB instead of local Tvheadend Server service.

    During last few days I did not encounter any OOM killer action, but randomly the Timeshift gets 'disabled' at client and kernel log on server RPi display these messages:

    [14213.650491] si2168 22-0064: downloading firmware from file 'dvb-demod-si2168-d60-01.fw'

    [14214.786939] si2168 22-0064: firmware version: D 6.0.13

    [14214.803072] si2157 23-0060: found a 'Silicon Labs Si2141-A10'

    [14214.803208] si2157 23-0060: downloading firmware from file 'dvb-tuner-si2141-a10-01.fw'

    [14215.371252] si2157 23-0060: firmware version: 1.1.11

    So it looks like the USB DVB-T2 adapter is reinitialized. It's a question if this is due to kernel issue or if it is invoked by Tvheadend.

    To enable the audio jack on RPi 4B in LibreELEC 10.x you need to:

    - edit the /flash/config.txt file ( see https://wiki.libreelec.tv/configuration/config_txt ), use Putty terminal to connect LibreELEC SSH console ( https://www.hostinger.com/tutorials/how-to-use-putty-ssh ).

    - add this line to config.txt: dtparam=audio=on

    - reboot LibreELEC

    - in Kodi GUI set the Audio output device in Settings - System - Audio menu to ALSA:bcm2835 Headphones, bcm2835 Headphones

    You should see the connected BlueTooth Headset there as well so it should work if you set it as Audio output device.

    I would recommend to use irexec for doing tasks that don't have a specific keycodes.

    See the examples here: RE: Remote Control

    The audio offset window number is 10145 so you can invoke it with kodi-send --action="ActivateWindow(10145)" command.

    If you activate the Debug log (Kodi menu System - Event log - Setting - Logging - Enable debug logging), you can navigate menus and see the tasks performed in /storage/.kodi/temp/kodi.log file, then create an appropriate lircrc config file / script.

    Hope this helps. :)

    Observerd for several weeks on LE 11 Nightly (currently 20220204) running on RPi 4B/2GB.

    Watching LiveTV with Timeshift active (Tvheadend server + client). Sometimes (but quite often, easily reproducible) after stepping back the video stops while audio continue playing. In kodi.log then repeating errors can be found: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)

    Using StepBack again or StepForward usually helps to recover video playing again.

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    Try to do this settings from scratch, before you search for channels for the first time (uninstall the Tvheadend server Add-on including settings, install it again). Disable the unneeded adapters and perform the MUXes configuration from Tvheadend.

    Consider a manual settings for just the MUX8 as outlined in post #2.

    Create a Network with just that single MUX, set the Frequency to 184500000, then you may need to play with Bandwith (probably 7 MHz for VHF) and Constellation. Then run Force Scan for the Network.

    BTW. you can also try to set the fixed adapter number for Astrometa before you start configuring Tvheadend:

    echo options dvb-usb-rtl28xxu adapter_nr=5 > /storage/.config/modprobe.d/astrometa.conf

    Reboot LE to activate it.