在无头模式下使用 lightdm 运行 PulseAudio 时如何使用除空接收器之外的其他功能?

在无头模式下使用 lightdm 运行 PulseAudio 时如何使用除空接收器之外的其他功能?

我像这样启动 PulseAudio:

sudo -u lightdm /usr/bin/pulseaudio --daemonize=yes --log-target=journal

打算使用它mopidy.服务

[Unit]
Description=Mopidy music server
After=avahi-daemon.service
After=dbus.service
After=network-online.target
Wants=network-online.target
After=nss-lookup.target
After=pulseaudio.service
After=remote-fs.target
After=sound.target

[Service]
User=mopidy
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/cache/mopidy
ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy
ExecStart=/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

[Install]
WantedBy=multi-user.target

并且 mopidy.service 确实使用了它;停止 lightdm-p​​ulseaudio 确定 mopidy 日志中的错误,恢复 lightdm-p​​ulseaudio 使 mopidy 回到正轨,因此显然 mopidy “选择”了它。

问题是 lightdm 没有可用的有用接收器:

$sudo -u lightdm pacmd list-sinks
1 sink(s) available.
  * index: 0
        name: <auto_null>
        driver: <module-null-sink.c>
        flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: RUNNING
        suspend cause: (none)
        priority: 1000
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 67.98 ms
        max request: 16 KiB
        max rewind: 16 KiB
        monitor source: 0
        sample spec: s16le 2ch 48000Hz
        channel map: front-left,front-right
                     Stereo
        used by: 1
        linked by: 1
        configured latency: 90.00 ms; range is 0.50 .. 2000.00 ms
        module: 15
        properties:
                device.description = "Dummy Output"
                device.class = "abstract"
                device.icon_name = "audio-card"

但也有可用的接收器,例如:

$pactl list short sinks
PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused

xcb_connection_has_error() returned true
348     alsa_output.pci-0000_00_1f.3.iec958-stereo.6    PipeWire        s32le 2ch 48000Hz       SUSPENDED

系统:Ubuntu 23.04

我知道还有其他接口,例如 HDMI,但我还是想使用光纤接口。我应该如何将光纤接收器(即 device=iec958:CARD=PCH,DEV=0)与 lightdm-p​​ulseaudio 一起使用?

相关内容