Bluetooth disconnects
|
8th Feb, 2023, 02:40 PM
Post: #1
|
|||
|
|||
Bluetooth disconnects
I am trying to use onboard BT and Wifi on my RPi3+. I am not sure if this is even possible but I believe I had it working in arch. I have a dongle (0a12:0001) but there was a bug with it at one point.
Anyhow, I have tried three different headphones with onboard BT. One works but when it stops getting any sound from Kodi for 30 seconds it disconnects. The other two I don't get any sound and I have to reboot. I don't see why one headphone would work different then the others. I used bluetoothctl to pair, connect, trust each headphone. Pulseaudio is running when I connect the headphones. The headphones will connect automatically when turned on. I added this but I'm not sure if it is needed. /etc/pulse/default.pa ### Automatically switch to newly-connected devices load-module module-switch-on-connect Any pointers? |
|||
9th Feb, 2023, 09:27 AM
Post: #2
|
|||
|
|||
RE: Bluetooth disconnects
I was able to get the dongle to work. I had a hard time getting the headphones to connect as I kept getting the HP are unavailable. I deleted the /var/lib/bluetooth directory and then restarted bluetooth and it connected but I couldn't get them trusted. I did this process a couple of times until it worked. I have to connect and then disconnect and then reconnect on reboot in order for Kodi to pipe the sound through the BT HP but they do stay connected.
|
|||
9th Feb, 2023, 02:04 PM
Post: #3
|
|||
|
|||
RE: Bluetooth disconnects
The dongle also drops the headphones except it takes a minute and a half instead of a 10 seconds of inactivity. If I keep Kodi in ALSA mode, the headphones stay connected once I run them through Kodi they will disconnect. The only thing in the Kodi log file is
Found BT Device - will adjust buffers to larger values I turned on full debug logs and it says: CLibInputHandler::DeviceRemoved - keyboard type device removed: Power Q20 Pro (AVRCP) (event1) I don't have a syslog file so I am no sure where to look. No comprehendo lol |
|||
10th Feb, 2023, 12:39 AM
Post: #4
|
|||
|
|||
RE: Bluetooth disconnects
OMG
Haven't you long suspected that something is generally wrong with your system? The various strange errors you report, that is really not normal Have you used a different power supply in the meantime? Kodi has nothing to do with Bluetooth, the message you see in the Kodi log comes from the Pulseaudio sink module. When I use bluetooth, I always use the onboard module, I don't have an external dongle at all If you want to see something in the syslog, you have to install a logger daemon additionally. I have rsyslog in use, because I log everything on a central logserver. |
|||
10th Feb, 2023, 04:34 AM
Post: #5
|
|||
|
|||
RE: Bluetooth disconnects
I installed rsyslog. If it was a power supply, I would seem to think that the BT HP would disconnect all the time like during playback. Also, if I connect the HPs when the audio output is set to PI:HDMI they don't disconnect. Not sure why the disconnect only when Kodi is set to pulseaudio and the headphones are connected.[/code]
Code: Feb 9 12:20:19 xbian kernel: [ 799.801796] input: Power Q20 Pro (AVRCP) as /devices/virtual/input/input8 |
|||
10th Feb, 2023, 06:49 AM
Post: #6
|
|||
|
|||
RE: Bluetooth disconnects
My first thought here was that this might have something to do with BT autosuspend. Two different BT adapters -> two different times until the connection is cut
I found this for example https://bugzilla.redhat.com/show_bug.cgi?id=1589548 BTW, I also have a bt keyboard that goes offline and then the whole BT stack goes crazy. since I don't really need this keyboard, it's been lying around for years without me having dealt with this problem any further. Maybe you have a similar problem. |
|||
10th Feb, 2023, 10:21 AM
Post: #7
|
|||
|
|||
RE: Bluetooth disconnects
Thanks per the links, I looked at the bus and for the BT dongle the power control was set to on. I went ahead and wrote a udev but this didn't help. I also edited the command line and added btusb.enable_autosuspend=0 and this didn't fix the issue either. I disabled CEC as I was starting to think CEC was sending a signal to disconnect the BT dvice. Didn't fix it.
These are set to auto. I edited the files and changed them to on but it didn't help. I tried with and without restarting bluetooth. ./1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/bluetooth/hci0/power/control ./1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/bluetooth/hci0/rfkill1/power/control I have tried three different headphones. Only set of HPs get passed sound. The other two don't get any sound but I can use the controls to pause and start video. These two do not disconnect. I set up the default.pa to switch to BT HPs when present. |
|||
10th Feb, 2023, 01:36 PM
Post: #8
|
|||
|
|||
RE: Bluetooth disconnects
The problem is that it creates two instance of pulseaudio. The first one won't pipe through kodi so when I go to PI:HDMI and back to Pulse it creates a second socket with a new PID that works through Kodi but it crashes when idle and naturally this disconnects my headphones.
|
|||
10th Feb, 2023, 03:29 PM
Post: #9
|
|||
|
|||
RE: Bluetooth disconnects
I'm guessing I have to wait for something else to start (pulse or bluetooth) before kodi starts?
|
|||
10th Feb, 2023, 10:13 PM
Post: #10
|
|||
|
|||
RE: Bluetooth disconnects
Honestly: you confuse me more and more, this all sounds extremely strange
How do you start Pulseaudio? Kodi only initializes Pulseaudio at startup and then never again. do you have any addon installed that is going crazy? You mentioned once in the Kodi forum the Audio Profiles addon ... |
|||
10th Feb, 2023, 10:14 PM
Post: #11
|
|||
|
|||
RE: Bluetooth disconnects
(10th Feb, 2023 01:36 PM)grandcanyon Wrote: The problem is that it creates two instance of pulseaudio. The first one won't pipe through kodi so when I go to PI:HDMI and back to Pulse it creates a second socket with a new PID that works through Kodi but it crashes when idle and naturally this disconnects my headphones. How nice that you mention such important things once in a while |
|||
11th Feb, 2023, 02:25 AM
Post: #12
|
|||
|
|||
RE: Bluetooth disconnects
(10th Feb, 2023 10:13 PM)Nachteule Wrote: Honestly: you confuse me more and more, this all sounds extremely strange It starts on boot. I don't know how it starts as I didn't write the code to start it as I'm sure someone wrote an upstart to start pulse which looks like it is in the xbmc.conf The Audio Profiles switches between PI: HDMI and Pulse like you would through the menus. I don't have any other weird addons unless Youtube is weird. (10th Feb, 2023 10:14 PM)Nachteule Wrote:(10th Feb, 2023 01:36 PM)grandcanyon Wrote: The problem is that it creates two instance of pulseaudio. The first one won't pipe through kodi so when I go to PI:HDMI and back to Pulse it creates a second socket with a new PID that works through Kodi but it crashes when idle and naturally this disconnects my headphones. Well yeah. If I would have seen that up front, I would have mentioned it. It would have saved me countless reboots and writing udev rules. |
|||
12th Feb, 2023, 04:40 AM
Post: #13
|
|||
|
|||
RE: Bluetooth disconnects
Not that I don't believe you, but I have now tested once with the Audio Profiles. After I finally understood how to handle this, I tested the following configuration back and forth:
Profile 1: switches to PI:HDMI and is automatically activated when I watch a PVR Livestream Profile 3: switches to the analog output of the Raspberry Pi via Pulseaudio and is activated on GUI Profile 4: switches automatically to my Hifiberry AMP via Pulseaudio for videos that are not in the database All this works fine as far as I can tell, there is only one Pulseaudio instance running, nothing stutters and the sound is flawless. And this on a slower Pi3 (not the + variant) where the root filesystem is on the network, which from the theory is slower than an sd card In the next few days, maybe tomorrow, I still connect my bluetooth speaker and see how it behaves with that Currently running Kodi 21 Alpha and 5.4.150 kernel, as this kernel is the last one that allows smooth playback of HEVC videos. So the first thing to do is to find out why 2 pulseaudio instances are started on your system |
|||
17th Feb, 2023, 07:18 PM
Post: #14
|
|||
|
|||
RE: Bluetooth disconnects
The problem is that bluetooth creates a new pulseaudio socket every time it connects since I am seeing a
rfcomm_bind: Address already in use so bluetooth won't bind to the existing pulseaudio socket |
|||
18th Feb, 2023, 05:28 AM
(This post was last modified: 18th Feb, 2023 05:30 AM by Nachteule.)
Post: #15
|
|||
|
|||
RE: Bluetooth disconnects
(17th Feb, 2023 07:18 PM)grandcanyon Wrote: The problem is that bluetooth creates a new pulseaudio socket every time it connects since I am seeing a I have the feeling you have completely screwed up your pulseaudio/bluetooth by now My recommendation: remove everything that has to do with pulseaudio (apt-get purge ...) and start again from scratch Make sure that the directory /home/xbian/.config/pulse and /etc/pulse do not exist anymore before you reinstall the packages After reinstall, run the following script as root: Code: #!/bin/sh This will copy daemon.conf and client.conf to the xbian user area and changes have to be made there. Making changes in the orginal conf files I don't think is a very good idea |
|||
« Next Oldest | Next Newest »
|