Eu finalmente percebi que o problema veio do uso de aplay
em vez de paplay
.
Ainda não sei dizer por que aplay
funciona no host do Debian e não no Linux, mas pelo menos o problema está fechado.
Atualmente, estou tentando fazer com que um fone de ouvido Sennheiser MM450-X funcione com um Linux personalizado incorporado em uma placa de avaliação xplained Atmel SAMA5D2.
Consigo emparelhar e conectar-me a ele, mas quando tento reproduzir sons, nada é ouvido no fone de ouvido.
Estou usando o blueZ v5 com pulseaudio v9
Log de início do daemon de Bluetooth
Jan 1 05:48:53 buildroot bluetoothd[204]: Bluetooth daemon 5.46
Jan 1 05:48:53 buildroot bluetoothd[204]: Unknown key PageTimeout in main.conf
Jan 1 05:48:53 buildroot bluetoothd[204]: Unknown key InitiallyPowered in main.conf
Jan 1 05:48:53 buildroot bluetoothd[204]: Unknown key RememberPowered in main.conf
Jan 1 05:48:53 buildroot bluetoothd[204]: Unknown key EnableGatt in main.conf
Jan 1 05:48:53 buildroot bluetoothd[204]: Starting SDP server
Jan 1 05:48:53 buildroot bluetoothd[204]: Bluetooth management interface 1.14 initialized
Jan 1 05:48:53 buildroot bluetoothd[204]: Sap driver initialization failed.
Jan 1 05:48:53 buildroot bluetoothd[204]: sap-server: Operation not permitted (1)
Jan 1 05:48:53 buildroot pulseaudio[174]: [pulseaudio] bluez4-util.c: org.bluez.Manager.GetProperties() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Manager" doesn't exist
Jan 1 05:48:53 buildroot bluetoothd[204]: Endpoint registered: sender=:1.0 path=/MediaEndpoint/A2DPSource
Jan 1 05:48:53 buildroot bluetoothd[204]: Endpoint registered: sender=:1.0 path=/MediaEndpoint/A2DPSink
Quando me conecto ao fone de ouvido
Jan 1 05:51:51 buildroot bluetoothd[204]: Control: Refusing unexpected connect
Jan 1 05:51:52 buildroot kernel: input: 00:16:94:0B:90:02 as /devices/virtual/input/input1
Todos os módulos bluetooth parecem estar carregados
# pactl list short | grep blue
11 module-bluetooth-discover
12 module-bluez5-discover
13 module-bluez4-discover
14 module-bluetooth-policy
16 module-bluez5-device path=/org/bluez/hci0/dev_00_16_94_0B_90_02
2 bluez_sink.00_16_94_0B_90_02 module-bluez5-device.c s16le 1ch 8000Hz SUSPENDED
3 bluez_sink.00_16_94_0B_90_02.monitor module-bluez5-device.c s16le 1ch 8000Hz SUSPENDED
4 bluez_source.00_16_94_0B_90_02 module-bluez5-device.c s16le 1ch 8000Hz SUSPENDED
2 bluez_card.00_16_94_0B_90_02 module-bluez5-device.c
E o coletor de fone de ouvido está configurado
# pactl list sinks
Sink #0
State: SUSPENDED
Name: alsa_output.platform-fc048000.classd.analog-stereo
Description: CLASSD Analog Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 1
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: alsa_output.platform-fc048000.classd.analog-stereo.monitor
Latency: 0 usec, configured 0 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "CLASSD PCM atmel-classd-hifi-0"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "CLASSD"
alsa.long_card_name = "CLASSD"
device.bus_path = "platform-fc048000.classd"
sysfs.path = "/devices/soc0/ahb/ahb:apb/fc048000.classd/sound/card0"
device.string = "hw:0"
device.buffering.buffer_size = "17632"
device.buffering.fragment_size = "4408"
device.access_mode = "mmap"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "CLASSD Analog Stereo"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Ports:
analog-output: Analog Output (priority: 9900)
Active Port: analog-output
Formats:
pcm
Sink #1
State: SUSPENDED
Name: bluez_sink.00_16_94_0B_90_02
Description: Sennheiser MM450-X
Driver: module-bluez5-device.c
Sample Specification: s16le 1ch 8000Hz
Channel Map: mono
Owner Module: 15
Mute: no
Volume: mono: 65536 / 100%
balance 0.00
Base Volume: 65536 / 100%
Monitor Source: bluez_sink.00_16_94_0B_90_02.monitor
Latency: 0 usec, configured 0 usec
Flags: HARDWARE HW_VOLUME_CTRL LATENCY
Properties:
bluetooth.protocol = "headset_head_unit"
device.intended_roles = "phone"
device.description = "Sennheiser MM450-X"
device.string = "00:16:94:0B:90:02"
device.api = "bluez"
device.class = "sound"
device.bus = "bluetooth"
device.form_factor = "headset"
bluez.path = "/org/bluez/hci0/dev_00_16_94_0B_90_02"
bluez.class = "0x240404"
bluez.alias = "Sennheiser MM450-X"
device.icon_name = "audio-headset-bluetooth"
Ports:
headset-output: Headset (priority: 0)
Active Port: headset-output
Formats:
pcm
Depois de definir a configuração do dissipador de fone de ouvido, nenhum som será reproduzido na saída do fone de ouvido
# pactl set-default-sink 1
# pactl set-sink-volume 1 65535
# aplay ChillingMusic.wav
Playing WAVE 'ChillingMusic.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
#
Eu tentei exatamente a mesma configuração do meu computador Debian 9 e está trabalhando com quase as mesmas mensagens de log
Oct 23 16:29:31 PC325 bluetoothd[31058]: Unable to connect Headset Voice gateway: connect: Device or resource busy (16)
Oct 23 16:29:31 PC325 bluetoothd[31058]: Connecting Headset Voice gateway failed: Input/output error
Oct 23 16:29:33 PC325 bluetoothd[31058]: Control: Refusing unexpected connect
Oct 23 16:29:35 PC325 bluetoothd[31058]: /org/bluez/hci0/dev_00_16_94_0B_90_02/fd3: fd(25) ready
Não posso ir mais longe e gostaria de saber se alguém já adicionou o mesmo problema.
Eu ficaria feliz em ter alguns conselhos para ir mais longe na depuração.
Eu finalmente percebi que o problema veio do uso de aplay
em vez de paplay
.
Ainda não sei dizer por que aplay
funciona no host do Debian e não no Linux, mas pelo menos o problema está fechado.