No sound after connecting to Bluetooth device wf-1000xm3 - bluetooth

Bluetoothctl shows my WF-1000xm3 ear phones connected. But, the earphones do not give the accoustic feedback 'bluetooth connected' and also sound does not work.
Below is the output of bluetoothctl.
$ bluetoothctl connect 14:3F:A6:81:00:38
Attempting to connect to 14:3F:A6:81:00:38
[CHG] Device 14:3F:A6:81:00:38 RSSI: -56
[CHG] Device 14:3F:A6:81:00:38 Connected: yes
Connection successful
I use EndeavourOS and installed PipeWire. The troubleshooting section of the Arch's PipeWire Wiki (https://wiki.archlinux.org/title/PipeWire), covers the problem "No sound after connecting to Bluetooth device". It refers to a udev script (https://gist.github.com/tinywrkb/04e7fd644afa9b92d33a3a99ab07ee9e), from which I copied this terminal comand
(pactl list sinks|grep Name|grep 'bluez.*.a2dp.sink'|sed 's/Name: //'|sed 's/\s//')
Which did not show any available devices.
Any idea, what the issue might be?

Related

Bluetooth gamepad doesn't create /dev/input/event

I want to use a Gamesir T1d gamepad (Bluetooth) to read it's commands with Python, on a Raspberry Pi 3 B+ (Buster).
I am able to connect the gamepad via Bluetooth:
[CHG] Device C6:86:A1:04:BB:53 RSSI: -78
[bluetooth]# connect C6:86:A1:04:BB:53
Attempting to connect to C6:86:A1:04:BB:53
[CHG] Device C6:86:A1:04:BB:53 Connected: yes
Connection successful
[CHG] Device C6:86:A1:04:BB:53 ServicesResolved: yes
[Gamesir-T1d-BB53]# pair C6:86:A1:04:BB:53
Attempting to pair with C6:86:A1:04:BB:53
[CHG] Device C6:86:A1:04:BB:53 Paired: yes
Pairing successful
[Gamesir-T1d-BB53]# info
Device C6:86:A1:04:BB:53 (random)
Name: Gamesir-T1d-BB53
Alias: Gamesir-T1d-BB53
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: Unknown (00008650-0000-1000-8000-00805f9b34fb)
Modalias: bluetooth:v000Dp0000d0110
RSSI: -78
[Gamesir-T1d-BB53]#
However, there is no event created under
/dev/input/
which I would need to read and map the gamepad's commands into Python.
When connecting a Bluetooth mouse, I can see events being created, so this seems to be a gamepad specific issue.
I was already trying xboxdrv, but without success, probably since the gamesir is not listed as supported device? Also, I have no glue if this is just a missing driver issue, or if there is a generic driver which could work, or if this is a driver issue at all.
What I am missing here?

[RPi3][Bluez] Managed to connect to a BLE device but can't list GATT attributes

I am doing a project where I need to create communication between two Raspberry Pi 3 on stretch (RPi) wirelessly with callback functionalities using C++ code. The first is supposed to send data to the second one. I decided to create a bluetooth connexion between the two using the on-board bluetooth-chips.
So first I decided to compile Linux Bluetooth Stack: Bluez on both RPi from source, version 5.50. Following this tutorial : https://learn.adafruit.com/install-bluez-on-the-raspberry-pi/installation on Adafruit. I managed to send a message from one pi to another using these codes :https://people.csail.mit.edu/albert/bluez-intro/x502.html. But to read a message sent by the client, I have to call the function "read(client, buf, sizeof(buf))" as shown in the server code which is a bit restrictive. I want to be notified whenever a message is received so that a callback function can be called. I saw it could be done by enabling notifications on the GATT Characteristics used for the communication.
This level of specification is not really shown on the C++ codes I got from https://people.csail.mit.edu/albert/bluez-intro/x502.html. After having improved my knowledge on GATT with this : https://www.novelbits.io/bluetooth-gatt-services-characteristics/ , I decided to follow Tony D's youtube tutorial on how to use Bluez APi
https://www.youtube.com/watch?v=5fQR2PHMDWE.
To make it easier, I decided to left one RPi aside and tried to connect a Bluetooth audio headset JBL T450BT which use Bluetooth 4.0, so it is supposed to support Bluetooth Low Energy.
On bluetoothctl here's the problem, I manage to power on the controller, scan on and detect the headset. I then trust, pair and connect. In GATT menu, I enter the command : list-attributes [dev address]. Bluetoothctl prints no error but returns nothing and is ready to receive other command lines.
sudo bluetoothctl
[bluetooth]# show
Controller XX:XX:XX:XX:XX:XX (public)
Name: VoitureRPi
Alias: VoitureRPi
Class: 0x004c0000
Powered: yes
Discoverable: no
Pairable: yes
UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1D6Bp0246d0532
Discovering: no
[bluetooth]# scan on
Device 78:44:05:BC:12:0C JBL T450BT
[bluetooth]# trust 78:44:05:BC:12:0C
[CHG] Device 78:44:05:BC:12:0C Trusted: yes
Changing 78:44:05:BC:12:0C trust succeeded
[bluetooth]# pair 78:44:05:BC:12:0C
Attempting to pair with 78:44:05:BC:12:0C
[CHG] Device 78:44:05:BC:12:0C Connected: yes
[CHG] Device 78:44:05:BC:12:0C UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 78:44:05:BC:12:0C UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 78:44:05:BC:12:0C UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 78:44:05:BC:12:0C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 78:44:05:BC:12:0C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 78:44:05:BC:12:0C ServicesResolved: yes
[CHG] Device 78:44:05:BC:12:0C Paired: yes
Pairing successful
[CHG] Device 78:44:05:BC:12:0C ServicesResolved: no
[CHG] Device 78:44:05:BC:12:0C Connected: no
[bluetooth]# connect 78:44:05:BC:12:0C
Attempting to connect to 78:44:05:BC:12:0C
[CHG] Device 78:44:05:BC:12:0C Connected: yes
Connection successful
[CHG] Device 78:44:05:BC:12:0C ServicesResolved: yes
[JBL T450BT]# menu gatt
[JBL T450BT]# list-attributes 78:44:05:BC:12:0C
[JBL T450BT]#
From there I get no answer from bluetoothctl but no error as well, as I told you. I am not able to discover services/characteristics.
On the youtube tuto I followed,it was told that the GATT services and Characteristics discovery was done during the pairing/first connexion. I assume that the Pi intends to do it but fails. That's maybe why I get the sequence :
connected: yes, ServicesResolved: yes Paired successfully and then ServicesResolved: no, connected no. Nothing like : [NEW] XXX Service or Characteristcs is shown.
I don't think the problem comes from the headset because it does the same thing on other devices I connect to. I have both pulseaudio and bluealsa packages installed on the RPi.
As mentionned in this tuto
Here the bluetooth status :
systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-11-08 11:29:38 CET; 27min ago
Docs: man:bluetoothd(8)
Main PID: 2646 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─2646 /usr/local/libexec/bluetooth/bluetoothd --experimental
Here's what hciconfig gives :
hciconfig -a
hci0: Type: Primary Bus: UART
BD Address: B8:27:EB:A8:0C:20 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:11205 acl:76 sco:0 events:520 errors:0
TX bytes:219869 acl:433 sco:0 commands:150 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'VoitureRPi'
Class: 0x4c0000
Service Classes: Rendering, Capturing, Telephony
Device Class: Miscellaneous,
HCI Version: 4.1 (0x7) Revision: 0x168
LMP Version: 4.1 (0x7) Subversion: 0x2209
Manufacturer: Broadcom Corporation (15)
Here's also what the D-Bus introspection tool returns :
busctl tree org.bluez
└─/org
└─/org/bluez
└─/org/bluez/hci0
└─/org/bluez/hci0/dev_78_44_05_BC_12_0C
├─/org/bluez/hci0/dev_78_44_05_BC_12_0C/fd1
└─/org/bluez/hci0/dev_78_44_05_BC_12_0C/player0
For people who got problems with pairing and connecting, this source was a huge help :https://www.sigmdel.ca/michel/ha/rpi/bluetooth_02_en.html
Anyway so that's my problem. I want to access Characteristics and their UUID's to be able to modify their permission or to create a new service with its own characteristics suited to my project.
To this point I think this is the only way to implement a notifier with a callback in a bluetooth communication. Maybe I'm wrong. Do you have any clue whatsoever ? :)
Thanks to A.Baur, the "--experimental" option was the last missing thing.
My system:Debian 10 + KDE
Installed:
- bluez-*
- bluetooth
- pulseaudio-module-bluetooth
Steps:
1. stop bluetooth service: >sudo systemctl stop bluetooth
2. modify: /etc/init.d/bluetooth ; by adding to the line:
SSD_OPTIONS="**--experimental** --oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION"
3. start bluetooth service: >sudo systemctl start bluetooth
4. connect to Bose QC35 II by bluetoothctl or other GUI tool.
I got it working in RPi with python examples of advertisement and gatt server from bluez-5.50. I used nRF tool to test it.

Raspberry Pi as a audio Transmitter to a Bluetooth Speaker

i wanted to ask you guys, if it is possible to use the Raspberry Pi as a transmitter from a audio source, lets say a TV for example.
I want to send the sound from the TV to the Raspberry Pi via audio Jack and then send the sound via Bluetooth to a wireless speaker. So the Rasberry should act like a bridge between TV and the speaker.
It should look like this in the end:
TV --Sound via audio jack--> Raspberry Pi ~~Sound via Bluetooth~~>
speaker
So, if there is a way, how can i do this ? Thanks in advance
RPi doen't have audio input. You need one of these adapter like this (http://raspberry-projects.com/pi/pi-hardware/audio-input) and connect input to TV and RPi output to wireless / bluetooth speakers. I haven't tried it yet. Let me your feedback.
Since a web search might bring others here as it did me, here's how I did this connecting my record player through a Raspberry Pi 3 to a Bose Portable Home/Smart Speaker.
Get an audio input into the Pi
I used a cheap USB soundcard bought on Adafruit
Identify your new PulseAudio input/source and note name
This can be done by calling pactl list sources (mine was identifiable from its name and description)
$ pactl list sources
...
Source #2
State: RUNNING
Name: alsa_input.usb-GeneralPlus_USB_Audio_Device-00.mono-fallback
Description: USB Audio Device Mono
...
Connect your Pi to your bluetooth speaker
Run sudo bluetoothctl (running this without sudo resulted in settings being forgotten upon reboot) and enter the commands below
(Optional) Give your Pi an alias when connecting over bluetooth: [bluetooth]# system-alias 'Your New BT Alias'
Enter scanning mode [bluetooth]# scan on
Put your speaker in pairing mode and wait for it to be listed in the rolling output. E.g.
[NEW] Device AA:AA:AA:AA:AA:AA AA-AA-AA-AA-AA-AA
[NEW] Device BB:BB:BB:BB:BB:BB BB-BB-BB-BB-BB-BB
[NEW] Device CC:CC:CC:CC:CC:CC My speaker's name
Pair with it referencing its address:
[bluetooth]# pair CC:CC:CC:CC:CC:CC
Attempting to pair with CC:CC:CC:CC:CC:CC
[CHG] Device CC:CC:CC:CC:CC:CC Connected: yes
Request confirmation
[agent] Confirm passkey 123456 (yes/no): yes
Connect to the speaker now
[bluetooth]# connect CC:CC:CC:CC:CC:CC
Attempting to connect to CC:CC:CC:CC:CC:CC
[CHG] Device CC:CC:CC:CC:CC:CC Connected: yes
Connection successful
Trust the speaker so it is automatically connected to when available
[My speaker's name]# trust CC:CC:CC:CC:CC:CC
[CHG] Device CC:CC:CC:CC:CC:CC Trusted: yes
Changing CC:CC:CC:CC:CC:CC trust succeeded
Note your bluetooth speaker's associated PulseAudio output/sink name
This can be done by calling pactl list sinks (again, should be identifiable by name and description)
$ pactl list sinks
...
Sink #2
State: RUNNING
Name: bluez_sink.CC_CC_CC_CC_CC_CC.a2dp_sink
Description: My speaker's name
...
Set up PulseAudio defaults
Identify a good volume level for your input so distortion is minimal. E.g.
pactl set-source-volume alsa_input.usb-GeneralPlus_USB_Audio_Device-00.mono-fallback 16000
Add your version of the following lines to /etc/pulse/default.pa to set up an audio loopback and ensure the correct devices (based on the names you noted above) are used by default:
### Make some devices default
set-default-sink bluez_sink.60_AB_D2_57_42_A9.a2dp_sink
set-default-source alsa_input.usb-GeneralPlus_USB_Audio_Device-00.mono-fallback
# Set up loopback
load-module module-loopback latency_msec=1
# Set input volume
set-source-volume alsa_input.usb-GeneralPlus_USB_Audio_Device-00.mono-fallback 16000

Debian Sid cannot connect to bluetooth keyboard

I am running Debian Sid with the following bluetooth-related packages installed:
blueman 2.0.4-1
bluetooth 5.43-1
bluez 5.43-1
bluez-firmware 1.2-3
firmware-misc-nonfree 20161130-2
gnome-bluetooth 3.20.1-1
I am trying to connect Microsoft Surface Ergonomic Keyboard, without much success. Any help would be appreciated! Below, please find the details about my conundrum.
gnome-bluetooth
gnome-bluetooth detects the keyboard but cannot connect to it. Upon clicking the discovered device, gnome-bluetooth quickly reverts to Not Set Up.
Sometimes, and I have yet to figure out when, gnome-bluetooth does prompt a PIN key for connection. Most of the time, the connection drops before I can type the key on the keyboard.
Rarely, gnome-bluetooth does manage to connect to the keyboard. Within a minute, however, it bugs out, rapidly going back and forth between Connected and Not Set Up.
hcitool
hcitool scan does not turn up any result, and nor does hcitool inq.
bluetoothctl
With scan on, bluetoothctl discovers the keyboard. The following errors occur, however:
Entering pair directly after discovery shows the following:
Attempting to pair with [mac address]
[CHG] Device [mac address] Connected: yes
Failed to pair: org.bluez.Error.AuthenticationFailed
[CHG] Device [mac address] Connected: no
Entering trust [mac address] before pairing results in the same error message.
Entering pairable on before pairing results in the same error message.
Entering connect [mac address] shows the following:
[CHG] Device [mac address] Connected: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device [mac address] Connected: no
Entering trust or pairable before using connect results in the same error message.
Tracing the error in syslog
This, I believe, is the relevant log:
dbus-daemon[1068]: Activating via systemd: service name='org.bluez.obex' unit='dbus-org.bluez.obex.service'
dbus-daemon[1068]: Activating via systemd failed for unit 'dbus-org.bluez.obex.service': Unit dbus-org.bluez.obex.service not found.
blueman.desktop[1381]: ERROR:dbus.connection:Exception in handler for D-bus signal:
blueman.desktop[1381]: Traceback(most recent call last):
blueman.desktop[1381]: File "/usr/lib/python3/dist-packages/dbus/connection.py", line 230, in maybe_handle_message
blueman.desktop[1381]: self._handler(*args, **kwargs)
blueman.desktop[1381]: File "/usr/lib/python3/dist-packages/blueman/bluez/PropertiesBlueZInterface.py", line 55, in wrapper
blueman.desktop[1381]: handler(name, value, **kwargs)
blueman.desktop[1381]: File "/usr/lib/python3/dist-packages/blueman/plugins/applet/GameControllerWakelock.py", line 36, in on_device_property_changed
blueman.desktop[1381]: klass = Device(path).get_properties()["Class"] & 0x1fff
blueman.desktop[1381]: KeyError: 'Class'
According to this blueman bugreport, your syslog shows a bug in the GameControllerWakelock plugin that causes blueman to crash, which is probably the reason why the GUI bugs around. You can disable that plugin, or update to a newer version of blueman to fix that. (For example by installing 2.1-alpha)
However, disabling the plugin will probably not fix your connection problems, only the GUI. The Authentification Error mentioned usually means that the PIN is wrong. The bug report also mentions that they implemented a PIN database that would probably land in 2.1, so upgrading might actually be worth a shot. If your keyboard is not yet in the PIN database, I would propose you create an issue on blueman github and talk to the guys there!
I had a similar problem, I couldn't connect it to Ubuntu 16.04.
In the end, searching and gathering different solutions I got this:
Open in terminal:
bluetoothctl
agent KeyboardDisplay
pairable on
discoverable on
scan on
(search for the MAC of your keyboard)
scan off
pair MAC:of:your:keyboard
(hopefully you will have to give the passkey that will appear in terminal. Write it and then hit the Enter key)
I hope it helps.

Siri remote (ATV4) with raspberry pi 3 bluetooth

I have a raspberry pi 3 and a 4th generation apple tv remote.
I don't understand why I am unable to see the remote when I scan with the raspberry pi using "hcitool scan" command.
I have to say that I can see other bluetooth device during the scan but never the remote.
I can see the remote when I scan with my iPhone.
My ATV4 is unplugged and i have put the remote on pair mode (menu + volume up)
What is wrong ? Thanks
I've been looking into this for a little while, and my conclusion so far is that there may be something a bit non-standard or unusual about the bluetooth in the Siri Remote / 4th generation Apple TV remote. Certainly it manages to upset LightBlue on my Mac and iPhone in slightly different ways.
If I use bluetoothctl, the remote does show up and I can connect to it (at least if I hold menu+volumeup for 5 seconds whilst bluetoothctl has discovery enabled):
root#raspberrypi:/home/pi# bluetoothctl
[NEW] Controller B8:27:EB:6C:15:98 raspberrypi [default]
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:27:EB:6C:15:98 Discovering: yes
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[NEW] Device 78:9F:70:5E:A3:14 DJ7Q6MZ9GQQT
[NEW] Device 67:8F:99:BC:EE:C5 67-8F-99-BC-EE-C5
[CHG] Device 67:8F:99:BC:EE:C5 RSSI: -64
[CHG] Device 67:8F:99:BC:EE:C5 RSSI: -44
[CHG] Device 67:8F:99:BC:EE:C5 RSSI: -64
[CHG] Device 67:8F:99:BC:EE:C5 RSSI: -44
[bluetooth]# connect 78:9F:70:5E:A3:14
Attempting to connect to 78:9F:70:5E:A3:14
[CHG] Device 78:9F:70:5E:A3:14 Connected: yes
Connection successful
[CHG] Device 78:9F:70:5E:A3:14 UUIDs:
00001800-0000-1000-8000-00805f9b34fb
00001801-0000-1000-8000-00805f9b34fb
0000180a-0000-1000-8000-00805f9b34fb
0000180f-0000-1000-8000-00805f9b34fb
00001812-0000-1000-8000-00805f9b34fb
0000181e-0000-1000-8000-00805f9b34fb
8341f2b4-c013-4f04-8197-c4cdb42e26dc
[CHG] Device 78:9F:70:5E:A3:14 Appearance: 0x03c0
[CHG] Device 78:9F:70:5E:A3:14 Modalias: bluetooth:v004Cp0266d0000

Resources