| Summary: | media-sound/audacity-2.4.2-r2: fatal crash on start when jackd is running | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Stuart Longland <stuartl> |
| Component: | Current packages | Assignee: | Professional Audio Applications Maintainers <proaudio> |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | CC: | ionen, richard |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
emerge --info
Clicking "rec" in Audacity |
||
|
Description
Stuart Longland
2020-12-30 04:01:55 UTC
Created attachment 680245 [details]
emerge --info
My `.asoundrc`, in case it matters:
pcm.!default {
type plug
slave { pcm "jack" }
}
pcm.jack {
type jack
playback_ports {
0 system:playback_1
1 system:playback_2
}
capture_ports {
0 system:capture_1
1 system:capture_1
}
}
pcm.shmtest {
type shm # Shared memory PCM
server test # Server name
}
server.test {
host 127.0.0.1
port 65432
}
(Yes, there's some stuff I need to remove, notably the "shm" stuff. I was trying to figure out what the "shm" server did.)
ALSA playback devices:
RC=0 stuartl@rikishi ~ $ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
lavrate
Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
Rate Converter Plugin Using Samplerate Library
speexrate
Rate Converter Plugin Using Speex Resampler
jack
JACK Audio Connection Kit
pipewire
PipeWire Sound Server
pulse
PulseAudio Sound Server
speex
Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
Plugin for channel upmix (4,6,8)
vdownmix
Plugin for channel downmix (stereo) with a simple spacialization
sysdefault:CARD=PCH
HDA Intel PCH, ALC269VC Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VC Analog
Front output / input
surround21:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VC Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VC Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VC Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VC Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VC Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC269VC Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
hdmi:CARD=PCH,DEV=1
HDA Intel PCH, HDMI 1
HDMI Audio Output
usbstream:CARD=PCH
HDA Intel PCH
USB Stream Output
sysdefault:CARD=ATHG1WL
ATH-G1WL, USB Audio
Default Audio Device
front:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
Front output / input
surround21:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=ATHG1WL,DEV=0
ATH-G1WL, USB Audio
IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=ATHG1WL
ATH-G1WL
USB Stream Output
sysdefault:CARD=CODEC
USB Audio CODEC, USB Audio
Default Audio Device
front:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
Front output / input
surround21:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=CODEC
USB Audio CODEC
USB Stream Output
hw:ATHG1WL (AudioTechnica ATH-GW1L USB headset) is the device being used with JACK.
Tried myself while jackd is running (jack2) with your .asoundrc. With USE="jack alsa" it did spit out similar warnings but still started fine (no assert messages), and with "jack -alsa" cleanly worked and using jackd directly. I don't use usbstream though, maybe related. To the best of my knowledge, I'm not using `usbstream` either. (Why would I when there's `snd-usb-audio`?) I haven't tried with `alsa` disabled, I guess I'll try that next. Created attachment 680332 [details]
Clicking "rec" in Audacity
Well the good news is with USE="-alsa jack", it does start… however, clicking "Record" has me confused!
So, a bit of digging around:
audacity: ../common/JackGraphManager.cpp:48: void Jack::JackGraphManager::AssertPort(jack_port_id_t): Assertion `port_index < fPortMax' failed.
audacity: ../common/JackGraphManager.cpp:48: void Jack::JackGraphManager::AssertPort(jack_port_id_t): Assertion `port_index < fPortMax' failed.
Those two lines are emitted from this file:
jack2-1.9.16/common/JackGraphManager.cpp:
44 void JackGraphManager::AssertPort(jack_port_id_t port_index)
45 {
46 if (port_index >= fPortMax) {
47 jack_log("JackGraphManager::AssertPort port_index = %ld", port_index);
48 assert(port_index < fPortMax);
49 }
50 }
Clearly, fPortMax is smaller than expected, or port_index is above the set maximum. Question is, where do these values come from?
fPortMax is set by the constructor:
66 JackGraphManager::JackGraphManager(int port_max)
67 {
68 assert(port_max <= PORT_NUM_MAX);
69
70 for (int i = 0; i < port_max; i++) {
71 fPortArray[i].Release();
72 }
73
74 fPortMax = port_max;
75 }
… which is called here:
52 JackGraphManager* JackGraphManager::Allocate(int port_max)
53 {
54 // Using "Placement" new
55 void* shared_ptr = JackShmMem::operator new(sizeof(JackGraphManager) + port_max * sizeof(JackPort));
56 return new(shared_ptr) JackGraphManager(port_max);
57 }
This seems to have just one caller, jack2-1.9.16/common/JackServer.cpp line 56:
43 //----------------
44 // Server control
45 //----------------
46 JackServer::JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, char self_connect_mode, const char* server_name)
47 {
48 if (rt) {
49 jack_info("JACK server starting in realtime mode with priority %ld", priority);
50 } else {
51 jack_info("JACK server starting in non-realtime mode");
52 }
53
54 jack_info("self-connect-mode is \"%s\"", jack_get_self_connect_mode_description(self_connect_mode));
55
56 fGraphManager = JackGraphManager::Allocate(port_max);
… which is called in jack2-1.9.16/common/JackServerGlobals.cpp (line 55):
41 int JackServerGlobals::Start(const char* server_name,
42 jack_driver_desc_t* driver_desc,
43 JSList* driver_params,
44 int sync,
45 int temporary,
46 int time_out_ms,
47 int rt,
48 int priority,
49 int port_max,
50 int verbose,
51 jack_timer_type_t clock,
52 char self_connect_mode)
53 {
54 jack_log("Jackdmp: sync = %ld timeout = %ld rt = %ld priority = %ld verbose = %ld ", sync, time_out_ms, rt, priority, verbose);
55 new JackServer(sync, temporary, time_out_ms, rt, priority, port_max, verbose, clock, self_connect_mode, server_name);
So, it could be a command line argument that previously didn't give problems, but is now tickling things the wrong way. I'm not sure though whether it is something `qjackctl` is passing `jackd` when it starts it (curiously, I can't even *see* `jackd` in the process tree even though it is clearly running) or whether Audacity is the guilty party at this point.
PulseAudio also works via Jack, and there, I don't have problems. I have a week-daily session with work colleagues on Slack using jackd, and that works without a hitch. It's just Audacity that gives me problems, I'll have to see if it's Audacity itself or its version of PortAudio (since it seems to bring its own).
<?xml version="1.0"?> <!-- JACK settings, as persisted by D-Bus object. You probably don't want to edit this because it will be overwritten next time jackdbus saves. --> <!-- Thu Jan 7 21:01:53 2021 --> <jack> <engine> <option name="driver">alsa</option> <option name="realtime">true</option> <option name="realtime-priority">10</option> <option name="verbose">false</option> <option name="clock-source">0</option> <option name="port-max">2048</option> <option name="sync">false</option> <option name="self-connect-mode"> </option> </engine> <drivers> <driver name="alsarawmidi"> </driver> <driver name="alsa"> <option name="device">hw:ATHG1WL</option> <option name="capture">hw:ATHG1WL</option> <option name="playback">hw:ATHG1WL</option> <option name="rate">48000</option> <option name="period">1024</option> <option name="nperiods">3</option> <option name="hwmeter">false</option> <option name="duplex">true</option> <option name="softmode">false</option> <option name="monitor">false</option> <option name="dither">n</option> <option name="shorts">true</option> </driver> <driver name="proxy"> </driver> <driver name="netone"> </driver> <driver name="net"> </driver> <driver name="loopback"> </driver> <driver name="dummy"> <option name="rate">48000</option> <option name="period">1024</option> <option name="wait">21333</option> </driver> </drivers> <internals> <internal name="audioadapter"> </internal> <internal name="netadapter"> </internal> <internal name="profiler"> </internal> <internal name="netmanager"> </internal> </internals> </jack> ^ My /home/stuartl/.config/jack/conf.xml… suggests fPortMax is being set to 2048… that ought to be enough I think! Okay… I got Audacity to start properly. - I could not find `jackd`, but did note that `jackdbus` was running. So, I killed it. (initially with -TERM, then -QUIT, finally -KILL when it didn't take the hint). - `pulseaudio` took great umbrage to this, spinning CPU wildly and gobbling RAM like crazy. So it too, got the `kill` treatment. - `pulseaudio` re-spawns. - I restart JACK via `qjackctl` for good measure. Now, Audacity starts, and seems to work. I think it might be a case of "turn it off, and back on again"… I shall keep an eye on this. |