balena-io-experimental / balena-sound

Build a single or multi-room streamer for an existing audio device using a Raspberry Pi! Supports Bluetooth, Airplay and Spotify Connect
https://balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/
MIT License
2.39k stars 427 forks source link

Implement support for the headless PlexAmp client #593

Open sniff122 opened 1 year ago

sniff122 commented 1 year ago

Added a container build for the headless PlexAmp client, this will allow a user to use the plex app on a mobile device to cast music from their media server to their Balena Sound device.

Change-type: minor Signed-off-by: Lewis L. Foster lewis@sniff122.tech

Hey there, appreciated contributor!

Have you taken a look at the contribution guidelines for this project? To enable our CI to work correctly and version the releases of the project, you need to ensure your commit messages contain the required information detailed here. Thank you!

ghost commented 1 year ago

An error occurred whilst building your landr site preview:

{
  "name": "Error",
  "message": "Command failed with code undefined: /usr/src/app/node_modules/gatsby/cli.js build",
  "stack": "Error: Command failed with code undefined: /usr/src/app/node_modules/gatsby/cli.js build\n    at Object.exports.run (/usr/src/app/lib/build-runner.js:257:11)\n    at async build (/usr/src/app/bot/index.js:132:19)\n    at async /usr/src/app/bot/index.js:210:25\n    at async Promise.all (index 0)\n    at async middleware (/usr/src/app/node_modules/@octokit/webhooks/dist-node/index.js:355:5)"
}
sniff122 commented 1 year ago

@balena-ci retest

sniff122 commented 1 year ago

really not sure why the generate version is failing, unless its just because its for an additional commit, could this be reviewed at some point though?

sniff122 commented 1 year ago

I'll find a way to have it automatically pull the latest plexamp headless archive

hexive commented 1 year ago

Using the versionbot/pr/593 branch I'm getting the following plex error in balena dashboard log:

<plex> internal/modules/cjs/loader.js:1057
<plex>   return process.dlopen(module, path.toNamespacedPath(filename));
<plex>                  ^
<plex> 
<plex> Error: Module did not self-register: '/opt/plexamp/plexamp/treble/linux-arm64/treble.node'.

Service exited 'plex sha256:3bac98b52b3814ca777ec8e4eaef53ee5845cd9741397978c3ccb2946359a2c4'

The service then shuts down and enters a restart loop. I can't get a terminal open to investigate because it's in a constant shutdown/restart state.

hexive commented 1 year ago

Fix: plexamp 4.6.0 requires Node 16

https://forums.plex.tv/t/plexamp-4-6-0-headless-install-error/821034

sniff122 commented 1 year ago

Ah didnt spot that, ill push up a change that bumps the node version

hexive commented 1 year ago

One more thing you might want to look at is the login.sh.

After a fresh build bash login.sh said "Plexamp appears to be already configured" even though it is the first run. Maybe check for a specific /Plexamp/Settings/[filename] instead of just the directory?

**

Otherwise everything is working great! Thank you for putting this together. I hope the balena-sound team merges this plugin. There are a lot of folks out there are looking for a player with spotify, airplay AND plex support. Right now --with this plugin-- this is the only player offering that combination. Additionally this would be the only player that allows plexamp multiroom streaming.

sniff122 commented 1 year ago

A docker volume is used to persist the config data but it might be worth checking the file that stores the login state instead of just the directory

sniff122 commented 1 year ago

That should be some docs about the plugin and using the user token config file instead of the settings folder

maggie44 commented 1 year ago

@sniff122, great to see all these new interesting features.

I am wondering how you would feel about adding the plugin as a Block on the Hub instead of including it directly in the repo here? That is what we designed the Blocks for, and then we can update the docs that allow people to add the block if they want the feature. It seems it would stop the app becoming heavier than it needs to be for those that don't use the feature.

Would be interested to hear what you think. No problem continuing the development here though, just flagging that it may be difficult for us to merge it.

sniff122 commented 1 year ago

Oh I didn't know about that, no clue how I didn't know, oh well. Sounds like it might be a better idea making it a block then