Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 7 of 7
  1. #1
    Member CodeChimp's Avatar
    Join Date
    May 2008
    Location
    Essex, UK
    Posts
    42

    Plugin Development Tips

    I've been working on a plugin for LMS for sometime and totally new to PERL. Although I'm progressing I'm finding the round robin to test what I've written time consuming, especially when I'm making trivial mistakes.

    My process is copy plugin to LMS server plugins folder, restart LMS, test and look at error logs.

    Does anyone have any advice on how they write/test stuff that's better than this? I'm using VSCode as my IDE.
    Andrew.

    Squeezebox Transporter Black/TransNav - Onkyo TX-NR1009 - Dali Zensor 5 fronts, Dali E12F Sub
    Squeezebox Touch - Audio Engine A2
    Squeezebox Receiver - Audio Engine A2
    Squeezebox Radio
    Squeezebox Boom
    Squeezebox Controller

    Server: Lenovo ThinkServer TS140, Unraid 6.x, LMS 7.9.2 (own docker image)
    Orange Squeeze, iPeng

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

    Plugin Development Tips

    > My process is copy plugin to LMS server plugins folder, restart LMS,
    > test and look at error logs.
    >
    > Does anyone have any advice on how they write/test stuff that's better
    > than this? I'm using VSCode as my IDE.


    What system are you on? I strongly recommend you don't test your plugin
    on your server. Because it stops playback whenever you have to restart :-).

    It's easiest if you are on a Unixy system (Linux, macOS): just symlink
    you plugin folder to the LMS Plugins folder (NOT InstalledPlugins - see
    Settings/Information). Then restart LMS when needed.

    Even better: get a tarball (or git clone of the LMS code) and just run
    ../slimserver.pl. That would give you the log output right there in the
    console. No need to monitor the server.log somewhere else. Ctrl-C to
    stop LMS.

    --

    Michael

  3. #3
    Member CodeChimp's Avatar
    Join Date
    May 2008
    Location
    Essex, UK
    Posts
    42
    Quote Originally Posted by mherger View Post
    > My process is copy plugin to LMS server plugins folder, restart LMS,
    > test and look at error logs.
    >
    > Does anyone have any advice on how they write/test stuff that's better
    > than this? I'm using VSCode as my IDE.


    What system are you on? I strongly recommend you don't test your plugin
    on your server. Because it stops playback whenever you have to restart :-).

    It's easiest if you are on a Unixy system (Linux, macOS): just symlink
    you plugin folder to the LMS Plugins folder (NOT InstalledPlugins - see
    Settings/Information). Then restart LMS when needed.

    Even better: get a tarball (or git clone of the LMS code) and just run
    ../slimserver.pl. That would give you the log output right there in the
    console. No need to monitor the server.log somewhere else. Ctrl-C to
    stop LMS.

    --

    Michael
    Thanks for the insight.

    When I say "server" I actually mean a test instance running on my own machine, I'm not messing with my proper server
    I'm on Mac so the symlink idea will work well as a quick fix and I'll try running LMS from console.
    This plugin is actually a joint effort with my partner who's on Windows, I'll let him struggle with the equivalent on that.
    Andrew.

    Squeezebox Transporter Black/TransNav - Onkyo TX-NR1009 - Dali Zensor 5 fronts, Dali E12F Sub
    Squeezebox Touch - Audio Engine A2
    Squeezebox Receiver - Audio Engine A2
    Squeezebox Radio
    Squeezebox Boom
    Squeezebox Controller

    Server: Lenovo ThinkServer TS140, Unraid 6.x, LMS 7.9.2 (own docker image)
    Orange Squeeze, iPeng

  4. #4
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,844
    Quote Originally Posted by cublet View Post
    Thanks for the insight.

    When I say "server" I actually mean a test instance running on my own machine, I'm not messing with my proper server
    I'm on Mac so the symlink idea will work well as a quick fix and I'll try running LMS from console.
    This plugin is actually a joint effort with my partner who's on Windows, I'll let him struggle with the equivalent on that.
    If you can - develop as much code outside of LMS in a simple test rig. This is probably true if plugin is adding support for network formats or streaming source and not if you are trying to enhance LMS or add a LMS specific features.

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

    Plugin Development Tips

    > This plugin is actually a joint effort with my partner who's on Windows,
    > I'll let him struggle with the equivalent on that.


    Windows is much more complicated, as it doesn't come with Perl. And the
    Perl modules we ship with LMS require a specific, rather old Perl
    version: he'll have to install ActiveState Perl 5.14. In case he can't
    find it anymore, let me know, I still have a copy.

    --

    Michael

  6. #6
    Member CodeChimp's Avatar
    Join Date
    May 2008
    Location
    Essex, UK
    Posts
    42
    Quote Originally Posted by mherger View Post
    > This plugin is actually a joint effort with my partner who's on Windows,
    > I'll let him struggle with the equivalent on that.


    Windows is much more complicated, as it doesn't come with Perl. And the
    Perl modules we ship with LMS require a specific, rather old Perl
    version: he'll have to install ActiveState Perl 5.14. In case he can't
    find it anymore, let me know, I still have a copy.

    --

    Michael
    Thanks for the tips, I'll pass that on. I think he'll probably just keep testing on a docker image, or setup a linux VM for dev purposes.
    Andrew.

    Squeezebox Transporter Black/TransNav - Onkyo TX-NR1009 - Dali Zensor 5 fronts, Dali E12F Sub
    Squeezebox Touch - Audio Engine A2
    Squeezebox Receiver - Audio Engine A2
    Squeezebox Radio
    Squeezebox Boom
    Squeezebox Controller

    Server: Lenovo ThinkServer TS140, Unraid 6.x, LMS 7.9.2 (own docker image)
    Orange Squeeze, iPeng

  7. #7
    Member CodeChimp's Avatar
    Join Date
    May 2008
    Location
    Essex, UK
    Posts
    42
    Quote Originally Posted by bpa View Post
    If you can - develop as much code outside of LMS in a simple test rig. This is probably true if plugin is adding support for network formats or streaming source and not if you are trying to enhance LMS or add a LMS specific features.
    I did think about a test rig but it's the dependence on Slim::Networking::SimpleAsyncHTTP; that will probably make things awkward.

    I think we had a breakthrough on this project yesterday so hopefully not too much more deploy/test loops to do.
    Andrew.

    Squeezebox Transporter Black/TransNav - Onkyo TX-NR1009 - Dali Zensor 5 fronts, Dali E12F Sub
    Squeezebox Touch - Audio Engine A2
    Squeezebox Receiver - Audio Engine A2
    Squeezebox Radio
    Squeezebox Boom
    Squeezebox Controller

    Server: Lenovo ThinkServer TS140, Unraid 6.x, LMS 7.9.2 (own docker image)
    Orange Squeeze, iPeng

Posting Permissions

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