After compiling on a LFS audacity failed

Hello,

audacity does not run on ‘linux from scratch’

audacity-src-1.3.13
glibc-2.7
alsa-1.0.19
linux-2.6.30

I try to start audacity on a shell in X11. For a very short time I see the audacity window.
But the program breaks with the following message.

ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:935:(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

In VLC or MPlayer ‘Alsa’ runs without problems. Where is the mistake?

Unfortunately that does not tell us much. I get those messages on Ubuntu 10.10, but then Audacity launches and works correctly.
I’d suggest that you have a go at building from the current svn head (1.3.14) and see if that sorts out the problem.
http://audacityteam.org/community/developers#svn

If the problem persists, then you may need to build a debug version to see where the problem lies.

there is a copy and paste bug in ./src/Menus.cpp" line 598
wrong code was:
c->AddItem(wxT(“ResetToolbars”), _(“&Reset Toolbars”), FN(OnResetToolBars), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
working is:
c->AddCheck(wxT(“ResetToolbars”), _(“&Reset Toolbars”), FN(OnResetToolBars), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);

Cheers

garyr001

Unfortunately, c->AddItem is correct (it is NOT a “checkable” menu item). This is very strange that changing it to a checkable item fixes your issue. This is the same code from 1.3.10 (about a year ago):

   c->AddCheck(wxT("ShowTranscriptionTB"), _("Transcri&ption Toolbar"), FN(OnShowTranscriptionToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
   c->AddSeparator();
   c->AddItem(wxT("ResetToolbars"), _("&Reset Toolbars"), FN(OnResetToolBars), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
   c->EndSubMenu();

when I go back to AddItem call, I get a segmentation fault on startup:
backtrace:
Core was generated by `audacity’.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f179fad1ef0 in wcslen () from /lib64/libc.so.6
(gdb) bt
#0 0x00007f179fad1ef0 in wcslen () from /lib64/libc.so.6
#1 0x00007f17a029ea6c in std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::operator+=(wchar_t const*) ()
from /usr/lib64/libstdc++.so.6
#2 0x00000000005c22cb in wxString::operator+=(wchar_t const*) ()
#3 0x00000000006f3c5b in CommandManager::AddItem(wchar_t const*, wchar_t const*, CommandFunctor*, wchar_t const*, unsigned int, unsigned int, int) ()
#4 0x000000000062d8bd in AudacityProject::CreateMenusAndCommands() ()
#5 0x0000000000657c33 in AudacityProject::AudacityProject(wxWindow*, int, wxPoint const&, wxSize const&) ()
#6 0x000000000065623e in CreateNewAudacityProject() ()
#7 0x00000000005c60d6 in AudacityApp::OnInit() ()
#8 0x00000000005c9207 in wxAppConsole::CallOnInit() ()
#9 0x00007f17a4ec6c64 in wxEntry(int&, wchar_t**) () from /usr/lib64/wx-2.8-stl/libwx_baseu-2.8.so.0
#10 0x00000000005c4f24 in main ()
If the function call is okay, then it has to do something with the parameters:
I changed
c->AddItem(wxT(“ResetToolbars”), _(“&Reset Toolbars”), FN(OnResetToolBars),0 , AlwaysEnabledFlag, AlwaysEnabledFlag);
to
c->AddItem(wxT(“ResetToolbars”), _(“&Reset Toolbars”), FN(OnResetToolBars), wxT(“Ctrl+Shift+T”), AlwaysEnabledFlag, AlwaysEnabledFlag);
and now startup is okay.
I also had some problems with compiling (wx stuff - reverse functionality uses a class member which does not exist, MACRO definitions are missing on the ffmpeg stuff and on other sources). I made some Q&D chnages and now it seems to work fine for me …

Cheers

Gerhard