-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Opus codec #133
Comments
I'm sorry, no plans. Maybe you could ask Andy, author of the Audio::Scan module we're using: |
I'll comment here to keep the discussion in one place. So, the good news is that adding Opus support to Audio::Scan would not be much work, probably about on the level of the work that was done for DSD support recently. There would be 4 bits of work needed in Audio::Scan:
After all this stuff, it's relatively easy to add to LMS as a new transcoded file format. All that being said, can you explain your use case a bit? Are these your own encoded Opus files or are they from somewhere else? If they are your own, why do you prefer Opus over FLAC? I think Opus is great for things like low-latency voice chat, but I don't see a reason to use it for music. I'm not trying to discourage you, just pointing out that the chances of this getting worked on are pretty slim (no pun intended). |
Thanks Andy, my case is pretty simple: |
FWIW: somebody seems to have patched Audio::Scan to support Opus: https://github.com/jrmuizel/AudioScan-opus/. Somebody else further developed LMS support: http://forums.slimdevices.com/showthread.php?t=107011 |
Thanks a lot, I'll follow the discussion(s) |
Hi, just for the question "Why to support Opus?" Because it is the standard of the future. Opus will also be the standard of the broadcasting industry as all new hardware in this business will support Opus. See this posting on the mozilla blog: https://hacks.mozilla.org/2012/09/its-opus-it-rocks-and-now-its-an-audio-codec-standard/ |
Reposting from the Audio-Scan issue, for the benefit of those watching this one: After reviewing the existing Opus patch, I can't accept it. The samplerate is hardcoded to 48000 when the format definitely supports more than one samplerate. If anyone would like to continue work on Opus support, please fork this repo and do so via a pull request. I also can't stress enough that a proper set of tests is essential, with test files that cover the range of possible Opus encoding options.
|
Hi guys, I changed my mind about Opus and merged Jeff's great patch into Audio-Scan 1.01. Hope this helps! https://github.com/andygrundman/Audio-Scan |
I'm reopening this, now that Andy has been kind enough to take the initial, important step. |
Any change of plans to support opus in LMS? |
You should be able to build this for your own use pretty easily. Did you try to do so? Head over to Andy‘s repository to get the latest and greatest. |
Thanks Michael, but I'm not into development - I'm a github user because I want to be able to report issues and make feature requests, I only use Linux on my tiny PCPs (normal desktop is Windows). I realize that you do this in your spare time, that there are tons of real problems for you to deal with, and that implementing just another lossy codec doesn't exactly get top priority, so please close the issue with whatever code you find suitable. |
Assuming PCP refers to piCorePlayer, you might want want to get in touch with @paul-1 and ask him whether an update would be possible. He's the guy behind LMS on pCP (and many more aspects of pCP). |
Audio Scan is a pretty easy update. If we do update it, will LMS/Squeezelite handle playing OPUS files? |
Good point!... There's a "patch" for LMS available in https://forums.slimdevices.com/showthread.php?107011. |
The patch is going to be harder to deal with unless that's something you can merge into 7.9.2 Can you do module checks to enable the opus file type? if Audio::Scan >= 1.01 then 'ops' => 'Slim::Formats::OggOpus', |
I consider adding this to 7.9.2, as it's rather lightweight anyway. Would our recent sox builds support decoding Opus? |
@grummisch - could you please provide a sample file? |
libopus is available to be easily added, but I'm not sure the version of sox in LMS allows for extra codecs dynamically loaded. @ralph-irving? |
Sample file: |
Yes, we would need to rebuild the sox binaries with opus support. I already have a modified buildme.sh to include opus support in sox, been using it since Roland0 posted the howto on the forum. Traveling ATM so can't attach it. |
I've created the branch https://github.com/piCorePlayer/slimserver-vendor/tree/soxopus containing the sox build script changes to include opus. @paul-1 would you test the buildme-pcp.sh script? I can rebuild the sox binaries for LMS over the next few days if the plan is to move forward with opus support. |
Thanks Ralphy, now I’m traveling. I’ll be able to do it later in the week. @mherger. Any chance you can make the LMS mods for this? A separate test branch would make it easier for me to build a full test package. |
@paul-1 I might be a bit busy this week, too. But I'd let you know. Thanks! |
As I build the sox-dsd-opus binaries I'm uploading them to https://sourceforge.net/projects/lmsclients/files/utility/sox-opus/20181010-9da8441/ I will post another update once complete. |
I built the new sox, seemed to check out fine, it was able to read the opus sample file. As soon as LMS updates are made, will do a full test. |
Will require an update to Audio::Scan >= 1.01 to work.
Works fine here. |
I wasn't looking closely enough, infact tracks are missed. All tracks are found by the scanner, identified as Audio, but some of the tracks don't end up in the database. No errors are in the log. |
@ralph-irving There is some info missing in the Metadata, This is basically the first thing done after getting the tags from the file (Slim::Formats::Ogg) I wrote a quick program to pull the tags out (Using Audio::Scan), you can see that tag missing from the track that wasn't added. Not sure yet if it is the encoder, or Audio::Scan. Do you have a different MetaData reader?
|
It’s probably an Audio::Scan issue if that field is missing. I’ll take a look if you can send me those files. |
The opus encoder transfers the flac tags to the opus file automatically, but the length is not a flac tag. @paul-1 I just have the opusinfo tool. New logical stream (#1, serial: 5491160d): type opus $ opusinfo 010-SmackwaterJack.opus New logical stream (#1, serial: 6d424da5): type opus |
Thanks, this is definitely an issue with Audio::Scan, it doesn't always parse the Ogg packets properly. Specifically, final_serialno is sometimes read from the wrong point in a packet which causes the duration to not be set. I'll see if I can figure it out. |
A rainy day here, so I played with the code..... There is a problem with the buffer logic, where the opus.c seeks to the end of the file, and then steps backwards through the file to find the last packet header. I started to go cross-eyed looking at the code, so I just increased the buffer so that it "should" be large enough to find the last header. This takes care of the test files not reading.......but obviously is just a band-aid.
|
I checked in a minimalist fix, the root cause was simply that the buffer was not being cleared when seeking further back into the file. I left the buffer size at 8500 because it helps test the seek code, but I don't know where this number came from. Looking at the opusfile library, 64K seems to be the right value to use, because there is no blocksize hint as there is in Vorbis. I still want to do some more cleanup work on this, but hopefully it will be able to scan all your files now. |
1.02 Looks good on my end. |
* add binaries for macOS 64-bit * disable native Opus streaming * add strings for the File Formats settings * require Audio::Scan 1.02
Thanks a lot all of you guys! I merged the necessary changes to public/7.9. Binaries remain to be added/updated. I only added macOS binaries so far. Will add more when needed and available :-). |
BTW: this was one of the nicest LMS collaborations I've seen in a while, from contributors old and new ;-) |
@michaelherger I uploaded a zip with all the sox-opus-binaries to the picoreplayer dropbox share a few days ago and submitted the PR for the sox opus source changes. |
@grummisch The pCP binary package has been updated. Assuming your running pCP 4.0.0......first thing, do a nightly update on LMS. Then on the pCP web page, on the LMS tab, there is a button to "Update Libs" After all the updates are done, you should be good with your opus files. If you have problems, please respond in the pCP support thread. https://forums.slimdevices.com/showthread.php?109404-ANNOUNCE-piCorePlayer-4-0-0 |
I'm on pCP 4.0.0 - unfortunately I'm stuck already on the nightly update: Only place I could find the words nightly update was on the pCP web page, on the LMS tab; No Update file was found, Please check LMS Server configuration. My Software Updates settings: Clicking the Check for updates now button: A new version of Logitech Media Server is available (7.9.0). Click here to download. When the link is clicked: New tab named Index of /LogitechMediaServer_v7.9.1 opens I assume I'm in the wrong place, and go no further... Sorry about the fuss, normally I only do pCP release updates... |
Did you try this procedure? https://www.picoreplayer.org/how_to_upgrade_lms.shtml |
NO! |
@grummisch good to hear you're all set! @paul-1 I think there's a problem right now for people who want to install LMS on pCP without the manual procedure. There's been a report in the forum, too (http://forums.slimdevices.com/showthread.php?t=109613) |
Why would lms require the new audio scan?
On pcp they will have to update the binaries separately.
…Sent from my iPhone
On Oct 18, 2018, at 11:11 AM, Michael Herger <notifications@github.com<mailto:notifications@github.com>> wrote:
@grummisch<https://github.com/grummisch> good to hear you're all set!
@paul-1<https://github.com/paul-1> I think there's a problem right now for people who want to install LMS on pCP without the manual procedure. There's been a report in the forum, too (http://forums.slimdevices.com/showthread.php?t=109613)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#133 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGLG8d0lTrJxwvN3ENBxDTLAsvmOryzRks5umJokgaJpZM4L3IBr>.
|
The problem is the |
I do have Scan.pm included in the new binary package
…Sent from my phone
________________________________
From: michaelherger <notifications@github.com>
Sent: Thursday, October 18, 2018 12:02 PM
To: Logitech/slimserver
Cc: paul-1; Mention
Subject: Re: [Logitech/slimserver] Support for Opus codec (#133)
The problem is the Audio/Scan.pm included with LMS is expecting 0.93. But the binary LMS finds is 1.02. You'd have to include the Perl part with your bundle and put it in the arch specific folder. This way it takes precedence over the one included with LMS.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#133 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGLG8SAsxx3FQG9DHItxovrdhY6gIIeLks5umKX-gaJpZM4L3IBr>.
|
Would it be possible to also provide an opusdec binary until squeezelite gets Opus support? |
The sox binaries included with the latest LMS 7.9.2 already have support for decoding opus streams. There are no plans to add opus support to squeezelite. Not sure why you're referencing squeezelite on googlecode. Current development for squeezelite is on github https://github.com/ralph-irving/squeezelite |
|
With all due respect: get a Pi3b and you're all set. We've gone a long way already to implement this rather exotic request. Let's not over-optimize either. |
Hi folks, sorry to post this to the developer forum, but I'm not getting any resonance on the user forum: https://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files/page4 My main questions / challenges: I tend to agree with ghost tbh, opus is one of the best (ie quality for bandwidth) and most future proof lossless audio codecs around and it is the new internet standard. I'd love to see LMS include fully functional support for it. pls lmk how I can support troubleshooting. Glad to help. |
From the Audio::Scan perl module version 1.08 or newer has improved ogg/opus scanning support, but not all platforms include the latest release, which is actually 1.10. See https://github.com/LMS-Community/Audio-Scan |
Yeah, I've deleted my comment shortly after posting it. The issue was with sox not being installed. |
Any plans? My .opus files are not recognized when scanning.
The text was updated successfully, but these errors were encountered: