Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: jbbum on May 01, 2024, 01:05:02 PM

Title: hdmi output
Post by: jbbum on May 01, 2024, 01:05:02 PM
is there a way to monitor if raspberry 0w hdmi output is active?  (iow)Have pi 0w output only when selected as input to monitor.
Title: Re: hdmi output
Post by: Rich on May 01, 2024, 02:31:47 PM
Hi jbbum
It sounds like you want to be able to test if a monitor is connected
to the HDMI port.

I do that with another video port on a laptop to see if an external
monitor is connected:
Code: [Select]
if [ $(cat /sys/class/drm/card0-VGA-1/status) = "connected" ]
then
        # Copy our special xorg.conf where Xorg can find it.
        busybox cp -f xorg.conf.2monitors /etc/X11/xorg.conf
        Monitors=2
fi

I don't know if pi uses a similar layout, but start by looking for a subdirectory
with HDMI in its name under  /sys/class/drm/.
Title: Re: hdmi output
Post by: jbbum on May 01, 2024, 04:13:05 PM
Hi Rich,
Scenario-Raspberry pi 0w connected as input to TV. Pi is programmed with ffmpeg to access stream from esp32 webcam and output to fbdev, no X, want pi to be idle with no stream output until the pi is selected on the tv with the "input or source" button on remote, a cli is then ran to access stream from esp32 webcam.
Title: Re: hdmi output
Post by: Rich on May 01, 2024, 05:07:41 PM
Hi jbbum
Maybe  udev  would be of some help?
Try this:
Code: [Select]
udevadm monitorThen toggle the "input or source" button on remote and
see if any events are generated.
Title: Re: hdmi output
Post by: jbbum on May 01, 2024, 05:30:38 PM
Hi Rich
Got no responses.
Title: Re: hdmi output
Post by: jbbum on May 02, 2024, 02:07:24 PM
Found this "cec-client which is part of cec utils package on raspbian.  Checking to see if it can be loaded on piCore, and achiece desired result.
Title: Re: hdmi output
Post by: patrikg on May 02, 2024, 03:58:56 PM
https://libcec.pulse-eight.com/

https://github.com/Pulse-Eight/libcec

Also found this text on there site:

Quote
If your TV cannot detect the Raspberry Pi's CEC, or if the the Pi can't detect the TV, try adding the following line in /boot/config.txt and reboot the Pi: hdmi_force_hotplug=1
Title: Re: hdmi output
Post by: jbbum on May 09, 2024, 01:55:21 PM
Trying to get cec-utils over to piCore but can't get libudev.so.1 required by cec-client.  There is no libudev.tcz in 14.xv7 and the 13.x does not include libudev.so.1.  Is there a way to get updated library without using the debian version with all the unnessary dependencies?
Title: Re: hdmi output
Post by: Paul_123 on May 09, 2024, 04:56:53 PM
The extension is udev-lib.tcz

Title: Re: hdmi output
Post by: Paul_123 on May 09, 2024, 04:58:03 PM
The extension is udev-lib.tcz

I have not invested time in cec packaging, because every application I've heard of works only about 75% of what the user needs.
Title: Re: hdmi output
Post by: Rich on May 09, 2024, 05:27:00 PM
Hi jbbum
... There is no libudev.tcz in 14.xv7 and the 13.x does not include libudev.so.1. ...
Tinycore/piCore only have libudev.so.0 because they run an older
version of udev. I'm not certain, but I think that later versions of
udev are somehow tied to systemd.
Title: Re: hdmi output
Post by: jbbum on May 11, 2024, 11:13:14 AM
Hi Rich,
You are probably correct.  Did manage to get dependencies loaded, including 'libudev1' but ran into an error with libcec.  Sorry but I didn't note the error as I gave up at that point.
Title: Re: hdmi output
Post by: Juanito on May 11, 2024, 11:40:22 AM
It is possible to run later versions of the udev library (libudev.so.1) alongside the tinycore version, you have to be careful when compiling though.