Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 2484 - Win/Linux: Opus import fails
Win/Linux: Opus import fails
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Application Core
2.4.2
Per OS All
: P1 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-16 06:02 UTC by Peter Sampson
Modified: 2020-06-17 07:01 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1) launch 2.4.2 2) Import an opus audio file 3) Observe: error message >MP3 Decoding failed >CRC check failed
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2020-06-17 00:00:00
petersampsonaudacity: Regression+
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Lin+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2020-06-16 06:02:55 UTC
Windows and Mac have  a different scenario

1) Windows:
This is clearly a regression on 2.4.1 where the same OPUS file can be successfully imported.

On 2.4.2 you can still export an opus file but you can't re-import it.
It yields the error message
>MP3 Decoding failed
>CRC check failed

-----------------------------------------

2) Mac:
On latest 2.4.2 I get the same error message as on W10

On 2.4.1 - 2.3.0 I get a different error message
>Error Importing
>Audacity did not recognize the type of file ...
>Try installing FFmpeg. For uncompressed files, also try File>Import>Raw Data

Of course I do have 64-bit FFmpeg installed (and I know it works from other exports)

It *may* be a regression on Mac too as this Forum poster
https://forum.audacityteam.org/viewtopic.php?f=47&t=111585
reports that it used to work for them on 2.3.0 but fails to work on 2.4.1

---------------------------------------------------

I can't vouch for Linux - but for now assume all platforms
Comment 1 Peter Sampson 2020-06-16 06:07:08 UTC
(In reply to Peter Sampson from comment #0)
Sorry in the Mac section it should say

On 2.4.1 - 2.3.1 I get a different error message
>Error Importing
>Audacity did not recognize the type of file ...
>Try installing FFmpeg. For uncompressed files, also try File>Import>Raw Data
Comment 2 Steve Daulton 2020-06-16 06:34:56 UTC
On Linux with Audacity 2.4.2 I get the error:

"MP3 Decoding Failed:
lost synchronization"

In 2.4.1 I can import the opus file.


Also, if I select the "ffmpeg-compatible files" filter in the import file browser, opus files are not visible. This is the same in 2.4.1.

Rather surprisingly, opus files are not visible in 2.4.1 or 2.4.2 when "All supported files" is selected.
Comment 3 Peter Sampson 2020-06-16 08:08:33 UTC
See also Big #2381 Mac: Export to OPUS (OggOpus) is not available on Mac

which may have some bearing on the Mac aspect of this bug
Comment 4 Peter Sampson 2020-06-16 08:09:45 UTC
See also Bug #1945
Windows: ASSERT (in debug builds only) importing opus format
Comment 5 Leland Lucius 2020-06-16 10:31:48 UTC
The "fix" is in:

https://github.com/audacity/audacity/commit/3276234

But, here's the deal.  The cause was the changes I made to the libmad importer. It was scanning the first n-bytes of the file to try and identify whether the file is an MP3 or not. This seems to be fairly common practice as some MP3s "may" contain "stuff" that the importer doesn't understand like APE tags.  However, there must be something in an OPUS file that looks like an MP3 frame.

I could enhance this scanning to require say 5 or 10 consecutive frames after the first frame is identified.

But for now the "fix" just disables this scanning and if the file does not immediately start with an MP3 frame, then the libmad importer will "deny" the file and the next importer will be tried, eventually being imported by FFmpeg.  This means that MP3 files with oddball stuff at the beginning may not import if the FFmpeg libraries are not installed.
Comment 6 Peter Sampson 2020-06-16 11:44:21 UTC
Testing on W10 with Audacity 2.4.2 3276234

This now works fine on Windows

So this properly deals with the regression on Windows

---------------------------------

On Mac I now get the older error message:
>Error Importing
>Audacity did not recognize the type of file ...
>Try installing FFmpeg. For uncompressed files, also try File>Import>Raw Data

Do we need to raise a separate bug for failed OPUS import on Mac ?

Is this related to 
Bug #2381 Mac: Export to OPUS (OggOpus) is not available on Mac  ?

I can't test to see if OPUS import works on 2.3.0 or earlier on Mac
Comment 7 Leland Lucius 2020-06-16 12:20:29 UTC
(In reply to Peter Sampson from comment #6)
> Is this related to 
> Bug #2381 Mac: Export to OPUS (OggOpus) is not available on Mac  ?
> 
I think you are correct...no import or export Opus support on Mac.
Comment 8 Peter Sampson 2020-06-17 06:47:48 UTC
Steve wrote by email
>Opus import is now working for me on Linux (thanks Leland).
>
>I still see the strange issue that if any filter other than "All files" is
>selected in the Import file browser, .opus files are invisible.
>Does this need logging as a separate bug?

The residual is logged as all platforms Bug #2485

The Mac part of this bug is different to the Windows and Linux regression so I will be moving that to consolidate it with Bug #2381

As this in now just a Linux and Windows regression bug that is now fixed and tested OK on both platforms I shall close it off