Thank you for your donation!


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


Plexamp Headless on Moode 9+
#11
(07-03-2024, 08:49 AM)ovizii Wrote: I was highly interested in being able to use my plexamp client to stream music to moode.
Over the years, I used to use a simple solution called plexdlnaplayer to bridge my plexamp client to moode's UPNP renderer.

So I haven't touched a headless plexamp installation in quite some time. 

My question now is:

- do you actually need plexamp headless? I mean does it add any additional features or do we simply need the option to stream from a plexamp client?
- how much overhead does plexamp headless add?

I'm asking these questions because a solution like I described above is simpler, its only a tiny, tiny docker container or app (depending on your preferred usage) which bridges plexamp client of UPNP. There are no licensing problems and no distribution problems.

Anyway, I am really happy to see work happening on integrating plexamp clients with moode.

- do you actually need plexamp headless? I mean does it add any additional features or do we simply need the option to stream from a plexamp client?
If you wish to use raspberryPi as an independent Plexamp player without using your other devices to stream. I am not sure if you solution changes the file format or quality during transfer but that is also another risk while using a middleware.
- how much overhead does plexamp headless add?
Nothing noticeable as per my experience. I use Raspberry Pi 4.
Reply
#12
(06-06-2024, 10:49 AM)Tim Curtis Wrote:
(06-03-2024, 12:35 PM)Tim Curtis Wrote: Here's a mockup of Renderer Config with Plexamp settings



Assume nodejs is installed, the systemd service file is there and code to change the default user id in the file to the actual userid happens during moode startup. With these in place only steps 2, 3, and 5 are needed in the Guide.

@vinnn, Some questions about Plexamp and nodejs run state

1. What method can be used to determine whether Plexamp is running or not?
For example pgrep <executable_name>

2. How to start/stop nodejs itself?
We don't want this running by default unless its actually going to be used.

ETA: 3. How to determine the version of Plexamp?

Nvm,

I managed to figure it out. The plumbing is committed and seems to work ok. I'll just go ahead and make a short help guide and then testing can happen in the field after 9.0.2 is released.

The other option is to do a local build yourself if you are familiar with using the build tooling etc.

Great work Tim implementing this renderer for Plexamp. I am testing that now and it looks like Plexmap service is not releasing MPD no matter what configuration I set for that.

I installed a test clean install and used setup_3rdparty_plexamp.txt to install only PlexAMP and same thing happened.

Is this currently working in version 9.0.3 or I am doing something wrong?

Thanks!


Attached Files Thumbnail(s)
   
Reply
#13
I have no idea how plexamp works but below is the code thats used to check whether its running or not

Code:
pgrep -a node | grep plexamp

This run state is checked every 3 seconds by /var/www/daemon/worker.php. If it's running then moOde displays the "Plexamp Active" overlay.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#14
(07-07-2024, 01:57 AM)Tim Curtis Wrote: I have no idea how plexamp works but below is the code thats used to check whether its running or not

Code:
pgrep -a node | grep plexamp

This run state is checked every 3 seconds by /var/www/daemon/worker.php. If it's running then moOde displays the "Plexamp Active" overlay.


I assume a node is always running due to Plexamp service needs that for listening.

but we can check its playing status from the list of applications accessing any sound cards as per below:

pi@moodeEdifier:~ $ lsof /dev/snd/*
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    168284   pi  mem    CHR  116,6           463 /dev/snd/pcmC2D0p
node    168284   pi   39u   CHR  116,7      0t0  464 /dev/snd/controlC2
node    168284   pi   40u   CHR  116,6      0t0  463 /dev/snd/pcmC2D0p

As I checked it stops using them after about 13-14 seconds and ALSA is free after that.

I hope this is something usable for checking real Plexamp status.


Any suggestions? @vinnn
Reply
#15
(07-07-2024, 06:03 AM)ehsan2023 Wrote:
(07-07-2024, 01:57 AM)Tim Curtis Wrote: I have no idea how plexamp works but below is the code thats used to check whether its running or not

Code:
pgrep -a node | grep plexamp

This run state is checked every 3 seconds by /var/www/daemon/worker.php. If it's running then moOde displays the "Plexamp Active" overlay.

I assume a node is always running due to Plexamp service needs that for listening.

but we can check its playing status from the list of applications accessing any sound cards as per below:

pi@moodeEdifier:~ $ lsof /dev/snd/*
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    168284   pi  mem    CHR  116,6           463 /dev/snd/pcmC2D0p
node    168284   pi   39u   CHR  116,7      0t0  464 /dev/snd/controlC2
node    168284   pi   40u   CHR  116,6      0t0  463 /dev/snd/pcmC2D0p

As I checked it stops using them after about 13-14 seconds and ALSA is free after that.

I hope this is something usable for checking real Plexamp status.


Any suggestions? @vinnn

Good info. If that method or any other method can be confirmed I'll go ahead and make the change to the detection mechanism.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#16
I do not have Plexamp to test, but this suggests that you can query it …
get_plexamp_playing_status.py
Reply
#17
(07-07-2024, 02:03 PM)steve4star Wrote: I do not have Plexamp to test, but this suggests that you can query it …
get_plexamp_playing_status.py

Thanks Steve,

I tested and can confirm the python code method is working and it respond with 0 while not playing and 1 while Plexamp is playing.

Code:
pi@moodeEdifier:~ $ python3 plexamp_status.py
1
pi@moodeEdifier:~ $ python3 plexamp_status.py
0


Moode audio + PlexAmp is a super power music player for me. considering the official Tidal support that comes with Plexamp.
Reply
#18
(07-08-2024, 12:16 PM)ehsan2023 Wrote:
(07-07-2024, 02:03 PM)steve4star Wrote: I do not have Plexamp to test, but this suggests that you can query it …
get_plexamp_playing_status.py

Thanks Steve,

I tested and can confirm the python code method is working and it respond with 0 while not playing and 1 while Plexamp is playing.

Code:
pi@moodeEdifier:~ $ python3 plexamp_status.py
1
pi@moodeEdifier:~ $ python3 plexamp_status.py
0


Moode audio + PlexAmp is a super power music player for me. considering the official Tidal support that comes with Plexamp.

Does the ALSA output get closed immediately after playback stops?

This test will give you an idea of how long it takes for Plexamp to close and release the ALSA output.

Code:
1. Start playback
2. watch -n .5 "date +%M:%S && moodeutl --hwparams"
3. Stop playback

When the watch command reports "closed" note the number of secs that have elapsed.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#19
(07-08-2024, 01:46 PM)Tim Curtis Wrote:
(07-08-2024, 12:16 PM)ehsan2023 Wrote:
(07-07-2024, 02:03 PM)steve4star Wrote: I do not have Plexamp to test, but this suggests that you can query it …
get_plexamp_playing_status.py

Thanks Steve,

I tested and can confirm the python code method is working and it respond with 0 while not playing and 1 while Plexamp is playing.

Code:
pi@moodeEdifier:~ $ python3 plexamp_status.py
1
pi@moodeEdifier:~ $ python3 plexamp_status.py
0


Moode audio + PlexAmp is a super power music player for me. considering the official Tidal support that comes with Plexamp.

Does the ALSA output get closed immediately after playback stops?

This test will give you an idea of how long it takes for Plexamp to close and release the ALSA output.

Code:
1. Start playback
2. watch -n .5 "date +%M:%S && moodeutl --hwparams"
3. Stop playback

When the watch command reports "closed" note the number of secs that have elapsed.

Hi,

Just a friendly bump to see if anyone can run this test to determine how long it takes for Plexamp to close the ALSA output after play stops.

I'd like to get this update into upcoming 9.0.5 :-)

Thx
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#20
(07-11-2024, 10:04 PM)Tim Curtis Wrote:
(07-08-2024, 01:46 PM)Tim Curtis Wrote:
(07-08-2024, 12:16 PM)ehsan2023 Wrote:
(07-07-2024, 02:03 PM)steve4star Wrote: I do not have Plexamp to test, but this suggests that you can query it …
get_plexamp_playing_status.py

Thanks Steve,

I tested and can confirm the python code method is working and it respond with 0 while not playing and 1 while Plexamp is playing.

Code:
pi@moodeEdifier:~ $ python3 plexamp_status.py
1
pi@moodeEdifier:~ $ python3 plexamp_status.py
0


Moode audio + PlexAmp is a super power music player for me. considering the official Tidal support that comes with Plexamp.

Does the ALSA output get closed immediately after playback stops?

This test will give you an idea of how long it takes for Plexamp to close and release the ALSA output.

Code:
1. Start playback
2. watch -n .5 "date +%M:%S && moodeutl --hwparams"
3. Stop playback

When the watch command reports "closed" note the number of secs that have elapsed.

Hi,

Just a friendly bump to see if anyone can run this test to determine how long it takes for Plexamp to close the ALSA output after play stops.

I'd like to get this update into upcoming 9.0.5 :-)

Thx


Awesome news!

I tested that multiple times and Plexamp closes ALSA after 15 seconds for me every time after stop.

The only issue I have with Plexamp is the minimum volume is a bit loud and the curve goes up very quickly.
Reply


Forum Jump: