Problem with Software Playthrough and Pulse

Greetings,
I am running Slackware Linux 14.2 (K4.4.88), Audacity 2.1.2, and Pulseaudio 9.0 with an Asus Zonar D2 audio card.
This combination was working with Slackware 14.1 without Pulseaudio. However, now I can’t get the audio monitor (Software Passthrough) to work. With Software Passthrough off, It will record and I can play it back without any problems, but I cannot monitor the recording while it is being played. I am not using the “Monitor” recording option in the Pulse mixer, but it does not seem to make any difference with or without the Monitor option selected. When I start a recording or “Click to start monitoring” with Software Passthrough on, I get a fraction of a second of sound from my speakers, then Audacity stops with both level “meters” frozen at the last sample reading. If I select record with Software Passthrough on, Audacity stops recording in a fraction of a second. With Software Playthrough unchecked (off), the recording or monitoring does not freeze. I suspect it has something to do with Audacity and Pulse, but I am not sure. Is this a known problem and is there anything I can do to fix it?

Thanks.
Girvin

What is it that you are trying to record, and how?

Greetings,
Thanks for your prompt reply.
I am trying to record from old media, such as records and tapes, via the Line Input of my Asus Zonar D2 audio card.

This has worked in the past, but is now broken in some way. This morning, it was working for a few seconds, then it suddenly stopped again and has not worked since, even if I close Audacity and reopen it… After my posting yesterday, I did some more web searching and discovered a similar thread which suggested adding the Pulse module-loopback module with pactl: “pactl load-module module-loopback”. I tried it, but now I get an echo on the fraction of a second of audio with “Software Playthrough” on. So, the module actually made my problem worse, not better. With Playthrough turned off, then there is no output to my speakers, but Audacity will record continuously. In fact, there is no Audacity output channel displayed on Pulse’s volume control app. So, it seems that Audacity is not opening an output channel without Playthrough turned on, but with Playthrough turned on, Audacity plays a fraction of a second of audio to the output and then stops recording or monitoring, with the level meters showing the last sample.

Now, with the “Monitor” version of Pulse’s D2 “Recording” device, I get nothing. That may be an artifact of the loopback module, because yesterday, without the module, the Monitor and non-Monitor devices produced the same results.

I think the main issue here is that Audacity stops after a fraction of a second of audio recording with Software Passthrough turned on, I don’t think that is the way it is supposed to work, but I have no clue why it is doing this.

BTW: I compiled my Audacity from source.
I see there is a new 2.2.0 version available. As a rule, I do not normally install any software that ends in 0, but in this case I will make an exception to see if this problem has been fixed.

I have seen in other postings that the “Help > Audio Device Info” output file has been uploaded, so I am going to try to do that with my deviceinfo.txt file in case that helps.

Thanks.
Girvin
deviceinfo.txt (1.85 KB)

Update.
I compiled and tried Audacity 2.2.0 but got the same results as 2.1.2. The problem with Software Passthrough is still there.
Girvin

I don’t think this is directly related to your issue, but for information…

Naming conventions vary. In Audacity, the three part version number is:
Series (Currently “2”) . Major . Minor
Series 2 is pretty much a complete rewrite from series 1 (Series 1 has been obsolete for a long time now).
The “Major” release number increments for major updates and milestones.
The “Minor” release number increments for all other releases. There is no special significance to specific numbers.
Any other versions (nightly builds, alpha / beta versions, release candidates) are clearly named to indicate what they are, and are not classed as “releases”.

“Audacity 2.2.1 RC1” is now available, and is a release candidate for the Audacity 2.2.1 release. A release candidate is a pre-release build that provides an opportunity for users to report problems before the new version is released. If no serious problems are reported, then the release candidate is renamed, and released with no other changes. If any significant problems are reported, then there is the opportunity for the developers to fix the problem and make a new release candidate.

Audacity 2.2.1 RC1 has several important bug fixes, (especially for the “Chains” feature), so I’d recommend updating as soon as convenient. If there is no RC2, then you can continue to use RC1 because it will be identical to the 2.2.1 release (or update to 2.2.1 if you prefer).

Thanks. I was about to ask for that :slight_smile:

It appears that the only real (hardware) audio device available to Audacity is:
Device name: HDA ATI HDMI: 0 (hw:1,3)

There is no sign of your Asus Zonar D2.
What output do you get from the command:

aplay -l

Steve,
Thanks for the Audacity versioning tutorial. Yes, the Audacity versioning system is a bit different than most. I am accustomed to the system: Major.Minor.Bug-fixes or: Major.Minor.Security-fixes.Bug-fixes. So, a “0” digit in the last (right-most) digit is a red flag that there are bugs in the version and I stay clear of them if at all possible. As I already posted in my last update that I did download version 2.2.0, compiled and installed it, but it did not fix my problem.

Yes, I was concerned about the D2 not being listed in the deviceinfo file, especially in the device selection list. My Audacity device selection list only has “pulse” and “default” listed and also the HDMI device in the playback list. Also, there is no listing in the deviceinfo for the recording or playback sections. It seems Audacity isn’t attached to the D2. The HDMA device comes from my graphics card, which I do not use (the HDMI port, I do use the graphics). In my system, ALSA had been setting this device as default at boot, so I added an “/etc/modprobe.d/alsa-base.conf” file which changes the default sound card 0 to the D2 and the HDMI “card” to card 1. There is also a noisy motherboard sound chip, but I have that disabled in the BIOS so ALSA does not even find it. I am enclosing the output of “aplay -l” as well as copies of my “/etc/asound.conf” and “/etc/modprobe.d/alsa-base.conf”.

Since my last posting, I also discovered a freedesktop.org document called PulseAudio - The Perfect Setup, which has some instructions for PulseAudio setup.
PerfectSetup
This document is dated Feb 9, 2016, so it is fairly recent. The document has sections for applications and includes Audacity. The section says that Audacity works with Pulse, but they mention a PulseAudio patch to make it work. Here is another excerpt:

Audacity doesn’t support PulseAudio, nor Esound for the moment. You’ll have to kill or suspend pulseaudio before you use this application. Audacity uses the PortAudio cross-platform Audio API which doesnt support pulseaudio. Some work was started on making portaudio support PulseAudio but this does not appear to be under active development currently and does not work in it’s current state.

This seems to conflict with what I am reading on the Audacity website, which endorses PulseAudio. And:

Using pasuspender to momentarily suspend pulseaudio is another way to use Audacity.


pasuspender -- audacity <argument>

Which may be a possibility.

HTH.
Girvin
alsa-base.conf.txt (772 Bytes)
asound.conf.txt (105 Bytes)
aplay-l.txt (352 Bytes)

That information is mostly correct but also rather dated. Most of it was copied from the old website in 2013 and has only had a handful of minor updates since.

That is incorrect and I suspect was written much earlier than 2013. Portaudio (hence Audacity) has fully supported PulseAudio for many years. If you have a fully working PulseAudio system, then Audacity can use it.

That’s an old workaround that dates back to the early days of PulseAudio on Ubuntu. Ubuntu was an early adopter of PulseAudio (some would say “too early”), and it took them a while to get it working properly. “pasuspender – audacity” was a workaround for broken PulseAudio set-ups. It ‘may’ work for you, but be aware that it is just working around a broken sound system.


If you look in the “Input Devices” and “Output Devices” tabs of PulseAudio Volume Control (pavucontrol), is your Xonar listed?

Steve,

If you look in the “Input Devices” and “Output Devices” tabs of PulseAudio Volume Control (pavucontrol), is your Xonar listed?

Yes, it is:

CMI8788 [Oxygen HD Audio] (Virtuoso 200 (Xonar D2)) Analog Stereo

In the “Configuration” tab, I have set it to “Analog Stereo Duplex”, which seems the best option of many for my configuration and use.

Ah-Ha!!
I just ran Audacity 2.2.0 from an xterm to see if there were any Audacity error messages spit out and I got a lot. I am attaching the text of the output. The last 3 messages starting with “Expression…” were generated when the monitoring failed in less than a second of playing.
So, it looks like there is some sort of compile problem. Keep in mind that there were no fatal build errors when I compiled Audacity. There were many warnings, mostly about unused variables, but nothing fatal. In case it may help, here is my configure argument list:
–enable-unicode --enable-nyquist --with-expat=system
–with-libvorbis=system --with-libmad=system --with-libflac=system
–with-libsndfile=system --with-libid3tag=system --with-libsoxr
–with-portaudio
–with-ladspa --with-ffmpeg=system --with-soundtouch=system
–with-libtwolame=system --with-libvamp=system
–without-libresample --without-libsamplerate --without-lv2

Thanks.
Girvin
console-errors.txt (4.34 KB)

Wow, that’s a lot. I just use:

../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading --enable-debug

or

../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading

depending on whether I’m installing for production use, or building for development / testing.
If I don’t use the local (included in the Audacity source) version of PortAudio, I get a build error. This is because the developers had to modify the PortAudio library so that PortMidi would work correctly. I can’t see whether you are building with a local or system version of PortAudio, but for Audacity 2.2.0 it needs to be the local version.


From the console messages, this part looks suspicious:

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.AV200.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.AV200.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.AV200.pcm.modem.0:CARD=0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline:CARD=0,DEV=0
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.AV200.pcm.modem.0:CARD=0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline:CARD=0,DEV=0
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.AV200.pcm.modem.0:CARD=0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM phoneline
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.AV200.pcm.modem.0:CARD=0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM phoneline
ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to open slave

I think those references to “AV200” are your Asus Xonar not working, but other than that I don’t know what they mean.

When you run other audio applications, do they show up in PulseAudio volume control, and is PulseAudio connecting them to your Xonar sound card?

Steve,

I think those references to “AV200” are your Asus Xonar not working, but other than that I don’t know what they mean.

Yes, the AV200 is the sound chip used in the Xonar D2. These messages puzzled me too. They look like compiler errors, but it is in runtime, not compile time. It may be some sort of debug feature. These seem to be coming from the ALSA lib, but I do not know what they mean, other than it doesn’t look right.

I can’t see whether you are building with a local or system version of PortAudio, but for Audacity 2.2.0 it needs to be the local version.

It does look like the compile is with the local portaudio. Here is the end of the configure:

Finished configure:
EXPAT: using SYSTEM libraries
FFMPEG: using SYSTEM libraries
LAME: using SYSTEM libraries
LIBFLAC: using SYSTEM libraries
LIBID3TAG: using SYSTEM libraries
LIBMAD: using SYSTEM libraries
LIBNYQUIST: using LOCAL libraries
LIBSBSMS: using LOCAL libraries
LIBSNDFILE: using SYSTEM libraries
LIBSOUNDTOUCH: using SYSTEM libraries
LIBSOXR: using LOCAL libraries
LIBTWOLAME: using SYSTEM libraries
LIBVAMP: using SYSTEM libraries
LIBVORBIS: using SYSTEM libraries
LV2: disabled
PORTAUDIO: using LOCAL libraries
PORTSMF: using LOCAL libraries
PORTMIDI: using LOCAL libraries
WIDGETEXTRA: using LOCAL libraries
ladspa plugin support: enabled
audiounit plugin support: disabled
VST plugin support: enabled
prefix=/usr

Run 'configure --help' for an explanation of these options,
otherwise run 'make' to build Audacity.



When you run other audio applications, do they show up in PulseAudio volume control, and is PulseAudio connecting them to your Xonar sound card?

Yes, they do. I use xine a lot and it connects fine. I have also seen some Firefox connections in Pulse, so it is using Pulse to play sound and I have heard it.
Thanks.
Girvin

In that case, it “should” be very straightforward; Just select “Pulse” for recording and playback devices, and let PulseAudio handle the Xonar.
You’re going to tell me that doesn’t work.

Steve,

In that case, it “should” be very straightforward; Just select “Pulse” for recording and playback devices, and let PulseAudio handle the Xonar.
You’re going to tell me that doesn’t work.

Yes, it sortof works. Here is the problem:
If I have “Software Passthrough” turned off, recording seems to be working fine, but I cannot hear what is being recorded (or monitored) and Pulse does not show any Audacity playback connection for the output channel (speakers).
If I turn “Software Passthrough” on, then I record and hear less than a second of sound and Audacity stops with the level meters stuck at the last sample. If I stop and restart the recording process, I get another fraction of a second of recording and it stops again. When it stops, I can see there is an Audacity connection made in Pulse, but it is not producing any sound. I do not know why Audacity is stopping. The only clue I have is those last 3 lines of the console output when I started the recording process and Audacity spit them out when it stopped. They reference “/src/hostapi/alsa/pa_linux_alsa.c”.

If Audacity was stable and recording with Software Passthrough turned on so I could hear what is being recorded, then I don’t think I would have a problem with Audacity. I just want to hear what is being recorded, while it is being recorded or in the monitor mode (“Click to start Monitoring”).
Girvin

Greetings and Happy New Year!
Sorry I haven’t posted on this thread for a while, but I have been working on seasonal task commitments and finally got time to work this problem again last week.

Well, I have had some success since my last posting, but the solution to my problem is not what I intended. I was hoping to get Audacity working with PulseAudio, but nothing I tried worked, so I decided to get rid of PulseAudio and installed xfce-mixer instead of the Pulse volume control/mixer app. Audacity is now working as well as it did under Slack 14.1.

When I decided to get rid of Pulse, I realized Pulse has the only volume control/mixer app on Slack 14.2, so I needed another mixer. Since Audacity last worked on Slack 14.1’s xfce-mixer, I decided to pull the xfce-mixer source code off the Slack 14.1 disk and build it on Slack 14.2. That worked and the familiar mixer ran fine on the Slack 14.2 xfce. xfce-mixer has two controls that the Pulse mixer does not have - “Analog Input Monitor” and “Digital Input Monitor”. I have not determined what the latter is used for, but the former, I use with Audacity in place of the Software Pass-Through function in order to listen to what I am recording. Testing it with Audacity worked fine.

So, in summary, I found that:

  1. Audacity’s Software Pass-Through function will not work with the PulseAudio mixer/volume control. It randomly stops playing and/or recording with Software Pass-Through turned on (enabled). Note that Software Pass-Through still has noise problems with the xfce-mixer, but it does not suddenly stop. So the problem is not all with Pulse. Audacity has some responsibility for it not working.
  2. Audacity will work with xfce-mixer if the Software Pass-Through function is turned off (disabled) and the xfce-mixer Analog Input Monitor is used to listen to the recorded signal as it is being recorded. Note that if Software Pass-Through is turned on and the Analog Input Monitor control is muted, there is output, but there are periodic noise spikes on the signal, including what is being recorded. So Audacity’s Software Pass-Through mode is still not acceptable. However, it does not suddenly stop when in this mode.

I thank all who responded to this thread.
Girvin Herr, OP

Pavucontrol has that, but it is shown dynamically when there is an active recording stream to monitor (it appears as an option in the “Recording” tab).

Possibly for monitoring S/PDIF input?

Just to clarify for the benefit of other readers, this is to say that you have not been able to get Audacity’s “Software Playthrough” to work satisfactorily on your computer. It works fine on all the computers that I have access to.

Thanks for the update, and I’m pleased to hear that you have a usable solution.