When audacity is started, jack crashes [SOLVED]

Greetings.

I have some trouble getting audacity to work with jack. When audacity is started, jack crashes.

I checked the FAQ, searched here on the forums, and looked online, including entering into dialog with falkTX (who is the author of KXStudio) over on linuxmusicians. So far, (several days) I have discovered no resolution to the problem.

Brief description of the problem: When I start audacity, jack crashes. When I try to point audacity at jack, I find that audacity does not see jack as an option. If I start audacity, then start jack, both continue to run, but audacity does not see jack, and then with both jack and audacity running, when I rescan audio devices, jack crashes.

Platform is KXStudio over a fresh install of ubuntustudio 12.04amd64 (3.2.0-23-realtime #36~precise1-Ubuntu SMP), running audacity 2.0.1 compiled from source (but see bolded, below). After installing ubuntustudio12.04amd64, I logged in a couple of times to make sure all was OK but I didn’t change or update anything, then installed KXStudio. My soundcard is a creative soundblaster live CT4620, rather old, but it worked well, I thought.

So far, I have:

…un-installed/removed completely, ‘bluez-alsa’, a bluetooth item which was reported to cause some problems with ‘audacity’ and its recognition of ‘jack’, but that did not make a difference. Onward.

While running ‘audacity’ from a terminal, I got some more clues (too long to detail for this post), and decided that maybe I should see what the latest stable ‘audacity’ release had to offer. Well… I decided to compile the latest version (which is 2.0.1) to replace the initially installed version (which was 2.0.0), and see if that made a difference.

I had some initial resistance to doing this because I had seriously wanted this installation to be relatively free of clutter, and devoted solely to music-making. So much for that plan. Onward.

So, checking dependencies, I installed what was necessary. > Well, there were a few packages, notably, “nyquist:i386”, and “libavcodec53”, which caused synaptic to desire to uninstall, among other things, the entire KXStudio meta. So, I declined to install these “dependencies” (and ask, maybe therein lies further clue to this ‘problem’?) >

I compiled ‘audacity 2.0.1’ with success.

Running it, I experienced the same lack of ‘audacity’ to recognize ‘jack’, the same stopping of ‘jack’ when ‘audacity’ was run, and no real difference (as far as the problem goes) that I could easily detect. :sadness:

I also tried:

FalkTX said:

There’s one simple thing you can try.
quit audacity, start jack, open in a text editor this file:

.config/audacity-data/audacity.cfg

and replace the whole content with this:

[AudioIO]
RecordingDevice=JACK Audio Connection Kit: system
Host=JACK Audio Connection Kit
PlaybackDevice=JACK Audio Connection Kit: system
RecordChannels=2
[GUI]
ShowSplashScreen=0

To do this, I also:

More on trying to get ‘audacity’ to recognize ‘jack’ in MXStudio/ubuntustudio12.04amd64.

There was no “audacity.cfg” file at location: ~/.config/audacity-data/audacity.cfg
In fact, there was no ~/.config/audacity-data/
So, I created the location and the file as specified. It made no difference, ‘audacity’ still fails to see ‘jack’ and still stops ‘jack’.

There was an “audacity.cfg” file at this location: ~/.audacity-data/audacity.cfg
This is a file that keeps being overwritten with each run of ‘audacity’.

I did find another “audacity.cfg” file at location: /usr/share/kxstudio/config/audacity-data/audacity.cfg

It is dated Thu 26 Apr 2012 01:52:37 PM MDT

And contains

[AudioIO]
RecordingDevice=JACK Audio Connection Kit: system
Host=JACK Audio Connection Kit
PlaybackDevice=JACK Audio Connection Kit: system
RecordChannels=2
[GUI]
ShowSplashScreen=0

The contents are as falkTX specified above. The size of that file is 182 bytes. But I noticed that the file I wrote (with ‘gedit’) is 210 bytes. I don’t understand this. Maybe there is extra white space? I copy/pasted that 182 byte file in case there was a difference. It made no difference.

I created another user account, thinking maybe I broke something during the install. It has the same problem with ‘audacity’ failing to recognize ‘jack’

I also edited audacity.conf to contain only the line:

NewPrefsInitialized=1

I also tried tweaking jack settings; starting jack with qjackctl rather than the KXStudio default application, “Cadence”; and the host of grasping-at-straws possibilities I could think of. On a ubuntustudio10.04amd64 installation on this same machine, I had to disable pulseaudio in order to get audio to play for more than a few minutes without crashing the pulseaudio sink/source hookup in jack and losing sound altogether.

Now, I am stumped. So, I thought I’d ask here.

Thanks.

That would suggest to me that there is a problem with Jack. Audacity should not be able to make Jack crash.
Does Jack work with other applications (for example Ardour)?

Have you tried the repository version of Audacity? Does that work?

It shouldn’t be necessary to disable PulseAudio to run Jack, so that is another indication that all is not quite right with the sound system.

Does Audacity work if you just use ALSA without Jack running?

steve wrote:

That would suggest to me that there is a problem with Jack. Audacity should not be able to make Jack crash.
Does Jack work with other applications (for example Ardour)?

Jack appears to work flawlessly with everything else I have tried so far. Ardour, rosegarden, guitarix, zynaddsubfx, and firefox (youtube, etc), for instance.


steve wrote:

Have you tried the repository version of Audacity? Does that work?

I have tried it–had the same problem. I started with the repo offering, Audacity 2.0.0. Running that version is when I first noticed that Audacity crashed Jack. I tried many things to get it to work, but failed. That is why I decided to compile 2.0.1. I thought it might work better with Jack.

Please note: On this computer, I freshly installed ubuntustudio12.04, made no changes (logged out and in a few times to see that it was ‘there’ – I tried almost no installed programs), installed KXStudio, then began to configure and use the system. I did not try Audacity with Jack in the space between installing ubuntustudio and installing KXStudio.

steve wrote:

It shouldn’t be necessary to disable PulseAudio to run Jack, so that is another indication that all is not quite right with the sound system.

Does Audacity work if you just use ALSA without Jack running?

I have not found it necessary to disable PulseAudio to run Jack. Jack runs fine with PulseAudio and with all other applications I have tried so far in this installation, except Audacity.

I did, however, have a (vaguely) similar problem on this same hardware under ubuntustudio10.04amd64 (I could not get audio to play for more than (longest) a few dozen (20-40) minutes without having to restart Jack and re-bridge PulseAudio), which I ‘solved’ by getting rid of PulseAudio. I do not see that problem with this installation of ubuntustudio12.04and64. This problem only reminds me of that earlier problem.

Yes, Audacity works with ALSA, without Jack running. I edited a few files as I am used to doing. It works fine with ALSA. The symptom(s) I am seeing are that (1) Audacity is not aware of Jack; and, (2) that Jack crashes when Audacity is started. If I stop Jack, then start Audacity, then start Jack, then run rescan audio hardware, Jack starts to xrun continuously, then crashes. After that the system becomes unstable and I have to log out and back in.

Recall that my soundcard is a creative soundblaster live CT4620, rather old. It is native sampling rate is 48000. I know how to work with this. I also disabled the onboard sound in bios due to auto-reassignment of hardware name/designation on boot-up. I’ll fix that later. I don’t think these peculiarities are at issue, though I could be wrong.

I have only a few remaining issues with this installation, otherwise I am ready to work with it. These are, in order of importance to me, (1) getting Audacity to work with Jack; (2) managing to get rid of some unfortunately persistent dark-theme window settings that make it so I can’t see information in windows; and, (3) enabling nvidia graphics hardware acceleration via the proprietary driver. At this point, I think the only one that might cause me to abandon this installation is failing to get Audacity to work with Jack.

Thank you for your help, steve.

I keep seeing hints in your description of something odd/wrong. For example: “(2) managing to get rid of some unfortunately persistent dark-theme window settings that make it so I can’t see information in windows;” This was a problem in Audacity back with 1.3.something, but should not be a problem now as it was fixed well before Audacity 2.0 came out. Are you saying that you are having this problem with Audacity, or do you just mean with some other applications?

Similarly the problem with Jack not being seen was a problem in an old 1.3.x version, but again that has been fixed for quite a while. It sounds like you are using an old Audacity version :confused:

Two screenshots:
aud02.png
aud01.png

[/b]steve said:[/b]
I keep seeing hints in your description of something odd/wrong. For example: “(2) managing to get rid of some unfortunately persistent dark-theme window settings that make it so I can’t see information in windows;”

That is encouraging. I’d like to figure out what is odd/wrong, and fix it. Hopefully, I’ll be able to provide enough hints to afford your help in figuring it out. :slight_smile:

Please forgive me for adding any confusion. I am not saying that I have this dark theme problem with Audacity. I am saying that I have it with some other applications. That comment, “(2) managing to get rid of some unfortunately persistent dark-theme window settings that make it so I can’t see information in windows;” does not apply to Audacity specifically. It was in reference to the attempt to remove the default KXStudio window manager desktop theme, which is too dark for me to use. For example, greyed-out items are invisible to me.

I installed that theme in my main user account. An added user account does not have the theme – Audacity does has the same problem (i.e., not seeing Jack) in that account. I removed the theme from my main account to a large extent, but there are some windows that are still dark. And some programs, when installed in my main user account, are too dark for me. This is issue #2 of the three issues I am having with this new KXStudio/Ubuntustudio12.04amd64 that are troubling to me.

My problem with Audacity is issue #1.

Thanks.

Resolved!

I’ve had success with getting Audacity to be aware of Jack in my installation of KXStudio over ubuntustudio12.04amd64.

I finally narrowed down the problem. The problem appears to lie with the soundcard hardware, though it has worked in the past with ubuntustudio10.04amd64. (I’ve used the soundcard extensively–though I did find that I had to disable PulseAudio to get any meaningful audio uptime.)

Here’s how I did it: I ran the ubuntustudio12.04amd64 live DVD, “try ubuntustudio without changing anything”, and started Jack with QjackCtl. Next, I started Audacity. Jack immediately crashed.

This told me that the problem was with either the ubuntustudio12.04 or my hardware, exonerating KXStudio.


Next, I booted back into the HDD-installed OS, and monitored messages from QjackCtl while starting Audacity. This led me to suspect that Jack was failing to talk to the soundcard. Excerpt below:

Messages from QjackCtl (running KXStudio/ubuntustudio12.04amd64 from HDD):

10:04:40.606 Patchbay deactivated.
10:04:40.621 Statistics reset.
10:04:40.629 ALSA connection change.
10:04:40.636 D-BUS: Service is available (org.jackaudio.service aka jackdbus).
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
10:05:03.969 D-BUS: JACK server is starting...
Sun Jul 22 10:05:03 2012: Starting jack server...
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
10:05:03.974 D-BUS: JACK server was started (org.jackaudio.service aka jackdbus).
Sun Jul 22 10:05:03 2012: JACK server starting in realtime mode with priority 10
Sun Jul 22 10:05:03 2012: control device hw:0
Sun Jul 22 10:05:03 2012: control device hw:0
Sun Jul 22 10:05:03 2012: Acquired audio card Audio0
Sun Jul 22 10:05:03 2012: creating alsa driver ... hw:0|hw:0|1024|2|44100|0|0|nomon|swmeter|-|32bit
Sun Jul 22 10:05:03 2012: control device hw:0
Sun Jul 22 10:05:03 2012: configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 2 periods
Sun Jul 22 10:05:03 2012: ALSA: final selected sample format for capture: 16bit little-endian
Sun Jul 22 10:05:03 2012: ALSA: use 2 periods for capture
Sun Jul 22 10:05:03 2012: ALSA: final selected sample format for playback: 16bit little-endian
Sun Jul 22 10:05:03 2012: ALSA: use 2 periods for playback
Sun Jul 22 10:05:03 2012: graph reorder: new port 'system:capture_1'
Sun Jul 22 10:05:03 2012: New client 'system' with PID 0
Sun Jul 22 10:05:03 2012: graph reorder: new port 'system:capture_2'
Sun Jul 22 10:05:03 2012: graph reorder: new port 'system:playback_1'
Sun Jul 22 10:05:03 2012: graph reorder: new port 'system:playback_2'
Sun Jul 22 10:05:05 2012: Saving settings to "/home/test/.config/jack/conf.xml" ...
10:05:06.239 JACK connection change.
10:05:06.240 Server configuration saved to "/home/test/.jackdrc".
10:05:06.240 Statistics reset.
10:05:06.268 Client activated.
10:05:06.296 JACK connection graph change.
Sun Jul 22 10:05:06 2012: New client 'qjackctl' with PID 2551

[b][Edit: I STARTED AUDACITY AT THIS TIME][/b]

10:05:30.901 XRUN callback (1).
10:05:32.304 XRUN callback (1 skipped).
10:05:35.997 XRUN callback (3).
10:05:36.114 Shutdown notification.
10:05:36.139 Client deactivated.
10:05:36.140 D-BUS: JACK server was stopped (org.jackaudio.service aka jackdbus).
Cannot read socket fd = 19 err = Success
JackSocketClientChannel read fail
Cannot write socket fd = 17 err = Broken pipe
Cannot write socket fd = 17 err = Broken pipe
Cannot read socket fd = 17 err = Broken pipe
Could not read result type = 7
Sun Jul 22 10:05:35 2012: [1m[31mERROR: JackProcessSync::LockedTimedWait error usec = 5000000 err = Connection timed out[0m
Sun Jul 22 10:05:35 2012: [1m[31mERROR: Driver is not running[0m
Sun Jul 22 10:05:35 2012: [1m[31mERROR: Cannot create new client[0m
Sun Jul 22 10:05:36 2012: [1m[31mERROR: Unknown request 4294967295[0m
Sun Jul 22 10:05:36 2012: [1m[31mERROR: Abort![0m

[b][Edit: <snip dump>][/b]

Sun Jul 22 10:05:36 2012: [1m[31mERROR: End of stack trace[0m

On this machine, I had disabled the onboard sound system via BIOS due to automatic (random) reassignment of the hardware designations with each reboot. I re-enabled the onboard sound system and rebooted. I set Jack to use the onboard sound system instead of the Soundblaster Live! EMU10k1 / CT4620 soundcard.

With Jack running, I started Audacity. Jack did not crash. Audacity sees Jack and works with it.

The problem appears to lie with my soundcard itself, or with the way the software handles it. It’s a very old card, which led me to suspect that it might work well. Guess not. I only use it because I need the MIDI / gameport interface. (Yeah, I know. I’m poor. :slight_smile:)

So, I have discovered a work-around fix. I’d still like to get the soundcard working fully, but for now, the MIDI port is seen and works in Jack. Any further clues would be appreciated. I hope this helps others with similar problems.

Thanks again, steve et al…

Have you tried running Jack with a sample rate of 48 kHz (and Audacity also at 48 kHz)? I may be mistaken but I have a vague recollection of reading that some SoundBlaster cards are happier at 48 kHz. Worth a try anyway :stuck_out_tongue:

Yes, I tried matching the sampling rate very early on. Internally, the ct4620 card handles only 48000.

The gameport/MIDI is the only real reason I use this card. I should be happy.

Of possible interest on that ct4620 card:

http://www.damsbo.com/soundblaster/sbmod.htm

http://linux-audio.com/audio_quality_howto.htm

For example, at > http://www.pcavtech.com/soundcards/ct4620/index.htm > it is stated that

“Tests of the digital input of this card have been pretty disturbing… the digital input still seems to get unneeded DSP processing and corrupts sound quality by adding fairly broad 1 dB high peaks around 4 kHz, 10-12 kHz, and 16-20 Khz, with 44 kHz sampling. The digital output measures 1 dB down at 13.5 KHz, and -3dB at 17 khz, and -15 dB at 20 kHz. This is atypically bad performance for sound card digital I/O…”
And at > http://www.maz-sound.com/sblive.html > we read that “…the DSP runs fixed at 48 kHz, means every sound runs through the internal 8 point interpolation with 48 kHz … digital 1:1 copies are impossible (the 48 kHz SPDIF frequency can’t be changed to anything else either). [This] means: the SB Live! is no replacement for a digital-only card or an EWS64 L/XL for instance…”