Slackware-current, bluetooth headphones, and pulseaudio. Why is this working for me?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Slackware-current, bluetooth headphones, and pulseaudio. Why is this working for me?
This is an interesting post for me in that I found a workaround to my original challenges getting BT audio up for a new pair of headphones in Slackware-current. The challenge I have is I'm not %100 sure why my workaround is working and wanted to share in case anyone else can provide any thoughts or insights. If anyone has any ideas why I'm seeing this behavior in pulse please share. Thanks in advance!
So what's going on? Well, I bought a new pair of Sony 1000XM3 BT headphones and wanted to connect them to my Slackware-current ASUS UX303U laptop with a Sabarent 4.2 USB dongle. After first plugging in the USB dongle I realized that no BT unit was being detected so I rebuilt my 4.18.10 kernel with the appropriate BT drivers and Le voilą, we have BT interfaces!
Code:
bash-4.4$ lsusb | grep Blue
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Code:
bash-4.4$ lsmod | grep blue
bluetooth 401408 59 btrtl,btintel,btbcm,btusb,rfcomm
ecdh_generic 24576 3 bluetooth
rfkill 24576 7 asus_wmi,bluetooth,cfg80211
Now came, pairing and connecting the BT audio unit. I choose to do this via gui in XFCE using the Blueman-applet 2.0.7. Simple enough I loaded up XFCE 4.12, clicked on Blueman, "setup new device" then began the pairing process. Here is where things started to get a little interesting... The headphones were discovered and paired successfully, however they would not "connect". Instead I got this error in Blueman when attempting to connect...
Quote:
Connection Failed: blueman bluez.errors DBusFailedError: Protocol not available
After seeing this I started to take a look at the BT configs, google my ass off, then start to look into the connection between Blueman and Pulse.
I noticed something a little interesting. The bluetooth modules listed in default.pa where not loading on boot. When using pactl list to query loaded modules nothing was returned even though pulse was showing as running using ps -aux under process 1741.
One of the things that was nagging me, but I'm not sure if it's related to the issue is the fact that the system loaded pulse-audio is loaded with the
Quote:
--disallow-module-loading
option. I've been wondering if this has anything to do with the fact that the BT modules listed in default.pa aren't showing. Maybe someone can help me here?
Anyway, next I tried to kill pulseaudio (-k) and restart from command-line (this also works without killing the original instance and just starting a new pulse process) to see if that would provide any additional insights. A few interesting things happened here.. First upon restart I got an ofono error (though the service did restart fine).
Code:
bash-4.4$ sudo pulseaudio
E: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Now we see a new instance of pulse as process 27233. Is 1741 the instance of pulse called during boot? If so, why doesn't it load modules? hmmm
But more importantly the Pulse audio bluetooth modules seem to correctly load after the manual (re)load at bash.
Code:
bash-4.4$ sudo pactl list | grep blue
Name: module-bluetooth-policy
module.description = "Policy module to make using bluetooth devices out-of-the-box easier"
Name: module-bluetooth-discover
Name: module-bluez5-discover
With the BT modules now up I can access pavucontrol and notice that my headphones are now listed as an output option. Upon using mplayer to play an MP3 and chrome/ffox to load a youtube video and I can now verify that audio is working through my bluetooth headset. Even though it is working I have many lingering questions..
Why does Slackware not start pulse with modules loaded? Is this specific to my setup or have others dealt with this?
What is the orfono error?
Is the "Connection Failed: blueman bluez.errors DBusFailedError: Protocol not available" error because blueman relies on pulse to provide the modules needed to load the BT device as a handset?
Does "--disallow-module-loading" have anything to do with requireing another instance of pulse to be run?
How can I best automate this?
What am I missing? pulse is a newer sound system for me so I'm just looking to learn so if there is a question I should be asking, lemme know.
Thanks in advance for anyone who wants to dive in and help me understand what's going on!
Regards,
AP
--------------------
** default.pa **
Code:
bash-4.4$ cat /etc/pulse/default.pa
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)
#
# this file sits in /etc/pulse/ directory
.fail
### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties
### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available
### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
### ADDED BY POOH to try and correct pulse auto detect issue
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif
### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv
### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams
### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink
### Honour intended role device property
load-module module-intended-roles
### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle
### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
### Enable positioned event sounds
load-module module-position-event-sounds
### Cork music/video streams when a phone stream is active
load-module module-role-cork
### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply
### Make some devices default
#set-default-sink output
#set-default-source input
First, Pulseaudio is a piece of SW (in my opinion it should be called incomplete&unstable work/crap) that you need to treat with respect, be happy that it works and never ask why. If you're a patient person and have plenty of time to waste, you can try to make some sense of this official "documentation", that's what they call it: https://www.freedesktop.org/wiki/Sof...Documentation/
In addition, this is the unofficial one and maybe a little more comprehensive: https://gavv.github.io/articles/puls...nder-the-hood/
Back to your questions, I'm still using pulseaudio 9, the last one I was happy with, and I also noticed that I was not able to load modules, although the option allow-module-loading from /etc/pulse/daemon.conf should have been active (yes) by default. I went on and copied that option and removed the comment - ;
/etc/pulse/daemon.conf
These records will also "automate" the loading of the modules.
Besides, off the record, just to give you an example, I'm still failing to make pulseaudio work over the network.
The official "documentation" recommends to use:
I'm reading this while waiting on laptop to finish upgrading to -current, to see if that would fix this same issue. Something must have happened, because my sen.hd1 headphones have been working fine on that laptop under 14.2--but I do keep up with patches and kernel changes, but not which one precisely caused the change to where I get the same Dbus Service Unknown error when trying to connect to paired headset. I'm glad this thread has suggested something if I'm still getting the error when I try in -current, in a few minutes, when it's through upgrading.
current didn't fix it: got a message when starting x: failed to apply network settings; You might not be able to connect to the bluetooth network via this machine; Exception: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
I made abga's changes to daemon.conf and default.pa, but still BT headphones still failed.
Your DBus error seems to be related to the bluetooth network functionality and not to the audio. For further investigation you'll need to generate a DBus log and check which component is not properly loading, throwing the "well-known core error":
Quote:
Exception: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
Now, DBus is launched in /etc/rc.d/rc.messagebus with the output directed to /dev/null
Code:
/usr/bin/dbus-daemon --system 1> /dev/null
And you'll need to temporarily direct it to a log file and study it.
Some references (skip to the last part of the post - there are a lot of stupid log paste sections in the beginning): https://github.com/blueman-project/blueman/issues/190
Back to the audio functionality, please post the outputs of:
Code:
/usr/bin/pactl list sources short
/usr/bin/pactl list sinks short
/usr/bin/pactl list cards
E: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Having exactly the same issues as OP with my Sony bluetooth headphones.
4.19.14 kernel on -current
Exactly same error logs as well.
EDIT: After adding the modules in the abga's #2 post into default.pa nothing worked but after I ran "updatedb" I could suddenly connect via bluetoothctl ..... This makes no sense to me at all. I must have fixed it another way
EDIT: After adding the modules in the abga's #2 post into default.pa nothing worked but after I ran "updatedb" I could suddenly connect via bluetoothctl ..... This makes no sense to me at all. I must have fixed it another way
You always need to restart pulseaudio after changing its config.
@alex.pujols
Had a short search on the web after your error:
Code:
E: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
I have the same issue, with Bose QC35 IIs on Arch Linux. I feel like I have tried everything I have read about this, and hardly anywhere do I see the `backend-ofono.c` error. A lot of people with similar issues seem to downgrade various packages (bluez 4 and pulseaudio 9 for example), which is something I am not really interested in doing. I really want to figure out why this is happening before trying to work around it, assuming it can't be fixed.
My bluetooth headphones pair and connect perfectly, but they do not show up as an output device in `pavucontrol`, nor do they show as a sink in `pacmd list-sinks`.
Edit: I forgot to mention I also tried installed `ofono` itself, which felt weird because it doesn't seem like it should have anything to do with this.
Last edited by rosshadden; 02-27-2019 at 05:23 PM.
Reason: additional information
No, Richard. This article, like most I have found, assumes that the headphones show up as an audio sink to begin with. Mine connects perfectly fine through bluetoothctl, but it never shows up as an audio output device. I tried connecting to it with Blueman based on the article and it didn't work when I tried to connect to it as an Audio Sink. The error it gives is a general one with no helpful details within, even in the stacktrace.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.