Problem accessing the mic with 2.1.1 with Azalia sound card

I have used Audacity for many years successfully, almost always using Linux. I currently use OpenSuSE on my computers, and Audacity is playing up on one of the machines when I attempt to get input from its Mic connection. There is no problem with output; sound is produced without problem. There is also no problem with recording sound that is coming from other running programs like Firefox and web pages which are sound sources. It is only when I connect a cable to the Mic port that Audacity does not detect a signal.

I have two machines running Audacity 2.1.1 and OpenSuSE Leap 42.1. The other machine, the older one, is able to handle Mic input fine, so the problem is specific to the hardware on my newer machine. When I have pavucontrol running, I can see that signal is detected by it. I can also record Mic input using the Audio Recorder program on this machine. It is only Audacity that cannot detect Mic input.

I have done these tests in the hope that they will give you a bit more information about my hardware and setup:
The output from “arecord -l” is

**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: 92HD99BXX Analog [92HD99BXX Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

The output from “cat /etc/modprobe.d/50-sound.conf” is

options snd slots=snd-hda-intel
# 5Dex.mtR84bFRyqF:FCH Azalia Controller
alias snd-card-0 snd-hda-intel

The output from /usr/sbin/alsa-info.sh can be seen at http://www.alsa-project.org/db/?f=9ac811d945434a235c56769be9d07200d2d132a6
The output from “lspci -vnn | grep -A 1 -i audio” is

00:01.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller [1002:9902]
        Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller [1002:9902]
        Flags: bus master, fast devsel, latency 0, IRQ 32
--
00:14.2 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller [1022:780d] (rev 01)
        Subsystem: Toshiba America Info Systems Device [1179:fa91]

The command “arecord -d 4 /tmp/test.wav” causes a good recording of the Mic input.
The problem is not urgent for me because I can use Audio Recorder instead of Audacity, but it would be able to use Audacity uniformly across the machines for audio work if you are able to identify the problem.
I have this software installed on the machine:

> rpm -qa | grep alsa
alsa-oss-1.0.28-5.2.x86_64
alsa-1.0.29-10.1.x86_64
alsa-utils-1.0.29-9.1.x86_64
alsa-firmware-1.0.29-3.2.noarch
alsa-plugins-32bit-1.0.29-10.1.x86_64
alsa-plugins-pulse-1.0.29-10.1.x86_64
alsa-oss-32bit-1.0.28-5.2.x86_64
alsa-plugins-1.0.29-10.1.x86_64
alsa-plugins-pulse-32bit-1.0.29-10.1.x86_64
> rpm -qa | grep pulse
libpulse0-7.0-3.1.x86_64
pulseaudio-7.0-3.1.x86_64
libxine2-pulse-1.2.6-3.2.x86_64
pulseaudio-utils-7.0-3.1.x86_64
libpulse-mainloop-glib0-7.0-3.1.x86_64
pulseaudio-lang-7.0-3.1.noarch
alsa-plugins-pulse-1.0.29-10.1.x86_64
libpulse0-32bit-7.0-3.1.x86_64
pulseaudio-bash-completion-7.0-3.1.x86_64
alsa-plugins-pulse-32bit-1.0.29-10.1.x86_64
> rpm -q libasound2
libasound2-1.0.29-10.1.x86_64

The output of “uname -a” is

Linux t2 4.1.15-8-default #1 SMP PREEMPT Wed Jan 20 16:41:00 UTC 2016 (0e3b3ab) x86_64 x86_64 x86_64 GNU/Linux

That’s a good sign. We should be able to get Audacity recording from the Mic input.

That “should” give use two ways to record from the Mic input with Audacity.
Let’s try the Pulse Audio route first.

  1. Starting from a fresh log-in to your computer and assuming that you don’t have any audio apps starting up automatically on log-in.
  2. Connect your microphone.
  3. Open pavucontrol and check in the “Input Devices” tab that you are getting a signal from the mic. and turn the input level up so that you are getting a good strong signal (you may need to turn this down later, but set it high for this test).
  4. Close pavucontrol (this “should” not make a difference, but I’ve seen occasions when it does, so close pavucontrol, but leave PulseAudio running).
  5. Launch Audacity
  6. Ensure that “ALSA” is the only available “host” option in the device toolbar.
  7. Ensure that “Pulse” is selected in the device toolbar as the recording device.
  8. Open pavucontrol. Check that you are still getting a signal on the “Input Devices” tab, then switch to the “Recording” tab. The Recording tab should be empty (“No applications currently recording audio”)
  9. Arrange the Audacity window and the pavucontrol window so that you can see both side by side.
  10. Click on the Recording Meter in Audacity (“Click to start monitoring”). You should immediately see Audacity appear in the “Recording” tab of pavucontrol, and the meters in both applications should be responding to input from the mic.

What happened?

Steve wrote:


7) Ensure that “Pulse” is selected in the device toolbar as the recording device.

“Pulse” is not a listed option. The choice is between “default” and “HD-Audio Generic: 92HD99BXX Analog (hw:1,0)”


10) Click on the Recording Meter in Audacity (“Click to start monitoring”). You should immediately see Audacity appear in the “Recording” tab of pavucontrol, and the meters in both applications should be responding to input from the mic.

With “default” selected, the recording meter is dead when it is clicked. With “HD-Audio…” selected, I now see a signal from the source. Recording works perfectly.

I thought that I tried that before but I may not have. Thanks for the help. I really appreciate it.

Is PulseAudio still running?
Where did you get Audacity from and how did you install it?
How are you launching Audacity?

Steve wrote:

Is PulseAudio still running?

Well, when I run pavucontrol it detects the hardware and state of the machine accurately. The only other way I can tell is with the command “ps -eaf | grep pulse” which reports

gfreeman  1842     1  0 Mar24 ?        00:00:06 /usr/bin/pulseaudio --start --log-target=syslog



Where did you get Audacity from and how did you install it?

I downloaded it from the packman.links2linux.de (packman-multimedia) repository with the command

zypper in audacity

The RPM is audacity-2.1.1-94.6.x86_64. I am using OpenSuSE Leap 42.1

How are you launching Audacity?

The Multimedia menu has Audacity listed.

Try this to see what happens:

  1. Open pavucontrol,
    (a) Check in the “Input Devices” tab that there is a meter responding to input from the microphone.
    (b) Go to the “Recoding” tab, and set the bottom “show” control to “All streams”. The tab should be empty (no active streams). Leave this open.

  2. Open a Terminal window and type:

audacity

then press Enter.
You should see a load of messages as Audacity scans the sound system, probably including a load of “warning” messages (that’s normal as Audacity scans for things that may not exist on your system). Then Audacity should launch. Watch pavucontrol as much as possible while this goes on.

  1. Assuming that Audacity launches and pavucontrol remains open:
    (a) Did you notice anything happen in the Recording tab while Audacity was launching (probably not, but if you did then it’s probably relevant).
    (b) Switch to the “Input Devices” tab. Do you still see a meter responding to input from the microphone?

  2. Switch back to Audacity and from the “Help” menu select “Audio Device Info”. Wait for the info to be populated, then copy the entire contents and paste that into your reply.

Steve wrote


1(b) Go to the “Recoding” tab, and set the bottom “show” control to “All streams”. The tab should be empty (no active streams).

When I click on All Streams, it comes up with two options: Applications, and Virtual streams. There is a message in the middle of the window saying “No application is currently recording audio”.


type audacity

I get

> audacity
ALSA lib pcm_dsnoop.c:615:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1039:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1039:(snd_pcm_dmix_open) unable to open slave
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
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4607




3(a) Did you notice anything happen in the Recording tab while Audacity was launching

No, there was no change.


3(b) Switch to the “Input Devices” tab. Do you still see a meter responding to input from the microphone?

Yes. pavucontrol still detects the signal.


4) Switch back to Audacity and from the “Help” menu select “Audio Device Info”. Wait for the info to be populated, then copy the entire contents and paste that into your reply.

The only message there is

Stream is active ... unable to gather information.

Note that I have done these tests with Audacity input set to “default”, the state it starts in.

That could be that you’ve put Audacity into record mode, or you’ve activated the recording meter.

Click the “Stop” button to ensure that Audacity is in “stop mode”. (Audacity Manual)

Click the Cancel button to close the “Audio device info” window.

Does the recording meter in Audacity show the text “Click to Start Monitoring”?

If it doesn’t then the meter is active. Clicking on the recording meter toggles it on / off, so click on it so that it does show the text (as in the image above), then run “Audio Device Info” again.

Steve wrote

…That could be that you’ve put Audacity into record mode, or you’ve activated the recording meter.

OK. I understand. This is what I get when it is not in recording mode:

==============================
Default recording device number: 0
Default playback device number: 0
==============================
Device ID: 0
Device name: default
Host name: ALSA
Recording channels: 32
Playback channels: 32
Low Recording Latency: 0.008707
Low Playback Latency: 0.008707
High Recording Latency: 0.034830
High Playback Latency: 0.034830
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Selected recording device: 0 - default
Selected playback device: 0 - default
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Available mixers:
==============================
Available recording sources:
==============================
Available playback volumes:
==============================
Recording volume is emulated
Playback volume is emulated

I don’t understand why Audacity is not seeing PulseAudio. That should happen automatically if PulseAudio is running, and you tell me that PulseAudio is running.

Let’s try from a different angle:

Check that again and write down precise step by step instructions for how you make that work.

I first checked with “ps -eaf | grep pulse” that pulseaudio was running

gfreeman  1842     1  0 Mar24 ?        00:02:28 /usr/bin/pulseaudio --start --log-target=syslog

I then ran pavucontrol and connected the sound source to the Mic port, confirming that pavucontrol could see the signal.
With pavucontrol on Recording, I issued the command “arecord -d 4 /tmp/test.wav”. Pavucontrol window changed from

No application is currently recording audio

to

ALSA plugin [aplay]: ALSA Capture from [Built-in Audio Analog Stereo]

and below the arecord command was the message

Recording WAVE '/tmp/test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

That could be the problem.
I’m not certain, but I think that Audacity expects / requires the audio sample format to be at least 16 bit.

This article gives a general idea of how to change the default format for PulseAudio: http://www.overclock.net/a/how-to-get-the-best-sound-with-and-properly-configure-pulseaudio

I’d suggest that you try setting the default format to signed 16-bit, and a sample rate of 44100 Hz.

This is what I have:

default-sample-format = s16le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2
default-channel-map = front-left,front-right

You will need to at least restart Pulse - I’d suggest logging out and back in again, or rebooting to ensure that the changes take effect.

(Leave Audacity preferences at the default “32-bit float” 44100 Hz.)

BE SURE TO MAKE THE BACKUP.

If the above does not work, there is a much more in-depth article on the subject here: PulseAudio - ArchWiki

Steve wrote

…This article gives a general idea of how to change the default format for PulseAudio: > http://www.overclock.net/a/how-to-get-t > … pulseaudio

I’d suggest that you try setting the default format to signed 16-bit, and a sample rate of 44100 Hz.

I don’t think that is the problem. “arecord” has 8000 Hz and unsigned 8 bit as the defaults. I can change them with

arecord -d 4 -r 192 -f cd /tmp/test.wav

I did look at /etc/pulse/daemon.conf as you suggested. It indicated that

 default-sample-format = s16le
 default-sample-rate = 44100
 alternate-sample-rate = 48000
 default-sample-channels = 2
 default-channel-map = front-left,front-right

were the defaults. I uncommented those lines and re-logged in, but it has made no difference.
Now, I am seeing “default” as the only selectable input.

I’m running out of ideas.
Look in “Help > About Audacity > Build Information”. Which version of PortAudio and wxWidgets has Audacity been built with?

Perhaps tgf should build current Audacity from source code http://www.audacityteam.org/download/source/. We recently updated PortAudio which has a lot of fixes for Linux.

Gale

Steve wrote:

Which version of PortAudio and wxWidgets has Audacity been built with?

Build information → Core libraries indicates:

PortAudio   (Audio playback and recording)   v19
wxWidgets 2.8.12

Gale Andrews wrote:

Perhaps tgf should build current Audacity from source code > Redirecting to: https://www.audacityteam.org/download> . We recently updated PortAudio which has a lot of fixes for Linux.

I have downloaded the source code, and installed all the “-dev” packages that I thought would help. I have run “./configure” and then “make” but compilation is failing because of data type issues:

mv -f .deps/audacity-BlockFile.Tpo .deps/audacity-BlockFile.Po
g++ -DHAVE_CONFIG_H -I.  -Wno-deprecated-declarations -D__STDC_CONSTANT_MACROS -DLIBDIR=\"/usr/local//lib64\"   -I../lib-src/portaudio-v19/include   -I../lib-src/libsoxr/src -I../lib-src/lib-widget-extra -I/usr/lib64/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXGTK__ -pthread   -I../lib-src/ffmpeg   -I../lib-src/lame    -I../lib-src/libnyquist    -I../lib-src/lv2/include -I../lib-src/lv2/include -I../lib-src/portsmf  -I../lib-src/sbsms/include -I../lib-src/libvamp  -I/usr/lib64/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXGTK__ -pthread -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -Wno-unused-local-typedefs -I../lib-src/portmixer/include  -DwxDEBUG_LEVEL=0  -Wall -I../include -I../lib-src/FileDialog                 -MT audacity-DirManager.o -MD -MP -MF .deps/audacity-DirManager.Tpo -c -o audacity-DirManager.o `test -f 'DirManager.cpp' || echo './'`DirManager.cpp
In file included from /usr/include/wx-3.0/wx/intl.h:17:0,
                 from /usr/include/wx-3.0/wx/filename.h:17,
                 from DirManager.h:16,
                 from DirManager.cpp:65:
blockfile/../ondemand/ODDecodeTask.h: In member function ‘virtual const wxChar* ODDecodeTask::GetTip()’:
/usr/include/wx-3.0/wx/translation.h:38:58: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in return
     #define _(s)                     wxGetTranslation((s))
                                                          ^
blockfile/../ondemand/ODDecodeTask.h:57:42: note: in expansion of macro ‘_’
    virtual const wxChar* GetTip(){return _("Decoding Waveform");}
                                          ^
DirManager.cpp: In static member function ‘static void DirManager::CleanTempDir()’:
DirManager.cpp:397:88: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ for argument ‘5’ to ‘void RecursivelyRemove(wxArrayString&, int, bool, bool, const wxChar*)’
    RecursivelyRemove(filePathArray, count, true, true, _("Cleaning up temporary files"));
                                                                                        ^
DirManager.cpp: In member function ‘bool DirManager::SetProject(wxString&, wxString&, bool)’:
DirManager.cpp:523:91: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ for argument ‘5’ to ‘void RecursivelyRemove(wxArrayString&, int, bool, bool, const wxChar*)’
          RecursivelyRemove(dirlist, count, false, true, _("Cleaning up cache directories"));
                                                                                           ^
DirManager.cpp: In member function ‘wxFileName DirManager::MakeBlockFilePath(wxString)’:
DirManager.cpp:592:9: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
       if(!dir.DirExists() && !dir.Mkdir(0777,wxPATH_MKDIR_FULL))
         ^
DirManager.cpp: In member function ‘int DirManager::ProjectFSCK(bool, bool)’:
DirManager.cpp:1395:17: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
             NULL};
                 ^
DirManager.cpp:1395:17: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1412:40: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ for argument ‘7’ to ‘int RecursivelyEnumerateWithProgress(wxString, wxArrayString&, wxString, bool, bool, int, const wxChar*)’
       _("Inspecting project file data"));
                                        ^
DirManager.cpp:1449:20: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
                NULL};
                    ^
DirManager.cpp:1449:20: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1449:20: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1511:41: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
                                     NULL};
                                         ^
DirManager.cpp:1511:41: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1511:41: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1570:20: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
                NULL};
                    ^
DirManager.cpp:1570:20: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1570:20: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1629:17: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
             NULL};
                 ^
DirManager.cpp:1629:17: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp:1629:17: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ in initialization
DirManager.cpp: In member function ‘void DirManager::RemoveOrphanBlockfiles()’:
DirManager.cpp:1817:40: error: cannot convert ‘const wxString’ to ‘const wxChar* {aka const wchar_t*}’ for argument ‘7’ to ‘int RecursivelyEnumerateWithProgress(wxString, wxArrayString&, wxString, bool, bool, int, const wxChar*)’
       _("Inspecting project file data"));
                                        ^
Makefile:2407: recipe for target 'audacity-DirManager.o' failed
make[2]: *** [audacity-DirManager.o] Error 1
make[2]: Leaving directory '/tmp/audacity-minsrc-2.1.2/src'
Makefile:1346: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/tmp/audacity-minsrc-2.1.2/src'
Makefile:716: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Are you using system wxWidgets? Audacity will fail to compile with the issues you see in that case, because system wxWidgets on OpenSUSE uses STL.

If you self-build wxWidgets with no configure arguments I would assume Audacity will build against it.


Gale

I think this may be fixed in jengelh’s fork:
https://github.com/jengelh/audacity

Unfortunately the pull request from jengelh has merge conflicts with the current audacity/audacity code, but if you can confirm that jengelh’s fix works, then that may help to get the fix committed.

ThomasFeher has already confirmed that commit fixes building on OpenSUSE https://github.com/audacity/audacity/pull/112 but Paul did not want to commit it even if he resolved the conflicts.

If no-one reviews and commits we’ll have to track it on Audacity Bugzilla.


Gale