MSSE Flag on ARM?

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
adaptiman
Posts: 30
Joined: Fri Mar 16, 2018 8:28 pm
Operating System: Linux Debian

MSSE Flag on ARM?

Post by adaptiman » Sat Mar 17, 2018 2:00 pm

I'm trying to build Audacity 2.2.2 on Raspbian Stretch. I have the latest code tree from github. My compiler is gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516. I have wxWidgets installed. When configuring Audacity, I'm using the following command:

Code: Select all

../configure --with-lame --with-libid3tag --with-libsoxr=local --with-libvorbis --with-lv2 --with-portaudio --with-midi --with-portmidi --with-widgetextra=local --with-portmixer
during the configuration process, I get an error:

Code: Select all

...
checking for lrintf... yes
gnu XXX
checking whether C++ compiler accepts -msse... no
configure: error: Need a version of gcc with -msse
configure: error: ../../../lib-src/sbsms/configure failed for lib-src/sbsms
The -msse flag is specifc to x86 platforms. I found the following reference on the gnu.org site:
‘sse’
Use scalar floating-point instructions present in the SSE instruction set. This instruction set is supported by Pentium III and newer chips, and in the AMD line by Athlon-4, Athlon XP and Athlon MP chips. The earlier version of the SSE instruction set supports only single-precision arithmetic, thus the double and extended-precision arithmetic are still done using 387. A later version, present only in Pentium 4 and AMD x86-64 chips, supports double-precision arithmetic too.

For the x86-32 compiler, you must use -march=cpu-type, -msse or -msse2 switches to enable SSE extensions and make this option effective. For the x86-64 compiler, these extensions are enabled by default.
Why would failing to use an x86 flag cause my ARM-based compile to fail? I think this may be a bug.

adaptiman
Posts: 30
Joined: Fri Mar 16, 2018 8:28 pm
Operating System: Linux Debian

Re: MSSE Flag on ARM?

Post by adaptiman » Sat Mar 17, 2018 5:18 pm

UPDATE: While this options is not documented under configure --help for the application, there is a flag --disable-sse that will get the config and build through. I don't know if this is the right thing to do, but it works. It would be helpful to make a note of this option on the compile page under the heading "Compiling on Unix" that can be found at http://wiki.audacityteam.org/wiki/Developing_On_Linux.

Can someone out there with deep knowledge of Audacity confirm that disabling sse on ARM (Raspberry Pi Stretch) is the correct thing to do?

steve
Site Admin
Posts: 47301
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu
Contact:

Re: MSSE Flag on ARM?

Post by steve » Sat Mar 17, 2018 7:20 pm

Audacity does not claim to be supported by Raspbian / Raspberry Pi, though there are some reports on https://www.raspberrypi.org/forums to indicate that it is possible to build Audacity on that platform. Also, this page says that Audacity binaries are available: http://www.rpilab.net/resources/audacity/

I would not expect good performance of Audacity on a Pi, due to the relatively low performance of the hardware.

The documentation does state that SSE is required on Windows, but does not explicitly say so for Linux as SSE is normally supported on Linux systems.

Unless you have a specific reason why you need to build Audacity from source, I'd suggest you try installing Audacity with apt as described on rpilab.net
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

adaptiman
Posts: 30
Joined: Fri Mar 16, 2018 8:28 pm
Operating System: Linux Debian

Re: MSSE Flag on ARM?

Post by adaptiman » Sat Mar 17, 2018 10:25 pm

steve wrote: Unless you have a specific reason why you need to build Audacity from source, I'd suggest you try installing Audacity with apt as described on rpilab.net
I have two reasons for compiling it on Rasbian - 1) The current raspbian package is 2.1.2-2 which is two years old, and 2) what I REALLY want to do is to use mod-script-pipe so I can control Audacity functions from the command line. This plugin is not provided in the standard package. After trying for two days to compile, I've given up on this. So if I use the current apt build, I would need a compiled object file for mod-script-pipe. I've cloned the current audacity tree and reverted to the 2.1.2 tag in an attempt to compile only the object file, to no avail.

If I could find a 2.1.2 version of mod-script-pipe, I'd be done.

steve
Site Admin
Posts: 47301
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu
Contact:

Re: MSSE Flag on ARM?

Post by steve » Sun Mar 18, 2018 2:07 pm

mod-script-pipe has been getting a lot of attention in this release, with many more commands supported, so definitely a good idea to go with the latest development code if possible. SSE is used for performance optimisations and I'd guess that compiling with SSE disabled "should" work (losing the benefits of the optimisation), but as we have now dropped official support for Windows XP, we only build and test with SSE enabled. So yes, it "should" work as far as I'm aware, but it is largely untested.

When you get it working (being optimistic ;)), take a look at pipeclient.py (https://github.com/audacity/audacity/bl ... eclient.py). It should work with Python 2.7 or later (Python 3 recommended) and can be imported as a module to make writing and reading to the pipe easier. Note also that the temp directory where the pipe is created is hard coded to "/tmp" (rather than using TMPDIR environmental variable).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

adaptiman
Posts: 30
Joined: Fri Mar 16, 2018 8:28 pm
Operating System: Linux Debian

Re: MSSE Flag on ARM?

Post by adaptiman » Sun Mar 18, 2018 2:32 pm

BIG THANK YOU!!!! to Steve for engaging me in this "quest." Since the apt package of Audacity for RPi is two years old, and there's no reference to the -msse flag before mine this week, I assume that no one is working on compiling Audacity for RPi except maybe me. So I will borrow Steve's optimism and carry on.

Let me give you a little bit of background on WHY I want to do this. FACT ONE: I've been a podcaster for more than 10 years. My show has been on a hiatus for the past three years because my kids reached college age and I got distracted. But my wife and I want to get back into our show (http://catholicfamilypodcast.com). FACT TWO: RPi3 has become a pretty powerful platform with a Broadcom BCM2837 SoC with a 64-bit processor — a 1.2GHz quad-core ARM Cortex-A53 CPU that claims roughly 10 times the speed of the processor in the original model. RPi is small, efficient and can run on 12 volts DC if necessary, making it portable. I've used the apt version of Audacity on the RPi and the performance is pretty good. FACT THREE: Someone finally made a high quality RPI audio card with both inputs and outputs (https://blokas.io/). This creates an opportunity for creating a killer platform for podcasting on RPi. Using the standard RPi touchscreen, I want to create the ultimate podcasting platform that can be run by touch commands to record and publish a podcast. But to make it REALLY hum, I need the automation of mod-script-pipe, and to do that, I have to compile from source.

So all of this being said, I will continue down this path hoping that this community may see some value in this project which I'm happy to share with all. I'll keep this thread here until I get past the compile phase, then move it over to the Podcasting forum. Once again, thanks for the support.

adaptiman
Posts: 30
Joined: Fri Mar 16, 2018 8:28 pm
Operating System: Linux Debian

Re: MSSE Flag on ARM?

Post by adaptiman » Sun Mar 18, 2018 6:21 pm

I was able to successfully compile. YEA!! But upon launching the app, I get the following error:

Code: Select all

An assertion failed!
../src/gtk/window.cpp(3142): assert "source" failed in DoClientToScreen(): ClientToScreen failed on unrealized window.
I've appended the backtrace of the error. On the console, I get the following error:

Code: Select all

(audacity:7464): Gtk-WARNING **: gtk_window_set_titlebar() called on a realized window
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Any ideas?
Attachments
audacity-runtime-error-backtrace.txt
(1 KiB) Downloaded 16 times

steve
Site Admin
Posts: 47301
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu
Contact:

Re: MSSE Flag on ARM?

Post by steve » Sun Mar 18, 2018 9:14 pm

Which version of wxWidgets are you using, and did you build with gtk2 or gtk3?
Audacity needs to be built with wxWidgets 3.0.x with gtk2 (preferably wxWidgets 3.0.2, built with gtk2).
If wxWidgets 3.0.2 is not available in the raspbian repository, you can get it here: https://github.com/wxWidgets/wxWidgets/ ... .2.tar.bz2
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

adaptiman
Posts: 30
Joined: Fri Mar 16, 2018 8:28 pm
Operating System: Linux Debian

Re: MSSE Flag on ARM?

Post by adaptiman » Mon Mar 19, 2018 1:41 am

steve wrote:Which version of wxWidgets are you using, and did you build with gtk2 or gtk3? Audacity needs to be built with wxWidgets 3.0.x with gtk2 (preferably wxWidgets 3.0.2, built with gtk2).
Built with wxWidgets 3.0.4 with gtk2.

PROGRESS!! I backed off both the git repos for wxWidgets and Audacity to the last released versions of both programs (3.0.4 for wxWidgets and 3.1.2 for Audacity) and was able to compile and run successfully! At this point, I have a running version of Audacity 3.1.2 on Raspbian.

HOWEVER, there's a problem. When I move into the mod-script-pipe directory and attempt to compile mod-script-pipe, I get an error:

Code: Select all

ScripterCallback.cpp:16:19: fatal error: wx/wx.h: No such file or directory
 #include <wx.wx.h>
compilation terminated.
Obviously, the build doesn't know where the wx library headers are (which are in /usr/local/include/wx-3.0/wx). How can I configure the plugin to know where the wx files are?
Last edited by adaptiman on Mon Mar 19, 2018 2:29 am, edited 1 time in total.

steve
Site Admin
Posts: 47301
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu
Contact:

Re: MSSE Flag on ARM?

Post by steve » Mon Mar 19, 2018 2:02 am

adaptiman wrote:and 3.1.2 for Audacity
There isn't a 3.1.2 version of Audacity.

The current source code for mod-script-pipe is here, though I don't know if it will work with older versions of Audacity: https://github.com/audacity/audacity/tr ... cript-pipe
Because mod-script-pipe is not yet shipped with Audacity, it has quite regularly been broken and stayed that way until someone notices and fixes it. Trying to find an old version that works could be tricky. If you can get Audacity 2.3.0 alpha to build (the current development code), then the current version of mod-script-pipe should work, though not that mod-script-pipe must be built on the same day that you run ./configure for Audacity.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply