Thank you for your donation!


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


Plexamp improvements
#1
Heart 
Sorry for bumping a solved thread but I do have some related concerns with Plexamp. While I'm here, I'd also like to say HI & say thank you for such an elegantly simple steaming distro.

My first thought was the Plexamp version mentioned in the setup guide being out of date (v4.10.1 vs v4.11.2). Plexamp has been notoriously fussy in the past when using an outdated server.

The second thing that struck me was the plexamp service file under /etc/systemd/system, which requires the user 'pi' and their home directory. This looks much like the default service file as distributed with Plexamp. It's worth noting that they assume PIOS where this is a default. As the setup for moOde encourages use use of Pi Imager where user creation is possible, the 'pi' user may not exist.

I honestly love Plexamp (especially while they still have Tidal support, and that's a sore point) but their support kinda sucks. To get round these issues in the past, I created my own service and updater which can be found on my my github page. This won't be bullet proof as it was only made for myself and assumes an existing setup (so following the current setup guide remains a valid first step). However, the benefits are that it doesn't assume a 'pi' user or sudo privileges to update, install nodejs, or control the service - everything is installed, set-up and controlled as the current user.

Hopefully this is some food for thought. As I think I've found my new streaming distro, I'd be happy to assist in making this more robust in future.
Reply
#2
Split from the "[SOLVED] Plexamp not playing" thread
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Here's the code that manages Plexamp during moode startup. It's in /var/www/daemon/worker.php. 

Update the service file to reflect the userid and home directory.
Code:
// Start Plexamp renderer
if ($_SESSION['feat_bitmask'] & FEAT_PLEXAMP) {
    if ($_SESSION['plexamp_installed'] == 'yes') {
        sysCmd("sed -i '/User=/c \User=" . $_SESSION['user_id'] . "' /etc/systemd/system/plexamp.service");
        sysCmd("sed -i '/WorkingDirectory=/c \WorkingDirectory=/home/" . $_SESSION['user_id'] . "/plexamp' /etc/systemd/system/plexamp.service");
        sysCmd("sed -i '/ExecStart=/c \ExecStart=/usr/bin/node /home/" . $_SESSION['user_id'] . "/plexamp/js/index.js' /etc/systemd/system/plexamp.service");
        if (isset($_SESSION['pasvc']) && $_SESSION['pasvc'] == 1) {
            $status = 'started';
            startPlexamp();
        } else {
            $status = 'available';
        }
    } else {
        $status = 'not installed';
    }
} else {
    $status = 'n/a';
}

Your nice installer/updater script would make things much easier but it does some CLI prompting which isn't really WebUI friendly. Moode already has all the deps (I think) except for nodejs.

Could the script be adapted so it doesn't require user input?
What is jq?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
The script certainly could be modified to avoid any user prompting. Personally, I'd be interested in identifying the node requirement & keeping it updated automatically too. This may be a product of the included module's devDependencies as listed in their respective package.json files, but I should probably speak to someone over there before making that assumption...

Jq is a command-line JSON processing tool. I use it to determine the newest version available for download. It could also be used for my idea above. 

I feel inclined to make some changes to the script anyway, so if you have any suggestions that may be of benefit to others here then I'd happily consider them and keep you updated on progress. Seeing as it's working for most, there's clearly no rush & I should have time later this month.
Reply
#5
I've overhauled my script

Main differences being:
- Removed interactive elements 
- Added best-guess for node based upon dependency checking
- Added optional arguments that override defaults & best-guess

Just note that relying on the default best-guess Node setup is likely to fail at some point. In such cases, you'll have to look at the release announcements and specify the required Node version as an argument with '-n <version>'. I asked on the Plex forums about extending an existing endpoint to include the Node requirements, but they obviously have their own ideas.

Not sure how useful this is for you, but feel free to use/adapt/ignore. I was hoping to find a more robust node solution...
Reply
#6
Anyone who figures out how to manage the JavaScript ecosystem deserves a medal!.

I saw one blogger refer to Node as “aging like milk”.

Regards,
Kent
Reply
#7
(10-20-2024, 04:25 PM)TheOldPresbyope Wrote: I saw one blogger refer to Node as “aging like milk”.
IMHO, that blogger knows Node very well... I could not have said it better - and I am now, somehow, in the milk industry :-)
Reply


Forum Jump: