Skip to content

Update Dev Container setup with SoftSqueeze support#1552

Open
mipa87 wants to merge 3 commits intoLMS-Community:public/9.2from
mipa87:devContainer
Open

Update Dev Container setup with SoftSqueeze support#1552
mipa87 wants to merge 3 commits intoLMS-Community:public/9.2from
mipa87:devContainer

Conversation

@mipa87
Copy link
Copy Markdown
Contributor

@mipa87 mipa87 commented Apr 6, 2026

  • Updated devcontainer.json to include environment variables and commands for initialization and startup.
  • Configured editor settings and added necessary files for Perl Language Server integration.
  • Developed a standalone SoftSqueeze container with VNC support, including entrypoint and management scripts.
  • Added initialization script to create a shared network for containers.
  • Implemented post-create and post-start scripts for LMS setup and auto-start functionality.
  • Introduced a clean-up script to remove runtime-generated folders.
  • Enhanced documentation for Dev Container usage, SoftSqueeze setup, and troubleshooting.

Everything has been tested - Docker Compose and Dockerfile, GitHub Codespaces and Dev Containers, Podman (Docker should be compatible) — on both Windows and GitHub Codespaces on Linux.

I hope this makes development easier for new Perl developers like me 🙂

image image

- Updated devcontainer.json to include environment variables and commands for initialization and startup.
- Configured editor settings and added necessary files for Perl Language Server integration.
- Developed a standalone SoftSqueeze container with VNC support, including entrypoint and management scripts.
- Added initialization script to create a shared network for containers.
- Implemented post-create and post-start scripts for LMS setup and auto-start functionality.
- Introduced a clean-up script to remove runtime-generated folders.
- Enhanced documentation for Dev Container usage, SoftSqueeze setup, and troubleshooting.

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
Comment thread .vscode/PerlLanguageServerBootstrap.pm
@michaelherger
Copy link
Copy Markdown
Member

Thanks! I had seen your branch and it intrigued me. I never really used dev containers, and running them on Github directly showed quite a few limitations with a free account. But this should still be a good addition.

Before I go into great details: why Softsqueeze, but no squeezelite of Squeezeplay? I believe the latter are way more popular (and important nowadays) than the former.

@mipa87
Copy link
Copy Markdown
Contributor Author

mipa87 commented Apr 6, 2026

The advantage of Dev Containers is that you don't need any additional tools for local development—everything is included in a single "package."

Yes, you’re right, SoftSqueeze isn’t popular anymore, but I’m working on an improvement regarding bitmap fonts, and SoftSqueeze is perfect for that. And I didn’t want to install it locally. I can set up other containers, but there are certainly sound issues, especially when the host is Windows.

Comment thread .devcontainer/softsqueeze/SOFTSQUEEZE.md
Copy link
Copy Markdown
Member

@michaelherger michaelherger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I will definitely have to give this a try! I've never been able to debug LMS... this would be a first.

Maybe you could add a section to DEVCONTAIERS.md explaining how to map a music folder to the container? Or did I miss that?

Comment thread DEVCONTAINERS.md Outdated
Comment on lines +120 to +122
- `Cache/`
- `Logs/`
- `prefs/`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would these folders live in the clone's root? Any way to move this elsewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is possible to mount this paths as volume. I can add this as option to the image

Copy link
Copy Markdown
Contributor Author

@mipa87 mipa87 May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on what you want—whether to use the project's root directory or something else. I prefer the project's root directory, which is slimserver's default behavior.

Comment thread .devcontainer/clean-folders.sh Outdated
cd "$REPO_ROOT"

if [[ "$FORCE" != "1" ]]; then
echo "[INFO] This will delete: ${FOLDERS_TO_CLEAN[*]}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to show the full list. Just to not get nervous about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll do that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment thread .devcontainer/devcontainer.json
Comment thread .devcontainer/devcontainer.json Outdated
Comment on lines +83 to +84
"/workspaces/slimserver/CPAN/arch/5.40/x86_64-linux-thread-multi",
"/workspaces/slimserver/CPAN/arch/5.40/x86_64-linux-thread-multi/auto",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be made platform independent? I'm a Mac user...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give it a try. I was worried it wouldn't work for everyone, but I don't have a way to test it—I'm on Windows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, you can try.

Comment thread .gitattributes Outdated
@@ -0,0 +1,2 @@
# Normalize all text files to LF in this repository (fix issues with line endings with Dev Containers on Windows)
* text=auto eol=lf
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause any file change to change line endings, potentially "modifying" a full name just for the line endings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the definition; after that, we can run this script and see what changes

git add --renormalize .
git status

Copy link
Copy Markdown
Contributor Author

@mipa87 mipa87 May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following files will be modified:

  • Firmware/receiver.version
  • Graphics/CODE2000.HTM
  • HTML/EN/html/ext/ext-all-debug.js
  • Slim/Plugin/CLI/Settings.pm
  • Slim/Plugin/DateTime/Settings.pm
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/customtags.html
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/httpprotocol.html
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/powersearch.html
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/powerwords.html
  • Slim/Plugin/Podcast/ProtocolHandler.pm
  • Slim/Plugin/Podcast/Settings.pm
  • Slim/Plugin/RS232/Settings.pm
  • Slim/Plugin/Rescan/Settings.pm
  • Slim/Plugin/UPnP/HTML/EN/plugins/UPnP/MediaServer/MediaReceiverRegistrar.xml
  • Slim/Plugin/iTunes/Settings.pm
  • Slim/Plugin/xPL/Settings.pm

Is this okay, or should I add some exceptions to the .gitattributes file?

@michaelherger
Copy link
Copy Markdown
Member

michaelherger commented Apr 8, 2026

First attempt failed. Trying to run using F5 would bring up the debug panel, but no output whatsoever. And after a second or two it stops. Might be the platform is an issue here?

vscode ➜ /workspaces/git/platforms (public/9.2) $ perl -v
This is perl 5, version 32, subversion 1 (v5.32.1) built for aarch64-linux-gnu-thread-multi

The container was created for ARM (Apple Silicon). I tried tweaking all x86_64 paths to use the aarch64 version instead. But still: no feedback, no LMS running.

Then tried to run LMS manually (inside the container):

vscode ➜ /workspaces/git/server (devContainer) $ perl slimserver.pl 
[26-04-08 06:34:16.1322] main::init (282) Starting Lyrion Music Server (v9.2.0, git-40b56d906, 2026-04-06 02:22:50 +0200) perl 5.032001 - aarch64-linux-gnu-thread-multi
[26-04-08 06:34:16.7947] main::init (555) Server done init: http://172.17.0.2:9000
[26-04-08 06:34:16.8250] Slim::Utils::Misc::msg (1346) Warning: [06:34:16.8248] Async::HTTP: Unable to load IO::Socket::SSL, will try connecting to SSL servers in non-SSL mode

Would probably be good to add IO::Socket::SSL too?

@mipa87
Copy link
Copy Markdown
Contributor Author

mipa87 commented Apr 8, 2026

It must be challenging to develop without debugging.

Yes, the "issue" is the platform. I'll try to fix it, but I don't have a way to test it, so it's good that you have a Mac.

I'll also add the music paths as volume mount.

- Updated Dockerfile to include necessary packages and environment variables.
- Improved clean-folders.sh to provide clearer output on folder deletion.
- Modified devcontainer.json to include optional mounts for host folders.
- Added engine-utils.sh for better container engine detection.
- Refactored initialize.sh to utilize engine-utils for container engine selection.
- Updated post-start.sh to execute a new start-lyrion.sh script for starting LMS.
- Enhanced SOFTSQUEEZE.md with clearer instructions and tips for SoftSqueeze usage.
- Improved softsqueeze.sh to support both podman and docker with compose.
- Created start-lyrion.sh for streamlined LMS startup process.
- Updated .gitattributes and .gitignore for better file handling.
- Refined PerlLanguageServerBootstrap.pm for improved module loading.
- Updated extensions.json and launch.json for better VS Code integration.
- Enhanced DEVCONTAINERS.md with clearer instructions for running and stopping Lyrion.

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
@mipa87
Copy link
Copy Markdown
Contributor Author

mipa87 commented Apr 19, 2026

Updated—I hope it works for you too.

Comment thread .editorconfig
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something about this configuration file must be wrong/incomplete: after I had tried out your PR my indenting was set to spaces all over the place. Not in VSCode, but something overrode the setting I have in VSCode. All my existing code which was using tabs before (incl. LMS) suddenly started using spaces. Did this not happen to you?

Copy link
Copy Markdown
Contributor Author

@mipa87 mipa87 May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the "editorconfig.editorconfig" extension has been installed (see .vscode/extensions.json), so every project you open uses this extension? The files are formatted correctly in the LMS, right?

Comment thread .gitignore
Comment on lines -10 to -14
# Ignore cache, logs and prefs files
Cache/*
Logs/*
prefs/*
Plugins/*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep these.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted; the project root is used for these folders.

Comment thread .devcontainer/clean-folders.sh Outdated
Comment on lines +10 to +12
"/config/prefs"
"/config/logs"
"/config/cache"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can't really be put in the root folder, can they? It's my (likely incorrect) understanding that this script would be run outside the container on the system host?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is intended to be used within the Dev Container, so yes. But you're right that it could confuse users if they're using it without Dev Container, so I've changed it to the project's root directory.

…and enhance documentation

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants