Linux: Can't load audio device

Description

The audio device is always loading.

❯ audiorelay
2022-10-13 19:14:53:238 [INFO] Version: 0.26.3, os: Linux, osVersion: 5.15.72-1-MANJARO
2022-10-13 19:14:53:388 [INFO] Initializing locale to en
2022-10-13 19:14:53:408 [INFO] Network addresses: NetworkInfo(broadcastAddresses=[192.168.31.255], localAddresses=[192.168.31.54])
2022-10-13 19:14:53:410 [INFO] Starting the server...
2022-10-13 19:14:53:413 [INFO] Waiting for devices from PortAudio...
2022-10-13 19:14:53:414 [INFO] Status initializing
2022-10-13 19:14:53:416 [INFO] Checking for update...
2022-10-13 19:14:53:618 [INFO] Showing main window...
2022-10-13 19:14:53:640 [INFO] Rendering api: OPENGL
2022-10-13 19:14:57:333 [INFO] Found no update

Could you please run /opt/audiorelay/bin/AudioRelay > ~/Desktop/audiorelay-output.txt 2>&1 and post the content? There should be more info.

Also, what does pactl info return?

i am facing the same issue after updating to v0.26.3 and logs do not have any errors

audiorelay-output.txt :

2022-10-14 15:24:01:539 [INFO] Version: 0.26.3, os: Linux, osVersion: 5.18.19-3-MANJARO
2022-10-14 15:24:02:030 [INFO] Initializing locale to en
2022-10-14 15:24:02:088 [INFO] Network addresses: NetworkInfo(broadcastAddresses=[192.168.50
.255], localAddresses=[192.168.50.88])
2022-10-14 15:24:02:093 [INFO] Starting the server...
2022-10-14 15:24:02:104 [INFO] Waiting for devices from PortAudio...
2022-10-14 15:24:02:118 [INFO] Checking for update...
2022-10-14 15:24:02:118 [INFO] Status initializing
2022-10-14 15:24:02:578 [INFO] Showing main window...
2022-10-14 15:24:02:639 [INFO] Rendering api: OPENGL
2022-10-14 15:24:04:324 [INFO] Found no update

pactl info returns the following :

Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 13
Tile Size: 65472
User Name: sw
Host Name: sw-pc
Server Name: pulseaudio
Server Version: 16.1
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: audiorelay-speakers
Default Source: audiorelay-virtual-mic-sink.2
Cookie: 398c:7c56

Thanks for the logs. Did you run the complete command though?
The ‘2>&1’ part is important.

yes brother , i did make sure to redirect both stdout and stderr to the log file , just copy pasted the command

1 Like

Same issue here, tried reinstalling with no luck.

audiorelay-output.txt:

2022-10-15 13:22:01:370 [INFO] Version: 0.26.3, os: Linux, osVersion: 6.0.1-270-tkg-pds
2022-10-15 13:22:01:782 [INFO] Initializing locale to en
2022-10-15 13:22:01:832 [INFO] Network addresses: NetworkInfo(broadcastAddresses=[192.168.1.255], localAddresses=[192.168.1.40])
2022-10-15 13:22:01:836 [INFO] Starting the server...
2022-10-15 13:22:01:842 [INFO] Waiting for devices from PortAudio...
2022-10-15 13:22:01:847 [INFO] Status initializing
2022-10-15 13:22:01:850 [INFO] Checking for update...
2022-10-15 13:22:02:345 [INFO] Showing main window...
2022-10-15 13:22:02:393 [INFO] Rendering api: OPENGL
2022-10-15 13:22:02:469 [INFO] Found no update
2022-10-15 13:22:26:958 [INFO] Status terminating
2022-10-15 13:22:26:964 [INFO] Stopping the server, reason: shutdown

pactl info:

Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 370
Tile Size: 65472
User Name: krypto
Host Name: Main-Root
Server Name: PulseAudio (on PipeWire 0.3.59)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_29_00.1.hdmi-stereo-extra1
Default Source: alsa_output.pci-0000_29_00.1.hdmi-stereo-extra1.monitor
Cookie: 6161:c01c

Same problem
audiorelay-output.txt:

2022-10-16 11:54:14:942 [INFO] Version: 0.26.3, os: Linux, osVersion: 6.0.1-zen2-1-zen
2022-10-16 11:54:17:089 [INFO] Initializing locale to ru
2022-10-16 11:54:17:249 [INFO] Network addresses: NetworkInfo(broadcastAddresses=[10.19.8.255], localAddresses=[10.19.8.51])
2022-10-16 11:54:17:256 [INFO] Starting the server...
2022-10-16 11:54:17:271 [INFO] Waiting for devices from PortAudio...
2022-10-16 11:54:17:365 [INFO] Checking for update...
2022-10-16 11:54:17:408 [INFO] Status initializing
2022-10-16 11:54:19:123 [INFO] Found no update
2022-10-16 11:54:20:400 [INFO] Showing main window...
2022-10-16 11:54:20:477 [INFO] Rendering api: OPENGL
2022-10-16 11:54:30:945 [INFO] Status terminating
2022-10-16 11:54:30:947 [INFO] Stopping the server, reason: shutdown

pactl info:

Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 26
Tile Size: 65472
User Name: roman7662
Host Name roman555555
Server Name: pulseaudio
Server Version: 16.1
Default Sample Specification: s16le 2ch 4410
Default Channel Map: front-left,front-right
Default Sink: audiorelay-speakers
Default Source: alsa_input.pci-0000_00_1b.0.analog-stereo
Cookie: 18ba:07a8

maybe it’s problem only on arch

/etc/pulse/
default.pa

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

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

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
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

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.include /etc/pulse/default.pa.d

client.conf

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for PulseAudio clients. See pulse-client.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; default-sink =
; default-source =
; default-server = 
#; default-server = roman
; default-dbus-server =

autospawn = no
; autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no

system.pa

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started in system
# mode.

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev/hal support)
load-module module-detect
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### Enable positioned event sounds
load-module module-position-event-sounds

### Allow including a system.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.include /etc/pulse/system.pa.d

daemon.conf

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; remixing-produce-lfe = no
; remixing-consume-lfe = no
; lfe-crossover-freq = 0

; flat-volumes = no

; rescue-streams = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 4
; default-fragment-size-msec = 25

; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0

/.config/pulse/


and i use a pasystray

Thanks for all the details. I’m looking into replacing the audio library with something more stable.

Could someone please confirm whether it happens on this older version?
audiorelay-0.25.7.deb
audiorelay-0.25.7.tar.gz

1 Like

Works as expected. All my audio devices show up, and then some.

audiorelay-output.txt:

2022-10-16 19:28:08,505 main WARN JMX runtime input lookup class is not available because this JRE does not support JMX. JMX lookups will not be available, continuing configuration. Ignoring java.lang.IllegalArgumentException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup
2022-10-16 19:28:08,634 main WARN JMX runtime input lookup class is not available because this JRE does not support JMX. JMX lookups will not be available, continuing configuration. Ignoring java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup
2022-10-16 19:28:08,635 main WARN JMX runtime input lookup class is not available because this JRE does not support JMX. JMX lookups will not be available, continuing configuration. Ignoring java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup
2022-10-16 19:28:08,652 main ERROR Could not reconfigure JMX java.lang.NoClassDefFoundError: javax/management/InstanceNotFoundException
	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:637)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:302)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:209)
	at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:243)
	at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:219)
	at NZ.a(SourceFile:70)
	at ue.a(SourceFile:34)
	at com.azefsw.audioconnect.desktop.app.MainKt.main(SourceFile:15)
Caused by: java.lang.ClassNotFoundException: javax.management.InstanceNotFoundException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 8 more

2022-10-16 19:28:08,657 INFO Version: 0.25.7, os: Linux, osVersion: 6.0.1-270-tkg-pds
2022-10-16 19:28:08,961 INFO Initializing locale to en
2022-10-16 19:28:08,999 INFO Network addresses: NetworkInfo(broadcastAddresses=[192.168.1.255], localAddresses=[192.168.1.40])
2022-10-16 19:28:09,004 INFO Starting the server...
2022-10-16 19:28:09,009 INFO Waiting for devices from PortAudio...
2022-10-16 19:28:09,015 INFO Status initializing
2022-10-16 19:28:09,016 INFO Portaudio version: PortAudio V19.7.0-devel, revision unknown
2022-10-16 19:28:09,020 INFO Checking for update...
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
cannot connect system:capture_1 to AudioRelay.C.41759.2:in_000
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1822
2022-10-16 19:28:09,327 INFO Status initialized
2022-10-16 19:28:09,468 INFO Showing main window...
2022-10-16 19:28:09,822 INFO Found update for 0.26.3
2022-10-16 19:28:24,963 INFO Stopping the server, reason: shutdown
2022-10-16 19:28:24,970 INFO Status terminating
2022-10-16 19:28:24,983 INFO Closing main window...
2022-10-16 19:28:24,987 pool-1-thread-1 ERROR Unable to unregister MBeans java.lang.NoClassDefFoundError: javax/management/InstanceNotFoundException
	at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:379)
	at org.apache.logging.log4j.core.LoggerContext$1.run(LoggerContext.java:320)
	at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry$RegisteredCancellable.run(DefaultShutdownCallbackRegistry.java:119)
	at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry.run(DefaultShutdownCallbackRegistry.java:78)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.management.InstanceNotFoundException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 5 more

This gets added everytime I press the refresh button on the devices in 0.25.7 (refresh button is greyed out in 0.26.3):

2022-10-16 19:25:27,500 INFO Status initializing
2022-10-16 19:25:27,502 INFO Portaudio version: PortAudio V19.7.0-devel, revision unknown
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
cannot connect system:capture_1 to AudioRelay.C.39465.2:in_000
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1822
2022-10-16 19:25:27,788 INFO Status initialized

I’m also getting really high CPU usage (20-30% on Ryzen 1700) when 0.26.3 is open and on the server or the player tab. The settings tab seems to drop usage back to 0% (0.25.7 barely had any CPU usage most of the time.)