Raspberry Pi / Raspian:通过记录从蓝牙耳机上录制声音不起作用,但也没有错误消息

时间:2019-02-12 13:28:23

标签: bluetooth raspberry-pi raspberry-pi3 bluez

我有一台具有最新无头弹力版的Pi 3b +。 Pis内部蓝牙已停用,因为我需要将其Pins插入另一台设备。相反,我使用的是Edimax Wifi /蓝牙USB-Dongle。

在系统上,我手动将bluez / bluetoothd编译并更新为v5.50,并将bluealsa更新为1.3.1版本。

系统启动时,日志中的所有内容看起来都很好。 journalctl | grep blue 返回:

>> timeit func(a, b)
3.23 ms ± 52.3 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

据我所知 2月12日13:24:55 raspberrypi bluetoothd [336]:无法设置隐私:被拒绝(0x0b)可以忽略。

我可以使用

连接到设备
Feb 12 13:24:54 raspberrypi kernel: bluetooth hci0: Direct firmware load for rtl_bt/rtl8723b_config.bin failed with error -2
Feb 12 13:24:55 raspberrypi bluetoothd[336]: Bluetooth daemon 5.50
Feb 12 13:24:55 raspberrypi bluetoothd[336]: Starting SDP server
Feb 12 13:24:55 raspberrypi systemd[1]: Started Raspberry Pi bluetooth helper.
Feb 12 13:24:55 raspberrypi bluetoothd[336]: Bluetooth management interface 1.14 initialized
Feb 12 13:24:55 raspberrypi bluetoothd[336]: Failed to set privacy: Rejected (0x0b)
Feb 12 13:24:55 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/ctl.c:571: Starting controller loop
Feb 12 13:24:56 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:675: Registering endpoint: /A2DP/SBC/Source/1
Feb 12 13:24:56 raspberrypi bluetoothd[336]: Endpoint registered: sender=:1.6 path=/A2DP/SBC/Source/1
Feb 12 13:24:56 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:910: Registering profile: /HSP/AudioGateway
Feb 12 13:24:56 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:910: Registering profile: /HFP/AudioGateway
Feb 12 13:24:56 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/main.c:302: Starting main dispatching loop

设备信息看起来像是它已正确检测到设备:

sudo bluetoothctl
scan on
pair XYZ
trust XYZ
connect XYZ

之后,我仍然无法在日志中找到任何可疑的东西:

    Device 00:23:01:04:95:CC (public)
        Name: Voice-BoomBox
        Alias: Voice-BoomBox
        Class: 0x00240404
        Icon: audio-card
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)

通过aplay播放声音时( aplay -D bluealsa:HCI = hci0,DEV = 00:23:01:04:95:CC,PROFILE = a2dp test16.wav ),声音可以正确播放

现在,我想通过录音来录制声音。我尝试过:

    Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:857: Profile method call: org.bluez.Profile1.NewConnection()
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/transport.c:688: State transition: 0 -> 2
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/transport.c:104: Created new IO thread: HFP Audio Gateway
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/ctl.c:675: +-+-
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:797: HFP Audio Gateway configured for device 00:23:01:04:95:CC
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/transport.c:688: State transition: 0 -> 2
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/transport.c:104: Created new IO thread: HFP Audio Gateway
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/io.c:1195: Starting IO loop: HFP Audio Gateway
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:573: Starting RFCOMM loop: HFP Audio Gateway
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: SET: command:+BRSF, value:59
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:+BRSF, value:992
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:OK
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:114: HFP state transition: 0 -> 2
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: TEST: command:+CIND, value:(null)
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:+CIND, value:("call",(0,1)),("callsetup",(0-3)),("service",(0-1)),("signal",(0-5)),("roam",(0-1)),("battchg",(0-5)),("callheld",(0-2))
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:OK
Feb 12 13:26:28 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:114: HFP state transition: 2 -> 5
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: GET: command:+CIND, value:(null)
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:+CIND, value:0,0,0,0,0,0,0
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:OK
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:114: HFP state transition: 5 -> 7
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: SET: command:+CMER, value:3, 0, 0, 1
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:OK
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:114: HFP state transition: 7 -> 8
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:114: HFP state transition: 8 -> 9
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:114: HFP state transition: 9 -> 13
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/ctl.c:675: +-+-
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: SET: command:+VGS, value:15
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:OK
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/ctl.c:675: +-+-
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: GET: command:+BTRH, value:(null)
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:OK
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: CMD: command:+CLCC, value:(null)
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: Unsupported AT message: CMD: command:+CLCC, value:(null)
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:ERROR
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/at.c:160: AT message: SET: command:+CSRSF, value:0,0,0,1,0,0,0
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: Unsupported AT message: SET: command:+CSRSF, value:0,0,0,1,0,0,0
Feb 12 13:26:29 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/rfcomm.c:96: Sending AT message: RESP: command:(null), value:ERROR
Feb 12 13:26:30 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:608: Endpoint method call: org.bluez.MediaEndpoint1.SelectConfiguration()
Feb 12 13:26:30 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:608: Endpoint method call: org.bluez.MediaEndpoint1.SetConfiguration()
Feb 12 13:26:30 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:540: A2DP Source (SBC) configured for device 00:23:01:04:95:CC
Feb 12 13:26:30 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:542: Configuration: channels: 2, sampling: 48000
Feb 12 13:26:30 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/transport.c:688: State transition: 0 -> 0
Feb 12 13:26:30 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/bluez.c:675: Registering endpoint: /A2DP/SBC/Source/2
Feb 12 13:26:30 raspberrypi bluealsa[373]: /usr/bin/bluealsa: ../../src/ctl.c:675: +-+-
Feb 12 13:26:30 raspberrypi bluetoothd[336]: Endpoint registered: sender=:1.6 path=/A2DP/SBC/Source/2

但是没有任何记录。但是,我的日志中仍然没有可疑的东西。

arecord -D bluealsa:HCI=hci0,DEV=00:23:01:04:95:CC,PROFILE=sco record.wav
arecord -f S16_LE -D bluealsa:HCI=hci0,DEV=00:23:01:04:95:CC,PROFILE=sco record.wav
sudo arecord -f cd -D bluealsa:HCI=hci0,DEV=00:23:01:04:95:CC,PROFILE=sco record.wav

有人暗示这里出了什么问题吗?

1 个答案:

答案 0 :(得分:0)

万一将来有人超越我的问题,这是我的问题得到解决的方式:

对于蓝牙,我使用的是Edimax BT / WiFi-加密狗(EW-7611ULB)。 Edimax本身说,您需要为更新的Linux Kernels(> v3.19)编译固件。他们还为此提供了一个教程here。我遵循了这些步骤,之后还检查了我的日志/日志。在这里,一切看起来都很不错,而且当我使用加密狗时,由于播放音频可以正常工作,我认为固件可以正常工作。

我真的没有主意,已经在考虑尝试使用pulseaudio,但是后来我又使用了另一个BT-dongle(来自LogiLink的东西),可以立即录制语音。