FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 26
  1. #1
    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 Attached Thumbnails Click image for larger version. 

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

Name:	PulseAudio.jpg 
Views:	1267 
Size:	36.4 KB 
ID:	16252  
    There is no 'CTRL' button on Chuck Norris's computer. Chuck Norris is always in control.

  2. #2
    Join Date
    Dec 2006
    Location
    Edinburgh, Scotland
    Age
    33
    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.

  3. #3
    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).

  4. #4
    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

  5. #5
    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.

  6. #6
    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

  7. #7
    Join Date
    Jul 2008
    Posts
    4
    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.

  8. #8
    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.

  9. #9
    Join Date
    Jul 2008
    Posts
    4
    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.

  10. #10
    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.

  11. #11
    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

  12. #12
    Join Date
    Dec 2007
    Age
    34
    Posts
    29
    it's works just one time for me.
    Giuliano Ribeiro
    LG P430 i5
    Fedora 16 64b
    Win7 64b

  13. #13
    Join Date
    Dec 2007
    Age
    34
    Posts
    29
    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

  14. #14
    Join Date
    Aug 2007
    Location
    Brasil
    Posts
    471
    Quote Originally Posted by giulianobr
    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:
    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

  15. #15
    Join Date
    Dec 2008
    Posts
    1

    Arrow

    Quote Originally Posted by jtang613
    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.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How to: Fix PulseAudio and primary audio issues with Fedora 10 (F10)
    By Silpheed2K in forum Guides & Solutions (Not For Questions)
    Replies: 160
    Last Post: 2nd December 2010, 05:46 AM
  2. pulseaudio multiple audio sources
    By M4rc0 in forum Using Fedora
    Replies: 9
    Last Post: 2nd July 2009, 06:25 AM
  3. PulseAudio audio capture problem, help needed.
    By placidrage in forum Using Fedora
    Replies: 4
    Last Post: 17th January 2009, 05:03 AM
  4. Pulseaudio update - missing audio device
    By geoffc in forum Using Fedora
    Replies: 10
    Last Post: 31st January 2008, 05:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •