Thank you for your donation!


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


Holo Red
#11
The variables and status look OK.

Here is the code block that handles "RoonBridge Active"

/var/www/daemon/worker.php
Code:
function chkRbActive() {
    $result = sysCmd('pgrep -c mono-sgen');
    if ($result[0] > 0) {
        $rendererNotActive = ($_SESSION['btactive'] == '0' && $GLOBALS['aplactive'] == '0' && $GLOBALS['spotactive'] == '0'
            && $GLOBALS['slactive'] == '0' && $_SESSION['paactive'] && $_SESSION['rxactive'] == '0'
            && $GLOBALS['inpactive'] == '0');
        $mpdNotPlaying = empty(sysCmd('mpc status | grep playing')[0]) ? true : false;
        $alsaOutputActive = sysCmd('cat /proc/asound/card' . $_SESSION['cardnum'] . '/pcm0p/sub0/hw_params')[0] == 'closed' ? false : true;
        //workerLog('rnp:' . ($rendererNotActive ? 'T' : 'F') . '|' . 'mnp:' . ($mpdNotPlaying ? 'T' : 'F') . '|' . 'aoa:' . ($alsaOutputActive ? 'T' : 'F'));
        if ($rendererNotActive && $mpdNotPlaying && $alsaOutputActive) {
            // Do this section only once
            if ($GLOBALS['rbactive'] == '0') {
                $GLOBALS['rbactive'] = '1';
                phpSession('write', 'rbactive', '1');
                $GLOBALS['scnsaver_timeout'] = $_SESSION['scnsaver_timeout'];
                sendFECmd('rbactive1');
            }
        } else {
            // Do this section only once
            if ($GLOBALS['rbactive'] == '1') {
                $GLOBALS['rbactive'] = '0';
                phpSession('write', 'rbactive', '0');
                sendFECmd('rbactive0');
                sysCmd('/var/www/util/vol.sh -restore');
                if ($_SESSION['rsmafterrb'] == 'Yes') {
                    sysCmd('mpc play');
                }
            }
        }
    }
}


This conditional statement determines whether to set the active flag
Code:
if ($rendererNotActive && $mpdNotPlaying && $alsaOutputActive)

Maybe RoonBridge is using a different ALSA card number than the one moode uses in $_SESSION['cardnum']. I have no idea how RB chooses the the ALSA card and device.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
Holo Red - by Jinxy - 08-25-2024, 10:00 AM
RE: Holo Red - by TheOldPresbyope - 08-25-2024, 12:34 PM
RE: Holo Red - by Jinxy - 08-26-2024, 11:55 AM
RE: Holo Red - by Tim Curtis - 08-26-2024, 12:01 PM
RE: Holo Red - by Jinxy - 08-26-2024, 01:02 PM
RE: Holo Red - by Tim Curtis - 08-26-2024, 02:14 PM
RE: Holo Red - by Jinxy - 08-26-2024, 04:08 PM
RE: Holo Red - by Tim Curtis - 08-26-2024, 04:31 PM
RE: Holo Red - by Jinxy - 08-27-2024, 03:13 PM
RE: Holo Red - by Jinxy - 08-27-2024, 03:30 PM
RE: Holo Red - by Tim Curtis - 08-27-2024, 05:14 PM
RE: Holo Red - by Jinxy - 08-27-2024, 06:26 PM
RE: Holo Red - by Jinxy - 08-30-2024, 07:34 PM

Forum Jump: