Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member
    Join Date
    Nov 2009
    Location
    DUS
    Posts
    914

    LMS - variable locations of (custom-)convert.conf !?!?

    Hi.

    I'm in the process of settings up LMS on ya RPi4. I do it from scratch. Building CPAN asf.

    I have a question.

    The (custom-)convert.conf files are spread all over the place on different OS installations.

    The location can not be chosen via "default" locations as it seems.
    I basically can not tell LMS where to look for the files at startup. LMS looks only in the lms root-directory (usually /usr/share/"lms") by default.

    Ubuntu and others leave the convert files at /etc/squeezeboxserver, pCP under its LMS rootdir /usr/local/slimserver/ ( which is not nice) , asf.

    I am wondering if a user accessible location, which already exists, wouldn't be a much better choice for at least
    the custom.convert.conf??

    I'd prefer to go for /var/lib/"lms"/prefs . To me that looks much better than above examples. It also wouldn't need a separate LMS backup procedure.

    What I don't know:

    How can I configure such a location?
    Can I make LMS scan that location as default-location for a custom-convert.conf ?


    Thx.

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    20,293
    Every plugin can have a custom-convert.conf file so there are usually multiple custom-convert.conf (as well as custom-types.conf & strings.txt) files in an installation.

    LMS searches for custom-convert.conf files in top level and all the directories that are listed in the Plugins folders in the LMS Information tab. Not sure what is the order of search but last one wins.

  3. #3
    Senior Member
    Join Date
    Nov 2009
    Location
    DUS
    Posts
    914
    LMS doesn't look e.g. in

    /var/lib/lms # a top level
    /var/lib/lms/prefs # as shown in info screen

    (just tried it)

    how can it then lookup

    /etc/squeezeboxserver

    on Ubuntu, which doesn't show anywhere !?!?

    Nope, it's not that simple.

    *********************************

    Here's the answer, I just figured it out myself.

    You'll find different default PATH configurations under:

    /usr/share/""lms""/Slim/Utils/OS/

    That's where you find the config files for Debian, RedHat, OSX,... where they define their file locations.
    If you then run Ubuntu, Debian gets applied, if you run Fedora, RedHat gets applied.

    Each of these OS basically runs its own config file. E.g inside the Debian.pm you'll find before mentioned /etc/squeezeboxserver

    What if you're not on that list???
    I am on ArchLinux Arm right now. There is no config file for that.
    Therefore LMS defaults to the generic "Unix" config for ArchLinux.

    Now I did this inside Unix.pm:

    Code:
    diff /usr/share/lms/Slim/Utils/OS/Unix.pm /usr/share/lms/Slim/Utils/OS/Unix.pm.orig 
    55c55
    < 	if ($dir =~ /^(?:strings|revision|types|repositories)$/) {
    ---
    > 	if ($dir =~ /^(?:strings|revision|convert|types|repositories)$/) {
    58,61d57
    < 
    < 	} elsif ($dir =~ /^(?:convert)$/) {
    < 
    < 		push @dirs, "/var/lib/lms/prefs";
    (inspired by the Debian folks)

    and then copied "BOTH" convert.conf and custom-convert.conf to my preferred directory /var/lib/lms/prefs

    Yep. It seems that unfortunately convert.conf has to be placed at the same location as custom-convert.conf.


    And guess what!?!?

    That's how I made it work.

    Perhaps there's a more elegant way. I don't know yet. Above was just a quick hack.

    At least I have an idea how it works for now.


    Cheers

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

    LMS - variable locations of(custom-)convert.conf !?!?

    > Each of these OS basically runs its own config file. If you're not on
    > that list???


    Create a Custom.pm (Slim::Utils::OS::Custom) module inheriting from
    whatever other module you like.

    > Now I did this on Unix.pm:


    Do not modify existing files, as they'll be overwritten next time you
    update. Create a Custom.pm instead.

    > Perhaps there's a more elegant way. I don't know yet.


    Creating a minimal Plugin would be more elegant imho.

    --

    Michael

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    20,293
    Quote Originally Posted by mherger View Post
    Creating a minimal Plugin would be more elegant imho.
    +1 Definitely the simplest and most maintainable way.

  6. #6
    Senior Member
    Join Date
    Nov 2009
    Location
    DUS
    Posts
    914
    Quote Originally Posted by mherger View Post
    > Each of these OS basically runs its own config file. If you're not on
    > that list???


    Create a Custom.pm (Slim::Utils::OS::Custom) module inheriting from
    whatever other module you like.

    > Now I did this on Unix.pm:


    Do not modify existing files, as they'll be overwritten next time you
    update. Create a Custom.pm instead.

    > Perhaps there's a more elegant way. I don't know yet.


    Creating a minimal Plugin would be more elegant imho.

    --

    Michael
    I'd prefer to rather extent the search PATH for the .conf files by the paths already known
    through the environment. And the "prefs" path is known.

    Basically doing that what BPA wrongly suggested in the first place.

    But writing a plugin... ...you gotta be kidding.

    I do very well understand that none of you likes to touch the code.
    LMS is a monster. Perhaps I'll find out how to extent the PATH. Then I'll do that.
    Because that'd be very generic and simple and wouldn't implicate anything else.
    If that doesn't work, I'll run a patch with every update. I mean, there are not that many
    updates anyhow.

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

    LMS - variable locations of(custom-)convert.conf !?!?

    > But writing a plugin... ...you gotta be kidding.

    It could be as simple as an empty sub called "initPlugin()". The
    important part is that LMS would automatically pick up the
    custom-convert.conf file from the plugin's folder. The plugin itself
    doesn't need to do anything at all.

    > I do very well understand that none of you likes to touch the code.
    > LMS is a monster. Perhaps I'll find out how to extent the PATH. Then
    > I'll do that.


    I bet extending the search path will be more complicated than writing
    that plugin. At the very least try the Custom.pm approach. See eg.

    http://wiki.slimdevices.com/index.ph...ls::OS::Custom

    --

    Michael

  8. #8
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    20,293
    Quote Originally Posted by soundcheck View Post
    But writing a plugin... ...you gotta be kidding.
    2 files (one of which is custom-convert.conf) and about 4 lines of code. The plugin code will do nothing - just provide a place for LMS to find the custom-convert.conf file.

    The example Michael has suggested is too complicated.

    I'll see if I have a boilerplate somewhere.

    No need to have the install stuff if you manually put the plugin directory into Plugins directory.

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    20,293
    Quick hack attached based on PlayWMA plugin.

    I change the name to Dummy. You can edit to whatever. Change the custom-convert.conf file to whatever you want. If you want binaries/ shell scripts/batch files add then in a Bin directory of the Dummy Plugin.

    Unzip and drop PlayDummy folder into Plugins directory (not Slim/Plugin)

    As an example it replaced wma decodes to ones using an invalid avconv command - so check Information/Filetypes to see if "install" worked.

    This is for a Linux system - not sure about Windows.
    Attached Files Attached Files

  10. #10
    Senior Member
    Join Date
    Nov 2009
    Location
    DUS
    Posts
    914
    FYI.

    I just figured that "Raspbian" is not part of "Debian.pm". That's not consistant. Unix.pm gets applied.
    I am wondering if I should write a change request on lms-git!?!?
    But I guess this also needs to be synced with the Raspbian LMS maintainer.


    PS:
    Once more. I won't use a plugin for that task. IMO the whole "path" subject
    needs to be revised. Adding a plugin increases the mess even further.

Posting Permissions

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