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

Audacity Bugzilla



Bug 2443 - Mac/Linux: Old (PowerPC) projects open flat-lined or with corrupted display on Intel machines
Mac/Linux: Old (PowerPC) projects open flat-lined or with corrupted display o...
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: User Interface
2.4.0
Per OS macOS and Linux
: P2 Repeatable
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-23 17:40 UTC by James Crook
Modified: 2020-05-24 12:51 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1) Open an Old Power PC project 2) Play 3) Observe: A: Project opens flatlined or showing lots of clipping. B: plays audio just fine.
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2020-05-24 00:00:00
james.k.crook: Must‑Test‑All‑OS+
james.k.crook: Regression+
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+
leland: Test‑OK‑Lin+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Crook 2020-05-23 17:40:13 UTC
Is an endian problem.  The .au files that show the problem are big endian.  If you amplify a section by 0dB, those .au files are converted to little endian and show fine.
Only happens if inlining functions, -finlinefunction, so does not happen in debug builds.
Not seen on Windows.

Seen by Bill originally, and also reported on forum.

https://forum.audacityteam.org/viewtopic.php?f=47&t=111123&p=395690#p395688
Comment 1 James Crook 2020-05-23 18:25:39 UTC
I can reproduce the symptoms by making the '==' comparison that compares two floats fail in these lines in BlockfFile.cpp

      ComputeMinMax256(summary256, &min, &max, &bad);
      if (min == summary64K[0] && max == summary64K[1] && bad == 0) {

Since inlining can change the values of floats (see this stack overflow question) perhaps this is a clue.

https://stackoverflow.com/questions/55590324/inline-version-of-a-function-returns-different-value-than-non-inline-version

Plan to test this by using __attribute__((noinline)) for the function I think is causing this.
Comment 2 Leland Lucius 2020-05-23 19:50:47 UTC
(In reply to James Crook from comment #1)
> I can reproduce the symptoms by making the '==' comparison that compares two
> floats fail in these lines in BlockfFile.cpp
> 
>       ComputeMinMax256(summary256, &min, &max, &bad);
>       if (min == summary64K[0] && max == summary64K[1] && bad == 0) {
> 
> Since inlining can change the values of floats (see this stack overflow
> question) perhaps this is a clue.
> 
> https://stackoverflow.com/questions/55590324/inline-version-of-a-function-
> returns-different-value-than-non-inline-version
> 
> Plan to test this by using __attribute__((noinline)) for the function I
> think is causing this.

WOW!  I never knew that "==" didn't work in some cases.  That in absolutely unreal.  If your tests prove it out, then I think dropping back to -O2 optimization or using -fno-inline-functions is warranted.
Comment 4 Peter Sampson 2020-05-24 09:33:24 UTC
Tested on macOS 10.15.4 and W10 with Audacity 2.4.2 00084a8

Tested using the "Old" project that Bill supplied by email/Dropbox that failed for me previously on Mac


1) Mac
All looks good here now - with the latest Audacity 2.4.2 00084a8 alpha the waveform is shown correctly and plays properly

With the former alpha for Mac I had and for 2.4.1 the waveform showed as a flatline (but played correctly)


2) Windows, W10
All remains good here - with the latest Audacity 2.4.2 00084a8 alpha the waveform is shown correctly and plays properly - but that was also the case with the previous Win alpha that I had and 2.4.1



I would like to see Bill test this on the two projects that he has that previously fell foul of this flat-lining.

Plus, of course, it needs a Linux test.
Comment 5 Bill Wharrie 2020-05-24 12:06:50 UTC
(In reply to Peter Sampson from comment #4)
Audacity_00084a8 works fine for me on Mohave and Catalina.
Comment 6 Leland Lucius 2020-05-24 12:46:22 UTC
Looks good on Linux as well. Great digging James. I don't believe I'd have ever found it and would have taken the easy way out.  :-)
Comment 7 Peter Sampson 2020-05-24 12:51:40 UTC
(In reply to Leland Lucius from comment #6)
>Great digging James.

Yes great forensic and insightful analysis James.