Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


CEC HDMI functionality ..not work
#1
Hi Tim hi to all guys...

Regarding the CEC HDMI functionality
an user of my community Faceboock
 "Hardware and software DAC HIFI Rasperry"
https://www.facebook.com/groups/318663196139962

... tells me that the functionality does not work well
he said...that
after installing the user-side packages "myuser" ( with sudo privileges )
 if I run "mpc play" or "mpc pause" or "mpc next" from the terminal, the commands are executed correctly. The same commands are present in the script. sh
but they have no effect,
if the terminal control with the cec-client utility the remote control keys are interpreted correctly. In the configuration file of the service that I report below is defined the user "pi". If I change "pi" to "myuser" nothing works. [Unit]
Description=cecmon
[Service]
ExecStart=bash moode_cec_mon_v1.0.sh
WorkingDirectory=/opt/shoefone/cec
StandardOutput=inherit
StandardError=inherit
Restart = always
User=pi
[Install]
WantedBy=multi-user.target

what is wrong...

tnks 4Urs support
Reply
#2
I'm not sure what that user installed but the HDMI CEC feature included in moode uses the built in Linux kernel based CEC functionality. The command cec-ctl is used. There is nothing else that has to be installed.

Here are the code blocks

/var/www/daemon/worker.php
Code:
//----------------------------------------------------------------------------//
workerLog('worker: --');
workerLog('worker: -- Startup complete ');
workerLog('worker: --');
//----------------------------------------------------------------------------//

// Turn display on
if ($_SESSION['hdmi_cec'] == 'on' && $_SESSION['localui'] == '1') {
    if (file_exists('/sys/class/drm/card0-HDMI-A-1/edid')) {
        $drmCardID = 'card0-HDMI-A-1';
    } else if (file_exists('/sys/class/drm/card1-HDMI-A-1/edid')) {
        $drmCardID = 'card1-HDMI-A-1';
    } else {
        $drmCardID = 'undefined';
    }

    if ($drmCardID != 'undefined') {
        sysCmd('cec-ctl --device=0 --playback "--phys-addr-from-edid=/sys/class/drm/' . $drmCardID . '/edid"');
        $cecSourceAddress = trim(sysCmd('cec-ctl --skip-info --show-topology | grep ": Playback" | cut -d":" -f1')[0]);
        sysCmd('cec-ctl --skip-info --to 0 --active-source phys-addr=' . $cecSourceAddress);
        sysCmd('cec-ctl --skip-info --to 0 --cec-version-1.4 --image-view-on');
        workerLog('worker: HDMI display:     drm-card=' . $drmCardID . ', cec-source-addr=' . $cecSourceAddress);
    } else {
        workerLog('worker: HDMI display:     drm-card=' . $drmCardID);
    }
}

/var/www/daemon/watchdog.sh

Code:
wake_display () {
    WAKE_DISPLAY=$(sqlite3 $SQLDB "SELECT value FROM cfg_system WHERE param='wake_display'")
    if [[ $WAKE_DISPLAY = "1" ]]; then
        cec-ctl --skip-info --to 0 --cec-version-1.4 --image-view-on
        export DISPLAY=:0
        xset s reset > /dev/null 2>&1
    fi
}
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: