Cannot compile audacity 2.0.2 (Ubuntu Hardy 8.04.4) [SOLVED]

Hello Everyone,

I am trying to compile Audacity 2.0.2 from source (using Ubuntu Hardy 8.04.4 LTS for some reasons). While I could workaround the “SND_PCM_TSTAMP_ENABLE” issue (according to https://forum.audacityteam.org/t/error-compiling-audacity-1-3-9-on-ubuntu-8-04/11263/1 ), make is (much later) failing with this message:

g++ -c -I../lib-src/portmixer/include   -Wall -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../lib-src/FileDialog -I/home/sbialonski/Downloads/audacity-src-2.0.2/lib-src/lib-widget-extra        -I../lib-src/libresample/include -I../lib-src/sbsms/include -I../lib-src/libnyquist -I../lib-src/libvamp    -I../lib-src/ffmpeg -I../lib-src/portsmf -I../lib-src/portaudio-v19/include  -fno-strict-aliasing -I./include -I. -DLIBDIR="/usr/local//lib" -D__STDC_CONSTANT_MACROS   -Wall   import/ImportPCM.cpp -o import/ImportPCM.o
import/ImportPCM.cpp: In member function »virtual ImportFileHandle* PCMImportPlugin::Open(wxString)«:
import/ImportPCM.cpp:166: Fehler: »SF_FORMAT_OGG« wurde in diesem Gültigkeitsbereich nicht definiert
make[1]: *** [import/ImportPCM.o] Fehler 1

I also tried to compile the source using “./configure --without-libvorbis” as I thought that maybe this library could have caused the problem, but the error message remains the same. Do you have any suggestions or ideas? :slight_smile: I will be glad to give you any other information that you may need.

Update Ubuntu?
Install Audacity 1.3.4 from the Ubuntu repository?

Thank you for your reply. :slight_smile:

Indeed, updating Ubuntu would be a natural suggestion. Unfortunately, I cannot update Ubuntu (because a proprietary software package depends on it). Next, I do - of course - use Audacity 1.3.4. Nonetheless, I would love to work with Audacity 2.X, and I wondered whether it is possible to compile it from source for Ubuntu Hardy. Has anybody experienced similar issues when trying to compile it for Ubuntu Hardy?

That line 166 disallows libsndfile handling OGG files due to a bug in libsndfile.

As a hack just try removing or commenting the entire following block in ImportPCM.cpp:

   } else if (file &&
              (info.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_OGG) {
      // mchinen 15.1.2012 - disallowing libsndfile to handle
      // ogg files because seeking is broken at this date (very slow,
      // seeks from beginning of file each seek).
      // This was said by Erik (libsndfile maintainer).
      // Note that this won't apply to our local libsndfile, so only
      // linux builds that use --with-libsndfile=system are affected,
      // as our local libsndfile doesn't do OGG.
      // In particular ubuntu 10.10 and 11.04 are known to be affected
      // When the bug is fixed, we can check version to avoid only
      // the broken builds.

      return NULL;

Don’t forget to remove the return NULL; at the bottom (scroll the code quote to see it) .


Gale

Thank you, Gale! With your hack, audacity 2.0.2 now successfully compiles under Ubuntu Hardy. :slight_smile:

While testing audaciy, I experienced a strange behaviour: I can select via the “File>Open” as well as via the “File>Import>Audio” dialog box a file, but hitting the “OK”-Button does not have any effect. The software doesn’t freeze, but hitting OK doesn’t work. So I am not able to import any audio file. I don’t see any error messages on the console appearing when I hit OK. I don’t know whether this makes any sense for you, but I appreciate any idea. :slight_smile:

When starting audacity, the console reads:

ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib setup.c:555:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib setup.c:555:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:813:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Expression 'stream->capture.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3857
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3875
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3875
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3875
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3875

PS: Audio capturing and play back do work well. :slight_smile:

I’m a little confused as the screen that I think you are looking on does not have an “OK” button. Could you post a screen shot.

I’m a little confused as the screen that I think you are looking on does not have an “OK” button. Could you post a screen shot.

Sure! :slight_smile: This is the one showing the File>Open dialog box:
audacity_import_audio_screenshot.png
And here is the File>Import>Audio dialog box.
audacity_import_audio_screenshot.png
They both appear to be the same. By the way, the Cancel-Button works fine.

Steve, I think you gave me an important hint. If the OK-Button is not supposed to be present, I can maybe just double-click on a file in the dialog box in order to get it imported/opened. I tried that and it worked! Thank you! :slight_smile: (Double-clicking doesn’t allow for selecting and opening several files at once, but this is just a minor drawback, I think.)

I thank you all for your time and help! And special thanks to the developers for this great piece of software! :slight_smile:

I think that the problem may be due to the version of libgtk-dev that you are using (or not).
Could you check if you have libgtk-dev installed, and if you do, which version it is.
On an up-to-date system it would probably be libgtk2.0-dev (around version 2.20).

You’re right. I did not have installed any libgtk-dev package. Now I installed libgtk2.0-dev (version: 2.12.9-3ubuntu5). Interesting side effect: Audacity does not compile any more (linking seems to make problems). I get the following message:

../lib-src/FileDialog.a(FileDialog.o): In function `FileSelector(wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*, int, wxWindow*, wxString, void (*)(void*, int), void*)':
audacity-src-2.0.2/lib-src/FileDialog/FileDialog.cpp:88: undefined reference to `FileDialog::FileDialog(wxWindow*, wxString const&, wxString const&, wxString const&, wxString const&, long, wxPoint const&, bool)'
collect2: ld gab 1 als Ende-Status zurück

Did you run:

make distclean

before compiling? If not, try that.

make distclean

did the job! Audacity 2.0.2 does now compile on Ubuntu 8.04 and works fine. Thank you very much, Steve! :slight_smile: I also would like to thank all the others involved!

Here’s the screenshot of the “new” File>Open dialog. The OK-Button is now replaced by an “Open”-Button which works well.
audacity_file_open_screenshot.png