quiniouben / vban

VBAN protocol open-source implementation
GNU General Public License v3.0
464 stars 65 forks source link

systemd setup #41

Open saitoh183 opened 4 years ago

saitoh183 commented 4 years ago

@quiniouben I tried the systemd from #28 but i get the following error

● vban_kraken_mic.service - vban - Emitter Kraken
   Loaded: loaded (/etc/systemd/system/vban_kraken_mic.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-12-09 19:11:39 EST; 49s ago
  Process: 17263 ExecStart=/usr/local/bin/vban_emitter -i 192.168.13.202 -p 6980 -s Kraken_mic -r 48000 -d plughw:CARD=Chroma,DEV=0 (code=exited, status=240/LOGS_DIRECT
 Main PID: 17263 (code=exited, status=240/LOGS_DIRECTORY)

Dec 09 19:11:37 user-ThinkPad-T420s systemd[1]: Started vban - Emitter Kraken.
Dec 09 19:11:39 user-ThinkPad-T420s pulseaudio[17267]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolau
Dec 09 19:11:39 user-ThinkPad-T420s pulseaudio[17267]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbu
Dec 09 19:11:39 user-ThinkPad-T420s vban_emitter[17263]: Fatal: alsa_open: open error: Device or resource busy
Dec 09 19:11:39 user-ThinkPad-T420s vban_emitter[17263]: Error: audio_set_stream_config: could not open backend with new config
Dec 09 19:11:39 user-ThinkPad-T420s vban_emitter[17263]: /usr/local/bin/vban_emitter version 2.1.0
Dec 09 19:11:39 user-ThinkPad-T420s systemd[1]: vban_kraken_mic.service: Main process exited, code=exited, status=240/LOGS_DIRECTORY
Dec 09 19:11:39 user-ThinkPad-T420s pulseaudio[17267]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Erro
Dec 09 19:11:39 user-ThinkPad-T420s systemd[1]: vban_kraken_mic.service: Failed with result 'exit-code'.

if i remove the -d get

vban_kraken_mic.service - vban - Emitter Kraken
   Loaded: loaded (/etc/systemd/system/vban_kraken_mic.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-12-09 01:50:46 EST; 17h ago
 Main PID: 4477 (vban_emitter)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/vban_kraken_mic.service
           ├─4477 /usr/local/bin/vban_emitter -i 192.168.13.202 -p 6980 -s Kraken_mic -r 48000
           └─4481 /usr/bin/pulseaudio --start --log-target=syslog

Dec 09 01:50:46 user-ThinkPad-T420s systemd[1]: Started vban - Emitter Kraken.
Dec 09 01:50:48 user-ThinkPad-T420s pulseaudio[4481]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaun
Dec 09 01:50:48 user-ThinkPad-T420s pulseaudio[4481]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus
Dec 09 01:50:48 user-ThinkPad-T420s pulseaudio[4481]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error

if i run /usr/local/bin/vban_emitter -i 192.168.13.202 -p 6980 -s Kraken_mic -r 48000 from the terminal, it works

Should i be using alsa or pulseaudio ?

output of aplay -L

default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=PCH
    HDA Intel PCH, CX20590 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    Direct sample snooping device
hw:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, CX20590 Analog
    Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 2
    HDMI Audio Output
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct sample mixing device
dmix:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Direct sample snooping device
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 1
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 2
    Hardware device with all software conversions
sysdefault:CARD=Chroma
    Razer Kraken 7.1 Chroma, USB Audio
    Default Audio Device
front:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    Front speakers
surround21:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    Direct sample mixing device
dsnoop:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    Direct sample snooping device
hw:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Chroma,DEV=0
    Razer Kraken 7.1 Chroma, USB Audio
    Hardware device with all software conversions
quiniouben commented 4 years ago

Hi, The trace suggest that pulseaudio is the backend selected by default on your system, but when the unit for vban_emitter is executed, pulseaudio is not started yet and seems not able to start because D-Bus is not ready yet neither. I guess you should add a dependency of type After in your unit file, that would wait pulseaudio to be started, or at least D-Bus. I am not using pulseaudio on my main machine currently, but if you have trouble to find the correct .target / .service to wait for, I can look for it. Let me know.