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
#12
I'll have to wait till the weekend to look further, for the moment i'm more than happy with the functionality I have.

It took me 2 attempts to install Roon Bridge, something may have got overwritten/corrupted.
Reply
#13
A quick update, I swapped out the CM4 Lite, that the Red came with and flashed Red OS on to a CM4 with 32 gig eMMC and 8 gig of RAM.

I wasn't sure if it would work, it does, not recommended as I have probably voided the warranty.

Anyhow, that leaves my to experiment with moode as I have a IO Board and the CM4 Lite. The aim is to get everything working, then I'll reflash the CM4 eMMC.
Reply


Forum Jump: