diff --git a/usr/local/bin/moodeutl b/usr/local/bin/moodeutl index f768a71db..2be6dd652 100755 --- a/usr/local/bin/moodeutl +++ b/usr/local/bin/moodeutl @@ -32,7 +32,7 @@ $features = array( FEAT_UPNPSYNC => 'UPnP volume sync', FEAT_SPOTIFY => 'Spotify Connect renderer', FEAT_GPIO => 'GPIO button handler', - FEAT_RESERVED => 'Reserved for future use', + FEAT_PLEXAMP => 'Plexamp renderer', FEAT_BLUETOOTH => 'Bluetooth renderer', FEAT_DEVTWEAKS => 'Developer tweaks', FEAT_MULTIROOM => 'Multiroom audio' @@ -170,7 +170,7 @@ With no OPTION print the help text and exit. -o\t\tList audio overlays -q\t\tQuery sql database -r\t\tRestart servers - -R\t\tRestart renderer [--bluetooth | --airplay | --spotify | --squeezelite | --roonbridge] + -R\t\tRestart renderer [--bluetooth | --airplay | --spotify | --squeezelite | --plexamp | --roonbridge] -t\t\tPrint last 10 lines of moode log and wait -u\t\tCheck radio station urls for playability -U\t\tCheck station urls, list only unplayable @@ -404,7 +404,7 @@ function restartServers() { function restartRenderer($argv) { $renderers = array('--bluetooth' => 'btsvc', '--airplay' => 'airplaysvc', '--spotify' => 'spotifysvc', - '--squeezelite' => 'slsvc', '--roonbridge' => 'rbsvc'); + '--squeezelite' => 'slsvc', '--plexamp' => 'pasvc', '--roonbridge' => 'rbsvc'); if (!isset($argv[2])) { echo 'Missing 2nd argument [renderer name]' . "\n"; @@ -420,7 +420,7 @@ function restartRenderer($argv) { } else { echo 'Invalid renderer name' . "\n"; - echo 'Valid names are: --bluetooth, --airplay, --spotify, --squeezelite, --roonbridge' . "\n"; + echo 'Valid names are: --bluetooth, --airplay, --spotify, --squeezelite, --plexamp, --roonbridge' . "\n"; return; } diff --git a/var/local/www/db/moode-sqlite3.db.sql b/var/local/www/db/moode-sqlite3.db.sql index 359d72279..064d9b363 100644 --- a/var/local/www/db/moode-sqlite3.db.sql +++ b/var/local/www/db/moode-sqlite3.db.sql @@ -1,5 +1,5 @@ -- --- File generated with SQLiteStudio v3.1.0 on Sat May 25 14:17:33 2024 +-- File generated with SQLiteStudio v3.1.0 on Mon Jun 3 18:16:08 2024 -- -- Text encoding used: UTF-8 -- @@ -397,7 +397,7 @@ INSERT INTO cfg_system (id, param, value) VALUES (60, 'toggle_songid', ''); INSERT INTO cfg_system (id, param, value) VALUES (61, 'slsvc', '0'); INSERT INTO cfg_system (id, param, value) VALUES (62, 'ap_network_addr', '172.24.1.1/24'); INSERT INTO cfg_system (id, param, value) VALUES (63, 'cpugov', 'ondemand'); -INSERT INTO cfg_system (id, param, value) VALUES (64, 'RESERVED_64', ''); +INSERT INTO cfg_system (id, param, value) VALUES (64, 'pasvc', '0'); INSERT INTO cfg_system (id, param, value) VALUES (65, 'pkgid_suffix', ''); INSERT INTO cfg_system (id, param, value) VALUES (66, 'lib_pos', '-1,-1,-1'); INSERT INTO cfg_system (id, param, value) VALUES (67, 'mpdcrossfade', '0'); @@ -448,7 +448,7 @@ INSERT INTO cfg_system (id, param, value) VALUES (111, 'cover_scale', '1.25'); INSERT INTO cfg_system (id, param, value) VALUES (112, 'rsmafterrb', 'No'); INSERT INTO cfg_system (id, param, value) VALUES (113, 'library_tagview_artist', 'Artist'); INSERT INTO cfg_system (id, param, value) VALUES (114, 'scnsaver_style', 'Gradient (Linear)'); -INSERT INTO cfg_system (id, param, value) VALUES (115, 'RESERVED_115', ''); +INSERT INTO cfg_system (id, param, value) VALUES (115, 'rsmafterpa', 'No'); INSERT INTO cfg_system (id, param, value) VALUES (116, 'mpd_httpd', '0'); INSERT INTO cfg_system (id, param, value) VALUES (117, 'mpd_httpd_port', '8000'); INSERT INTO cfg_system (id, param, value) VALUES (118, 'mpd_httpd_encoder', 'lame'); diff --git a/www/daemon/worker.php b/www/daemon/worker.php index 7c16ad675..70f0079e0 100755 --- a/www/daemon/worker.php +++ b/www/daemon/worker.php @@ -490,6 +490,15 @@ workerLog('worker: -- Special configs'); workerLog('worker: --'); //----------------------------------------------------------------------------// +// Plexamp: TBD +if (file_exists('somefile') === true) { + $_SESSION['plexamp_installed'] = 'yes'; +} else { + $_SESSION['plexamp_installed'] = 'no'; + $msg = 'not installed'; +} +workerLog('worker: Plexamp: ' . $msg); + // RoonBridge // Their installer sets the systemd unit to enabled but we need it disabled because we start/stop it via System Config setting if (file_exists('/opt/RoonBridge/start.sh') === true) { diff --git a/www/inc/constants.php b/www/inc/constants.php index 853e5d059..2bc8a25a5 100755 --- a/www/inc/constants.php +++ b/www/inc/constants.php @@ -70,15 +70,16 @@ const NOTIFY_DURATION_MEDIUM = 10; const NOTIFY_DURATION_LONG = 30; const NOTIFY_DURATION_INFINITE = 8640000; // 100 days -// Component names +// Component names (for notification messages) const NAME_AIRPLAY = 'AirPlay'; const NAME_BLUETOOTH = 'Bluetooth Controller'; const NAME_BLUETOOTH_PAIRING_AGENT = 'Pairing Agent'; const NAME_SPOTIFY = 'Spotify Connect'; const NAME_SQUEEZELITE = 'Squeezelite'; -const NAME_ROONBRIDGE = 'RoonBridge'; const NAME_UPNP = 'UPnP'; const NAME_DLNA = 'DLNA'; +const NAME_PLEXAMP = 'Plexamp'; +const NAME_ROONBRIDGE = 'RoonBridge'; const NAME_GPIO = 'GPIO Controller'; const NAME_LOCAL_DISPLAY = 'Local Display'; @@ -117,8 +118,8 @@ // Features availability bitmask // NOTE: Updates must also be made to matching code blocks in playerlib.js, sysinfo.sh, moodeutl, and footer.php -// sqlite3 /var/local/www/db/moode-sqlite3.db "SELECT value FROM cfg_system WHERE param='feat_bitmask'" -// sqlite3 /var/local/www/db/moode-sqlite3.db "UPDATE cfg_system SET value='97206' WHERE param='feat_bitmask'" +// moodeutl -q "SELECT value FROM cfg_system WHERE param='feat_bitmask'" +// moodeutl -q "UPDATE cfg_system SET value='97207' WHERE param='feat_bitmask'" const FEAT_HTTPS = 1; // y HTTPS mode const FEAT_AIRPLAY = 2; // y AirPlay renderer const FEAT_MINIDLNA = 4; // y DLNA server @@ -132,7 +133,7 @@ const FEAT_UPNPSYNC = 1024; // UPnP volume sync const FEAT_SPOTIFY = 2048; // y Spotify Connect renderer const FEAT_GPIO = 4096; // y GPIO button handler -const FEAT_RESERVED = 8192; // y Reserved for future use +const FEAT_PLEXAMP = 8192; // y Plexamp renderer const FEAT_BLUETOOTH = 16384; // y Bluetooth renderer const FEAT_DEVTWEAKS = 32768; // Developer tweaks const FEAT_MULTIROOM = 65536; // y Multiroom audio diff --git a/www/inc/renderer.php b/www/inc/renderer.php index 3225756ca..8d8e3c94f 100644 --- a/www/inc/renderer.php +++ b/www/inc/renderer.php @@ -39,6 +39,7 @@ function stopBluetooth() { sysCmd('killall -s 9 bluealsa-aplay'); } +// AirPlay function startAirPlay() { sysCmd('systemctl start nqptp'); @@ -63,7 +64,6 @@ function startAirPlay() { debugLog('startAirPlay(): (' . $cmd . ')'); sysCmd($cmd); } - function stopAirPlay() { $maxRetries = 3; for ($i = 0; $i < $maxRetries; $i++) { @@ -93,6 +93,7 @@ function stopAirPlay() { sendFECmd('aplactive0'); } +// Spotify Connect function startSpotify() { $result = sqlRead('cfg_spotify', sqlConnect()); $cfgSpotify = array(); @@ -146,7 +147,6 @@ function startSpotify() { debugLog('startSpotify(): (' . $cmd . ')'); sysCmd($cmd); } - function stopSpotify() { sysCmd('killall librespot'); @@ -165,6 +165,7 @@ function stopSpotify() { sendFECmd('spotactive0'); } +// Squeezelite function startSqueezeLite() { sysCmd('mpc stop'); @@ -174,7 +175,6 @@ function startSqueezeLite() { sysCmd('systemctl start squeezelite'); } - function stopSqueezeLite() { sysCmd('systemctl stop squeezelite'); @@ -187,7 +187,6 @@ function stopSqueezeLite() { $GLOBALS['slactive'] = '0'; sendFECmd('slactive0'); } - function cfgSqueezelite() { $result = sqlRead('cfg_sl', sqlConnect()); @@ -200,11 +199,31 @@ function cfgSqueezelite() { fclose($fh); } +// UPnP +function startUPnP() { + sysCmd('systemctl start upmpdcli'); +} + +// Plexamp +function startPlexamp() { + sysCmd('mpc stop'); + sysCmd('systemctl start nodejs'); + sysCmd('systemctl start plexamp'); +} +function stopPlexamp() { + sysCmd('systemctl stop plexamp'); + sysCmd('systemctl stop nodejs'); + sysCmd('/var/www/util/vol.sh -restore'); + phpSession('write', 'paactive', '0'); + $GLOBALS['paactive'] = '0'; + sendFECmd('paactive0'); +} + +// RoonBridge function startRoonBridge() { sysCmd('mpc stop'); sysCmd('systemctl start roonbridge'); } - function stopRoonBridge() { sysCmd('systemctl stop roonbridge'); sysCmd('/var/www/util/vol.sh -restore'); @@ -212,7 +231,3 @@ function stopRoonBridge() { $GLOBALS['rbactive'] = '0'; sendFECmd('rbactive0'); } - -function startUPnP() { - sysCmd('systemctl start upmpdcli'); -} diff --git a/www/js/playerlib.js b/www/js/playerlib.js index 4f9d06258..5328e705d 100755 --- a/www/js/playerlib.js +++ b/www/js/playerlib.js @@ -18,7 +18,7 @@ const FEAT_INPSOURCE = 512; // y Input source select const FEAT_UPNPSYNC = 1024; // UPnP volume sync const FEAT_SPOTIFY = 2048; // y Spotify Connect renderer const FEAT_GPIO = 4096; // y GPIO button handler -const FEAT_RESERVED = 8192; // y Reserved for future use +const FEAT_PLEXAMP = 8192; // y Plexamp renderer const FEAT_BLUETOOTH = 16384; // y Bluetooth renderer const FEAT_DEVTWEAKS = 32768; // Developer tweaks const FEAT_MULTIROOM = 65536; // y Multiroom audio diff --git a/www/ren-config.php b/www/ren-config.php index 8a55d6ad2..4c11bb322 100644 --- a/www/ren-config.php +++ b/www/ren-config.php @@ -121,23 +121,6 @@ submitJob('slrestart', '', NOTIFY_TITLE_INFO, NAME_SQUEEZELITE . NOTIFY_MSG_SVC_MANUAL_RESTART); } -// RoonBridge -if (isset($_POST['update_rb_settings'])) { - if (isset($_POST['rbsvc']) && $_POST['rbsvc'] != $_SESSION['rbsvc']) { - $update = true; - phpSession('write', 'rbsvc', $_POST['rbsvc']); - } - if (isset($update)) { - submitJob('rbsvc'); - } -} -if (isset($_POST['update_rsmafterrb'])) { - phpSession('write', 'rsmafterrb', $_POST['rsmafterrb']); -} -if (isset($_POST['rbrestart']) && $_POST['rbrestart'] == 1) { - submitJob('rbrestart', '', NOTIFY_TITLE_INFO, NAME_ROONBRIDGE . NOTIFY_MSG_SVC_MANUAL_RESTART); -} - // UPnP client for MPD if (isset($_POST['update_upnp_settings'])) { $currentUpnpName = $_SESSION['upnpname']; @@ -157,6 +140,40 @@ submitJob('upnpsvc', '', NOTIFY_TITLE_INFO, NAME_UPNP . NOTIFY_MSG_SVC_MANUAL_RESTART); } +// Plexamp +if (isset($_POST['update_pa_settings'])) { + if (isset($_POST['pasvc']) && $_POST['pasvc'] != $_SESSION['pasvc']) { + $update = true; + phpSession('write', 'pasvc', $_POST['pasvc']); + } + if (isset($update)) { + submitJob('pasvc'); + } +} +if (isset($_POST['update_rsmafterpa'])) { + phpSession('write', 'rsmafterpa', $_POST['rsmafterpa']); +} +if (isset($_POST['parestart']) && $_POST['parestart'] == 1) { + submitJob('parestart', '', NOTIFY_TITLE_INFO, NAME_ROONBRIDGE . NOTIFY_MSG_SVC_MANUAL_RESTART); +} + +// RoonBridge +if (isset($_POST['update_rb_settings'])) { + if (isset($_POST['rbsvc']) && $_POST['rbsvc'] != $_SESSION['rbsvc']) { + $update = true; + phpSession('write', 'rbsvc', $_POST['rbsvc']); + } + if (isset($update)) { + submitJob('rbsvc'); + } +} +if (isset($_POST['update_rsmafterrb'])) { + phpSession('write', 'rsmafterrb', $_POST['rsmafterrb']); +} +if (isset($_POST['rbrestart']) && $_POST['rbrestart'] == 1) { + submitJob('rbrestart', '', NOTIFY_TITLE_INFO, NAME_ROONBRIDGE . NOTIFY_MSG_SVC_MANUAL_RESTART); +} + phpSession('close'); // Bluetooth @@ -219,8 +236,34 @@ $_select['rsmaftersl_on'] .= "\n"; $_select['rsmaftersl_off'] .= "\n"; +// UPnP client for MPD +$_feat_upmpdcli = $_SESSION['feat_bitmask'] & FEAT_UPMPDCLI ? '' : 'hide'; +$_SESSION['upnpsvc'] == '1' ? $_upnp_btn_disable = '' : $_upnp_btn_disable = 'disabled'; +$_SESSION['upnpsvc'] == '1' ? $_upnp_link_disable = '' : $_upnp_link_disable = 'onclick="return false;"'; +$_SESSION['dlnasvc'] == '1' ? $_dlna_btn_disable = '' : $_dlna_btn_disable = 'disabled'; +$_SESSION['dlnasvc'] == '1' ? $_dlna_link_disable = '' : $_dlna_link_disable = 'onclick="return false;"'; +$autoClick = " onchange=\"autoClick('#btn-set-upnpsvc');\""; +$_select['upnpsvc_on'] .= "\n"; +$_select['upnpsvc_off'] .= "\n"; +$_select['upnpname'] = $_SESSION['upnpname']; + +// Plexamp +if (($_SESSION['feat_bitmask'] & FEAT_PLEXAMP)) { + $_feat_plexamp = ''; + $_SESSION['plexamp_installed'] == 'yes' ? $_pa_svcbtn_disable = '' : $_pa_svcbtn_disable = 'disabled'; + $_SESSION['pasvc'] == '1' ? $_pa_btn_disable = '' : $_pa_btn_disable = 'disabled'; + $_SESSION['pasvc'] == '1' ? $_pa_link_disable = '' : $_pa_link_disable = 'onclick="return false;"'; + $autoClick = " onchange=\"autoClick('#btn-set-pasvc');\" " . $_pa_svcbtn_disable; + $_select['pasvc_on'] .= "\n"; + $_select['pasvc_off'] .= "\n"; + $autoClick = " onchange=\"autoClick('#btn-set-rsmafterpa');\" " . $_pa_btn_disable; + $_select['rsmafterpa_on'] .= "\n"; + $_select['rsmafterpa_off'] .= "\n"; +} else { + $_feat_plexamp = 'hide'; +} + // RoonBridge -//DELETE:if (($_SESSION['feat_bitmask'] & FEAT_ROONBRIDGE) && $_SESSION['roonbridge_installed'] == 'yes') { if (($_SESSION['feat_bitmask'] & FEAT_ROONBRIDGE)) { $_feat_roonbridge = ''; $_SESSION['roonbridge_installed'] == 'yes' ? $_rb_svcbtn_disable = '' : $_rb_svcbtn_disable = 'disabled'; @@ -236,17 +279,6 @@ $_feat_roonbridge = 'hide'; } -// UPnP client for MPD -$_feat_upmpdcli = $_SESSION['feat_bitmask'] & FEAT_UPMPDCLI ? '' : 'hide'; -$_SESSION['upnpsvc'] == '1' ? $_upnp_btn_disable = '' : $_upnp_btn_disable = 'disabled'; -$_SESSION['upnpsvc'] == '1' ? $_upnp_link_disable = '' : $_upnp_link_disable = 'onclick="return false;"'; -$_SESSION['dlnasvc'] == '1' ? $_dlna_btn_disable = '' : $_dlna_btn_disable = 'disabled'; -$_SESSION['dlnasvc'] == '1' ? $_dlna_link_disable = '' : $_dlna_link_disable = 'onclick="return false;"'; -$autoClick = " onchange=\"autoClick('#btn-set-upnpsvc');\""; -$_select['upnpsvc_on'] .= "\n"; -$_select['upnpsvc_off'] .= "\n"; -$_select['upnpname'] = $_SESSION['upnpname']; - waitWorker('ren-config'); $tpl = "ren-config.html"; diff --git a/www/setup.txt b/www/setup.txt index fa9b2236f..7360d5b90 100644 --- a/www/setup.txt +++ b/www/setup.txt @@ -239,11 +239,12 @@ To run it type /var/www/util/coverview.php -on | -off restart-renderer.php This command restarts the specified renderer. To run it type /var/www/util/restart-renderer.php --renderer ---bluetooth Restart bluetooth ---airplay Restart airplay ---spotify Restart spotify ---squeezelite Restart squeezelite ---roonbridge Restart roonbridge +--bluetooth Restart Bluetooth +--airplay Restart AirPlay +--spotify Restart Spotify Connect +--squeezelite Restart Squeezelite +--plexamp Restart Plexamp +--roonbridge Restart RoonBridge ################################################################################ # Post questions regarding this guide to http://moodeaudio.org/forum diff --git a/www/templates/ren-config.html b/www/templates/ren-config.html index 939ac6b5c..2aa310b73 100644 --- a/www/templates/ren-config.html +++ b/www/templates/ren-config.html @@ -227,74 +227,110 @@
This service functions as a UPnP media renderer that uses MPD for playback.
+ +
- This component must be manually installed. Visit the manufacturer website for more information on installation and updating.
- CAUTION: 100% volume at start of playback has occurred when Roon endpoint volume is set to "Device volume".
+ This component is not bundled with moOde. Visit the manufacturer website for information on installation and configuration.
This service functions as a UPnP media renderer that uses MPD for playback.
++ This component is not bundled with moOde. Visit the manufacturer website for information on installation and configuration. +