From 02920c122ffab722f0bfa2a800e2d4ecab6cf1bf Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Mon, 25 Aug 2025 17:06:21 +0200 Subject: [PATCH] successfully passtrough rest of APIs --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ main_app.py | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6acd8aa..7de66d9 100644 --- a/README.md +++ b/README.md @@ -264,5 +264,54 @@ node js/index.js mv plexamp.service /etc/systemd/system/ systemctl daemon-reload systemctl enable --now plexamp # to start at boot and start now +``` +### Configure Plexamp Headless +Once started I recommend settings these settings for optimal experience: +```bash +# Do not mixdown to stereo (val: true/false) +echo "Bfalse" > ${HOME}/.local/share/Plexamp/Settings/%40Plexamp%3Asettings%3AaudioMixdownToStereo + +# Set cache size to 512MB (val: 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072) +echo "N512" > ${HOME}/.local/share/Plexamp/Settings/%40Plexamp%3Asettings%3AcacheSize + +# Set how many songs to precache on WiFi (val: 0/5/10/15/20/25/40) +echo "N0" > ${HOME}/.local/share/Plexamp/Settings/%40Plexamp%3Asettings%3AcachingWiFi + +# Set player name (Marantz here) +echo "SMarantz" > ${HOME}/.local/share/Plexamp/Settings/%40Plexamp%3Asettings%3AplayerName + +# Set precache network speed to 10Mbps (val: 0/1/5/10/50/100) +echo "N10" > ${HOME}/.local/share/Plexamp/Settings/%40Plexamp%3Asettings%3AprecacheNetworkSpeed + +# Set sample rate conversion quality to highest (64 point sinc) (val: 0-4) +echo "N4" > ${HOME}/.local/share/Plexamp/Settings/%40Plexamp%3Asettings%3AsampleRateConversionQuality + +# Set sample rate matching to "Strict" (val: 0-2) +echo "N2" > ${HOME}/.local/share/Plexamp/Settings/%40Plexamp%3Asettings%3AsampleRateMatching +``` +_I don't recommend accessing the Plexamp Headless webUI as it might cause issues with the hack (not tested though)._ + +#### Setup output device +I had to manually overwrite the default connection as I wanted to output to a S/PDIF device, check your devices with `aplay -l` : +``` +**** List of PLAYBACK Hardware Devices **** +card 1: PCH [HDA Intel PCH], device 0: ALCS1200A Analog [ALCS1200A Analog] + Subdevices: 1/1 + Subdevice #0: subdevice #0 +``` + +Create the file ``/etc/asound.conf`` and modify it to match your device, this worked for me: +``` +pcm.!default { + type plug + slave { + pcm "iec958:CARD=PCH,DEV=0" + } +} + +ctl.!default { + type hw + card PCH +} ``` \ No newline at end of file diff --git a/main_app.py b/main_app.py index 59cc3f8..552693d 100644 --- a/main_app.py +++ b/main_app.py @@ -54,7 +54,7 @@ async def call_official(request: Request, path: str) -> httpx.Response: # Forward request upstream upstream_response = await official_client.request( method=request.method, - url=f"{str(request.base_url).rstrip('/')}/{path}", # f"{OFFICIAL_API}/{path}", + url=f"{str(request.base_url).rstrip('/').replace("http://", "https://")}/{path}", # f"{OFFICIAL_API}/{path}", headers=req_headers, content=body, params=request.query_params,