Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 1st June 2008, 04:07 AM
jtang613 Offline
Registered User
 
Join Date: Apr 2004
Location: Ottawa, Canada
Posts: 1,931
Bluetooth Audio with PulseAudio

This is a really nice feature to have working if you have a Bluetooth headset. Especially for watching movies or listening to music on your laptop. And lately BT under Linux has been making good progress toward becoming seamlessly integrated. Although it still requires a bit of manual configuration. Hopefully this howto will help others get BT audio up and running.

This howto should work equally well under F8 or F9. Of course, you'll need a supported Bluetooth module and BT headset. I use a Motorola S9 headset and it works great.

Some packages you should have:
Code:
yum install bluez-gnome pulseaudio-module-bluetooth bluez-utils-gstreamer bluez-utils-alsa
In order for ALSA to recognize your headset, you need to determine its device MAC address and create a ~/.asoundrc file.

To determine your headset's device MAC, turn it on and issue the command:
Code:
hcitool scan
You should see something like: 00:11:22:33:44:55. That's the MAC you need, write it down or copy to clipboard.

Next, create the file: ~/.asoundrc (in your home folder) with the following contents:
Code:
pcm.bluetooth {
	type plug
	slave {
		pcm "bluetooth_hw"
	}
}

pcm.bluetooth_hw {
	type bluetooth
	device 00:11:22:33:44:55   # Make sure you put YOUR device MAC here
	profile "auto"
}
In order to get PulseAudio to recognize your headset, you need to issue a few commands each time you power up your headset. Eventually someone will add auto-detect functionality, but for now I've just created a script that I launch whenever I want to use my headset. You can add a launcher to your panel beside the volume control for one-click-to-go. The ~/bt_snd script contains:
Code:
#!/bin/bash
pactl load-module module-alsa-sink device=bluetooth
pactl load-module module-alsa-source device=bluetooth
After powering up your headset and running the script, open the PulseAudio volume control. You should see your Bluetooth device under the Output tab. At this point, you can right-click on it to set it as Default, or right-click on individual streams to direct them to the Bluetooth output.


Hope this helps,
Jason
Attached Thumbnails
Click image for larger version

Name:	laptop3.jpg
Views:	880
Size:	51.6 KB
ID:	16251   Click image for larger version

Name:	PulseAudio.jpg
Views:	1138
Size:	36.4 KB
ID:	16252  
__________________
There is no 'CTRL' button on Chuck Norris's computer. Chuck Norris is always in control.
Reply With Quote
  #2  
Old 25th June 2008, 12:43 PM
bobyn Offline
Registered User
 
Join Date: Dec 2006
Location: Edinburgh, Scotland
Age: 30
Posts: 2
Just a quick thank you for the instructions, I got my Sony Ericsson HBH-DS980 bluetooth headsets working on F9.

I didn't use pulse before as a few of my apps (mythtv) weren't compatible, now its sorted.

Thanks again.
Reply With Quote
  #3  
Old 27th June 2008, 12:19 AM
TheTweaker Offline
Registered User
 
Join Date: Jun 2008
Posts: 1
hcid crashes

When I do this with my logitech headset and Kensington-USB bluetooth adapter, hcid segfaults when I issue the pactl commands:
Code:
hcid[29040]: segfault at 1c ip 17f4f76 sp 7fff9801b8d0 error 6 in libaudio.so[17e9000+23000]
the pulse audio daemon reports this when it happens:

Code:
ALSA lib pcm_bluetooth.c:1505:(audioservice_recv) Error receiving data from audio service: Success(0)
ALSA lib pcm_bluetooth.c:1521:(audioservice_expect) Bogus message BT_SETCONFIGURATION_REQ received while BT_SETCONFIGURATION_RSP was expected
W: alsa-util.c: Unable to determine current swparams: Operation not permitted
ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL bluetooth
pulseaudio: pcm_bluetooth.c:797: bluetooth_playback_poll_revents: Assertion `pfds[1].fd >= 0' failed.
Aborted
Any help would be great (I'm on fedora 9, x86_64).
Reply With Quote
  #4  
Old 9th July 2008, 11:50 PM
RudeBwoy Offline
Registered User
 
Join Date: Oct 2005
Location: Sosnowiec, Poland
Posts: 51
If i could make it work would be great.
I have Motorola DC800 like audio gateway. It is paired with my laptop. I am trying to issue commands
Code:
pactl load-module module-alsa-sink device=bluetooth
that you posted but i get
Code:
Failure: Module initalization failed
I have tried to do it as root, still same error. Even when i unloaded this module it still gave me same error message.
__________________
F14 x86_64
-------------------------------------------------------
http://www.michalklich.com
Emancipate yourself from mental slavery, none but ourselves can free our mind.
Bob Marley
Reply With Quote
  #5  
Old 10th July 2008, 12:04 AM
jtang613 Offline
Registered User
 
Join Date: Apr 2004
Location: Ottawa, Canada
Posts: 1,931
I've noticed similar behaviour lately.

1) It seems Bluez / Gstreamer / PulseAudio are going through some development that has affected how the module inits work. I've been able to get it to work by directly loading bluetooth_hw instead of the slave device.

2) Make sure PulseAudio has not crashed on you. Load the PulseAudio Volume Control, it will fail if the PulseAudio daemon has crashed.

3) Make sure the Bluetooth 'Audio Service' is enable in the Bluetooth Preferences dialog prior to running pactl.

- J
__________________
There is no 'CTRL' button on Chuck Norris's computer. Chuck Norris is always in control.
Reply With Quote
  #6  
Old 10th July 2008, 03:47 PM
RudeBwoy Offline
Registered User
 
Join Date: Oct 2005
Location: Sosnowiec, Poland
Posts: 51
2) Make sure PulseAudio has not crashed on you. Load the PulseAudio Volume Control, it will fail if the PulseAudio daemon has crashed.

3) Make sure the Bluetooth 'Audio Service' is enable in the Bluetooth Preferences dialog prior to running pactl.

That is done.

Frankly speaking i have no idea how to follow your suggestion in first step. Little info so i could try to do it.
__________________
F14 x86_64
-------------------------------------------------------
http://www.michalklich.com
Emancipate yourself from mental slavery, none but ourselves can free our mind.
Bob Marley
Reply With Quote
  #7  
Old 30th July 2008, 02:54 AM
yissachar Offline
Registered User
 
Join Date: Jul 2008
Posts: 2
I have the same problem as TheTweaker; my pulseaudio crashes when i try to load the modules as above. I'm running 64 bit FC9. I can't get anything to come out of the headset.
Reply With Quote
  #8  
Old 30th July 2008, 03:03 AM
jtang613 Offline
Registered User
 
Join Date: Apr 2004
Location: Ottawa, Canada
Posts: 1,931
Try using the line below with bluetooth_hw instead of just bluetooth. Recent updates to some of the Alsa / Gstreamer / etc internals seem to have botched the slave - device resolver.
Code:
pactl load-module module-alsa-sink device=bluetooth_hw
btw: Make sure The Bluetooth Audio service is running and make sure PulseAudio is running before turning on your headset AND TURN ON AND PAIR YOUR HEADSET BEFORE RUNNING PACTL.
__________________
There is no 'CTRL' button on Chuck Norris's computer. Chuck Norris is always in control.
Reply With Quote
  #9  
Old 30th July 2008, 03:10 AM
yissachar Offline
Registered User
 
Join Date: Jul 2008
Posts: 2
I tried that, and it doesn't work either The bluetooth applet (gnome) reports that it is paired, and connected. The audio service is running.
Reply With Quote
  #10  
Old 30th July 2008, 03:15 AM
jtang613 Offline
Registered User
 
Join Date: Apr 2004
Location: Ottawa, Canada
Posts: 1,931
Well, then you should report the error to the PulseAudio Bugzilla / Mailing Lists / developers . Hopefully they're already aware of the issue, but if not I'm sure it wouldn't hurt to let them know about it.
__________________
There is no 'CTRL' button on Chuck Norris's computer. Chuck Norris is always in control.
Reply With Quote
  #11  
Old 30th July 2008, 07:53 AM
RudeBwoy Offline
Registered User
 
Join Date: Oct 2005
Location: Sosnowiec, Poland
Posts: 51
I have reported this bug. Feel free to sign up https://bugzilla.redhat.com/show_bug.cgi?id=455224
__________________
F14 x86_64
-------------------------------------------------------
http://www.michalklich.com
Emancipate yourself from mental slavery, none but ourselves can free our mind.
Bob Marley
Reply With Quote
  #12  
Old 16th September 2008, 01:15 AM
giulianobr Offline
Registered User
 
Join Date: Dec 2007
Age: 31
Posts: 31
it's works just one time for me.
__________________
Giuliano Ribeiro
LG P430 i5
Fedora 16 64b
Win7 64b
Reply With Quote
  #13  
Old 19th September 2008, 09:01 PM
giulianobr Offline
Registered User
 
Join Date: Dec 2007
Age: 31
Posts: 31
please, I need run the pactl command every time I connect to my bluetooth headset??
__________________
Giuliano Ribeiro
LG P430 i5
Fedora 16 64b
Win7 64b
Reply With Quote
  #14  
Old 13th November 2008, 09:44 AM
M4rc0 Offline
Registered User
 
Join Date: Aug 2007
Location: Brasil
Posts: 471
Quote:
Originally Posted by giulianobr View Post
please, I need run the pactl command every time I connect to my bluetooth headset??
Dae

That's why he created a launcher for this
I would add in ~/.bashrc if I were you
---

Now my question, would this be so different for ALSA instead of PULSE ?
The instructions are almost the same except for the last part with pactl

Altho i tried anyway and got the following:
Quote:
Connection failure: Connection refused
On skype I get "problem with audio codec" or something.

What am I missing?

I've created a topic for this
Reply With Quote
  #15  
Old 29th December 2008, 09:15 PM
jnalley Offline
Registered User
 
Join Date: Dec 2008
Posts: 1
Arrow

Quote:
Originally Posted by jtang613 View Post
btw: Make sure The Bluetooth Audio service is running and make sure PulseAudio is running before turning on your headset AND TURN ON AND PAIR YOUR HEADSET BEFORE RUNNING PACTL.
jtang613, I'm glad you mentioned the topic of pairing. It didn't seem to be addressed in the original post in this thread. I'm trying to pair my Plantronics 510 headset with a Kensington Micro USB bluetooth dongle. My issue is that i'm not able to successfully pair in Fedora 9 but I am in that _other_ operating system. When i just use the command line to pair (as opposed to kde/gnome tools), i get the following output:

[root@jnalley ~]# hcitool cc mac_obtained_by_hcitool scan
Can't create connection: Input/output error

hcidump gives the following info for this connect attempt:
Code:
HCI sniffer - Bluetooth packet analyzer ver 1.41
device: hci0 snap_len: 1028 filter: 0xffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Role Change (0x12) plen 8
> HCI Event: Link Key Request (0x17) plen 6
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
> HCI Event: Command Complete (0x0e) plen 10
> HCI Event: Connect Complete (0x03) plen 11
Despite what that dump may lead you to believe, it never actually pairs/connects. My /etc/bluetooth/hcid.conf contains the following:

Code:
options {
        autoinit yes;
        security user;
        pairing multi;
        passkey "0000";
}

device {
        name "%h-%d";
        class 0x000100;
        iscan enable; pscan enable;
        lm accept;
        lp rswitch,hold,sniff,park;
}
I've tried security auto with no change in behavior. Any thoughts or insight are greatly appreciated.
Reply With Quote
Reply

Tags
audio, bluetooth, pulseaudio

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Fix PulseAudio and primary audio issues with Fedora 10 (F10) Silpheed2K Guides & Solutions (No Questions) 160 2nd December 2010 05:46 AM
pulseaudio multiple audio sources M4rc0 Using Fedora 9 2nd July 2009 07:25 AM
PulseAudio audio capture problem, help needed. placidrage Using Fedora 4 17th January 2009 05:03 AM
Pulseaudio makes all audio sharp harrisony Using Fedora 0 19th November 2008 11:04 PM
Pulseaudio update - missing audio device geoffc Using Fedora 10 31st January 2008 05:50 PM


Current GMT-time: 15:35 (Sunday, 23-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Kalimpang Photos on Instagram - Chernushka Photos on Instagram - Hoyland Nether Travel Photos