System sound crashes on Audacity start

Thanks for all the detective work.

I am not surprised the system sound does not get disabled on launch of Audacity but SoundBlaster does. One reaction I cannot avoid is that SoundBlasters are problematic cards with any audio software, even on Windows. Considering Creative never really intended their cards to run on Linux, this just multiplies the problems. Do I take it you are using some open source drivers for the Audigy that ALSA or OpenSuse recommend? Or are you using some generic Linux USB audio drivers? I know you would argue this does not excuse Audacity having an apparent issue and Ardour not, but I think it would be valuable to know the drivers situation for Audigy.

As well as the AudioIO.cpp changes for 1.3.13, the version of PortAudio in use changed and has not changed since (but probably will be resynced with latest PortAudio sources for 2.0.3 release). So the PortAudio version is something that you could change without messing with the internals of AudioIO.cpp. The portaudio version in Audacity SVN is 12th October 2010 SVN snapshot r1554, implemented in Audacity revision 10783 ( http://code.google.com/p/audacity/source/detail?r=10783 ).

Note you will need to apply lib-src/portmixer/portaudio.patch to your chosen version of PortAudio (disabling portmixer is not really desirable - at best, you will have to change all sound settings in the system). At worst…

Audacity does not officially support WINE, but as a suggestion for the MP3 export options issue in 1.3.12 under WINE, set these in ~/.audacity-data/audacity.cfg before launch. For example:

MP3Bitrate=192

If you have any links for “Audigy works in Ardour but not Audacity”, feel free to post them, if they have reasonable testing and diagnosis behind them.



Gale

Have you tried any other live CD distribution (for example “Knoppix” or “Mint”)? If the sound system works with those but Audacity still shows the same problem with the Audigy 2 then that will tell us that the problem is not specific to openSUSE.

I just tried Mint 14.1 and installed Audacity 2.0.1 from their package manager - same exact problem. So, it is not distribution specific.

I’ll also work on the suggestions from Gale’s message and replay in a day or so.
Thank you

Do I take it you are using some open source drivers for the Audigy that ALSA or OpenSuse recommend? Or are you using some generic Linux USB audio drivers?

Yes, the Audigy drivers are the ones coming with the distribution, details here: Alsa Opensrc Org - Independent ALSA and linux audio support site
And these are not USB drivers for Audigy, it is a PCI card. When I was talking about removing USB devices I meant the others (cassette deck, TV tuner, web cam) so to reduce the chance of conflicts or incompatibilities; I could see how this may cause confusion, sorry.

Audacity does not officially support WINE, but as a suggestion for the MP3 export options issue in 1.3.12 under WINE, set these in ~/.audacity-data/audacity.cfg before launch.
For example:
MP3Bitrate=192

WINE is not looking at “home” - that is in fact mapped by default as Z drive. Nevertheless, I was trying to find where the export format information is stored under Windows XP so thank you for the instructions. I saw the configuration file already but it had no bitrate information.
So, I went under the virtual machine, looked at the audacity.conf then exported an MP3 file and checked the differences in audacity.conf. After that I edited the configuration file under WINE and copied the lines found in previous step. I did test the export and the MP3 file shows the new bitrate. In case someone needs the details:
The configuration file location under PlayOnLinux:

/home/user1/PlayOnLinux_drive/wineprefix/audacity/drive_c/users/user1/Application Data/Audacity/audacity.cfg

Lines added under:

[FileFormats]
...
MP3RateMode=3
MP3Bitrate=192
MP3VarMode=0
MP3ChannelMode=1
MP3SetRate=2
MP3VbrRate=4
MP3AbrRate=128
MP3CbrRate=192

And that results in a 192kbps CBR Stereo MP3.

If you have any links for “Audigy works in Ardour but not Audacity”, feel free to post them, if they have reasonable testing and diagnosis behind them.

Unfortunately, nothing I found was of any help; I wish it were and I didn’t have to waste your time!

As well as the AudioIO.cpp changes for 1.3.13, the version of PortAudio in use changed and has not changed since (but probably will be resynced with latest PortAudio sources for 2.0.3 release). So the PortAudio version is something that you could change without messing with the internals of AudioIO.cpp. The portaudio version in Audacity SVN is 12th October 2010 SVN snapshot r1554, implemented in Audacity revision 10783 ( > Google Code Archive - Long-term storage for Google Code Project Hosting. > ).
Note you will need to apply lib-src/portmixer/portaudio.patch to your chosen version of PortAudio (disabling portmixer is not really desirable - at best, you will have to change all sound settings in the system). At worst…

I’ll give this a shot but don’t know how soon; I will definitely post if successful.
I’m not too optimistic though; I quickly downgraded portaudio using the openSUSE 11.3 rpm (portaudio-19-265.1.x86_64.rpm which was built from pa_stable_v19_20071207.tar.bz2) and this made no difference.
I’m not convinced this is a bug in PortAudio or Audacity; I’m still thinking the changes implemented in 1.3.13 added features without accounting for some situations. I could think of a (hypothetical) situation where Audacity doesn’t “understand” the response from the sound card and then issues some command that is invalid from the sound card point of view, causing its drivers to crash. I couldn’t find it again but I remember reading a post about some software issues with a sound card reporting real sampling rates, that were different a little bit from standard and the SW was trying to set the wrong rate (i.e. 44089 instead of 44100 and the SW was trying 44000). Or something like forcing a mixer setting that the card can’t do, etc.

In conclusion:

  • I believe I could use 1.3.12 under Wine for now.
  • If something doesn’t work and I really need it, I will have to resort to the virtual machine.
  • I’ll give it a shot with PortAudio SVN when I get the time; I’ll post any good results for this or other idea I might have.

Thank you both for your time and the help!

Thanks for the update. Please keep in touch about what happens if you proceed with another version of PortAudio.

Am I correct the only virtual scenario where Audacity works with Audigy is virtual WIndows XP?

I’d been told PlayOnLinux used Linux-like file paths, so thanks for giving the path you had.

For me in Ubuntu 12:04 (real machine), audacity.cfg is in

~/.PlayOnLinux/wineprefix/audacity/dosdevices/c:/users/<username>/Application Data/Audacity/

or another route to the same file:

~/.PlayOnLinux/wineprefix/audacity/drive_c/users/<username>/Application Data/Audacity/

In WINE on 12.04, the path is more familiar to Windows users:

~/.wine/drive_c/users/<username>/Application Data/Audacity

Thanks for the update. Please keep in touch about what happens if you proceed with another version of PortAudio.

Tried several versions of PortAudio, starting with pa_stable_v19_20071207.tar.gz, and up to the latest SVN, with and without portmixer - no difference.

Am I correct the only virtual scenario where Audacity works with Audigy is virtual WIndows XP?

The only way it worked for me was under XP in VMware. However, I only used the USB cassette player as a source; I’m not sure what happens if I use the standard capture input of the sound card, it might work.

Just FYI, LMMS detects PulseAudio, ALSA and JACK and works fine with any of them.

Regards

OK sorry it did not work out. I made a note but I don’t recall any previous occurrences of this exact issue (loss of system sound).

Unfortunately the developer who implemented these Audio IO changes for 1.3.13 is no longer active in the project, but if he becomes so I will point him to this topic.


Gale

Hi! So will there be some update? I instaled 2.0.3 just yesterday. Before that I had some 5year old version which worked fine and smooth. Only problem was that Audacity wasn’t return system recording/imput settings. For example - I recorded audio form some podcast or video, but after closing Audacity I cant immediately talk on skype. That was annoying but understandable. maybe there must be some dialog before closing to offer user switch back to mic.
Now - audacity is starting as huge application like Aftereffects…it longs forever. Any setting changes happens some 20…30sek. while application is not responding at all, almost hangs machine.
And of course - problem above - except Audacity, all sounds disappear. I wonder how it is possible at all? Why audacity even controls which sound must work on system and which not?
So now I don’t know what to do… I need Audacity. I used to it and need finish my task.

I just wanted to ask whether there is any solution to nkent’s problem, yet. I have exactly the same problems on two different machines with Opensuse 12.2 (64 Bit), an audigy 2 PCI card and audacity. I do not use pulse-audio, but alsa. And I am quite sure that there were no problems for Opensuse 11.4.

I want to add that there are other programs like “Fillmore 0.1.0+trunk” that lead to similar effects like audacity as soon as you try to start a recording. Also in Kwave one can find settings that lead to the effects described by nkent. So after all the problem may not be completely audacity specific.

The problem is specific to certain sound cards, I believe. No-one on Audacity Team has this problem on Linux.

Audacity should not change system sound settings but Skype is a law unto itself.

Audacity 1.3.x and later are relatively slow in processing the waveform in longer tracks. Without some concrete information on your Linux distro (and whether this is a distro package of Audacity) and information on your computer speed and RAM it is hard to comment.

Are you saying you have no system audio after launching Audacity? Or do you lose sound after quitting Audacity?

Do you still have Skype?

What sound card are you using?

I guess you could try Audacity 1.3.12 which did not cause system sound problems for nkent. This may mean compiling Audacity from source code. We cannot tell until you say what Linux distro you are using and where you obtained 2.0.3 from.


Gale

@moenchmeyer, there is no imminent solution, because the problem is not widespread and we are short of Linux developers.

In addition, I see from looking at the Forum that there are many reports of Creative cards working well on Ubuntu with Audacity 1.3.13 or later. As per your comments, it could be that the source of the problem lies with OpenSuse.


Gale

Hi Everyone,

Just some updates.

Changes (since Dec 2012):
The Tape2PC was returned due to terrible SNR, lack of basic functions, and overall poor quality. It was replaced by a regular cassette deck (TEAC W-890R). Thus, there was no USB input so I had to use something else.
Around the same time Audacity 1.3.12 under Wine started exhibiting same problem as higher versions, crashing the system out sound (when Audigy is used). So, I had to look into other ways to making Audacity work.

Things tried
Since Audacity didn’t like Audigy I reconsidered the necessity for Audigy’s front I/O port, bought a couple of adapters and decided to use the PC case front audio ports. So, out comes Audigy and the on-board audio gets enabled (mobo ASUS P5Q3). Installed latest Audacity from Packman repositories (2.0.2) and no more system sound crash, all seemed fine, until tried recording. The “Line in” input presents a significant DC offset; what’s worse is that there is a difference between channels too. And yes, I know that 1st thing that comes to mind is “Normalize” which indeed removes the DC offsets; the problem is the sound activated recording becomes useless. Audacity sees the DC offset as noise, so in my case the noise signal level reported was approx. -36dB on L channel and -42dB on R channel; setting sound activated recording level to -35dB drops some portions of the signal on R, and setting to anything under -36dB records all the time since L has always 'signal". I need “sound activated recording” so I could leave the cassette player do its thing for 3 hrs (auto reverse + continuous play x 2 x 90min) and don’t have be there to stop the recording. I couldn’t find any SW solution, Audacity “suggestions” lists compensating for DC offset prior to recording but was rejected. I booted to Windows 7 and saw the same offset in Audacity for Windows. I concluded the sound controller may have some problem and decided trying another sound card (3rd!).

Got an ASUS Xonar DS; this was OK as price, 7.1 channels and compatible with the Antec PC case audio header. I installed the card, disabled the on-board, and found out this too has DC offsets on the input line, only different values than before. Booted in Windows and was surprised to find there was no offset. Back to Linux and found out the sound driver (oxygen) has a lot of options and settings; one of them is the High Pass Filter. Once this was enabled there is no DC offset on Line in - all good but … when Audacity starts it disables HPF! In other words, you can only enable HPF after Audacity was started; I figured that shouldn’t be a problem creating a small script to launch Audacity and then enable HPF. Moving on, I tried using Audacity and ran into other issues; the device list had about 150 devices. It seems that all those options and settings I mentioned above, are confusing Audacity into thinking they are separate mixer channels; for example there was “attack time” with discrete settings ranging between 1ms and 48ms - each setting was seen by Audacity as a channel. Also, the sound card was detected 3 times, each with a slightly different name. At this point, I decided to return the Xonar card and try something else.

Since Audacity problems with Audigy seem to happen only when Audigy is default system sound out, I reinstalled it and kept the on-board sound enabled. From KDE sound settings I selected default sound out the motherboard sound (speakers connected to it) and default sound in the Audigy (this configuration also allows using Audigy’s I/O port for sound in). This seems to be a working configuration for all applications, (even Skype uses the devices correctly); there is no DC offset on Line in (sound activated level is at -48dB). :slight_smile:

Another working configuration, without Audigy - while tinkering with the above, I went ahead and ordered a Xitel INport Hotwire ($15). Linux recognizes it “out-of-the-box” as USB sound in, no DC offset, no detectable added noise. I was able to record with Audacity using 48KHz sampling rate. :slight_smile:

Conclusion(s)
I believe I found at least a couple of issues with Audacity for Linux:

  1. Audacity doesn’t always “understand” the sound configuration correctly; latest example, the Xonar with 150 devices and I think similar problems happen with Audigy too.
  2. Audacity does alter system sound settings; in my case see the HPF setting on Xonar (or other reports with Skype problems after Audacity). I think this is what happens when it crashes the Audigy drivers, by forcing incorrect settings, after incorrect reading of the system configuration.

A couple of suggestions for DC offset issue - it could help if there are separate audio record level settings for each channel, or some sort of “zero-out” button to use as reference the current level.

Also, sorry to hear there are no developers for Audacity Linux, wish I was better at this because is sad to see a great Linux application becoming Windows-only.

Thank you and Best Regards!

Thanks for your helpful observations, nkent.

We do have a couple of Linux developers :slight_smile: but this is still “short” given the small amount of spare time they have.

I note your suggestions for “Sound Activated Recording”. Another possible solution might be to start a Timer Recording for the length of the tape, as this is known.

Many new Windows Vista/7/8 laptops and netbooks/notebooks come with a built-in DC offset cancellation feature for motherboard sound.

Audacity’s support for multi-channel devices isn’t that good yet, I guess this is the basic problem with Xonar. Did you try using the Xonar with JACK and choosing JACK host in Audacity?

It’s true that Audacity can disable or set to default sound card settings it doesn’t understand, one example on Windows is volume controls on individual channels. But it shouldn’t change crucial settings like sample rates.

But it still seems that the Linux version has a part to play in the problems seen here too.


Gale