Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Senior Member
    Join Date
    May 2010
    Location
    London, UK
    Posts
    976
    Quote Originally Posted by bpa View Post
    Just loaded into LMS and on scanning and I get "console" errors (i.e. from a library routine probably Audi::Scan from somewhere not in LMS) from 2 of the 3 files.

    The problem files do not have any codec details. I have Audio::Scan 1.02 - I need to see if I can get Audio::Scan 1.05 (which is on Windows)

    Code:
    Not an Opus file (bad opus header): /mnt/hddrive/home/albums/Test/Heatwave Moving Through a Ghost Town.01.Louigi Verona.198. Heatwave Moving Through a Ghost Town.opus
    Not an Opus file (bad opus header): /mnt/hddrive/home/albums/Test/Until All The Ghosts Are Gone HD 24-96.01.ANEKDOTEN.Shooting Star.opus
    .
    This is a known problem in Audio::Scan. I believe that the OP is aware.
    https://github.com/andygrundman/Audio-Scan/issues/7

  2. #12
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by mrw View Post
    This is a known problem in Audio::Scan. I believe that the OP is aware.
    https://github.com/andygrundman/Audio-Scan/issues/7
    Is OP really aware of what it means ? The files were made available for testing.
    This error means the files are not playable with opus native players.
    Also there is no determined duration so hard to test truncation.

  3. #13
    Senior Member
    Join Date
    May 2010
    Location
    London, UK
    Posts
    976
    Quote Originally Posted by bpa View Post
    Is OP really aware of what it means ? The files were made available for testing.
    This error means the files are not playable with opus native players.
    Also there is no determined duration so hard to test truncation.
    Good point, my bad.

    The file that does scan (One (No Art-RG).01.Scooter.One (No Art-RG)) seems to play out to the end here, with no apparent issue. That's with flac transcoding. I have no natively capable player.

    My 'opusinfo' reports: Original sample rate: 44100Hz.
    I believe that "standard" opus generates only a limited number of sample rates up to 48000Hz. 44100Hz is not included.
    I also suspect that Audio::Scan may only handle the 48000Hz variant, but I'm not sure.

  4. #14
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by mrw View Post
    The file that does scan (One (No Art-RG).01.Scooter.One (No Art-RG)) seems to play out to the end here, with no apparent issue. That's with flac transcoding. I have no natively capable player.
    I compared against native and VLC - and it seemed but hard to tell that maybe 5-10secs were cut off.

    My 'opusinfo' reports: Original sample rate: 44100Hz.
    I believe that "standard" opus generates only a limited number of sample rates up to 48000Hz. 44100Hz is not included.
    I also suspect that Audio::Scan may only handle the 48000Hz variant, but I'm not sure.
    It's odd. I had hoped it may show up difference between good/bad files - instead it just confused. So I'll ignore those tools.

  5. #15
    Junior Member
    Join Date
    Jan 2021
    Posts
    22
    Hi folks, thanks for the flurry of responses. 👍

    I'll try to answer all of them here.

    1. Interesting to hear the two of the files I originally shared seem abnormal. In that case, please ignore them. I created those a while ago with an old version of Foobar that probably just didn't support Opus properly yet. My apologies.
    Here is a share with three newer, shorter opus files, created with Foobar 2000 1.6.11 and opusenc 1.3 (both current). Please use those going forward.

    2. All files exhibit faster playback when transcoding to PCM and at least one (Poplar) ends prematurely when transcoded to FLAC. Although playback speed is fine then.

    3. Opusenc will always resample 44,1kHz to 48kHz. 44,1kHz is not supported by default: https://wiki.xiph.org/OpusFAQ#How_do...ted_by_Opus.3F
    https://wiki.xiph.org/OpusFAQ#But_wo...Hz_directly.3F
    LMS correctly identifies my opus files as 48kHz, so do other players I tried.
    So tools reporting 48kHz are correct, as well as the original source to be 44.1kHz.

    Anything else I can do to help?

  6. #16
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by damazta View Post
    1. Interesting to hear the two of the files I originally shared seem abnormal. In that case, please ignore them. I created those a while ago with an old version of Foobar that probably just didn't support Opus properly yet. My apologies.
    Here is a share with three newer, shorter opus files, created with Foobar 2000 1.6.11 and opusenc 1.3 (both current). Please use those going forward.
    Of the older files, which were created by old Foobar to try to correlate issues with encoders.

    2. All files exhibit faster playback when transcoding to PCM and at least one (Poplar) ends prematurely when transcoded to FLAC. Although playback speed is fine then.
    Either edit the "ops pcm" rule in convert.conf or create a custom-convert.conf (may be better so that change is not lost) with updates as detailed by mrw.

    What do you mean by premature - 5 secs, 15 secs, 5 mins ??? These are long files and testing requires playing them.

    3. Opusenc will always resample 44,1kHz to 48kHz. 44,1kHz is not supported by default: https://wiki.xiph.org/OpusFAQ#How_do...ted_by_Opus.3F
    https://wiki.xiph.org/OpusFAQ#But_wo...Hz_directly.3F
    LMS correctly identifies my opus files as 48kHz, so do other players I tried.
    So tools reporting 48kHz are correct, as well as the original source to be 44.1kHz.
    OK - as before ignoring the opusinfo tools as they do not add info.
    Last edited by bpa; 2022-07-07 at 05:36.

  7. #17
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,776
    Quote Originally Posted by damazta View Post
    Here is a share with three newer, shorter opus files, created with Foobar 2000 1.6.11 and opusenc 1.3 (both current). Please use those going forward.
    Nothing shared.

  8. #18
    Senior Member
    Join Date
    May 2010
    Location
    London, UK
    Posts
    976

    Defect - Audio::Scan's handling of Opus

    I built Audio::Scan with some debugging turned on, to see what might be seen with one of the problem opus files.

    After considerable scrutiny of the source code, and two relevant RFCs[1], I now understand what is going on and how the failure to scan arises.

    I also have an idea on how it might be corrected. But that will require some careful thinking, and a clearer head than I currently have.

    In a nutshell, the problem is this:

    Ogg encapsulation provides for a stream to split into a number of pages, each page having a length of up to about 65,000 bytes. A page may be "self contained", or it may be followed by further "continuation" pages, which will contribute data into an overall Opus packet.

    An Opus metadata packet might be contained within a single Ogg page, or it may run over into several pages. The latter would almost certainly be the case if there is an image in the metadata.

    Audio::Scan's extraction and parsing process fails to handle this latter case properly - it doesn't wait for the entire metadata packet to be assembled before attempting to extract metadata. Furthermore, it "fails to realize" that it has done with scanning metadata, and carries on scanning the stream, looking for Opus "header" packets that would not normally be expected. If it finds an 'O' (the first letter of the possible headers 'OpusTags' and 'OpusHead'), then it expects to see a header. If, as is likely, it is looking inside binary image data at the time, then it fails with the message "Not an Opus file (bad opus header)".

    The original poster of the issue raised at Audio::Scan's github page, https://github.com/andygrundman/Audio-Scan/issues/7, identified "large" embedded artwork as the probable cause. And that tallies with my findings above.

    Matters are complicated by the possibility of the existence of multiple logical Opus/Ogg streams within the overall encapsulation. That will require some thought.

    I expect to be able to generate a "proof of concept" patch against Audio::Scan that would fix the issue. But it may take a little time.

    [1] RFC 3533 - "The Ogg Encapsulation Format Version 0" and RFC 7845 - "Ogg Encapsulation for the Opus Audio Codec".

  9. #19
    Senior Member
    Join Date
    May 2010
    Location
    London, UK
    Posts
    976
    Quote Originally Posted by damazta View Post
    Anything else I can do to help?
    Remove all artwork from the test files. "Large" metadata triggers a bug in Audio::Scan, which at worst (I earlier said "best"...) prevents the file being scanned. It is also quite likely that the bug interferes with Audio:Scan's ability to make its assessment of stream duration.
    Last edited by mrw; 2022-07-07 at 05:31.

  10. #20
    Senior Member
    Join Date
    May 2010
    Location
    London, UK
    Posts
    976
    Quote Originally Posted by mrw View Post
    I expect to be able to generate a "proof of concept" patch against Audio::Scan that would fix the issue. But it may take a little time.
    Well, it took less time than I thought. Which said, there is plenty of review required before finalization.

    I have attached the patch for those that might be able to use it.

    The patched Audio::Scan successfully scans all three samples that @damazta posted on his OneDrive recently:

    Heatwave moving through a Ghost Town...
    Until All the Ghosts are Gone
    One (No Art RG).01Scooter

    The first two, containing artwork, fail to scan without the patch.

Posting Permissions

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