通过蓝牙播放音频时的延迟

通过蓝牙播放音频时的延迟

我正在尝试解决这里描述的相同问题:https://askubuntu.com/questions/145935/get-rid-of-0-5s-latency-when-playing-audio-over-bluetooth-with-a2dp. 降低在蓝牙设备上播放音频时的延迟。

当我连接蓝牙设备收听音频(例如蓝牙耳机)时,声音会延迟到达(约 0.5 秒)。我正在使用嵌入式设备。

我已经尝试了那里列出的所有解决方案,但这些对我都不起作用。我还尝试按照此处列出的步骤进行操作:https://juho.tykkala.fi/Pulseaudio-and-latency但没有成功。

我遵循的具体程序是:

  1. 连接蓝牙设备(通过 bluetoothctl)
  2. 将一些模块加载到 PulseAudio 中(pactl load-module module-alsa-source device=hw:2,0)
  3. 加载一个环回模块,将声音传送到耳机(pactl load-module module-loopback source=alsa_input.hw_2_0 sink=bluez_sink.30_C0_1B_E4_CF_8D.a2dp_sink)

附加信息:

我必须使用 pulseAudio。我很确定我可以通过移除蓝牙设备的卡并用不同的参数重新加载来解决这个问题(如第二个链接所示),但我不知道如何为 bluez 卡完成此操作。

使用

pactl 列表卡

给出


Card #0
    Name: bluez_card.30_C0_1B_E4_CF_8D
    Driver: module-bluez5-device.c
    Owner Module: 20
    Properties:
        device.description = "JBL T450BT"
        device.string = "30:C0:1B:E4:CF:8D"
        device.api = "bluez"
        device.class = "sound"
        device.bus = "bluetooth"
        device.form_factor = "headset"
        bluez.path = "/org/bluez/hci1/dev_30_C0_1B_E4_CF_8D"
        bluez.class = "0x240404"
        bluez.alias = "JBL T450BT"
        device.icon_name = "audio-headset-bluetooth"
        device.intended_roles = "phone"
    Profiles:
        headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 30, available: yes)
        a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: yes)
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: a2dp_sink
    Ports:
        headset-output: Headset (priority: 0, latency offset: 0 usec, available)
            Part of profile(s): headset_head_unit, a2dp_sink
        headset-input: Headset (priority: 0, latency offset: 0 usec)
            Part of profile(s): headset_head_unit

pactl 列表接收器

Sink #1
    State: RUNNING
    Name: bluez_sink.30_C0_1B_E4_CF_8D.a2dp_sink
    Description: JBL T450BT
    Driver: module-bluez5-device.c
    Sample Specification: s16le 2ch 44100Hz
    Channel Map: front-left,front-right
    Owner Module: 20
    Mute: no
    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
    Monitor Source: bluez_sink.30_C0_1B_E4_CF_8D.a2dp_sink.monitor
    **Latency: 49696 usec, configured 39512 usec  <-- HERE THE PROBLEM**
    Flags: HARDWARE DECIBEL_VOLUME LATENCY 
    Properties:
        bluetooth.protocol = "a2dp_sink"
        device.description = "JBL T450BT"
        device.string = "30:C0:1B:E4:CF:8D"
        device.api = "bluez"
        device.class = "sound"
        device.bus = "bluetooth"
        device.form_factor = "headset"
        bluez.path = "/org/bluez/hci1/dev_30_C0_1B_E4_CF_8D"
        bluez.class = "0x240404"
        bluez.alias = "JBL T450BT"
        device.icon_name = "audio-headset-bluetooth"
        device.intended_roles = "phone"
    Ports:
        headset-output: Headset (priority: 0, available)
    Active Port: headset-output
    Formats:
        pcm

有什么建议吗?谢谢

相关内容