Since I recently came across some music in the Ogg Opus format, I looked into playing it with LMS.
The main issue is that the library LMS uses to read audio metadata (AudioScan) doesn't support Opus. I did, however, find a forked version which does.
As this one hasn't been updated in a while, I decided to merge the Opus support into the current AudioScan.
Attached you will find a patch for AudioScan enabling Opus support (credit goes to the original author linked above), plus some support files for LMS.
Instructions
Install the Opus libraries and sox with the Opus codec enabled. Most likely, your distribution will have it packaged already (e.g. libopus, libopus-dev, opus-tools, sox in Debian)
Note: if your sox version doesn't support Opus (check with sox -h), you can compile it yourself or use opusdec instead. However, you will lose the ability to seek in a track when using opusdec.
Download the attached zip and build the module:
If the build was successful, you'll find the perl modules inCode:mkdir build; cd build wget https://raw.githubusercontent.com/Logitech/slimserver-vendor/public/7.9/CPAN/buildme.sh wget http://search.cpan.org/CPAN/authors/id/A/AG/AGRUNDMA/Audio-Scan-0.96.tar.gz wget https://github.com/Logitech/slimserver-vendor/raw/public/7.9/CPAN/Sub-Uplevel-0.22.tar.gz wget https://github.com/Logitech/slimserver-vendor/raw/public/7.9/CPAN/Test-Warn-0.23.tar.gz wget https://github.com/Logitech/slimserver-vendor/raw/public/7.9/CPAN/Tree-DAG_Node-1.06.tar.gz unzip lmsopus-alpha.zip tar xzf Audio-Scan-0.96.tar.gz cd Audio-Scan-0.96 patch -p1 < ../Audio-Scan-0.96.opus.patch cd .. mv Audio-Scan-0.96.tar.gz Audio-Scan-0.96.orig.tar.gz tar czf Audio-Scan-0.96.tar.gz Audio-Scan-0.96 chmod +x buildme.sh ./buildme.sh Audio::Scan
e.g. for perl 5.24 on Linux 64bit:Code:./build/arch/<perl version>/<architecture>
copy the content of the build/arch directory to your LMS installation's CPAN/arch folderCode:build/arch/5.24/x86_64-linux-thread-multi
e.g. if your LMS is in opt/logitechmediaserver-7.8-0-noCPAN, the full final path will be
In your LMS installation, edit Slim/Formats.pm and add the format:Code:/opt/logitechmediaserver-7.8-0-noCPAN/CPAN/arch/5.24/x86_64-linux-thread-multi/auto/Audio ...
and finally copy OggOpus.pm to your LMS installation's Slim/Formats folderCode:'ogf' => 'Slim::Formats::OggFLAC', 'ops' => 'Slim::Formats::OggOpus', # add this line
Edit your modules.conf:
This takes care of the metadata part. To actually be able to play it, add this line to your custom-types.conf:Code:Audio::Scan 0.93 0.96
and modify your custom-convert.conf.Code:ops opus audio/ogg audio
For sox with opus:
Code:ops mp3 * * # IFB:{BITRATE=--abr %B}D:{RESAMPLE=--resample %D} [sox] -q -t opus $FILE$ -t wav - | [lame] --silent -q $QUALITY$ $RESAMPLE$ $BITRATE$ - - ops ops * * - ops aif * * [sox] -q -t opus $FILE$ -t raw -r 44100 -c 2 -2 -s $-x$ - ops pcm * * [sox] -q -t opus $FILE$ -t raw -r 44100 -c 2 -2 -s - ops flc * * # IFRD:{RESAMPLE=-r %d}T:{START=trim %s} [sox] -t opus $FILE$ -t flac -C 0 $RESAMPLE$ - $START$
For opusdec:
Code:ops mp3 * * [opusdec] --quiet $FILE$ --force-wav - | [lame] --silent -q $QUALITY$ $RESAMPLE$ $BITRATE$ - - ops ops * * - ops pcm * * [opusdec] --quiet --rate 44100 $FILE$ - ops flc * * [opusdec] --quiet --force-wav $FILE$ - | [sox] -q -t wav - -t flac -C 0 $RESAMPLE$ -
Results 1 to 10 of 34
Thread: [Howto] play Ogg Opus files
-
2017-02-21, 15:51 #1
- Join Date
- Aug 2012
- Location
- Austria
- Posts
- 1,130
[Howto] play Ogg Opus files
Last edited by Roland0; 2017-02-27 at 11:38. Reason: added modules.conf
Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Chiptunes | LMSlib2go | ...
Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...
-
2017-02-21, 21:45 #2
[Howto] play Ogg Opus files
> The main issue is that the library LMS uses to read audio metadata
> (AudioScan) doesn't support Opus. I did, however, find a 'forked
> version' (https://github.com/jrmuizel/AudioScan-opus/) which does.
> As this one hasn't been updated in a while, I decided to merge the Opus
> support into the current AudioScan.
Did you submit a pull request to Andy
(https://github.com/andygrundman/Audio-Scan)? This very topic had come
up recently on our github site:
https://github.com/Logitech/slimserver/issues/133
--
Michael
-
2017-02-22, 04:59 #3
This is pretty cool, I had no idea someone had worked on this years ago. I'd be happy to add this to Audio-Scan if you want to submit a pull request.
-
2017-02-23, 16:34 #4
- Join Date
- Aug 2012
- Location
- Austria
- Posts
- 1,130
I didn't submit a pull request, since I'm not the original author.
I guess we have the following options:
- Motivate the original author to submit the pull request
- You apply my patch directly (possibly in a feature branch)
- I fork AudioScan, apply the patch, and submit a pull request
What would you prefer?Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Chiptunes | LMSlib2go | ...
Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...
-
2018-07-09, 20:16 #5
I changed my mind about Opus and merged it into Audio-Scan 1.01, now on CPAN. Hope this helps some of you!
https://github.com/andygrundman/Audio-Scan
https://metacpan.org/release/Audio-Scan
-
2018-10-05, 05:58 #6Michael
"It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
(LMS: Settings/Information)
-
2018-10-05, 11:13 #7
- Join Date
- Aug 2012
- Location
- Austria
- Posts
- 1,130
Yes
Would you be able to provide a pull request,
Everything that needs to be done is described in the first post, however, and the one new source file is in the attached zip, in case you want to speed things up by doing it yourself.
or all wrapped up in a little plugin?
Any example available?Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Chiptunes | LMSlib2go | ...
Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...
-
2018-10-05, 11:41 #8
I can’t find OggOpus.pm in your posting. It isn’t in the archive either, is it?
Michael
"It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
(LMS: Settings/Information)
-
2018-10-05, 11:45 #9
- Join Date
- Aug 2012
- Location
- Austria
- Posts
- 1,130
Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | Chiptunes | LMSlib2go | ...
Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...
-
2018-10-05, 12:37 #10
[Howto] play Ogg Opus files
> It's in the zip (as are the *.conf files)
Oh... the iOS .zip preview only shows the first file in the archive (and
I don't even know where that preview is coming from, as I don't see it
on the iPad?!?).
Is that scanBitrate() method really needed? It's my understanding that
most of it is dealing with scanning remote streams. Is this a topic with
Opus?
--
Michael