Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bluetooth headset for skype on AMD64
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
ewg
n00b
n00b


Joined: 02 Aug 2005
Posts: 28

PostPosted: Mon Sep 22, 2008 10:51 am    Post subject: Bluetooth headset for skype on AMD64 Reply with quote

After quite some hassle, I made a combination of a Jabra BT2020 headset and a Hama Nano Bluetooth USB Adapter work on my amd64 box (Linux 2.6.25-gentoo-r7 x86_64 AuthenticAMD). Since there is quite a lot to find of information concerning this topic to find with google, and since most stuff seems obsolete, here are my experiences for anybody who might make use of them.

I started from a working bluetooth installation by upgrading to bluez-libs-3.36 and bluez-utils-3.36. First, I made sure the pairing of headset and dongle worked (btw, I have kdebluetooth-1.0_beta8 installed as passkey-agent and monitor).
Then, basically the new method for bluez>=3.16 from http://gentoo-wiki.com/HOWTO_use_a_bluetooth_headset works for me. Just follow the steps and then try to output sound to your headset using mplayer or whatever. Also try to capture audio, i.e. with arecord (see http://wiki.bluez.org/wiki/HOWTO/AudioDevices).

Some remarks:

  • Forget about the obsolete stuff. As the howto states, you don't need anything like overlays, btsco, bluetooth-alsa etc with newer versions of bluez. I just got confused by reading all that stuff and wasted much time.
  • Alsa: It works for me with the built-in kernel drivers, both static and as modules. You do not need SND_USB_AUDIO or SND_EMU10K1 as claimed on some pages. I didn't try alsa-driver; it's deprecated anyway. This is what I have in my .config now:
    Code:

    CONFIG_SND_TIMER=y
    CONFIG_SND_PCM=y
    CONFIG_SND_RAWMIDI=y
    CONFIG_SND_SEQUENCER=y
    CONFIG_SND_OSSEMUL=y
    CONFIG_SND_MIXER_OSS=y
    CONFIG_SND_PCM_OSS=y
    CONFIG_SND_PCM_OSS_PLUGINS=y
    CONFIG_SND_SEQUENCER_OSS=y
    CONFIG_SND_MPU401_UART=y
    CONFIG_SND_AC97_CODEC=y
    CONFIG_SND_ICE1724=y

  • Bluetooth kernel options: Of course you need SCO support, here are my options:
    Code:

    CONFIG_BT_L2CAP=m
    CONFIG_BT_SCO=m
    CONFIG_BT_RFCOMM=m
    CONFIG_BT_RFCOMM_TTY=y
    CONFIG_BT_HIDP=m
    CONFIG_BT_HCIUSB=m
    CONFIG_BT_HCIUSB_SCO=y

  • Skype: This was annoying - the headset worked, but not with skype. "Problem with audio playback" or "Problem with audio capture". The problem is that skype is 32bit and needs the bluetooth plugin libs under /usr/lib32/alsa-lib. But these are not yet part of emul-linux-x86-soundlibs. Luckily, I have a 32bit chroot environment. I installed bluez-3.36 inside and copied /usr/lib/alsa-lib/*bluetooth* to /usr/lib32/alsa-lib on my 64bit system. Voilà!
    If you are annoyed by skype complaining about missing ctl, add it to your ~/.asoundrc. Here is mine:
    Code:

    pcm.bt_headset {
            type bluetooth
            device xx:xx:xx:xx:xx:xx
    }
    ctl.bt_headset {
            type bluetooth
    }



TODO:
  • Pressing the hangup button on the headset does not terminate a call in skype. Anybody got this done?
Back to top
View user's profile Send private message
erikderzweite
Tux's lil' helper
Tux's lil' helper


Joined: 25 Feb 2006
Posts: 143

PostPosted: Tue Jan 13, 2009 2:44 pm    Post subject: Reply with quote

I prefer using old btsco method and it woks with newer kernels too. My patch for 2.6.28 is posted here: https://forums.gentoo.org/viewtopic-p-5384984.html#5384984
I didn't want to patch ekiga or setup 32-bit chroot just to be able to use newer method.
But the main reason is headset button: It is possible to use it with btsco and I haven't found a way to do it without btsco yet (assume there might be something relevant in dbus).
Anyway, here is my scripts for skype and ekiga (they basically do the same: if there is a call ringing — pick it up, if there is an ongoing call — drop it).
so, here is the howto:
1. modify .btscorc
Code:
AT\+CKPD=200
system python ~/ekiga-headset.py ; python ~/skype-headset.py

2. ekiga-headset.py
Code:
# -*- coding: utf-8 -*-
#!/usr/bin/python

import sys
import gobject
import dbus
import os
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
    import dbus.glib

#A Signal has been captured
def e_state_changed_callback(str, state):
    global ekiga_state, ekiga_token, ekiga_url, phone_state
    print "ekiga state changed: %s %d" % (str,state)
    ekiga_state = int(state)

    if ekiga_state in (2,3):#Disconnect ongoing call then exit
        ekiga_calls.Disconnect(test[0])
   print "disconnect"
   os._exit(99)

    elif ekiga_state == 4: #Pick up the call then exit
   ekiga_calls.Connect(test[0])
   print "connect"
   os._exit(99)

    else:#Exit, no action taken
   os._exit(99)


#D-Bus initialisation
bus = dbus.SessionBus()

#Object initialisation
ekiga_obj = bus.get_object('net.ekiga.instance', '/net/ekiga/instance')

#Interface initialisation
ekiga_calls = dbus.Interface(ekiga_obj, 'net.ekiga.calls')

#Connecting interface to dbus signal
ekiga_calls.connect_to_signal('StateChanged', e_state_changed_callback)


#checking if someone is calling or speaking
test = ekiga_calls.GetCallsList()

#Resending Signal to trigger needed action
if test:
   ekiga_calls.ResignalCallInfo(test[0])

#If there are no activity we just exit
else:
   os._exit(99)

#Main Loop This is needed to process signals from ekiga
mainloop = gobject.MainLoop()
mainloop.run()

3. skype-headset.py
Code:
# -*- coding: utf-8 -*-
#!/usr/bin/python

import sys
import Skype4Py

skype = Skype4Py.Skype()

# Attach to Skype client
skype.Attach()

# ----------------------------------------------------------------------------------------------------
# Creating instance of Skype object, assigning handler functions and attaching to Skype.
skype = Skype4Py.Skype()

#Get Information about all calls
all_calls = skype.Calls()

#filter currently ringing calls and answer them
ringing_calls = filter(lambda x: x.Status == Skype4Py.clsRinging, skype.Calls())
if ringing_calls:
  print ringing_calls
  for call in ringing_calls:
    call.Answer()
#If noone is ringing -- hang up running calls
else:
  #hang up all runnings calls
  for call in skype.ActiveCalls:
    call.Finish()


Have fun!


Last edited by erikderzweite on Tue Jan 13, 2009 5:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
erikderzweite
Tux's lil' helper
Tux's lil' helper


Joined: 25 Feb 2006
Posts: 143

PostPosted: Tue Jan 13, 2009 5:28 pm    Post subject: Reply with quote

Oh, I forget that you need Skype4Py in order to use skype python script.
You can get it here: http://sourceforge.net/project/showfiles.php?group_id=202148&package_id=240783

Download the source archive, unpack it and launch setup.py

So far I am unaware of any ebuilds for that — feel free to make some :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum