want to get mod-script-pipe module working on Raspberry Pi, problems compiling

I have a Raspberry Pi Zero W and I’d like to get Audacity working with mod-script-pipe activated. I know this hardware is incredibly slow for Audacity, but the combination does what I need it to do for now (play multiple wav files as part of a project and selectively mute/unmute individual tracks). For the project I’m building, I’d like the muting/unmuting to be done via a script, and so I’m hoping to use mod-script-pipe to do this. Installing Audacity from a package (Add/Remove software in the GUI, which pointed to an old version, 2.2.2-1+b1 for raspbian buster) seems to result in no modules being available, though the software does run. It looks like I need to build it from the source code to have this module available (if that’s not the case, it’d be good to know a simpler way to do this), but I’m running into some trouble here (my Linux knowledge is a bit limited, but I have some programming experience and can follow directions…)

First, seems like the version of cmake installed was too old, but I was able to build and install a newer version, so I have cmake 3.18.4 installed now. I’ve tried following the directions at https://forum.audacityteam.org/t/building-audacity-2-4-2-on-ubuntu-20-04/57719/1
but keep running into the following error when running make after cmake:

cc: error: unrecognized argument in option ‘-mfpu=neon-vfpv4 -mcpu=cortex-a7’
cc: note: valid arguments to ‘-mfpu=’ are: auto crypto-neon-fp-armv8 fp-armv8 fpv4-sp-d16 fpv5-d16 fpv5-sp-d16 neon neon-fp-armv8 neon-fp16 neon-vfpv3 neon-vfpv4 vfp vfp3 vfpv2 vfpv3 vfpv3-d16 vfpv3-d16-fp16 vfpv3-fp16 vfpv3xd vfpv3xd-fp16 vfpv4 vfpv4-d16
make[2]: *** [cmake-proxies/libsoxr/CMakeFiles/libsoxr.dir/build.make:82: cmake-proxies/libsoxr/CMakeFiles/libsoxr.dir/__/__/lib-src/libsoxr/src/cr.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2048: cmake-proxies/libsoxr/CMakeFiles/libsoxr.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

I’m also not sure how to tell it to build the mod-script-pipe module during or after this process. Any help would be appreciated!

Firstly, Audacity does not officially support Raspberry Pi. It “may” work, but we have not tested on Raspberry Pi.

I think you might find Audacity 2.3.3 easier to build. I posted instructions for Debian here: https://forum.audacityteam.org/t/building-audacity-2-3-3-on-debian-ubuntu/54761/1

Getting somewhere (with SSE disabled), but currently running into the following error:

make[5]: Entering directory '/home/pi/Downloads/audacity/audacity/build/lib-src/libsndfile/src'
autogen --writable test_endswap.def
fserr 2: cannot stat test_endswap.def:  No such file or directory
make[5]: *** [Makefile:1051: test_endswap.c] Aborted

Do you have libsndfile and libsndfile-dev installed?

I have libsndfile1 and libsndfile1-dev

pi@raspberrypi:~/Downloads $ apt list libsndfile1
Listing... Done
libsndfile1/stable,now 1.0.28-6 armhf [installed]
pi@raspberrypi:~/Downloads $ apt list libsndfile1-dev
Listing... Done
libsndfile1-dev/stable,now 1.0.28-6 armhf [installed]

If I try to install the versions without the 1 at the end, for libsndfile-dev it selects libsndfile1-dev instead, and for libsndfile it says unable to locate package libsndfile.

pi@raspberrypi:~/Downloads $ sudo apt install libsndfile-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libsndfile1-dev' instead of 'libsndfile-dev'
libsndfile1-dev is already the newest version (1.0.28-6).
The following packages were automatically installed and are no longer required:
  libflac++6v5 libportsmf0 libsuil-0-0 libvamp-hostsdk3v5
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~/Downloads $ sudo apt install libsndfile
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libsndfile

I think you’re going to need help from someone that has successfully built Audacity on a Raspberry Pi. Is there perhaps a Raspberry Pi forum ?

I was able to get something built following adaptiman’s procedure as outlined in
https://forum.audacityteam.org/t/audacity-1-3-3-presonus-inspire-now-much-love/182/1

I ran sudo apt update and sudo apt upgrade to upgrade a few things on my system, and now Audacity crashes upon startup. It didn’t do that before; I was able to successfully run the build and control it with mod-script-pipe. I’ve tried re-building it following the same instructions as before, but it will still crash upon startup. I renamed the .audacity-data directory, but that didn’t help. I think it has something to do with a change in ALSA in the new Raspbian OS (https://www.raspberrypi.org/blog/new-raspberry-pi-os-release-december-2020/ ), but I’m not sure about the specifics (being somewhat new to all of this). I can still get sound to play using other software (i.e. ecasound, using alsahw,1,0 as the output; this works with an inexpensive USB audio adapter that worked previously with Audacity as well).

The terminal output when I start Audacity is below:

ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.front.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback

running aplay -l yields the following:

**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

When using ALSA directly it is important to ensure that no other apps are using the audio device because ALSA is (almost always) a single client device. PulseAudio is intended to overcome that limitation by providing a multi-client audio interface for apps to use.