Audio and input support in KBluetooth :)

Finally, the most wanted feature has landed in KBluetooth, support for Audio!

The support is divided in 4 blocks:

  1. Pair the device
    The support for pair the devices should be working, not only for HEADSETS but for everything.
  2. Connect to the service
    KBluetooth will detect if the paired device has audio service, and connect to it.
  3. Support for PulseAudio
    PulseAudio rocks, and since it rocks it will detect and configure the new device automagically :)
  4. Support for Alsa
    Alsa is not automagical like PulseAudio, so we’ve to write a few things in a file to get it working.

Everything is done by KBluetooth but Alsa support, so I’ll explain how to get it working manually.

1-Pair it using kbluetooth-wizard (be sure that you’re using kbluetooth-wizard an not kbluetooth-inputwizard)

2-Launch kbluetooth-devicemanager, click in your headset and write somewhere the Address (XX:XX:XX:XX:XX:XX)

3-Open with your favorite editor the file ~/.asoundrc (located in your home) and add:

pcm.bluetooth {
type bluetooth
device 00:11:22:33:44:55
profile "auto"
}

4-If you want use it with Phonon, try the following configuration (is not working totally but something is something :))

pcm.softvol {
type softvol
slave {
pcm "bluetooth"
}

control {
name "SoftMaster"
card 0
}
hint {
show on
description "BlueTooth Headset"
}
}
pcm.bluetooth {
type bluetooth
device 00:11:22:33:44:55
profile "auto"
}

With this, a Bluetooth device should appear in KDE-Multimedia configuration, but as I said is not full working (If I recall correctly the output was working perfectly but not the input).

As always, the corresponding video:
Download video

Cya!

=-=-=-=-=
Powered by Blogilo

  • FloPe

    Hi,

    when can i download and test it? And where? kde-apps?

  • http://proli.net apol

    \o/

  • Dennis

    That’s great news. Though I wonder about the need to manually note the device address. Blueman-1.21 is able to figure that out on its own. Perhaps a look-see at how they do it would eliminate the need.

    • http://www.afiestas.org afiestas

      I guess they write the file I describe in the post, I’ll do more research anyway.

  • Phobeus

    Sounds great and would mean one gtk-applet less. Thanks for your work!

  • jospoortvliet

    Would automagic integration in Phonon be so hard? I’m wondering cuz I don’t want to install pulse audio and have to deal with all the crazy stuff I see people complain about all over the web – audio works perfectly for me as it is…

    • http://www.afiestas.org afiestas

      Yes, because of phonon bug(s) (workspace part, not the lib itself)

  • Framp

    I’ve just installed pulseaudio to try this but – after having managed to install pulseaudio correctly – I can’t get my paired headset to work

    It doesn’t record or play audio at all.

    By the way, thank you for working on this – KDE needs absolutely the ability to pair easily a bt headset!

    • http://www.afiestas.org afiestas

      You need at least KDE 4.4, and KBluetooth from the svn. What devices are in KDE-Multimedia systemsettings? can you give me more details? thanks!

      • http://www.facebook.com/profile.php?id=100003407031501 Jack

        csolisHi Clemej,Going through the same tgthuhos. I just installed xubuntu and so far I am enjoying it. The theme available in the iso is far better than the one available in tha basic install from repositories. I can use my netbook again, no more swap to disk.

  • Dennis

    @jospoortvliet
    I tend to agree with you. Even with the latest bluez (4.62) and pulseaudio (0.9.21) and blueman; its still not a smooth ride. I think and I am not phonon expert, the fewer layers the better. I’m sure lots of people have rave things to say about pulseaudio but my experiences with it coupled with bluetooth and kde-4.4.1 does not fit in that category.

  • Dennis

    afiestas,

    If I might ask, what version of bluez are you using and how do you have it configured?

  • Framp

    @afiestas
    Yes, I’ve installed Kbluetooth from the svn and I have a device called bluetooth (It shows up also in skype for example)
    but it doesn’t play the testing sound from the multimedia settings tab and doesn’t work at all with skype.
    It’s a Treo headset and works fine on my phone and on windows.

    The device is in the Device manager – it simply doesn’t work.
    Ah, and I don’t see extra channel on kmix, unfortunately.
    I’ve tried with gstreamer and with xine backends (and yes I’ve installed the required libs for pulseaudio)
    I’m using Arch Linux by the way.

    Now I’ve removed temporarily pulseaudio and tried to configure the headset with alsa but without success.
    As expected, I’ve a device called Bluetooth headset but I can’t select it: it’s greyed out.
    On skype I’ve a new device called softvol but, if selected, uses the pc speakers.
    No entries in kmixer too

    Thanks again for your time :)

  • Nick

    After some tinkering, I have my headset working using PA and the Gentoo kbluetooth-9999 ebuild from the KDE overlay. My mic even works in Mumble and Skype, which is awesome!

    My only issue is that I was not previously using PA, and since installing it, Phonon no longer sees my regular sound card. I can’t get KDE to output sound to my speakers now. Any ideas?

    Thanks for your hard work on this…I’ll keep playing and see what else I can break. ;)

    • http://www.afiestas.org afiestas

      Try to use Trunk 4.5 (the beta is alrady tagged iirc), that version comes with poulseaudio integration.

  • http://linuxcrunch.com zayed

    Thanks for your effort. as Phobeus said “one gtk-applet less. ” I would like to suggest to review the wizard thing in configuration the devices. I feel it is not necessary. You can put the configuration in one windows.

  • http://vladimir_prus.blogspot.com/ Vladimir Prus

    These are great news — I am surely looking forward towards smooth Bluetooth headset support.

    May I ask a few technical questions, based on the svn head state of kbluetooth:
    1. Am I right that OrgBluezAudioInterface::Connect is only called when you pair the device for the first time, and not when the device connects thereafter?
    2. If so, is this a problem? And what does that Connect call actually does? Bluez source code looks like it’s establishing AVDTP session, whatever that might be, so presumably this must be called each time a headset becomes available. On the other hand, my current manual setup appears to work without that method ever called, at least as far as dbus-monitor can tell.
    3. What magic makes the device available to pulse? All instruction I saw involve manually adding pulse sink for the new device. Is KBluetooth doing it somehow?

    Thanks,
    Volodya

    • http://www.afiestas.org afiestas

      1: Yes, then bluez will remain the settings and use the agent to give access to your device (in case that the device is not trusted)
      2: Nope, Bluez is going to handle everything for us.
      3: A Google summer of code done the last year :p, I don’t really know what black magic is done there.

  • http://code.google.com/p/libgcal-cpp christian

    Hi.
    is there any plan to support the opposite headset profile (for using pc as an handsfree device for a bluetooth phone)? cfr. http://padovan.org/blog/2010/02/handsfree-profile-into-bluez-and-ofono/

    • http://www.afiestas.org afiestas

      Step by step, but yes maybe for kde 4.6 we’ll be able to support that.

  • james

    what is the address to the svn? Spent so much time trying to install anonsvn.kde.org/home/kde/trunk/playground/network/kbluetooth/, and then became disappointed it was old

    • http://www.afiestas.org afiestas

      It is the correct url

  • Pingback: Xlinux.pl | Strona główna | Konqiklub()