Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Senior Member JoeMuc2009's Avatar
    Join Date
    Jan 2009
    Location
    Marktoberdorf, Germany
    Posts
    113

    Amiga MOD Transcoder available?

    Hi all,

    something a bit unusual maybe but I thought it could not harm to ask.
    I'm still a big fan of 4-channel Amiga SoundTracker / ProTracker modules. It's really oldschool nowadays but I still love it.
    However, my Amiga is not directly connected to my hi-fi set, and it's not very comfortable to control module playlists on a computer when everything else is controlled more or less with LMS. This would become super easy if LMS had something like a transcoder for Amiga modules. Winamp for instance had the so-called oldsk00l plugin as an option to read MOD files directly and play them on a PC. I imagine this might be possible in LMS as well.
    It would add a whole new level of joy. Unfortunately, I am absolutely beginner level in LMS internals and Perl is not something I can handle well. So I thought maybe somebody else has the same thoughts and/or more capability to get there?
    Foobar2000 is officially capable to use MOD files as its input but I have no idea how to use it in LMS.
    Linux has a module player called "xmp" which is also capable of creating WAV output.
    But what I am looking for is not a solution to create WAV files of all my modules. That would be a giant waste of disk space as a module can be as small as a kilobyte whereas the WAV created from it could easily exceed 100MB or more. So the conversion should happen in-line if possible.

    Thank you for your thoughts!
    Cheers,
    Joe
    Last edited by JoeMuc2009; 2017-12-01 at 04:15.


    PN me if your Boom / Classic / Transporter display has issues!

    LMS 7.9.0 on Windows Server 2012
    1x Squezeebox Classic SB2
    7x Squeezebox Classic SB3 (one waiting for repair)
    7x Squeezebox Boom (two waiting for repair)
    1x Transporter
    2x Controller (one waiting for repair)
    3x Touch (two waiting for repair)
    1x Radio

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,720
    ffmpeg (aka avconv) can handle MOD - well at least one sample I tested.

    You could set up the approrporiate new type for a .MOD file with custom-type.conf and then add a MOD type to custom-convert.conf which has a MOD filetype and uses ffmpeg to convert to flac and then LMS sends flac stream to player.


    Alternatively convert the MOD files once to flac with the command

    ffmpeg -i input.mod -f flac output.flc

  3. #3
    Senior Member JoeMuc2009's Avatar
    Join Date
    Jan 2009
    Location
    Marktoberdorf, Germany
    Posts
    113
    Hi bpa,

    thanks for the pointer. I found the type.conf and convert.conf but could not get any ffmpeg version to accept the MOD files (ProTracker / SoundTracker compatible) as input. Just to be sure we are talking about the same thing here because MOD apparently was also the name for a video format.
    When I call ffmpeg -decoders, it returns 439 decoders but the words "MOD", "Protracker", or "Amiga" don't appear anywhere in there. So I assume the format is not supported.
    It's an up-to-date version though. The command line output reads:

    Code:
    ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 7.2.0 (GCC)
    No idea what I'm doing wrong. It does not seem as though there are many alternatives. Most Windows programs handling MOD files are to play them, mostly they present a GUI and do not offer command-line level support for conversion, if at all.

    Regards
    Joe


    PN me if your Boom / Classic / Transporter display has issues!

    LMS 7.9.0 on Windows Server 2012
    1x Squezeebox Classic SB2
    7x Squeezebox Classic SB3 (one waiting for repair)
    7x Squeezebox Boom (two waiting for repair)
    1x Transporter
    2x Controller (one waiting for repair)
    3x Touch (two waiting for repair)
    1x Radio

  4. #4
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,720
    I am using the ffmpeg that is installed as part of Ubuntu 16.04 - no special build.
    Log of conversion using ffmpeg so that version and decoders are shown
    Code:
    xxx@minitower:/tmp$ ffmpeg -loglevel info -i /home/xxxx/Downloads/lastr.mod -f flac lastr.flc
    ffmpeg version 3.3.3-2~ubuntu16.04.1~ppa1 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
      configuration: --prefix=/usr --extra-version='2~ubuntu16.04.1~ppa1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
      libavutil      55. 58.100 / 55. 58.100
      libavcodec     57. 89.100 / 57. 89.100
      libavformat    57. 71.100 / 57. 71.100
      libavdevice    57.  6.100 / 57.  6.100
      libavfilter     6. 82.100 /  6. 82.100
      libavresample   3.  5.  0 /  3.  5.  0
      libswscale      4.  6.100 /  4.  6.100
      libswresample   2.  7.100 /  2.  7.100
      libpostproc    54.  5.100 / 54.  5.100
    Guessed Channel Layout for Input Stream #0.0 : stereo
    Input #0, libopenmpt, from '/home/xxxx/Downloads/lastr.mod':
      Metadata:
        title           : last roundabout
        encoder         : ProTracker / NoiseTracker / Soundtracker / SoundTracker 2.6 / Ice Tracker / Mod's Grave
        comment         : (c) 1992 jesper kyd
                        : finished the 25-10-92
                        : composed for the...
                        : sound of silents ii
                        : skinny3
                        : skinny4=5(3)
                        : skinny2
                        : freak23
                        : freak17
                        : freak12
                        : 
                        : synth
                        : 
                        : 
                        : 
                        : overbazz
                        : overbazz2
                        : cguit
                        : eu2
                        : 
                        : strings2
                        : 
                        : strings1
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
      Duration: 00:08:02.66, bitrate: 3 kb/s
        Stream #0:0: Audio: pcm_f32le, 48000 Hz, stereo, flt, 3072 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (pcm_f32le (native) -> flac (native))
    Press [q] to stop, [?] for help
    [flac @ 0x556c80372580] encoding as 24 bits-per-sample
    Output #0, flac, to 'lastr.flc':
      Metadata:
        title           : last roundabout
        DESCRIPTION     : (c) 1992 jesper kyd
                        : finished the 25-10-92
                        : composed for the...
                        : sound of silents ii
                        : skinny3
                        : skinny4=5(3)
                        : skinny2
                        : freak23
                        : freak17
                        : freak12
                        : 
                        : synth
                        : 
                        : 
                        : 
                        : overbazz
                        : overbazz2
                        : cguit
                        : eu2
                        : 
                        : strings2
                        : 
                        : strings1
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
                        : 
        encoder         : Lavf57.71.100
        Stream #0:0: Audio: flac, 48000 Hz, stereo, s32 (24 bit), 128 kb/s
        Metadata:
          encoder         : Lavc57.89.100 flac
    size=   87181kB time=00:08:02.77 bitrate=1479.3kbits/s speed= 157x    
    video:0kB audio:87172kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.009557%
    For completeness the conf file that could work would be like the following. There will be issues like LMS will not able to scan the file so duration etc will not be known so conversion to flac would be an overall better solution.
    custom-types.conf
    Code:
    mod mp3 * *
    	# F:{PATH=%f}R:{PATH=%F}B:{BITRATE=-B %B}T:{START=-ss %s}
    	[ffmpeg] -loglevel quiet  -i $PATH$ -f wav - | [lame] --silent -q $QUALITY$ $BITRATE$ - -
    
    mod pcm * *
    	# F:{PATH=%f}R:{PATH=%F}B:{BITRATE=-B %B}T:{START=-ss %s}
    	[ffmpeg] -loglevel quiet  -i $PATH$ -f u16le -
    
    mod flc * *
    	# F:{PATH=%f}R:{PATH=%F}B:{BITRATE=-B %B}T:{START=-ss %s}
    	[ffmpeg] -loglevel quiet -i $PATH$ -f flac -
    custom-convert.conf
    Code:
    mod    mod           -                               audio
    custom-strings.txt
    Code:
    MOD
    	EN	Amiga MOD audio

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,720
    Quote Originally Posted by JoeMuc2009 View Post
    thanks for the pointer. I found the type.conf and convert.conf but could not get any ffmpeg version to accept the MOD files (ProTracker / SoundTracker compatible) as input. Just to be sure we are talking about the same thing here because MOD apparently was also the name for a video format.
    When I call ffmpeg -decoders, it returns 439 decoders but the words "MOD", "Protracker", or "Amiga" don't appear anywhere in there. So I assume the format is not supported.
    Just did some checking on MOD - it is not an encoding (ie. the audio is in PCM) - MOD is a muxer format so use "ffmpeg -demuxers" to list the demuxers and check if you have "libopenmpt" which is for "Tracker formats"

  6. #6
    Senior Member JoeMuc2009's Avatar
    Join Date
    Jan 2009
    Location
    Marktoberdorf, Germany
    Posts
    113
    Well, almost there. I added this to my custom-convert.conf:

    Code:
    mod flc * *
        # F:{PATH=%f}R:{PATH=%F}T:{START=--skip=%t}U:{END=--until=%v}D:{RESAMPLE=-r %d}
        [xmp] $PATH$ --nofilter -c -t 300 -o %TEMP%\1.wav | [flac] -cs --totally-silent --compression-level-0 $START$ $END$ -- %TEMP%\1.WAV | [sox] -q -t flac - -t flac -C 0 $RESAMPLE$ -
    And this to custom-type.conf:

    Code:
    #########################################################################
    #ID     Suffix          Mime Content-Type               Server File Type#
    #########################################################################
    mod     mod             audio/x-amiga-mod               audio
    This actually results in LMS being able MOD files when picked from the directory view in LMS's control interface in the browser. It doesn't even take long until the music starts. About 3 seconds average. Not too bad.

    HOWEVER:


    • neither the file name nor the module's internal name is shown. The latter is no surprise as there is nothing to extract the name from the MOD file and hand it over to LMS to pass it through to the player's display
    • the resulting stream is like a web radio stream. I cannot skip to a given point in the playback
    • in the browser it looks like nothing is playing at all during playback, see screenshot below
    • I'm not happy working with a temporary file that always has the same name. This would not work if two users wanted to consume MOD files at the same time. As LMS is Windows-based here, I cannot take xmp's output and pipe it directly to flac as one would do in Linux. It seems that it cannot work without files in Windows at all
    • the scanner apparently overlooks the .MOD files completely so they never make it into my library. I have to use the file system / directory based file picker to see modules


    Name:  2017-12-01_19-26-30.jpg
Views: 78
Size:  14.2 KB

    So this illustrates that the total play duration is shown on the left instead of right (which is always 0:00 with modules). And no information whatsoever on what is currently playing. Funny.

    Looked at ffmpeg again and it seems that it is not capable of using libopenmpt. Even though I put its binaries in the same directory as the ffmpeg executable, this is what I get:

    Code:
    >ffmpeg
    ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 7.2.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
      libavutil      55. 78.100 / 55. 78.100
      libavcodec     57.107.100 / 57.107.100
      libavformat    57. 83.100 / 57. 83.100
      libavdevice    57. 10.100 / 57. 10.100
      libavfilter     6.107.100 /  6.107.100
      libswscale      4.  8.100 /  4.  8.100
      libswresample   2.  9.100 /  2.  9.100
      libpostproc    54.  7.100 / 54.  7.100
    No libopenmpt in the list and no --enable-libopenmpt switch is available


    PN me if your Boom / Classic / Transporter display has issues!

    LMS 7.9.0 on Windows Server 2012
    1x Squezeebox Classic SB2
    7x Squeezebox Classic SB3 (one waiting for repair)
    7x Squeezebox Boom (two waiting for repair)
    1x Transporter
    2x Controller (one waiting for repair)
    3x Touch (two waiting for repair)
    1x Radio

  7. #7
    Senior Member JoeMuc2009's Avatar
    Join Date
    Jan 2009
    Location
    Marktoberdorf, Germany
    Posts
    113
    Oh by the way, credit where credit is due, the idea to use XMP comes from this blog:

    http://blog.netflowdevelopments.com/...iles-in-linux/

    At first it seemed that XMP is a Linux-only tool but it's actually open source and can be compiled on Windows as well.
    The sources can be found here:

    https://sourceforge.net/projects/xmp/files/xmp/4.0.7/

    I think it's legal to offer the compiled Windows EXE to anybody who desires to have it and can't compile themselves. Just PN me if you want it.


    PN me if your Boom / Classic / Transporter display has issues!

    LMS 7.9.0 on Windows Server 2012
    1x Squezeebox Classic SB2
    7x Squeezebox Classic SB3 (one waiting for repair)
    7x Squeezebox Boom (two waiting for repair)
    1x Transporter
    2x Controller (one waiting for repair)
    3x Touch (two waiting for repair)
    1x Radio

  8. #8
    Senior Member JoeMuc2009's Avatar
    Join Date
    Jan 2009
    Location
    Marktoberdorf, Germany
    Posts
    113
    Okay, my solution sucks. It is not possible to add the modules to the playlist. So it's either play them all from A to Z, or pick one, and playback stops after this one so I have to pick the next. The rest of what LMS or the playback devices offer appears to be mostly brain-dead. It should all behave just like the modules were "proper" source audio file streams but I'm still far from that.
    Maybe a plugin that worships the information extracted from the MOD file such as title, length, etc. would do a better job here. Also I would like to influence some parameters like "how many times are jump commands at the end of the song followed"? Because a lot of MODs are designed to run indefinitely by picking up playback at a given location once the end was reached, but there should be an end if they are part of a playlist. And this is something that needs to be determined before converting the MOD to anything else.
    Moreover, Amiga computers had a built-in low-pass filter that, if engaged, would cripple a good bit of the spectrum but is closer to what we (Amiga users) feel is original. It should be possible to engage or disengage, at least in the configuration so it can be changed on demand. Good playback tools like Modplug have configurable filters and algorithms for post-processing of the 8-bit output to give it better quality. The stereo experience should adjustable between full channel separation and mono. It's all missing if the toolchain is fixed the way I set it up.


    PN me if your Boom / Classic / Transporter display has issues!

    LMS 7.9.0 on Windows Server 2012
    1x Squezeebox Classic SB2
    7x Squeezebox Classic SB3 (one waiting for repair)
    7x Squeezebox Boom (two waiting for repair)
    1x Transporter
    2x Controller (one waiting for repair)
    3x Touch (two waiting for repair)
    1x Radio

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,720
    No libopenmpt in the list and no --enable-libopenmpt switch is available
    "--enable-libopenmpt" is a ffmpeg configure/build parameter not a runtime parameter but you probably need to have the library built and installed for the option to be available.

    For LMS to "know"about a file - it needs to be scanned and that means updating the LMS scanner about MOD. I think you'd be better off converting the MOD files to a know format such as Flac.

  10. #10
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    736
    Quote Originally Posted by JoeMuc2009 View Post
    It should all behave just like the modules were "proper" source audio file streams but I'm still far from that.
    Maybe a plugin that worships the information extracted from the MOD file such as title, length, etc. would do a better job here.
    Adding full support for new file types to LMS is rather involved, check out this thread for a basic overview.

    Good playback tools like Modplug have configurable filters and algorithms for post-processing of the 8-bit output to give it better quality.
    ffmpeg also supports libmodplug, but it needs to be configured/build with this option, similar to libopenmpt

Posting Permissions

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