Audacity 2.4.1 kills sound output (xfce, jack with pulseaudio bridge)

Audacity 2.4.1 kills sound output. After Audacity is launched no sound is sent to HDMI from Audacity or any other audio program. However, no errors are reported and the sound is shown in pulseaudio meter and cadence M meter.

I’m using jack2 with cadence to bridge to pulseaudio.

Restarting jack and pulseaudio has no effect - system reboot required.

Using HDMI for audio out:

card 0: PCH [HDA Intel PCH], device 0: ALC233 Analog [ALC233 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

Audacity set to use Jack with input and output as ‘system’.

[can’t post screeny to forum]

The problem seems to outputting to HDMI audio (card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]).

Audacity will output to internal analogue (card 0: PCH [HDA Intel PCH], device 0: ALC233 Analog [ALC233 Analog]) and USB (card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]).

Audacity seems to kill as well as not recognise HDMI audio. Steps to reproduce:

  1. Have jack2 running with pulseaudio bridged to jack (jack is configured with HDMI as output, USB as input)
  2. Programs (including VLC and Audacious) output sound to HDMI - both using both jack (‘directly’) and pulseaudio.
  3. Run Audacity
  4. Audacity won’t send audio to HDMI, additionally no other program now sent audio to HDMI either.

Quitting Audacity and restarting jack and bridge does not restore audio to HDMI - reboot necessary.

I’ve tried Audacity set to jack both ‘system’ and ‘pulseaudio’ as output device. I’ve tried it set to ALSA and various options (including jack). Also note, when set to ALSA the output device list includes internal analogue and USB as an options but NOT HDMI.

Output from terminal:

(Audacity:2661): GLib-GObject-WARNING **: 11:49:42.227: cannot register existing type 'GdkDisplayManager'

(Audacity:2661): GLib-CRITICAL **: 11:49:42.228: g_once_init_leave: assertion 'result != 0' failed

(Audacity:2661): GLib-GObject-CRITICAL **: 11:49:42.228: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
11:49:42: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1013,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1014,wx containers,compatible with 2.8).

(Audacity:2661): Gtk-WARNING **: 11:49:42.395: gtk_disable_setlocale() must be called before gtk_init()
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
11:49:44: Debug: ScreenToClient cannot work when toplevel window is not shown ...

11:49:44: Debug: ScreenToClient cannot work when toplevel window is not shown
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
Expression 'stream->playback.pcm' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4628
11:49:45: Debug: ScreenToClient cannot work when toplevel window is not shown ...

11:49:46: Debug: ClientToScreen cannot work when toplevel window is not shown
11:49:46: Debug: Unrecognized accel key 'backspace', accel string ignored.
11:49:46: Debug: Unrecognized accel key 'backspace', accel string ignored.
11:49:46: Debug: Unrecognized accel key 'numpad_enter', accel string ignored.
11:49:46: Debug: Unrecognized accel key 'numpad_enter', accel string ignored.

I think you’d be better off filing a bug with the audacity folks

:sob:

Thanks, I started a thread on the Audacity forum. I have a suspicion that it’s to do with the way I’ve configured ALSA.

1 Like

welcome ‘back’ to the forum. I was following your posts on the old forum and had a response in my drafts folder, but it was lost when the forum went ‘Total Inability To Support Usual Pictures’ at just the wrong moment. You should be back to member level soon and not be so restricted

I found your post on Audacity so we can check out screenshots on there
https://forum.audacityteam.org/download/file.php?id=28629

Your list of devices in ALSA is only showing HDMI 0 (hw:PCH,3)

card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1

The 0 in the 0/1 bit indicates that the subdevice is unavailable
(which could be JACK, Pulseaudio or Audacity) and seems odd if you were actually wanting HDMI 1

But Cadence can see 5 HDMI outputs

I have tried to replicate what you are doing in Audacity and results have been strange
Audacity works using the ‘pulse’ output option (but you may not have that on your system) and it can play audio to my monitor speakers on HDMI 2 (nVidia GPU) via Pulseaudio

but I cannot get it to work at all playing direct to this device connection in ALSA
I have to change the profile in Pulseaudio to ‘Off’ or Audacity does not show the connection
Then I get an error message that the audio format is incorrect (on every format)

I tried another audio recorder package ocenaudio and that is able to play audio to HDMI 2
so the problem with audio playback is likely to be in Audacity and not ALSA
I suggest you try using ocenaudio to check ALSA playback on your system

The HDMI 2 output does not work when connected to JACK
I have not checked HDMI outputs in JACK before to know if they worked
I do not recall anyone mentioning use of a HDMI output connection with JACK so it may never have worked, but I would expect to see some comment about either success or failure

2 Likes

Thanks for the detailed reply. :slightly_smiling_face:

card 0, devices 3 (hdmi) becomes unavailable when jack is running and using it, I assume this is normal?

I only have one hdmi stereo out (the 5 belong to Steve from the Audacity forum - he was trying to reproduce the problem).


I reconfigured my system to work with ALSA and Pulse. I get the same problem as when I use Jack. (Audacity set to ALSA with Pulse output option). Audacity appears to play, with a vertical line traversing the audio waveform, the meters in Audacity and Pulse go high. However, no audio is produced. After this the whole system will no longer send sound to the hdmi port, for example VLC and Deadbeef no longer send audio to hdmi. A system reboot is required (although I haven’t tried restarting Pulse audio)

(Audacity forum thread forum audacityteam org viewtopic php?f=48&t=112872)


OcenAudio will play to hdmi with both ALSA and Jack setups. I’d prefer to use Audacity - as I have enjoyed using it in the past and it is open source.

I’ve found a solution. Cadence was set to start jack2 at login. Disabling this and manually starting jack solves the problem.

Audacity will then output to hdmi when set to ‘ALSA’ with output device as ‘pulse’. This works for both ALSA + Pulse and Jack + Pulse bridge.

It may be something to do with the order that jack et al initialise that is throwing Audacity off.


I came to the solution by using the command systemctl --user restart pulseaudio after Audacity silenced the hdmi output. An alternative solution (to disabling jack2 autostart) is to issue this command at anytime before using Audacity.


Now, what I would ideally like is to automate Cadence settings shortly after login, ie:

<login>
<short wait>
<start jack>
<short wait>
<start bridge to pulse audio>

Put a script in your autostart programs and just do that…

If you don’t know how to do that, do you have the commands you want executed and how long you want to wait?

:innocent:

1 Like

I need work out the commands, I’ll have to research a little further.

Ping me when/if you need additional help to autostart /script the commands you have…

:wink:

I’d prefer to use Audacity

everyone says that about Oceanaudio, but it is usually because they don’t like the GUI controls
I have used Audacity for over 10 years on 2 platforms and it has always been excellent


The main problem is probably with the Pulseaudio JACK Sink Cadence starts JACK at boot time, but if Pulseaudio is not ready then Pulseaudio JACK Sink does not load or does not connect to Pulseaudio

so if Cadence settings are changed to turn off the Pulse bridge, JACK will start at boot

I know 2 ways to load the Pulseaudio JACK Sink independent of Cadence

First method is to use Pulseaudio module - module-jackdbus-detect
this module is used with qjackctl but is usually commented out in /etc/pulse/default.pa when using Cadence
If I recall correct from previous posts, you were using custom configuration for Pulseaudio ~/.config/pulse/default.pa ?
try adding this line to your configuration:

load-module module-jackdbus-detect channels=2

I am not certain this will work, but it does not require any extra start script
the module detects when JACK is running and will add or remove the connections automatically
and restart of Pulseaudio will reload Pulseaudio JACK Sink and Pulseaudio JACK Source if needed

The other method is to load the connections manually in a start script

#!/bin/bash
#wait for JACK and Pulseaudio to start
sleep 5
# load Pulseaudio to JACK sink
pactl load-module module-jack-sink channels=2
# load JACK to Pulseaudio source
pactl load-module module-jack-source channels=2

i would expect this to work. but script would have to be used every time Pulseaudio is restarted so the modules are reloaded

2 Likes

So I made a script and it successfully has a delay then starts jack2 then starts pulsebridge. Unfortunately, Audacity didn’t work with this method. Maybe the wait isn’t long enough. If jack+bridge started manually Audacity works.

cadence & disown
sleep 3
jack_control start
sleep 3
cadence-pulse2jack

update manually starting jack and bridge doesn’t reliably fix problem. nor does restarting pulse audio before audacity has run. I’m now thinking audacity has to be run and quit so it has done it’s think with sound system. then restarting pulse to fix and final run audacity again.

1 Like

I think I’ve found a solution (work around). Testing now before posting.

I’ve noticed reading the Audacity forums that it (and its version of wxWidgets) should be compiled against gtk2, not gtk3 which is often used incorrectly in Linux distros.

Is Audacity in the Manjaro repo compiled against gtk2? or how could I find out?

Refs

https://wiki.audacityteam.org/wiki/Building_On_Linux

Building Audacity 2.4.2 on Ubuntu 20.04

Is Audacity in the Manjaro repo compiled against gtk2? or how could I find out?

pamac info audacity is showing one of the dependencies is wxgtk3 - so it is GTK3
and audacity-git has the same dependency too

But audacity-wxgtk2 in AUR that uses GTK2


I was working on another idea for Audacity and JACK to find a way through this, but it was not getting anywhere

I have always had minor reliability problems with cross-platform packages that use PortAudio to connect in to JACK rather than native Linux connection.
Packages usually work OK when configured to work in JACK, but they can have a major seizure if they are launched when no JACK server is running

1 Like

Okay, the following solution seems to work okay - as long as Audacity is set to JACK with recording device - ‘system’ and playback device ‘system’.

I start and quit Audacity on login, along with sequence critical startup of Jack2 using Cadence.
Here is the script, it is autostarted at login (note all this is just so I can run Audacity when I like without having to do anything else):

#!/usr/bin/env bash
#start applications (disown to continue script)
cadence & disown
audacity & disown

#sleep then kill audacity, reset pulseaudio, start jack, start pulseaudio bridge
sleep 5
killall audacity
systemctl --user restart pulseaudio
jack_control start
sleep 1
cadence-pulse2jack

Appendix:

To get jack2 to run happy:

  1. Settings are crucial. Periods/Buffer - 2 works for my computer (I tried 3 for a while, but it threw up errors). (sample rate - 48K and buffer size 2048 )

  2. Commenting out modules in pulse audio default at (for user profile specific setting) ~/.config/pulse/default.pa

(Cadence and script handle this)

### Automatically connect sink and source if JACK server is present (commented out - lagos)
#.ifexists module-jackdbus-detect.so
#.nofail
#load-module module-jackdbus-detect channels=2
#.fail
#.endif

(disable auto-suspend options)

### Automatically suspend sinks/sources that become idle for too long (commented out lagos) suspend may mess with jack configuration
#load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
#.ifexists module-console-kit.so
#load-module module-console-kit
#.endif
#.ifexists module-systemd-login.so
#load-module module-systemd-login
#.endif

((system wide default for pulse-audio at /etc/pulse/default.pa))

1 Like

I’ve marked the below answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (I just want to avoid even more subjective opinions being posted and confusing you even more)

:innocent:
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.