Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 27

Hybrid View

  1. #1
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    3,026

    LMS for Windows using Strawberry Perl

    LMS for Windows using Strawberry Perl 5.32 64bit

    It's still early days, but I wanted to announce that I have a POC of LMS 8.3 running from git on Windows 10 using the latest Strawberry Perl 5.32.1.1 64-bit. I've only built the perl modules for the 64bit install and don't plan to create a 32-bit version. Is there really any point?

    I have not investigated if SB Perl supports compiled perl executables. I hope that with the help of forum members we can decide on and implement an approach to create a replacement for the defunct Active State Perl we're using now. One idea I had is to use the portable version of Strawberry Perl and bundle it with LMS in a self extracting zip file installer.

    If you'd like to do some testing, and are comfortable using the command line, here are the install steps.

    1. If you have Active State perl 5.14.2 already installed do NOT uninstall it as you won't be able to reinstall and update all it's perl modules later. Instead just rename the base folder.

    I renamed C:\Perl to C:\ActiveStatePerl. Which also breaks them in the cmd PATH which you want, because the new modules don't run with the old perl. To revert, uninstall Strawbery Perl and change the folder name back.

    2. Install Strawberry Perl 5.32 64bit from the link above in C:\Strawberry, the default, and allow the installer to update your PATH environment variables.

    3. Open a new command prompt window with administrator rights clone the repository into C:\Program Files\Squeezebox\slimserver

    Code:
    C:
    cd "\Program Files\Squeezebox\"
    git clone https://github.com/ralph-irving/slimserver-win64 slimserver
    cd slimserver
    If you don't have git install, you can download a zip file from the repository and extract it.

    4. If you already have LMS installed and running. Stop it now.

    5. Confirm the right perl version is in your PATH.
    Code:
    C:\>perl -v
    
    This is perl 5, version 32, subversion 1 (v5.32.1) built for MSWin32-x64-multi-thread
    
    Copyright 1987-2021, Larry Wall
    6. Execute the LMS run command script
    Code:
    cd "\Program Files\Squeezebox\slimserver"
    runslimserver
    7. Try to access http://localhost:9000/ from a browser.

    Here's my server information details.

    Code:
    Logitech Media Server Version: 8.3.0 - TRUNK @ UNKNOWN
    Hostname: hera
    Server IP Address: 192.168.11.19
    Server HTTP Port Number: 9000
    Operating system: Windows 10 - EN - cp1252
    Platform Architecture: 8664
    Perl Version: 5.32.1 - MSWin32-x64-multi-thread
    Audio::Scan: 1.05
    Mozilla::CA: 20200520
    Net::SSLeay: 1.90 - OpenSSL 1.1.1i 8 Dec 2020
    IO::Socket::SSL: 2.069
    Database Version: DBD::SQLite 1.66 (sqlite 3.32.3)
    Total Players Recognized: 1
    
    
    Cache Folder			C:\ProgramData\Squeezebox\Cache
    Preferences Folder		C:\ProgramData\Squeezebox\prefs
    Plugin Folders			C:\Program Files\Squeezebox\slimserver\Slim\Plugin, C:\ProgramData\Squeezebox\Cache\InstalledPlugins\Plugins, C:\Program Files\Squeezebox\slimserver\Plugins
    Helper Applications Folder 	C:\Program Files\Squeezebox\slimserver\Bin\MSWin32-x64-multi-thread, C:\Program Files\Squeezebox\slimserver\Bin, C:\Strawberry\perl\bin

    8. The server logs and redirected STDIN and STDOUT logs are located in C:\ProgramData\Squeezebox\Logs If not, you may need to create the folder first.


    If Strawberry Perl included modules required by LMS I did not build them. For a couple modules I had to install the SB Perl .pm modules files into "slimserver\CPAN\arch\5.32\MSWin32-x64-multi-thread" to override the dynamic loader default version specified in LMS bootstrap.

    I only had to build the following modules;

    Code:
    Audio-Cuefile-Parser-0.02
    Audio-Scan-1.05
    Class-XSAccessor-1.18
    EV-4.03
    Image-Scale-0.14
    MP3-Cut-Gapless-0.03
    Template-Toolkit-2.21
    Win32-Process-List-0.09
    XML-Parser-2.41
    YAML-LibYAML-0.65
    There are no build scripts yet, I compiled and tested each module manually to confirm they worked. Most required code changes to compile with the SB Perl included gcc mingw64.

    All sources and required changes are available in https://github.com/ralph-irving/slimserver-vendor-win64 and https://github.com/ralph-irving/slimserver-win64

    The work in progress platform build scripts are in the win64 branch of https://github.com/ralph-irving/slim...rms/tree/win64

    Should LMS be reliable with SB Perl my plan is to export both repositories and create pull requests to the official.

    I have only tested using the default plugins, so there's likely to be issues with some 3rd party plugins.

    I rebuilt all the helper binaries using the 64bit gcc compiler except for socketwrapper and wmadec. I used Visual Studio 2017 for those, since that's what I have installed.

    I could not find the source code for grant.exe, so I copied the 32-bit version which I also did for sls.exe, which I think uses a closed source aac decoder.
    Last edited by ralphy; 2022-02-03 at 04:46. Reason: Added platform build source url
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

  2. #2
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    3,026
    .....
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

  3. #3
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,724

    LMS for Windows using Strawberry Perl

    Wow... I'm speechless. This is quite a challenge you picked up there.
    Thank you very much for the work so far! This is looking very promising!

    I think moving away from ActiveStates' PDK will require some more
    thoughts: should we get rid of all those helpers we have around (control
    panel, tray icon, service registration helper)? Maybe the service could
    be registered using a newer/enhanced version of the installer?

    Did you look into PAR-Packer (https://metacpan.org/pod/pp)? "pp creates
    standalone executables from Perl programs". I've played around with it
    many years ago...

    Now I'll have to find a way to run Windows to help with this effort...
    Would anybody know about a virtualization product which can run Windows
    on a M1 Mac? I once tried to install a Windows on my NAS. But the
    outcome was worse than what I expected (it didn't succeed installing at
    all).

  4. #4
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    3,026
    Quote Originally Posted by mherger View Post
    Wow... I'm speechless. This is quite a challenge you picked up there.
    Thank you very much for the work so far! This is looking very promising!
    I've enjoyed the challenge. It's been a project that I wanted to persue for a while, it's kept me busy and helps the community.

    Quote Originally Posted by mherger View Post
    I think moving away from ActiveStates' PDK will require some more
    thoughts:
    I'm sure there will be issues migrating away for the PDK, I've never used it so will likely need help to create similiar with the new tools.

    Quote Originally Posted by mherger View Post
    I should we get rid of all those helpers we have around (control panel, tray icon, service registration helper)?
    Maybe the service could be registered using a newer/enhanced version of the installer?
    Perhaps a forum poll would help to decide. I'm not a daily windows user and can't remember the last time I used those tools.
    When I run LMS for windows it's from git in a minimized command prompt.

    Quote Originally Posted by mherger View Post
    Did you look into PAR-Packer (https://metacpan.org/pod/pp)? "pp creates
    standalone executables from Perl programs". I've played around with it
    many years ago...
    I wasn't aware of PAR-Packer. Strawberry Perl apparently supports it. I'll take a look.

    Thanks for your help with the problem of the different errno code between the perl versions. It's fixed now it git and I've removed my comment from the first post.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

  5. #5
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,724

    LMS for Windows using Strawberry Perl

    > CALL pp -o ..\slimserver.exe -M Win32:: -X XML::Parser -X XML::Parser::Expat -X YAML::XS -X Class::XSAccessor -X Template::Stash::XS slimserver.pl

    Would that executable include all Slim/* files? Were the existing
    *.perlapp etc. files of any help (eg.
    https://github.com/Logitech/slimserv...nter.perlsvc)?

    > I now need to script the entire build process which on Windows is going
    > to be a pain.


    Hey, you got Perl on that system, don't you? ;-)

    You could fork
    https://github.com/Logitech/slimserv...8.3/buildme.pl.

  6. #6
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    3,026
    Quote Originally Posted by mherger View Post
    > CALL pp -o ..\slimserver.exe -M Win32:: -X XML::Parser -X XML::Parser::Expat -X YAML::XS -X Class::XSAccessor -X Template::Stash::XS slimserver.pl

    Would that executable include all Slim/* files? Were the existing
    *.perlapp etc. files of any help (eg.
    https://github.com/Logitech/slimserv...nter.perlsvc)?

    > I now need to script the entire build process which on Windows is going
    > to be a pain.
    Not really. Par-Packer doesn't bundle the application perl files in the executable, it runs them from disk and even expands it's internal perl scripts into a temp folder to run.

    Code:
    C:\Users\%USERNAME%\AppData\Local\Temp\par-706164646f636b64\cache-af4f1571ecd40885f61f935cb2429de4774f953b\inc\lib
    I'll take a look at the perlsvc app too.

    Quote Originally Posted by mherger View Post
    Hey, you got Perl on that system, don't you? ;-)

    You could fork
    https://github.com/Logitech/slimserv...8.3/buildme.pl.
    Good point on the Perl. I'll try to create a win64 platform variant. Thanks.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

  7. #7
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    3,026
    I've made some progress as I now have a 64bit installer working for the server and scanner programs so you can at least run the squeezesvr.exe from a cmd prompt.

    However I've run into a few issue with these programs.

    I haven't looked at the SqueezeSvc integration indepth yet, but it appears to be using PerlSvc which is another ActiveState Perl SDK extension.

    The SqueezeTray program requires PerlTray which AFAICT is an ActiveState Perl module only.

    The SqueezeCP program crashes in the Wx dll when run in compiled binary form, but works when run as perl.exe cleanup.pl

    If the platforms buildme.pl script is run with full paths with or without the drive letter prefix then the system calls using rsync fail because c: is interpreted as a remote host and \ or / at the start of the path requires a /cygdrive/c prefix to actually reference the top level of the filesystem. If only relative paths are specified then the rsync commands run but other system calls in buildme.pl fail. I've worked around this by changing buildme.pl to append the prefix for now but would like to remove it if possible.

    Here what I'm using from a cmd prompt with Strawberry Perl and a set of Unix command for windows in the PATH.

    Code:
    perl buildme.pl --build win64 --buildDir /msys64/home/ralphy/source/slimserver-build --sourceDir /msys64/home/ralphy/source --destDir /msys64/home/ralphy/source/slimserver-install
    What is the command line for buildme.pl currently for the win32 build?

    What version and build of rsync is used on the win32 build machine?

    Could you provide me a copy for rsync and any required dlls from the win32 build system?

    I've tried 5 different rsync binaries and they all work a bit different with respect to pathnames. I'm currently using the 64bit 3.1.3 build from https://rsync.samba.org

    Thanks,
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

  8. #8
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,724

    LMS for Windows using Strawberry Perl

    > All sources and required changes are available in
    > https://github.com/ralph-irving/slimserver-vendor-win64 and
    > https://github.com/ralph-irving/slimserver-win64


    Why didn't you fork the repositories?... this way it'll be much harder
    to merge them. The two repositories could easily get out of sync...

  9. #9
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,724

    LMS for Windows using Strawberry Perl

    >> All sources and required changes are available in
    >> https://github.com/ralph-irving/slimserver-vendor-win64 and
    >> https://github.com/ralph-irving/slimserver-win64

    >
    > Why didn't you fork the repositories?... this way it'll be much harder
    > to merge them. The two repositories could easily get out of sync...


    I wanted to see the differences in Slim::Utils::OS::Win32 you applied -
    but it's not easy with this setup to diff them. Would it make sense to
    have a Win64 module or similar?

  10. #10
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    3,026
    Quote Originally Posted by mherger View Post
    > The LMS installer should be able to be changed to handle the dependency
    > and install perl if it's not there, keeping in mind that we will be tied
    > to a specific version of SB Perl, just like Linux.


    Good plan.
    Great that's settled. I can move forward now, no more compiled exes for windows.

    Quote Originally Posted by mherger View Post
    > However, I have no issues with moving to as close as possible to the
    > current win32 build system. In which case it would be helpful to have
    > the version details for all the tools, sans the PDK of course.[/color]

    I'm not sure I understand. As you might know the buildme.pl is
    cross-platform. On Windows whomever started the work decided to base it
    on cygwin, maybe just for the availability of all the same tools needed.
    Are you using the same Strawberry Perl to run the script as you use for
    LMS? Unless we want to move the 32 bit build to the same architecture
    (getting rid of ActiveState tools), I'd like to keep the current
    pipeline, as otherwise we'd have to tweak it even more to cover the two
    different builds.
    Yes, I'm fully aware of the fact that buildme.pl is cross platform. I've added the win64 build type to it.

    I don't see any reason to move the 32bit build. I would think that at some point we would stop providing the AS 32bit builds, since the PDK is no longer supported.
    In my mind the win32 bit build would eventually be retired. How many 32bit windows 10+ installs are there. You've already stopped provide the windows 32bit spotty helper.

    Quote Originally Posted by mherger View Post
    But maybe I'm overthinking this, and it actually doesn't really matter
    much whether we use cygwin or the tools you're using. As long as there's
    Perl, rsync and all the other tools, it should probably run just fine in
    both environments? Or are the paths a problem?
    I agree that it shouldn't matter. But if I'm going to change to the cygwin tools, it should be as close as possible to the version on the current build system.
    I've been bitten too many times, by changes to newer versions of tools that break what had been works great for years. Trying to track down what's changed is often a PITA.

    Quote Originally Posted by mherger View Post
    > All sources and required changes are available in
    > https://github.com/ralph-irving/slimserver-vendor-win64 and
    > https://github.com/ralph-irving/slimserver-win64


    Why didn't you fork the repositories?... this way it'll be much harder
    to merge them. The two repositories could easily get out of sync...
    I did this because the main repo is huge and all I need right now is the windows specific binaries and modules.

    I merge the changes from the official repo about once a week, unless, you've applied a lot of changes, then I do it more often.
    It's easy to export my repository and merge it into a branch of the official repo, I've done it many times in the past for other projects.
    I will do this when we're close to a working solution so I can create the pull request.
    Last edited by ralphy; 2022-02-05 at 04:49.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •