# bluetooth headset [05.05 updated !!!]

## hothead

Please get updated ebuilds from the bugtracker: https://bugs.gentoo.org/show_bug.cgi?id=91558

In cvs things can change quickly. If you have problems with the cvs ebuilds please report this to the bugtracker. 

I've added an iniscript that  should manage the headset connection.

Make your bluetooth headset running with linux

I commited a bug report with non-cvs ebuilds for btsco & bluetooth-alsa.

You have to place the sources manually into $DISTDIR before generating the digest.

You may also create your own snapshot from cvs and place it into $DISTDIR.

https://bugs.gentoo.org/show_bug.cgi?id=91558

In remote future bluetooth-alsa and btsco may be added to portage.

05.05.2004

Complete rewrite of the bluetooth-alsa ebuild 

The output of the bluetooth-alsa ebuild should be more clear now. Please test it.

bluetooth-alsa-cvs-1.6-r2.ebuild

```
# Copyright 1999-2004 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: $

ECVS_SERVER="cvs.sourceforge.net:/cvsroot/bluetooth-alsa"

ECVS_MODULE="btsco/kernel"

inherit cvs linux-mod

IUSE=""

DESCRIPTION="ALSA bluetooth headset driver [snd-bt-sco.ko]."

HOMEPAGE="http://bluetooth-alsa.sourceforge.net"

SRC_URI=""

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86"

S="${WORKDIR}/${ECVS_MODULE}"

DEPEND="virtual/alsa

   virtual/linux-sources"

general_info(){

   echo 

   ewarn "The kernel source needs to be configured and installed with BT_SCO and SND_HWDEP enabled."

   echo

   einfo "BT_SCO can be found under:"

   einfo "Device drivers -> Net. support -> Bluetooth subs. support -> SCO links support"

   echo

   einfo "If you have a usb bluetooth dongle you must also enable BT_HCIUSB_SCO:"

   einfo "Device drivers -> Net. support -> Bluetooth subs. support -> HCI USB driver -> SCO support"

   echo

   einfo "SND_HWDEP depends on special ALSA sound drivers"

   einfo "You can either choose the Tascam usb sound driver 'SND_USB_USX2Y'"

   einfo "or the soundblaster live driver 'SND_EMU10K1'."   

   echo 

   [ $DIE = true ] && die

   exit 1

}

choose_kernel(){

   echo

   echo "Proceed with enter to compile against running kernel."

   echo -n "You may also enter a different kernel version or type 'info' to get general information: "

   read KVERSION

   echo

   

   DIE="false"

   if [ -z $KVERSION ]; then

      if kernel_is 2 4; then 

         eerror "You need a 2.6.x series kernel" && DIE="true"

       else

         MODDIR="/lib/modules/$(uname -r)"

      fi

    else

      if  [ $KVERSION = info ]; then

         general_info

      elif  echo $KVERSION | grep ^2.6.* >/dev/null; then

         MODDIR="/lib/modules/${KVERSION}"

      elif echo $KVERSION | grep ^2.4.* >/dev/null; then

         eerror "You need a 2.6.x series kernel" && DIE="true"    

      else   

         eerror "$KVERSION is not a valid kernel version." && DIE="true"

      fi

   fi

   

   [ $DIE = true ] && general_info

   DIE="false"

   KSYMDIR="${MODDIR}/source"

   NEEDED_OPTIONS="BT_SCO SND_HWDEP"

   

   if [ ! -e ${MODDIR}/source/.config ]; then

      eerror "Either ${MODDIR} does not exist"

      eerror "or the symlink ${KSYMDIR} does not point to the kernel source"

      eerror "or the kernel souce is not properly configured" 

      einfo "Check this and if needed recompile your kernel with $NEEDED_OPTIONS enabled"

      DIE="true"

   fi

   [ $DIE = true ] && general_info

   DIE="false"

   for OPTION in $NEEDED_OPTIONS

    do

      if ! cat ${KSYMDIR}/.config | grep $OPTION | egrep -v ^# >/dev/null; then

         eerror "CONFIG_${OPTION} is not enabled." && DIE="true"

      fi

   done

   

   [ $DIE = true ] && general_info

}

pkg_setup() {

   choose_kernel

}

src_unpack() {

   cvs_src_unpack

}

src_compile() {

   set_arch_to_kernel

   make -C ${KSYMDIR} M=$(pwd) modules

}

src_install() {

   insinto ${MODDIR}/extra

   doins snd-bt-sco.ko   

}

pkg_postinst() {

   echo

   einfo "Running modules-update"

   /usr/sbin/update-modules   

}
```

04.05.2005

Split the ebuild into two 

btsco-cvs-0.4a.ebuild -> installs btsco & btsco2

```
# Copyright 1999-2004 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: $

ECVS_SERVER="cvs.sourceforge.net:/cvsroot/bluetooth-alsa"

ECVS_MODULE="btsco"

inherit eutils cvs

S="${WORKDIR}/${ECVS_MODULE}"

IUSE=""

DESCRIPTION="Userspace programm for connection a bluetooth headset to alsa."

HOMEPAGE="http://bluetooth-alsa.sourceforge.net"

SRC_URI=""

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86"

DEPEND="bluez-libs

        media-libs/libao"

src_unpack() {

        cvs_src_unpack

}

src_compile() {

        ./bootstrap

        ./configure

        make

}

src_install() {

        dobin btsco btsco2

        dodoc COPYING INSTALL README ChangeLog

}
```

bluetooth-alsa-cvs-1.6.ebuild -> only installs the kernel driver (snd-bt-sco.ko)

```
# Copyright 1999-2004 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: $

ECVS_SERVER="cvs.sourceforge.net:/cvsroot/bluetooth-alsa"

ECVS_MODULE="btsco/kernel"

inherit eutils cvs kernel-mod linux-info

IUSE=""

DESCRIPTION="ALSA bluetooth headset driver [snd-bt-sco.ko]."

HOMEPAGE="http://bluetooth-alsa.sourceforge.net"

SRC_URI=""

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86"

S="${WORKDIR}/${ECVS_MODULE}"

DEPEND="virtual/alsa

        virtual/linux-sources"

kernel_check() {

        echo

        echo -n "Compile against current kernel? [yes|no]: "

        read CURRENT

        if [ $CURRENT = yes ]; then

                KVERSION=${KV}; else

                echo -n "Enter the kernel version: "

                read KVERSION

        fi

                einfo "Checking kernel configuration."

                        if [ -e /lib/modules/${KVERSION} ]; then

                                if [ -e /lib/modules/${KVERSION}/kernel/sound/usb/usx2y/snd-usb-usx2y.ko ] &&\

                                        [ -e /lib/modules/${KVERSION}/kernel/net/bluetooth/sco.ko ]; then

                                        einfo "Kernel check was successfull."; else

                                                if [ ! -e /lib/modules/${KV}/kernel/sound/usb/usx2y/snd-usb-usx2y.ko ]; then

                                                        KCONFIG1="SND_USB_USX2Y" && eerror "Module snd-usb-usx2y.ko not found."

                                                fi

                                                if [ ! -e /lib/modules/${KV}/kernel/net/bluetooth/sco.ko ]; then

                                                        KCONFIG2="BT_HCI_SCO" && eerror "Module sco.ko not found."

                                                fi

                                        einfo "Recompile your kernel with ${KCONFIG1}=m ${KCONFIG2}=m enabled"

                                        die "missing modules"

                                fi; else

                                        eerror "/lib/modules/${KVERSION} does not exist."

                                        die "cannot find modules directory"

                        fi

}

pkg_setup() {

        kernel_check

}

src_unpack() {

        cvs_src_unpack

}

src_compile() {

        set_arch_to_kernel

        make -C /lib/modules/${KVERSION}/source M=$(pwd) modules

}

src_install() {

        insinto /lib/modules/${KVERSION}/extra

        doins snd-bt-sco.ko

}

pkg_postinst_kmod() {

        echo

        einfo "Running modules-update"

        /usr/sbin/update-modules

}
```

01.05.2005

updated ebuild to install btsco2 btsco-cvs-0.4-r2.ebuild

31.03.2005

Adapt ebuild version number to the actual btsco version 

To avoid confusion in the naming of the ebuild and the btsco version 

I took the decision to adapt the ebuild version to the btsco version.

So the latest version is now 0.4-r1 not 0.5:

btsco-cvs-0.4-r1.ebuild

If the server is down you can copy and paste the code from site four of this thread.

New feature - not yet documented

You are now able to invoke a programm / function with 

the connect button of the headset. Will write more about it 

if I have tested it. For more Information see: http://sourceforge.net/mailarchive/message.php?msg_id=11151435

30.03.2005

Behaviour of btsco changed slightly

You get all features of btsco with btsco -h

You have to use the verbose parameter -v if you want to get some debug information displayed. 

If you don't send any sound information to your headset you will not be able to change the volume. 

You can only change the volume when the headset is receiving something.

If you change the volume when the headset is receiving something the volume beep should increase or decrease. 

It also seems to me that the headset is now always disconnected/idle when you don't send anything to it

(there is no noise) but get's automatically connected when it is receiving something. Seems to me that the connect button

is not any longer required.

18.02.2005 03:41 

New btsco ebuild  :Exclamation:  :Exclamation:  :Exclamation: 

The kernel patch is no longer needed.

btsco-cvs-0.5 contains the snd-bt-sco module and the btsco usespace programm. 

It is testet with vanilla-sources [2.6.11]

Version 0.5 has some small fixes.

http://www.hotheads.de/linux/ebuilds/usr/net-wireless/btsco-cvs/btsco-cvs-0.5.ebuild

Version 0.4 no longer checks the kernel configuration but looks for the dependend modules

in the module directory you can choose. Of cause the appropriate sources have to be installed.

http://www.hotheads.de/linux/ebuilds/usr/net-wireless/btsco-cvs/btsco-cvs-0.4.ebuild

New project homepage

The bluetooth-alsa project has a new project homepage:

http://bluetooth-alsa.sourceforge.net

Patch the kernel

You can either use my ebuild that uses 

gentoo-dev-sources-2.6.8-r10 and applies the patch for you or you can patch your kernel manually. There are two pathes. One that was generated from cvs against gentoo-dev-sources-2.6.8-r8 and should work with vanilla-kernel up to 2.6.8.1 and the gentoo-dev-sources 2.6.8-x. And a patch for the 2.6.9 kernel which was generated from cvs against gentoo-dev-sources-2.6.9-r1.

 bluealsa-sources 

Get the ebuild from: www.hotheads.de/files/ebuilds/bluealsa-sources-2.6.8-r10.ebuild

Place the ebuild in your PORTAGE_OVERLAY generate the digest and emerge it -> If you don't know how to add ebuilds to your PORTAGE_OVERLAY. 

Look at the passage "The userspace program" for details. If that doesn't fit your needs, take a look at the portage manpage and the file /etc/make.conf.example.

 Patch the kernel manually

Fetch the bluetooth-alsa patch:

kernel 2.6.8 www.hotheads.de/files/patches/bluetooth-alsa-17-10-2004.patch

kernel 2.6.9 www.hotheads.de/files/patches/bluetooth-alsa-2.6.9.patch

Patch your kernel sources

```
# cd /usr/src/linux

# cat /path/to/the/patch/name_of_the_patch.patch | patch -p1
```

Reconfigure & recompile the kernel

enable sco voice support

```
Networking support -> [M/Y] Bluetooth subsystem support -> Bluetooth device drivers -> [M/Y] HCI USB driver -> [Y] SCO (voice) support
```

enable the bluetooth alsa driver as module 

```
Sound -> Advanced Linux Sound Architecture -> ALSA Bluetooth device -> [M] USB Bluetooth Alsa driver
```

To verify your settings. You should see the following output: 

```
# cat .config | grep SCO

CONFIG_BT_SCO=m

CONFIG_BT_HCIUSB_SCO=y

CONFIG_SND_BT_SCO=m
```

Recompile and reboot into the recompiled kernel.

The userspace program

Get the ebuild for btsco: www.hotheads.de/files/ebuilds/btsco-cvs-0.1.ebuild

copy the ebuild to your PORTAGE_OVERLAY

```
# cp btsco-cvs-0.1.ebuild PORTAGE_OVERLAY/net-wireless/btsco-cvs/
```

generate the digest 

```
# ebuild btsco-cvs-0.1.ebuild digest 
```

add btsco-cvs to package.keywords

```
# echo net-wireless/btsco-cvs ~x86 >> /etc/portage/package.keywords
```

emerge btsco-cvs

```
# emerge btsco-cvs
```

Modify modules

Set the the sound-cards limit in /etc/modules.d/alsa to 2 

```
snd card_limit=2
```

Run update-modules and restart alsasound. 

```
# /etc/init.d/alsasound restart
```

Find the appropriate settings for your headset

First you need to load the bluetooth alsa kernel module from your patched kernel:

```
# modprobe snd-bt-sco
```

To be able to connect to your headset you have to put your bluetooth headset into discovery mode.

To find out the address of your headset use the hcitool which is part of  the bluez-utils package:

```
hcitool scan 
```

The hcitool is part of bluez-utils. Next setting you have to find out is the channel of the headset:

```
 sdptool search --bdaddr <baddr> 0x1108
```

where <baddr> is the adress of the headset. 

In order to be able to connect to your headset you must have the sdp server running. The sdp server is started by the bluetooth init-script which is part of the bluez-utils package. 

```
# /etc/init.d/bluetooth start
```

Next you have to start kdebluetooth (I think it should also work with the gnome bluetooth daemon) daemon. As far as I realized it, kdebluetooth is neccessary for the pairing (autentification) of the headset.

Then you can connect to your headset with btsco.

```
btsco <bdaddr> [channel]
```

press the connect button on your headset and your headset should be connected. You will be asked once to enter the PIN of your headset.The kbluetoothd tray icon should blink while connecting and should be bright colored when pairing was sucessfully. 

Test the headset

Open xmms, choose ALSA as output plugin, configure the ALSA output plugin to use the BT Headset as output and play a sound file.

You can control the loudness with the loudness buttons on  the headset. 

 Connect with one click

In order to be able to connect/disconnect to your headset from the controlpanel you have to do the following:

modify '/etc/sudoers' to be able to load and unload modules as well as starting a program in daemon mode as user without entering password: 

```
# echo "username hostname = NOPASSWD:/sbin/modprobe,/sbin/rmmod,/sbin/start-stop-daemon" >> /etc/sudoers
```

Here are two sample skripts you can use to connect to your headset:

connect 

```
#!/bin/bash

if (lsmod | grep snd_bt_sco) >/dev/null

then 

sudo /sbin/start-stop-daemon --start --background --chuid username --exec /usr/bin/btsco -- <bdaddr> [channel]

else

sudo /sbin/modprobe snd-bt-sco

sleep 2

sudo /sbin/start-stop-daemon --start --background --chuid username --exec /usr/bin/btsco --  <bdaddr> [channel]

fi
```

username should be set to your username, <bdaddr> is the address of your headset and [channel] is the channel of your headset -> look at the settings passage.

disconnect

```
#!/bin/bash

if ( ps -u ruben | grep btsco ) >/dev/null

then 

pkill -KILL btsco

sudo /sbin/rmmod snd-bt-sco

sudo /sbin/rmmod snd-hwdep

sudo /sbin/rmmod sco

else

sudo /sbin/rmmod snd-bt-sco

sudo /sbin/rmmod snd-hwdep

sudo /sbin/rmmod sco

fi
```

To use your headset in skype just choose dsp1 in the sound settings.

If it works - happy skyping!

Report your experience with this howto please!

 If it doesn't work

If it doesn't work, please first check if it wasn't your slackness. Following are my kernel messages you can compare with your own. 

It may be interesting what headset and USB dongle I use:

Headset www.reichelt.de Art:HS-808

Dongle http://www.allnet.de/product_info_allnet.php?cPath=_&products_id=22844

As harware does not always correspond 100% to protocol standards, it may be that your hardware isn't working yet. 

Please supply the developers with information regarding your harware and malfunctions. 

Therefore you have to suscribe to the snd-bt-sco list. http://www.gargan.org/cgi-bin/list/0/

Error Checking

1. Make shure you have alsasound running.

```
# /etc/init.d/alsasound start
```

2. Make shure you have bluetooth running - it ist part of bluez-utils. 

```
# /etc/init.d/bluetooth start
```

3. Take a look at the output of lsmod, dmesg and the btsco program.

lsmod

The following modules should be loaded when you have inserted your bluetooth dongle and have loaded the snd-bt-sco driver.

```
Module                  Size  Used by

sco                    14916  0

snd_bt_sco             13664  1

snd_hwdep               9476  2 snd_bt_sco

rfcomm                 39068  11

hci_usb                13696  6

l2cap                  25540  7 rfcomm

bluetooth              49156  14 sco,rfcomm,hci_usb,l2cap

```

dmesg

inserting usb-dongle:

```
usb 2-2.2: new full speed USB device using address 8

Bluetooth: Core ver 2.6

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: HCI USB driver ver 2.7

usbcore: registered new driver hci_usb

Bluetooth: L2CAP ver 2.3

Bluetooth: L2CAP socket layer initialized

Bluetooth: RFCOMM ver 1.3

Bluetooth: RFCOMM socket layer initialized

Bluetooth: RFCOMM TTY layer initialized
```

loading snd-bt-sco driver:

```
snd-bt-sco revision 1.3 $

snd-bt-sco: snd-bt-scod thread starting
```

after connecting with btsco and pressing the connect button:

```
Bluetooth: SCO (Voice Link) ver 0.3

Bluetooth: SCO socket layer initialized
```

btsco

```
bash-2.05b$ btsco 00:0d:b5:80:21:04 1

Device is 1:0

Voice setting: 0x0060

RFCOMM channel connected

recieved AT+CKPD=200  #detecting the pushed connect button of the headset

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=07

Sending up speaker change 7
```

Ruben

----------

## Wishmaster

Hi!

Thanks for your howto. But I've a problem with:

```

obi btsco-cvs # btsco 00:0E:07:4F:A9:06 1

Error: hwdep next device (hw:0): Operation not permitted

Error: control open (hw:1): No such file or directory

Error: Can't find device. Bail

```

Everything before works fine. Do you have an idea?

[EDIT]

Ah, I've forgotten to load the module. After loading it, everything seems to work. The test with xmms was successful, but I've not tested it with skype yet.

Again, thx a lot for your great tutorial!

[/EDIT]

bye,

Wishmaster

P.S.: Just a little hint: "options snd cards_limit=2".  :Wink: 

----------

## masterbrian

First of all thank you for your howto.

I'm trying to make this thing work from some time, but without success.

BTW, I've followed step by step your guide but I have always the same result.

I can connect to the headset, change volume with alsamixer, but I can't hear anything  :Sad: 

Can you please help me?

THank you.

----------

## Deathwing00

Moved from Multimedia.

----------

## hothead

@masterbrian

Do you have tried to playback music from xmms to the headset?

Have you pushed the connect button of the headset after running btsco?

Ruben

----------

## masterbrian

@HotHead/Ruben

Yes, I've tryed. I've disabled artsd (I'm using kde), then I've started xmms, configured alsa as sound server and the Headset as "sound card". When I press play over xmms, it freeze. 

Same thing with aplay -D plughw:Headset file.wav.

When I've linked my gentoo-box with my headset with btsco I've pressed the connect button over headset for a while, but anything changes.

I'm running the same kernel as your, gentoo-dev-sources-2.6.8-r3

Can you please post your hcid.conf and pin_helper pls? Also one Lsmod would be usefull  :Wink: 

Thank you.

----------

## dreadhead

When I try to connect my headset I always get an Authentication Error.

I tried the following things:

```
# hcitool cc 00:0D:44:01:93:6D 

 Can't create connection: Input/output error 

 # hidd --connect 00:0D:44:01:93:6D 

 Can't create HID control channel: Permission denied 

 # sdptool search --bdaddr 00:0D:44:01:93:6D 0x1108 

 Class 0x1108 

 Failed to connect to SDP server on 00:0D:44:01:93:6D: Permission denied
```

I also get a popup with the message:

"Problem connecting with Logitech HS01. Authentication error" 

I enabled authentication in hcid.conf and changed pin_helper tu kbluebin. (I also tried it with the standard helper)

My Bluetooth-keyboard and Mouse work fine. Any ideas what I made wrong?

Thanks!

dreadhead

----------

## hothead

HOWTO UPDATED

@masterbrain

If you have configured your kernel as I described it everything should be fine. The module snd-bt-sco automatically loads the depending modules.

Modules

```
Module                  Size  Used by

sco                    14916  0

snd_bt_sco             13664  1

snd_hwdep               9476  2 snd_bt_sco

rfcomm                 39068  11

hci_usb                13696  6

l2cap                  25540  7 rfcomm

bluetooth              49156  14 sco,rfcomm,hci_usb,l2cap

```

Messages

inserting usb-dongle:

```
usb 2-2.2: new full speed USB device using address 8

Bluetooth: Core ver 2.6

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: HCI USB driver ver 2.7

usbcore: registered new driver hci_usb

Bluetooth: L2CAP ver 2.3

Bluetooth: L2CAP socket layer initialized

Bluetooth: RFCOMM ver 1.3

Bluetooth: RFCOMM socket layer initialized

Bluetooth: RFCOMM TTY layer initialized
```

loading snd-bt-sco driver:

```
snd-bt-sco revision 1.3 $

snd-bt-sco: snd-bt-scod thread starting
```

after connecting with btsco and pressing the connect button:

```
Bluetooth: SCO (Voice Link) ver 0.3

Bluetooth: SCO socket layer initialized
```

Output of btsco

```
bash-2.05b$ btsco 00:0d:b5:80:21:04 1

Device is 1:0

Voice setting: 0x0060

RFCOMM channel connected

recieved AT+CKPD=200  #detecting the pushed connect button of the headset

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=07

Sending up speaker change 7
```

@ dreadhead

OK that means you haven't got the sdp server running.

You have to emerge bluez-utils that contains the sdp server:

```
# emerge bluez-utils 
```

then you have to start the bluetooth init script that loads the sdp server:

```
# /etc/init.d/bluetooth start 
```

Ruben

----------

## riksta

 *dreadhead wrote:*   

> When I try to connect my headset I always get an Authentication Error.
> 
> I tried the following things:
> 
> ```
> ...

 

I think you need to bond your pc and device together first, so they have a trust

----------

## riksta

Hi there, i have been trying to edit the patch to apply it to my

2.6.9-gentoo-r1 kernel, but i am having some issues, mainly that

sndmagic.h appears to no longer exist!

Can anyone provide a solution, or has anyone hacked up a patch for

2.6.9 that they could kindly send to me?

Thanks

Rick

----------

## masterbrian

@hothead 

 *hothead wrote:*   

> 
> 
> Output of btsco
> 
> ```
> ...

 

Great! Here it is the problem: when I start btsco I get only until RFCOMM channel connected and anything else.

If I speaker up from computer I see that the dongle works, but if I press any buttons over the headset anything changes. I'm pretty sure that must be a problem in hcid.conf or pin_helper.

Can you please post them?

Thank you

----------

## masterbrian

 *riksta wrote:*   

> I think you need to bond your pc and device together first, so they have a trust

 

How did you bond devices? With kbluepin? witch pin_helper? 

Thank you

----------

## hothead

@riksta

Sorry but I don't know a workarround jet for the 2.6.9 Kernel. The changed something in the bluetooth subsystem so this patch doesn't work. Maybe you contact the developers.  http://www.gargan.org/cgi-bin/list/0/

-> I saw that someone already did - maybe that's you.

@masterbrain

As I described: You have to push the connect button of the headset to connect. -> see my commenct at the output of btsco. 

Maybe it's the version of kdebluetooth. I  currently use: 

```
net-wireless/kdebluetooth-0.0.20040824
```

I haven't modified anything than the PIN Helper. When you start kbluetoothd the first time you get a message to replace the pin helper - so I did.

But did not know the andvantage of this change - do you? For me it works for both PIN-Helpers - bluepin and the newer pinhelper.  I was asked only once to enter the pin of the headset.

Here is my configuration of the confirmation part of kdebluetooth :

Confirmation

```
Service |  Device  |  Adresse               |  Policy

*       |   BT808  |  00:0D:B5:80:21:04     |  allow
```

hci.conf

```
#

# HCI daemon configuration file.

#

# $Id: hcid.conf,v 1.4 2004/04/29 20:14:21 holtmann Exp $

#

# HCId options

options {

        # Automatically initialize new devices

        autoinit yes;

        # Security Manager mode

        #   none - Security manager disabled

        #   auto - Use local PIN for incoming connections

        #   user - Always ask user for a PIN

        #

        security auto;

        # Pairing mode

        #   none  - Pairing disabled

        #   multi - Allow pairing with already paired devices

        #   once  - Pair once and deny successive attempts

        pairing multi;

        # PIN helper

        #pin_helper /usr/bin/bluepin;

        pin_helper /etc/bluetooth/pin-helper;

        # D-Bus PIN helper

        #dbus_pin_helper;

}

# Default settings for HCI devices

device {

        # Local device name

        #   %d - device id

        #   %h - host name

        name "BlueZ (%d)";

        # Local device class

        class 0x100;

        # Default packet type

        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan

        iscan enable; pscan enable;

# Default link mode

        #   none   - no specific policy

        #   accept - always accept incoming connections

        #   master - become master on incoming connections,

        #            deny role switch on outgoing connections

        #

        #lm accept,master;

        #

        lm accept;

        # Default link policy

        #   none    - no specific policy

        #   rswitch - allow role switch

        #   hold    - allow hold mode

        #   sniff   - allow sniff mode

        #   park    - allow park mode

        #

        #lp hold,sniff;

        #

        lp rswitch,hold,sniff,park;

        # Authentication and Encryption

        #auth enable;

        #encrypt enable;

}
```

hope this helps!

Ruben

----------

## riksta

Hi hothead, thanks for the reply.

Yeah that was me that has contacted the developers... i'll try and keep this thread informed of what is going on

Rick

----------

## dreadhead

@ hotgead:

My sdp-server is already running. It changes nothing...

```
# ps xa | grep sdp

 5359 ?        Ss     0:00 /usr/sbin/sdpd
```

@ riska:

How should I bind pc and device?

----------

## riksta

 *dreadhead wrote:*   

> 
> 
> @ riska:
> 
> How should I bind pc and device?

 

Well, on my Sony Ericsson P800, i go to the bluetooth section, search for devices, and then choose my PC and "add" it, then it asks me to enter a PIN, then you will see that the kbluepin will pop up on the PC, where you should enter the same pin that you typed onto the phone

----------

## riksta

well, i got it working on 2.6.9

but i have a sony ericsson p800, and that has an audio gateway, rather than a headset its self.

the p800 dobviously doesn't have a connect button like the headset, so what do i do? :S

Rick

----------

## dreadhead

I have to press the headsets button for about 7 seconds to set it to the peer mode. On my last gentoo install I had no problems connecting to the headset but now I always get this Authentication Error. Even if the headset is set to the peer mode.

Any ideas what else I could try?

----------

## deviljelly

Hi, This btsco.c should compile fine with 2.6.9, and it may even work, don't worry about sndmagic.h, and the rest of the patches should work.

```

removed by request

```

Last edited by deviljelly on Thu Oct 28, 2004 8:32 am; edited 1 time in total

----------

## hothead

@deviljelly

Hi thank you for the good message that also 2.6.9 is now supported. I generated a patch against the 2.6.9-r1 gentoo kernel and it works. Maybe you can delete the code from your post - so people don't get confused and you don't have to scroll that much to see the following messages.

Ruben

----------

## linuxdude88

@masterbrain

have you got your headset working? i have exactly the same problem, i installed everything correctly, the output from above is the same. This is what i get when i start btsco:

```
Device is 0:0

Voice setting: 0x0060

RFCOMM channel connected

recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=12

Sending up speaker change 12
```

when i try to play a sound file, nothing happens, the program just hangs.

----------

## deviljelly

@Ruben, done....

 *hothead wrote:*   

> @deviljelly
> 
> Hi thank you for the good message that also 2.6.9 is now supported. I generated a patch against the 2.6.9-r1 gentoo kernel and it works. Maybe you can delete the code from your post - so people don't get confused and you don't have to scroll that much to see the following messages.
> 
> Ruben

 

----------

## oggy

 *dreadhead wrote:*   

> When I try to connect my headset I always get an Authentication Error.
> 
> I tried the following things:
> 
> ```
> ...

 

I've been having exactly the same problem (same headset too) util I deleted the file /etc/bluetooth/link_key.

After that the pairing and everything else worked according to the guide.

----------

## dreadhead

Thank you!!!!!!!!!!! It works!

Now my headset is connected to the PC but the alsa-driver works only if the snd-bt-sco module is loadet at startup. But if I load the module at startup the headset gets set as my primary sound device and every sound gets send to the headset.

Does anyone know how I can change the order of the devices?

Currently the headset is hw0:0, and my sound card is hw0:1

btw: Has anyone noticed that when the headset is active the mouse input with bluetooth-mouses is slower!?

----------

## dreadhead

I managed it to set my sound card to the first device by loading the snd-bt-sco module a bit later...

But i also have the problem that the mic of the headset is recognized as an output channel instead of an input channel. For example in KMix I see the mic on the output-tab ant the input-tab is empty. I think this is the reason why the headset doesnt work in skype.

----------

## mirko_3

 *linuxdude88 wrote:*   

> @masterbrain
> 
> have you got your headset working? i have exactly the same problem, i installed everything correctly, the output from above is the same. This is what i get when i start btsco:
> 
> ```
> ...

 

Hey, I have that same problem - aplay just hangs there.

Also, in dmesg, every time I run aplay:

```

snd-bt-sco: playback_open

snd-bt-sco: prepare ok bps: 16000 size: 32768 count: 8192

snd-bt-sco: prepare ok bps: 16000 size: 23808 count: 1488

snd-bt-sco: playback_trigger 1

snd-bt-sco: setting playback to bspcm

snd-bt-sco: playback_trigger 0

snd-bt-sco: setting playback to NULL

```

----------

## mirko_3

I guess you didn't manage to fix it?

Here's my btsco output (seems correct...):

```

Device is 1:0

Voice setting: 0x0060

RFCOMM channel connected

recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=11

Sending up speaker change 11

```

Also, aplay spits out this after a little while:

```

ALSA lib pcm_hw.c:578:(snd_pcm_hw_drain) SNDRV_PCM_IOCTL_DRAIN failed: Input/output error

```

----------

## mirko_3

I know I'm annoying people by bumping this up, so I'll stop now..

----------

## veezi

Thanks a lot for this howto  :Smile: 

I've got my headset working. Well, almost:

1. The volume control doesn't work at all. 

2. The headset microphone doesn't work. It also shows as an output device in alsamixer ??! 

My headset is Nokia HDW-2 (http://www.nokia.com/nokia/0,,2383,00.html). Did anybody have better success with this one?

Hope anyone can help. 

ThanksLast edited by veezi on Tue Nov 09, 2004 5:41 pm; edited 1 time in total

----------

## veezi

 *veezi wrote:*   

> Thanks a lot for this howto 
> 
> I've got my headset working. Well, almost:
> 
> 1. The volume control doesn't work at all.  
> ...

 

This is funny. I've connected vmware workstation (running on my linux box) to headset sound device (/dev/sound/dsp1). Running Windows I can:

1. Control volume (through the wave control)

2. Record through the microphone.

So, I guess I must be doing something wrong with Alsa+arts  :Confused: 

----------

## veezi

One more 'irrelevant' question:

Under kde, how do you override the default output device when using pure alsa (no oss compatibility). That is, which  of the following can be supplied as a device name:

```

mypc# ls /dev/snd

controlC0  hwC1D0    pcmC0D0p  pcmC0D2c  pcmC0D4p  pcmC1D0p  timer

controlC1  pcmC0D0c  pcmC0D1c  pcmC0D3c  pcmC1D0c  seq

```

----------

## hothead

Hi veezi,

if I doesn't misunderstand you, you simply want to change the device nodes for your soundcard -?

I assume you use the 2.6.x kernel with the udev (dynamic device naming support). 

There you can write rules where you can define symlinks for nearly every device that supports udev.

You can find some information about writing udev rules at

http://webpages.charter.net/decibelshelp/LinuxHelp_UDEVPrimer.html#UDEV

Don't know what's your native language - but you can also take a look at a post of mine:

https://forums.gentoo.org/viewtopic.php?t=193184&highlight=udev+cardreader

or search in the forum for other good udev guides.

Please supply the developers with your expirience.

In order to do that you have to suscribe to the snd-bt-sco mailing list:

http://sourceforge.net/projects/bluetooth-alsa/

Ruben

----------

## nirax

hi,

i tryed used the readme and found it very helpful but for me it needed several small changes in the process:

before i could use 

hcitool scan

i had to 

perform the "bluetooth start"

also the bluepin was not working at all under gnome.

it required the modifications sugested in this thread:

https://forums.gentoo.org/viewtopic.php?t=232495&highlight=gnomebluetooth

after having added this and the modifications to hcid.conf

i could connect to my nokia 6600 (i included all bt modules sugested in the other thread as i wanted to use also my nokia 6600 over bluetooth) and to my logitech headset.

for teamspeak i could change than to /dev/dsp1 and it was working flawless.

beside my lsmod looks a little different, this surely cause i precompiled some stuff i kernel:

```

dinu linux # lsmod

Module                  Size  Used by

snd_bt_sco             10656  3

snd_hwdep               7492  2 snd_bt_sco

fglrx                 228508  7

nvidia_agp              5852  1

agpgart                28140  2 nvidia_agp

ohci_hcd               18372  0

```

thanks

nirax[/code]

----------

## nirax

One question regarding the ebuild:

```

btsco-cvs-0.1.ebuild 

```

can i  emerge -uDv world   after sync without danger, or do i have to mark that package specially to avoid having it replaced by updates ?

----------

## hothead

I think it dont will do any harm emerge -uDv, because there is no other ebuild named btsco-cvs. 

But since I have never emerged with -uDv I don't know it for shure. 

If you have placed the ebuild in a local overlay that does not get synced via rsync, the ebuild will not be removed. 

But it will get unmerged if you emerged it with ACCEPT_KEYWORDS - you have to use the package.keywords - see the howto.

Ruben

----------

## buzzin

I keep running into a problem with btsco..

SDP tool says;

```

sdptool search --bdaddr 00:06:C5:0C:7B:38 0x1108

Class 0x1108

Searching for 0x1108 on 00:06:C5:0C:7B:38 ...

Service Name: Headset

Service RecHandle: 0x10000

Service Class ID List:

  "Headset" (0x1108)

  "Generic Audio" (0x1203)

Protocol Descriptor List:

  "L2CAP" (0x0100)

  "RFCOMM" (0x0003)

    Channel: 1

Profile Descriptor List:

  "Headset" (0x1108)

    Version: 0x0100

```

They pair fine, but when i run btsco i get the following ...

```

btsco 00:06:C5:0C:7B:38 1

Error: control open (hw:2): No such file or directory

Error: Can't find device. Bail

```

lsmod says

```

Module                  Size  Used by

rfcomm                 39192  0

l2cap                  26496  5 rfcomm

snd_bt_sco             14496  0

hci_usb                14720  2

snd_seq_midi            9376  0

snd_emu10k1_synth       8832  0

snd_emux_synth         38272  1 snd_emu10k1_synth

snd_seq_virmidi         8960  1 snd_emux_synth

snd_seq_midi_emul       8832  1 snd_emux_synth

snd_emu10k1            97928  1 snd_emu10k1_synth

snd_rawmidi            26148  3 snd_seq_midi,snd_seq_virmidi,snd_emu10k1

snd_ac97_codec         71120  1 snd_emu10k1

snd_util_mem            5632  2 snd_emux_synth,snd_emu10k1

snd_hwdep              10756  3 snd_bt_sco,snd_emux_synth,snd_emu10k1

snd_seq_oss            35328  0

snd_seq_midi_event      8704  3 snd_seq_midi,snd_seq_virmidi,snd_seq_oss

snd_seq                55568  8 snd_seq_midi,snd_emux_synth,snd_seq_virmidi,snd_seq_midi_emul,snd_seq_oss,snd_seq_midi_event

snd_seq_device          8968  7 snd_seq_midi,snd_emu10k1_synth,snd_emux_synth,snd_emu10k1,snd_rawmidi,snd_seq_oss,snd_seq

snd_pcm_oss            53672  0

snd_pcm                97156  3 snd_bt_sco,snd_emu10k1,snd_pcm_oss

snd_timer              26628  2 snd_seq,snd_pcm

snd_page_alloc         10888  3 snd_bt_sco,snd_emu10k1,snd_pcm

snd_mixer_oss          21120  1 snd_pcm_oss

snd                    57828  14 snd_bt_sco,snd_emux_synth,snd_seq_virmidi,snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_hwdep,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_pcm,snd_timer,snd_mixer_oss

soundcore              11232  1 snd

```

I notice i dont have a bluetooth section in lsmod but the device seems to pair correctly.  Any ideas would be most welcome.

Many thanks,

LSD

----------

## hothead

It seems that you don't have sco (sound) suppport enabled for the HCI USB Driver. 

Networking support -> [M/Y] Bluetooth subsystem support -> Bluetooth device drivers -> [M/Y] HCI USB driver -> [Y] SCO (voice) support

Have you used my ebuilds? - the current version is broken because the configure method changed. 

I will write a new ebuild for btsco this weekend containing the btsco userspace tool and the driver . The ebuild will look for the appropriate settings in your kernel configuration.

Ruben

----------

## buzzin

Thanks for the reply.

Those options are enabled in the kernel... Ive also done modprobe sco, which loaded the module ok, but didnt help the issue.

```

CONFIG_BT_SCO=m

CONFIG_BT_HCIUSB_SCO=y

CONFIG_SND_BT_SCO=m

```

I noticed ur ebuild didnt work, so i used the cvs instructions provided on the btsco site.

If you get a new ebuild working.. id love to give it a go...

Cheers.

----------

## elduderino

hmm, same here. 

```

(0:1)root@dudikov:/$ btsco

Error: control open (hw:2): No such file or directory

Error: Can't find device. Bail

```

what is really strange, is that 4 days ago it worked, an now the hotheads serverssection is down and reemrerging btsco-cvs broke it. 

i just had the problem that apart from playing music over the device everything (changing volume, connecting, diconnecting with the multifunction button) worked. 

now my selfpatched 269-r4 and the prepatched bluealsa-source-268 don´t work with btsco. so btsco seems to be the problem. 

any suggestions?

----------

## elduderino

ok an strace on btsco gives me:

```

...uninterresting

stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=8365, ...}) = 0

open("/usr/share/alsa/alsa.conf", O_RDONLY) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=8365, ...}) = 0

mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000

read(3, "#\n#  ALSA library configuration "..., 131072) = 8365

read(3, "", 131072)                     = 0

read(3, "", 131072)                     = 0

close(3)                                = 0

munmap(0x40017000, 131072)              = 0

access("/etc/asound.conf", R_OK)        = -1 ENOENT (No such file or directory)

access("/home/nick/.asoundrc", R_OK)    = -1 ENOENT (No such file or directory)

open("/dev/snd/controlC0", O_RDONLY)    = 3

close(3)                                = 0

open("/dev/snd/controlC0", O_RDWR)      = 3

ioctl(3, USBDEVFS_CONTROL, 0xbfffe25c)  = 0

ioctl(3, UI_DEV_CREATE, 0xbfffe590)     = 0

ioctl(3, 0xc0045520, 0xbfffe728)        = 0

close(3)                                = 0

stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=8365, ...}) = 0

open("/dev/snd/controlC1", O_RDONLY)    = 3

close(3)                                = 0

open("/dev/snd/controlC1", O_RDWR)      = 3

ioctl(3, USBDEVFS_CONTROL, 0xbfffe25c)  = 0

ioctl(3, UI_DEV_CREATE, 0xbfffe590)     = 0

ioctl(3, 0xc0045520, 0xbfffe728)        = 0

ioctl(3, 0x80dc5521, 0xbfffe4a0)        = 0

ioctl(3, 0xc0045520, 0xbfffe728)        = 0

close(3)                                = 0

stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=8365, ...}) = 0

open("/dev/snd/controlC2", O_RDONLY)    = -1 ENOENT (No such file or directory)

open("/dev/aloadC2", O_RDONLY)          = -1 ENOENT (No such file or directory)

open("/dev/snd/controlC2", O_RDWR)      = -1 ENOENT (No such file or directory)

open("/dev/snd/controlC2", O_RDONLY)    = -1 ENOENT (No such file or directory)

open("/dev/aloadC2", O_RDONLY)          = -1 ENOENT (No such file or directory)

open("/dev/snd/controlC2", O_RDWR)      = -1 ENOENT (No such file or directory)

write(2, "Error: ", 7Error: )                  = 7

write(2, "control open (hw:2): No such fil"..., 46control open (hw:2): No  such file or directory) = 46

write(2, "\n", 1

)                       = 1

write(2, "Error: ", 7Error: )                  = 7

write(2, "Can\'t find device. Bail", 23Can't find device. Bail) = 23

write(2, "\n", 1

)                       = 1

```

so, maybe theres a problem with the alsaversions?

     ,nick

----------

## elduderino

works again with the 0.2 release. 

but, still no sound coming through to my logitech hs01. 

dmesg gives me this while playing xmms: 

```

snd-bt-sco: playback_open

snd-bt-sco: prepare ok bps: 16000 size: 8000 count: 800

snd-bt-sco: prepare ok bps: 16000 size: 8000 count: 800

snd-bt-sco: playback_trigger 1

snd-bt-sco: setting playback to bspcm

snd-bt-sco: playback_trigger 0

snd-bt-sco: setting playback to NULL

snd-bt-sco: Disposing of previous socket count 2

```

also the user permissions seem strange:

```

(0:1)root@Muramasa:/dev/sound$ l

total 0

drwxr-xr-x  1 root root       0 Jan  1  1970 ./

drwxr-xr-x  1 root root       0 Jan  1  1970 ../

crw-------  1 nick audio 14, 12 Jan  1  1970 adsp

crw-------  1 nick audio 14,  4 Jan  1  1970 audio

crw-rw----  1 root audio 14, 20 Jan  1  1970 audio1

crw-------  1 nick audio 14,  3 Jan  1  1970 dsp

crw-rw----  1 root audio 14, 19 Jan  1  1970 dsp1

crw-------  1 nick audio 14,  0 Jan  1  1970 mixer

crw-rw----  1 root audio 14, 16 Jan  1  1970 mixer1

crw-------  1 nick audio 14,  1 Jan  1  1970 sequencer

crw-------  1 nick audio 14,  8 Jan  1  1970 sequencer2

(0:1)root@Muramasa:/dev/sound$       

```

see, what i mean. 

btsco seems to do everything right thou:

```

0:1)root@Muramasa:~$ btsco 00:0D:44:0A:87:C5 1

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=12

Sending up speaker change 12

recieved AT+VGS=13

Sending up speaker change 13

recieved AT+VGS=14

Sending up speaker change 14

```

pairing works, kdebluetooth shows connect, i can open the device with konqueror, got no artsd or something running. 

also the usb-device (acer dongle) should do the trick: 

lsusb gives me:

```

(0:1)root@Muramasa:/dev/sound$ lsusb

Bus 004 Device 001: ID 0000:0000

Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 003: ID 054c:014d Sony Corp.

Bus 001 Device 001: ID 0000:0000

```

HELP.  :Wink: 

----------

## hothead

Have you chosen the headset as audio device in the xmms alsa configuration?

```
BT Headset: BT SCO PCM (hw:1,0)
```

Have you started alsasound? - Read the README at the project homepage.

Maybe someone from the developers at the bluez-devel mailinglist can help you:

http://lists.sourceforge.net/lists/listinfo/bluez-devel

Ruben

----------

## elduderino

jupp, everythings on. in xmms i can switch between hw:0 and hw:1 (intelXXX and BT Headset) hw:0 plays my music hw:1 doesn´t start playing. 

alsasound and bluetooth running. otherwise btsco wouldn´t connect to my headset.

----------

## mirko_3

Well, yeah, that's exactly my problem... with a Jabra 250 headset

----------

## elduderino

hmm, ok joining the bluez-devel was a really god idea. 

for everyone having my problems. (see post up there) 

here´s what did the trick for me:

first check your SCO Routing:

```

(0:1)root@Muramasa:~$ hciconfig hci0 revision

hci0:   Type: USB

        BD Address: 00:60:57:02:95:FE ACL MTU: 192:8  SCO MTU: 64:8

        HCI 12.7

        Chip version: BlueCore01b

        SCO mapping:  HCI

```

if you have PCM standing there were SCO mapping says HCI here, hopes not lost.  :Wink: 

so if we want to change it, we can take a tool that kind of emulates some sort of power-cycling to unlock the device. so this sounds pretty unsafe, and the author warns that it could seriously break something. but it works.  :Wink: 

http://www.soft.uni-linz.ac.at/_wiki/tiki-index.php?page=ProjectBluezHandsfree

have a look at the "CSR reset utility" section, and download the tool. 

,nick

----------

## mirko_3

Ahhh, too bad...:

```

mirko3 mirko_3 # hciconfig hci0 revision

hci0:   Type: USB

        BD Address: 00:0B:0D:31:5B:71 ACL MTU: 120:20  SCO MTU: 64:0

        Unsupported manufacturer

```

If I read your post correctly, this means that hope is lost... :Sad: 

EDIT:

I tried the reset utility, and it returns Success, but I doubt it actually did anything, as there is no delay whatsoever... also, it seems to do exactly nothing....

----------

## elduderino

you should try a different usb-dongle. your SCO Mtu is 64:0 it must be 64:<0 like 64:8 or something to work.

----------

## mirko_3

I'll see if I can find another cheap one...

Anyway, SCO MTU can be changed with hciconfig, and I tried setting it to 64:8 but it didn't seem to matter... do you suppose I need to change ACL MTU as well? I will try it anyway maybe tomorrow.. 

Thanks for the answers.

----------

## herrzattacke

thanks ruben,

ur howto works fine with my Acer BT-600 Bluetooth dongle and a Logitech bluetooth headset.

thanks again, great work.

herrzattacke

----------

## dreadhead

I tried the new ebuild. It works fine! Thanks!

But I still got one problem... My Mic produces a noise that makes phonecalls nearly impossible. Does anyone have an idea how to fix that? Are there any configuration files?

----------

## hothead

Try the bluez-devel mailinglist.

Maybe someone there can help you:

http://lists.sourceforge.net/lists/listinfo/bluez-devel

Ruben

----------

## CB2206

hi,

first of all: THX A LOT!

my sony ericsson hb-35 headset is working! i can hear sound and even the mic is working (tested with skype). i even could not get this work under windows!  :Smile: 

there are just some small points left:

1) i'm using kde 3.3.1. when starting btsco the sounddevice is switched to the headset, but when killing btsco it does not reactivate my "normal" soundcard. (kmix still shows the settings for the headset) what do i have to do?

2) in kmix the ruler for the mic is on the input panel

3) using the mic ruler does not really much adjust the loudness

I hope mainly number 1 is fixable.  :Smile: 

thx again for your work!

----------

## ensonic

hi hi,

is there any solution in sight for newer kernels. I am using 2.6.10-rc1where the kernel-patch for kernel-2.6.7-8.24-08-04.patch does not apply anymore.

Stefan

----------

## CB2206

 *ensonic wrote:*   

> hi hi,
> 
> is there any solution in sight for newer kernels. I am using 2.6.10-rc1where the kernel-patch for kernel-2.6.7-8.24-08-04.patch does not apply anymore.
> 
> Stefan

 

you don't need the kernel patch anymore. just use the btsco-cvs-0.2 ebuild (look at the top of the first entry of this thread)

----------

## CB2206

mh...i tried to use my bt-headset again, today. it gets connected and i can hear music with xmms when i configure it to alsa/bt-headset output but the headset does not get set as main device in kde or alsa generally. why is this?

when i tried it the first time, the headset was automatically the main device.

thx a lot.

 *CB2206 wrote:*   

> hi,
> 
> first of all: THX A LOT!
> 
> my sony ericsson hb-35 headset is working! i can hear sound and even the mic is working (tested with skype). i even could not get this work under windows! 
> ...

 

----------

## ensonic

 *CB2206 wrote:*   

>  *ensonic wrote:*   hi hi,
> 
> is there any solution in sight for newer kernels. I am using 2.6.10-rc1where the kernel-patch for kernel-2.6.7-8.24-08-04.patch does not apply anymore.
> 
> Stefan 
> ...

 

ah, yes I wasn't expecting the ebuild beeing inside the -0.2.tar.bz.

now that worked, unfortunately when trying to load the module I get

```

# modprobe snd-bt-sco

FATAL: Error inserting snd_bt_sco (/lib/modules/2.6.10-rc1/extra/snd-bt-sco.ko): Unknown symbol in module, or unknown parameter (see dmesg)

# dmesg | tail -n1

snd_bt_sco: Unknown symbol snd_hwdep_new

```

any ideas?

----------

## hothead

-> The snd-hwdep module has to be loaded first, else you get this message.

Run modules-update and try to load the snd-bt-sco module again then the snd-hwdep module should get loaded automatically. Else do a reboot - modules-update is executed on every reboot. 

Ruben

----------

## tlaloctlaloc

Checkout does not finish at the moment due to lock file.

Thanks for thr ebuild, bye.

----------

## nirax

hi all,

i just noticed that when loading

also the ehci_hcd module for USB 2.0 support my

Logitech Headset cant connect anymore.

after a rmmod ehci_hcd i can however work again with the headset.

(Only using the ohci_hcd module.)

```

ehci_hcd               26052  0

mga                   115092  2

vmnet                  26972  8

vmmon                 153516  0

nvidia_agp              5852  1

agpgart                28140  2 nvidia_agp

ohci_hcd               18372  0

```

what could i do to enable bluetooth headset connect also when using both ehci and ohci at the same time ?

greetings,

nirax

----------

## astaecker

Hey,

thanks for your efford.

But I have problems with the compiling. Ok, I have an ~x86 system and a 2.6.10 kernel, but ... maybe can anybody help.

```

arne ~ # emerge btsco-cvs

Calculating dependencies ...done!

>>> emerge (1 of 1) net-wireless/btsco-cvs-0.2 to /

 * In order to be able to use btsco, you need to have kernel sources 2.6.x installed

 * You need to have a proper link to your kernel-sources:

 * -> ln -s /usr/src/linux-<your_kernelversion_here> /usr/src/linux

 * Bluetooth SCO support and the Tascam USB audio driver need to be enabled

 * BT_HCI_SCO support detected.

 * SND_USB_USX2Y support detected.

 * Kernel check was successfull!

>>> Unpacking source...

 * Fetching CVS module btsco into /usr/portage/distfiles/cvs-src/btsco ...

 * Running  cvs -q -f -z3 -d ":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/bluetooth-alsa" login

Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/bluetooth-alsa

 * Running  cvs -q -f -z3 -d ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/bluetooth-alsa" update -dP btsco

? btsco/Makefile

? btsco/Makefile.in

? btsco/aclocal.m4

? btsco/autom4te.cache

? btsco/config.h

? btsco/config.h.in

? btsco/config.log

? btsco/config.status

? btsco/configure

? btsco/install-sh

? btsco/missing

? btsco/stamp-h1

? btsco/avdtp/Makefile

? btsco/avdtp/Makefile.in

? btsco/sbc/Makefile

? btsco/sbc/Makefile.in

 * Copying btsco from /usr/portage/distfiles/cvs-src/btsco ...

 * CVS module btsco is now in /var/tmp/portage/btsco-cvs-0.2/work

>>> Source unpacked.

/usr/share/aclocal/pkg.m4:5: warning: underquoted definition of PKG_CHECK_MODULES

  run info '(automake)Extending aclocal'

  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal

/usr/share/aclocal/libart.m4:11: warning: underquoted definition of AM_PATH_LIBART

/usr/share/aclocal/libIDL.m4:6: warning: underquoted definition of AM_PATH_LIBIDL

/usr/share/aclocal/imlib.m4:9: warning: underquoted definition of AM_PATH_IMLIB

/usr/share/aclocal/imlib.m4:167: warning: underquoted definition of AM_PATH_GDK_IMLIB

/usr/share/aclocal/gtk.m4:7: warning: underquoted definition of AM_PATH_GTK

/usr/share/aclocal/glib.m4:8: warning: underquoted definition of AM_PATH_GLIB

/usr/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF

/usr/share/aclocal/audiofile.m4:12: warning: underquoted definition of AM_PATH_AUDIOFILE

/usr/share/aclocal/ORBit.m4:4: warning: underquoted definition of AM_PATH_ORBIT

checking for a BSD-compatible install... /bin/install -c

checking whether build environment is sane... yes

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables...

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ANSI C... none needed

checking for style of include used by make... GNU

checking dependency style of gcc... none

checking for a BSD-compatible install... /bin/install -c

checking for ranlib... ranlib

checking for ALSA CFLAGS...

checking for ALSA LDFLAGS...  -lasound -lm -ldl -lpthread

checking for libasound headers version >= 1.0.3... found.

checking for snd_ctl_open in -lasound... yes

./configure: line 3245: XIPH_PATH_AO: command not found

configure: creating ./config.status

config.status: creating Makefile

config.status: creating sbc/Makefile

config.status: creating avdtp/Makefile

config.status: creating config.h

config.status: config.h is unchanged

config.status: executing depfiles commands

cd . && /bin/sh /var/tmp/portage/btsco-cvs-0.2/work/btsco/missing --run autoheader

rm -f stamp-h1

touch config.h.in

cd . && /bin/sh ./config.status config.h

config.status: creating config.h

config.status: config.h is unchanged

make  all-recursive

make[1]: Entering directory `/var/tmp/portage/btsco-cvs-0.2/work/btsco'

Making all in sbc

make[2]: Entering directory `/var/tmp/portage/btsco-cvs-0.2/work/btsco/sbc'

gcc @AO_CFLAGS@ -O2 -march=athlon-xp -fomit-frame-pointer -ftracer -fprefetch-loop-arrays -pipe   -o sbcinfo  sbcinfo.o  -lasound -lm -ldl -lpthread

gcc: @AO_CFLAGS@: Datei oder Verzeichnis nicht gefunden

make[2]: *** [sbcinfo] Fehler 1

make[2]: Leaving directory `/var/tmp/portage/btsco-cvs-0.2/work/btsco/sbc'

make[1]: *** [all-recursive] Fehler 1

make[1]: Leaving directory `/var/tmp/portage/btsco-cvs-0.2/work/btsco'

make: *** [all] Fehler 2

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

 * PLEASE UPDATE TO YOUR PACKAGE TO USE linux-info.eclass

make[1]: Entering directory `/usr/src/linux-2.6.10-nitro2'

  CC [M]  /var/tmp/portage/btsco-cvs-0.2/work/btsco/kernel/btsco.o

  LD [M]  /var/tmp/portage/btsco-cvs-0.2/work/btsco/kernel/snd-bt-sco.o

  Building modules, stage 2.

  MODPOST

  CC      /var/tmp/portage/btsco-cvs-0.2/work/btsco/kernel/snd-bt-sco.mod.o

  LD [M]  /var/tmp/portage/btsco-cvs-0.2/work/btsco/kernel/snd-bt-sco.ko

make[1]: Leaving directory `/usr/src/linux-2.6.10-nitro2'

>>> Test phase [not enabled]: net-wireless/btsco-cvs-0.2

>>> Install btsco-cvs-0.2 into /var/tmp/portage/btsco-cvs-0.2/image/ category net-wireless

>>> dobin: making btsco executable...

install: Aufruf von stat für btsco nicht möglich: Datei oder Verzeichnis nicht gefunden

man:

prepallstrip:

strip: i686-pc-linux-gnu-strip --strip-unneeded

>>> Completed installing btsco-cvs-0.2 into /var/tmp/portage/btsco-cvs-0.2/image/

>>> Merging net-wireless/btsco-cvs-0.2 to /

--- /lib/

--- /lib/modules/

--- /lib/modules/2.6.10-nitro2/

--- /lib/modules/2.6.10-nitro2/extra/

>>> /lib/modules/2.6.10-nitro2/extra/snd-bt-sco.ko

--- /usr/

--- /usr/bin/

--- /usr/share/

--- /usr/share/doc/

>>> /usr/share/doc/btsco-cvs-0.2/

>>> /usr/share/doc/btsco-cvs-0.2/README.gz

>>> /usr/share/doc/btsco-cvs-0.2/INSTALL.gz

>>> /usr/share/doc/btsco-cvs-0.2/COPYING.gz

 * Run 'modules-update', load the snd-bt-sco module 'modprobe snd-bt-sco' and connect with btsco to your headset.

>>> Regenerating /etc/ld.so.cache...

 * Caching service dependencies ...                                       [ ok ]

>>> net-wireless/btsco-cvs-0.2 merged.

>>> Recording net-wireless/btsco-cvs in "world" favorites file...

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

```

The module is working, but there is no btsco program.

regards

----------

## astaecker

I found the solution myself.

First, on an ~x86 systems there is a new automake version managment through automake-wrapper. Actuel is automake 1.9.x, but btsco still needs automake 1.7. So I needed an prefix:

```

WANT_AUTOMAKE=1.7 emerge btsco-cvs
```

Second, there is a missing dependency: libao.

But then everythink works fine. Thanks for the ebuild.

----------

## nirax

i also found the solution to my problem.

my epox usb bluetooth adapter will not work connected to a hub.

must be in a computer output directly.

nirax

----------

## Trejkaz

Just wondering, is anyone using a stereo headset with this stuff?  I'm curious to know if it works, since a stereo BT headset might be a good replacement but my current crappy headset.  :Smile: 

----------

## veezi

I see two binaries in the package "btsco" and "btsco2", what's the difference between the two?  :Shocked: 

I'm also interested in a stereo headset  :Smile:   Anyone has experience with that?

----------

## LGW

just stumbled about this, I'm one of the developers of btsco.

there's little support for stereo headsets yet. It's not available as an alsa device yet, but you can stream audio files like this:

mpg123 --au - file.mp3 | sbc/sbcenc - | ./a2play <headsetaddr>

have a look at the project homepage for more information.

http://bluetooth-alsa.sourceforge.net/

I don't know whether this stuff (a2dp/a2play) is installed with the ebuild, though  :Smile: 

----------

## Macbeth

Hi all,

i tried to emerge btsco-cvs but the ebuild can not download the sources from cvs:

```
bash-2.05b# emerge btsco-cvs

Calculating dependencies ...done!

>>> emerge (1 of 1) net-wireless/btsco-cvs-0.2 to /

 * In order to be able to use btsco, you need to have kernel sources 2.6.x installed

 * You need to have a proper link to your kernel-sources:

 * -> ln -s /usr/src/linux-<your_kernelversion_here> /usr/src/linux

 * Bluetooth SCO support and the Tascam USB audio driver need to be enabled

 * BT_HCI_SCO support detected.

 * SND_USB_USX2Y support detected.

 * Kernel check was successfull!

>>> Unpacking source...

 * Fetching CVS module btsco into /usr/portage/distfiles/cvs-src/btsco ...

 * Running  cvs -q -f -z3 -d ":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/bluetooth-alsa" login

Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/bluetooth-alsa

cvs [login aborted]: end of file from server (consult above messages if any)

!!! ERROR: net-wireless/btsco-cvs-0.2 failed.

!!! Function cvs_fetch, Line 340, Exitcode 1

!!! cvs login command failed

!!! If you need support, post the topmost build error, NOT this status message.

```

if i try to check out the sources by hand i can't log in to cvs:

```

bash-2.05b# cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/bluetooth-alsa login

Logging in to :pserver:anonymous@cvs.sf.net:2401/cvsroot/bluetooth-alsa

CVS password:

cvs [login aborted]: end of file from server (consult above messages if any)

bash-2.05b#      

```

So, what have i to do to get the sources from cvs?

Whats the password? Return is not working.

Regards

Markus

----------

## hothead

I've updated the ebuild. You can now choose the kernel version 

the module should compile for.

Please try it.

----------

## fury

I've got a Jabra Freespeak, and I'm trying to get it to work.

I can see the device in discovery mode, but I'm stuck at:

```
#sdptool search --bdaddr 00:07:A4:00:37:06 0x1002

Class 0x1002

Failed to connect to SDP server on 00:07:A4:00:37:06: Protocol not supported

```

I'm 99% sure this is the problem (or one of many problems) preventing the rest of the sha-bang to work.  I pressed ahead anyway:

Since I don't know what the channel is, i just run " btsco <ID>" and it defaults to channel 2.  Alsa creates the devices, and I can see them in xmms, but it just locks up when I try to play anything.   Here's what aplay has to say:

```
aplay -d hw:1,0 /home/fury/test.mp3 

ALSA lib conf.c:2792:(snd_config_hook_load) "/usr/share/alsa/cards/Bluetooth SCO.conf" is not a word

ALSA lib conf.c:2672:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: Invalid argument

ALSA lib pcm.c:1947:(snd_pcm_open_conf) Invalid type for PCM default definition (id: default, value: cards.pcm.default)

aplay: main:508: audio open error: Invalid argument 
```

If I check the directory, there is no Bluetooth SCO.conf...

So yeah, I'm a little out of my leage on this one.  I included all this extra garbage because I'm desprate ;)

-Derek

----------

## penzo

ok guys this is great but how do i do this the other way around. i want my computer to appear/fuction as a bluetooth headset for my phone. 

thanks.

V

----------

## roboguy

Hi all,

I have a noika HDW-3 headset and a d-link dwb-120m dongle. I have installed the ebuild and can get connected but I can't get any sound from xmms

```

james@athos scripts $ btsco 00:03:89:67:8F:F7 1

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=07

Sending up speaker change 7

```

From reading this thread it sounds like my bluetooth dongle might not work  :Sad: 

```

athos root # hciconfig hci0 revision

hci0:   Type: USB

        BD Address: 00:40:05:D0:CE:2D ACL MTU: 377:10  SCO MTU: 16:0

        Firmware 2.16.007

athos root #

```

Can anyone tell me what bluetooth dongles definately work?

Cheers,

Roboguy

----------

## roboguy

 *roboguy wrote:*   

> 
> 
> From reading this thread it sounds like my bluetooth dongle might not work 
> 
> ```
> ...

 

Ok, so I went out today and got another dongle (a newlink one) got home and this is what it says

```

athos root # hciconfig

hci0:   Type: USB

        BD Address: 00:10:60:AC:B0:7A ACL MTU: 377:10  SCO MTU: 16:0

        DOWN 

        RX bytes:51 acl:0 sco:0 events:5 errors:0

        TX bytes:20 acl:0 sco:0 commands:6 errors:0

```

Not quite ready to give up on it yet I booted in to windoze and installed the drivers and what do you know, works with my headset and skype just fine. So based on this I believe that dongles that have SCO MTU: 16:0 will actually do voice after all.

The question is, why after I connect under linux, can I not hear anything from xmms?

Cheers,

Roboguy

----------

## gmichels

My dongle also has the 16:0 SCO MTU, however I can't make it work, even in Windows. It will connect but I can't hear or record any sound. Using btsco, AT commands such as volume up & down are recognized, but I get no sound either.

My crappy dongle is a Keyspan BT-2A, so I'm looking for a new one. Any information on the D-Link DBT-120, does it work?

----------

## fdthomas76

The Dongle from AVM BlueFritz! USB has allthough the SCO MTU 64:0! This damn thing didn't work.

Now I have a Yakumo dongle and it works perfect under amd64

kind regards

Thomas

----------

## thomasmue

Hi all, 

had anyone success with the Plantronics M 2500 Headset ?

The btsco-cvs compiled flawless, and there are no errors or warnings, when I modprobe snd-usbx2y and snd-bt-sco.

When I start the btsco program, I can hear a beep, but the program does not return. Also I can't see any entries in the log, when I press the connection button. 

Bluetooth in general is working, I had no problems connecting to and using my Nokia 6310i mobile phone.

Maybe it's not a problem with the driver, but a peering problem.

Any help is appreciated

Thanks, Thomas

----------

## Ladius

Just a note of success. Followed page one instructions and got my Jabra 250 connected via  my Kensington Bluetooth USB Adapter.

I couldn't get voice recording to work to test and see if the mic was working so was kinda worried, the XMMS test worked flawlessly. A test of a skype call to London, England from Southern California IP to IP worked just great.

----------

## hothead

Behaviour of btsco changed slightly

You get all features of btsco with btsco -h

You have to use the verbose parameter -v if you want to get some debug information displayed. 

If you don't send any sound information to your headset you will not be able to change the volume. 

You can only change the volume when the headset is receiving something.

If you change the volume when the headset is receiving something the volume beep should increase or decrease. 

It also seems to me that the headset is now always disconnected/idle when you don't send anything to it

(there is no noise) but get's automatically connected when it is receiving something. Seems to me that the connect button

is not any longer required.

----------

## at6

hi ruben,

works like a charm.

thank you.

best regards marc

----------

## the_g_cat

Hi folks,

Just wanted to drop in to ask a few compatibility questions. I'm gonna buy a Plantronics M2500 or a Jabra BT250 (depending on which fits best on my big ears  :Very Happy:  ) to use with my cellphone (S65, should be there any moment now) and my iBook through a D-Link DBT-120.

Just wanted to know if I would be able to use the DBT-120 with the updated firmware from Apple (sigh) on my desktop, or if it would be better to get another one, and if hotplug works well with BT stuff.

Thanks in advance for the help  :Smile: 

----------

## Tlaloc

Just an unimportant side note. When my phone connects btsco still shows version number 0.4 in the bash, may confuse someone.

Otherwise I wanted to thank you for the new version, even works better than that before (v0.2) and I can now use my spare nokia headset for gnomemeeting or skype and don't have to eat my microphone, as the recording level of the of my onboard sound cart is damn low and I have to come very near to it to make others hear me. I even thought of buying a new sound card.

Thanks, Valentin.

----------

## hothead

 *Quote:*   

> When my phone connects btsco still shows version number 0.4 in the bash, may confuse someone.

 

Yes, I allready realized that. I should have taken -r* numbers for my new ebuilds. I think I gonna adapt the ebuild version 

to the btsco version.

----------

## kamagurka

When I try merging btsco I get the following error:

```
Enter the kernel version: 2.6.10-gentoo-r6

 * Checking kernel configuration.

 * Module sco.ko not found.

 * Recompile your kernel with =m BT_HCI_SCO=m enabled
```

However, looking in my .config, there is no line referring to BT_HCI_SCO...

----------

## lenk

Hi, will this work with if I'm using OSS sound module? Thanks

----------

## hothead

@kamagurka 

That's a message from the bluetooth-alsa people. You should enable sco support for hci-usb

```
 CONFIG_BT_HCIUSB_SCO=y 
```

@lenk

NO. You have to use ALSA. snd-bt-sco is a ALSA module. The headset is used similar to a ordinary sound card.

If you want to use applications that use oss,  e. g. skype, you must enable the oss emulation stuff of alsa.

```
CONFIG_SND_OSSEMUL=y

CONFIG_SND_MIXER_OSS=m

CONFIG_SND_PCM_OSS=m

CONFIG_SND_SEQUENCER_OSS=y

```

----------

## kamagurka

 *hothead wrote:*   

> @kamagurka 
> 
> That's a message from the bluetooth-alsa people. You should enable sco support for hci-usb
> 
> ```
> ...

 

I have neither that nor BT_HCI_SCO *in* my kernel .config. How am I supposed to enable them?

[edit] nevermind, I had to hunt it down in the menuconfig.

----------

## edi

I tried it several times but it didn't work out for me. Today I had some spare time and so I decided to give it another try. 

System:

IBM X31 with build in bluetooth

Linux  2.6.12-rc2 i686 Intel(R) Pentium(R) M processor 1400MHz GenuineIntel GNU/Linux

sys-kernel/vanilla-sources-2.6.12_rc2

media-sound/btsco-cvs-0.4-r1

and following the HowTo gave me great success. I had to turn up my mic with 

```
alsamixer -c 1
```

 but then I was able to establish my first skype session  :Very Happy: 

----------

## hothead

In case my server should be down you use the code below.

```
# Copyright 1999-2004 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: $

ECVS_SERVER="cvs.sourceforge.net:/cvsroot/bluetooth-alsa"

ECVS_MODULE="btsco"

ECVS_ANON="yes"

ECVS_CVS_OPTIONS="-z3 -d"

ECVS_TOP_DIR="$DISTDIR/cvs-src/btsco"

inherit eutils cvs kernel-mod linux-info

S="${WORKDIR}/${ECVS_MODULE}"

SKM="${S}/kernel"

DESCRIPTION="ALSA bluetooth headset driver [snd-bt-sco.ko] and userspace programm [btsco]."

HOMEPAGE="http://bluetooth-alsa.sourceforge.net"

SRC_URI=""

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~x86"

DEPEND="bluez-libs

      media-libs/libao"

kernel_check() {

   echo

   echo -n "Compile against current kernel? [yes|no]: "

   read CURRENT

   if [ $CURRENT = yes ]; then

      KVERSION=${KV}; else

      echo -n "Enter the kernel version: "

      read KVERSION

   fi

      einfo "Checking kernel configuration."

         if [ -e /lib/modules/${KVERSION} ]; then

            if [ -e /lib/modules/${KVERSION}/kernel/sound/usb/usx2y/snd-usb-usx2y.ko ] &&\

               [ -e /lib/modules/${KVERSION}/kernel/net/bluetooth/sco.ko ]; then

               einfo "Kernel check was successfull."; else

                  if [ ! -e /lib/modules/${KV}/kernel/sound/usb/usx2y/snd-usb-usx2y.ko ]; then

                     KCONFIG1="SND_USB_USX2Y" && eerror "Module snd-usb-usx2y.ko not found."

                  fi

                  if [ ! -e /lib/modules/${KV}/kernel/net/bluetooth/sco.ko ]; then

                     KCONFIG2="BT_HCI_SCO" && eerror "Module sco.ko not found."

                  fi

               einfo "Recompile your kernel with ${KCONFIG1}=m ${KCONFIG2}=m enabled"

               die "missing modules"

            fi; else

               eerror "/lib/modules/${KVERSION} does not exist."

               die "cannot find modules directory"

         fi

}

pkg_setup() {

   kernel_check

}

src_unpack() {

   cvs_src_unpack

}

src_compile() {

   ./bootstrap

   ./configure

   make

   cd ${SKM}

   set_arch_to_kernel

   make -C /lib/modules/${KVERSION}/source M=$(pwd) modules

}

src_install() {

   dobin btsco

   dodoc COPYING INSTALL README

   insinto /lib/modules/${KVERSION}/extra

   doins ${SKM}/snd-bt-sco.ko

   echo

}

pkg_postinst() {

   einfo "Running modules-update"

   /usr/sbin/update-modules

   echo

   einfo "Load the snd-bt-sco module 'modprobe snd-bt-sco' and connect with btsco to your headset."

   echo

}
```

----------

## zervus

Wow, just got it working with Skype! It's a Sony Ericsson HBH600. Sound quality seems perfectly ok for speech.

Big thanks to all who work on this!

----------

## manoweb

This tutorial is very good, though it's a bit confusing at the beginning with all the ebuild versions etc.

I got my bt headset running. Tested with xmms, aplay, arecord, and skype.

I'm very pleased with the result but... is there a way to enhance the audio quality? Using a normal, analog microphone gives a *much* better result...

Thank you so much!

Alessio Sangalli IW2NYD

----------

## gmichels

I finally got it working. Listening is very good, but the problem is recording stuff. Generally, anything I record is really low and no one can hear a word I say in Skype, for example.

If I do the echo123 test in Skype, I can hear (on the headset) my recorded voice loud and clear. However, I tried recording stuff using arecord then playing it on my regular sound card, and the output is very very very low. That's where I guess the problem is coming.

Anyone have any ideas on how to improve the microphone input on the headset? Mine is a Jabra BT250.

----------

## riskable

Just thought I´d update the thread with the latest & greatest...  Apparently a recent cvs update included a new version of btsco called btsco2.  As far as I can tell it works the same as btsco, except that you enable your headset by pushing the headset´s button.  You can disable it the same way.

This is a much better way of doing it than turning the headset on every time it sends a sound.

Supposedly you can change what the button press on your headset does (think I read that somewhere).  Answer a skype call?  I hope so!

Still waiting on the documentation on this stuff.  For reference:

Start up btsco2...

```

./btsco2 00:0D:44:2E:EC:27

Device is 2:0

Voice setting: 0x0060

RFCOMM channel 1 connected
```

No sound works at this point and the headset is in standby mode.  Press the button...

```

recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=10

Sending up speaker change 10
```

Voila!  Now sound works!

Press the button again:

```

recieved AT+CKPD=200

disconnected SCO channel
```

...and now the headset is back in standby mode.  Very cool =)

----------

## hothead

I've updated the ebuild

----------

## hothead

I newly have authentication problems with kdebluetooth-0.99-beta1. I'm not able to pair my headset if it has allready been paired.

full description here: http://bugs.kde.org/show_bug.cgi?id=104876

Does someone of you has a similar problem or knows a solution?

Regards

hothead

----------

## pengi

 *dreadhead wrote:*   

> When I try to connect my headset I always get an Authentication Error.
> 
> I tried the following things:
> 
> ```
> ...

 

I got this problem too. (but I don't use kbluepin)

But because I don't want to run gnome or kde, I have some problem using the gnome/kde-bluetooth packages. I've tried to use a friends windows-box with my bluetooth-adapter to pair, so the headset will learn my adapters address, so it will accept connections from my computer. Should this work? Is there any other way to pair the computer with the headset without using kdebluetooth or gnome-bluetooth?

TIA

----------

## hothead

For everyone who is interested: 

I splitted the btsco-cvs ebuild into two parts:

bluetooth-alsa which only installs the kernel module

and 

btsco which installs btsco & btsco2.

You can copy & paste the code from the first page.

Regards hothead

----------

## veezi

I just installed the kernel module and btsco, but now whenever 'snd-bt-sco' is loaded aplay gives this (even for the real audio card that I have):

 *Quote:*   

> 
> 
> ALSA lib conf.c:2792:(snd_config_hook_load) "/usr/share/alsa/cards/Bluetooth SCO.conf" is not a word
> 
> ALSA lib conf.c:2672:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: Invalid argument
> ...

 

Is this a bug??! Or am I missing something obvieous:roll:

----------

## hothead

The question is if everthing is working so far ,

apart from this message?

Maybe running 'alsactl store' as root solves this.

If not - give me some more information:

kernelversion

alsa-version.

----------

## veezi

Module loads fine. I can connect to my headset. I do have sound in both devices (card and headset) only if I use oss emulation. But any output to alsa gives same error message (even KDE's arts can't use alsa anymore). If I unload the snd-bt-sco module my sound card works fine and I can use alsa directly on it.

Here's /etc/modules.d/alsa

 *Quote:*   

> 
> 
> alias char-major-116 snd
> 
> alias char-major-14 soundcore
> ...

 

Here's alsa version

 *Quote:*   

> 
> 
> #qpkg -I -i alsa
> 
> media-libs/alsa-lib-1.0.8 *
> ...

 

I'm running kernel 2.6.11.8, 

 *Quote:*   

> 
> 
> #uname -r
> 
> 2.6.11.8
> ...

 

Thanks for any help

----------

## janus4

@hothead: Hi, your ebuild works great. Thank you very much!

Ok, i had to discover that i have to use the kernel sources instead of the external ALSA Drivers, but after that...

Works for me!

My Device is an:

# hcitool info XX:XX:XX:XX:XX:XX

Requesting information ...

        BD Address:  XX:XX:XX:XX:XX:XX

        Device Name: B-Speech Vitac

        LMP Version: 1.1 (0x1) LMP Subversion: 0x434

        Manufacturer: Cambridge Silicon Radio (10)

        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00

                <3-slot packets> <5-slot packets> <encryption> <slot offset>

                <timing accuracy> <role switch> <hold mode> <sniff mode>

                <park state> <RSSI> <channel quality> <SCO link> <HV2 packets>

                <HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme>

                <power control> <transparent SCO>

----------

## russo79

I'm having a problem emerge btsco-cvs.

Here is the last lines of the emerge...

```

configure: creating ./config.status

config.status: creating Makefile

config.status: creating sbc/Makefile

config.status: creating avdtp/Makefile

config.status: creating config.h

config.status: executing depfiles commands

make  all-recursive

make[1]: Entering directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco'

Making all in sbc

make[2]: Entering directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco/sbc'

gcc -DHAVE_CONFIG_H -I. -I. -I..      -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'sbc.c' || echo './'`sbc.c

rm -f libsbc.a

ar cru libsbc.a sbc.o

ranlib libsbc.a

gcc -DHAVE_CONFIG_H -I. -I. -I..      -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'sbcinfo.c' || echo './'`sbcinfo.c

gcc   -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387   -o sbcinfo  sbcinfo.o  -lasound -lm -ldl -lpthread -lbluetooth

gcc -DHAVE_CONFIG_H -I. -I. -I..      -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'sbcdec.c' || echo './'`sbcdec.c

gcc   -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387   -o sbcdec  sbcdec.o libsbc.a -lasound -lm -ldl -lpthread -lbluetooth

gcc -DHAVE_CONFIG_H -I. -I. -I..      -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'sbcenc.c' || echo './'`sbcenc.c

gcc   -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387   -o sbcenc  sbcenc.o libsbc.a -lasound -lm -ldl -lpthread -lbluetooth

gcc -DHAVE_CONFIG_H -I. -I. -I..      -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'rcplay.c' || echo './'`rcplay.c

gcc   -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387   -o rcplay  rcplay.o -lbluetooth -lbluetooth -lasound -lm -ldl -lpthread -lbluetooth

make[2]: Leaving directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco/sbc'

Making all in avdtp

make[2]: Entering directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco/avdtp'

gcc -DHAVE_CONFIG_H -I. -I. -I..     -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'avdtp.c' || echo './'`avdtp.c

rm -f libavdtp.a

ar cru libavdtp.a avdtp.o

ranlib libavdtp.a

gcc -DHAVE_CONFIG_H -I. -I. -I..     -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'avtest.c' || echo './'`avtest.c

gcc  -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387   -o avtest  avtest.o -lbluetooth libavdtp.a -lbluetooth -lasound -lm -ldl -lpthread -lbluetooth

make[2]: Leaving directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco/avdtp'

make[2]: Entering directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco'

gcc -DHAVE_CONFIG_H -I. -I. -I.     -O3 -march=pentium4 -pipe -fomit-frame-pointer -mfpmath=sse,387 -c `test -f 'btsco.c' || echo './'`btsco.c

rm: cannot remove `btsco': Is a directory

make[2]: *** [btsco] Error 1

make[2]: Leaving directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/btsco-cvs-0.4a/work/btsco'

make: *** [all] Error 2

>>> Test phase [not enabled]: media-sound/btsco-cvs-0.4a

>>> Install btsco-cvs-0.4a into /var/tmp/portage/btsco-cvs-0.4a/image/ category media-sound

install: `btsco' is a directory

/usr/lib/portage/bin/dodoc: ChangeLog does not exist.

man:

prepallstrip:

strip: i686-pc-linux-gnu-strip --strip-unneeded

>>> Completed installing btsco-cvs-0.4a into /var/tmp/portage/btsco-cvs-0.4a/image/

>>> Merging media-sound/btsco-cvs-0.4a to /

--- /usr/

--- /usr/bin/

--- /usr/share/

--- /usr/share/doc/

--- /usr/share/doc/btsco-cvs-0.4a/

>>> /usr/share/doc/btsco-cvs-0.4a/README.gz

>>> /usr/share/doc/btsco-cvs-0.4a/INSTALL.gz

>>> /usr/share/doc/btsco-cvs-0.4a/COPYING.gz

>>> Safely unmerging already-installed instance...

--- !mtime obj /usr/share/doc/btsco-cvs-0.4a/README.gz

--- !mtime obj /usr/share/doc/btsco-cvs-0.4a/INSTALL.gz

--- !mtime obj /usr/share/doc/btsco-cvs-0.4a/COPYING.gz

--- !empty dir /usr/share/doc/btsco-cvs-0.4a

--- !empty dir /usr/share/doc

--- !empty dir /usr/share

--- !empty dir /usr/bin

--- !empty dir /usr

>>> original instance of package unmerged safely.

>>> Regenerating /etc/ld.so.cache...

 * Caching service dependencies...

>>> media-sound/btsco-cvs-0.4a merged.

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

```

Does anyone has an idea about why it doesn't install the files in /usr/bin ???

Or to be more precise, why are there errors while compiling and the program is still emerged?

Thanks???

----------

## janus4

 *russo79 wrote:*   

> I'm having a problem emerge btsco-cvs.
> 
> Here is the last lines of the emerge...
> 
> ```
> ...

 

Have you tried to "rm -r  /var/tmp/portage/btsco-cvs-0.4a/" before merging?

Mario

----------

## russo79

Yes, doesn't change anything  :Sad: 

----------

## janus4

 *russo79 wrote:*   

> Yes, doesn't change anything 

 

Ok, then i think you should try the ebuild Files from the gentoo bugzilla page:

https://bugs.gentoo.org/show_bug.cgi?id=91558

(There i have downloaded my Files)

The only Thing i changed is that i have created yesterday my own btsco-0.4a.tar.bz2 file from CVS. But i have tried to compile the File from the bugzilla page bevore and it compiled for me. As i had another problem i tried to use the last CVS but that is another one  :Wink: 

Mario

----------

## russo79

Thank you...

It worked just fine with the bug report files  :Smile: 

----------

## E-Razor

Hi Guys,

i've uploaded the ebuilds to my server, maybe its usefull for some of you.

http://wiki.erazor-zone.de/doku.php?id=wiki:projects:linux:gentoo

greetings rzr

----------

## CpuWhiz

I was looking into getting the Plantronics M2500 headset to use with Skype. I read on the bluetooth-alsa project that it works. What usb bluetooth dongle would you suggest I use with it? What works?

----------

## roboguy

 *CpuWhiz wrote:*   

> What usb bluetooth dongle would you suggest I use with it? What works?

 

I've tried a few different dongles with little success but I can tell you the one I have now works great. It's a yakumo dongle purchased from Amazon (UK). 

HTH,

Roboguy

----------

## jhgz1

Hi there,

I'm not very familiar with Bluetooth itself so the question might be a bit dumb.

Anyhow, I was looking into buying one of those sleek Apple wireless (Bluetooth) keyboards and I was wondering if it would be possible to use that keyboard at the same time as the headset. Before I spent the money on it I wanted to at least make sure that they would not be blocked by each other every time I try to use Skype or something similar.

Still, I have to say, the btsco ebuild really works wonderfully over here, thanks again for all the work!

(No idea what model my dongle is, it is only recognized as a generic USB device, burried somewhere inside my laptop)

----------

## ivanova

Ok after  a bit of a struggle - I installed everything with the ebuilds at http://wiki.erazor-zone.de/doku.php?id=wiki:projects:linux:gentoo

Everything starts without error messages, but all I get is static when trying to play something through the alsa device.

I use a SE HBH-600 headset with a billionton bluetooth usb adapter.

# btsco -v 00:0E:07:F2:XX:XX

```
btsco v0.4c

Device is 2:0

Voice setting: 0x0060

RFCOMM channel 1 connected

recieved AT*ECBP=?

i/o needed: connecting sco...

connected SCO channel

Done setting sco fd

recieved AT+CLIP=1

recieved AT+VGS=15

Sending up speaker change 15

recieved AT+CSCS="UTF-8"

recieved AT+CLAN?

recieved AT+CKPD=200

speaker volume: 15 mic volume: 1

driver is not in use

disconnected SCO channel

speaker volume: 15 mic volume: 1

i/o needed: connecting sco...

connected SCO channel

Done setting sco fd

recieved AT+VGS=15

Sending up speaker change 15

```

# lsmod

```

snd_bt_sco             11808  4 

snd_hwdep               7456  3 snd_bt_sco

sco                    11460  2 

rfcomm                 35612  3 

l2cap                  23300  7 rfcomm

hci_usb                13640  4 

bluetooth              44868  8 sco,rfcomm,l2cap,hci_usb

```

# dmesg

```

Bluetooth: Core ver 2.7

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: HCI USB driver ver 2.8

Bluetooth: L2CAP ver 2.7

Bluetooth: L2CAP socket layer initialized

Bluetooth: RFCOMM ver 1.5

Bluetooth: RFCOMM socket layer initialized

Bluetooth: RFCOMM TTY layer initialized

Bluetooth: SCO (Voice Link) ver 0.4

Bluetooth: SCO socket layer initialized

```

# hciconfig -a

```

hci0:   Type: USB

   BD Address: 00:10:60:B0:7F:9A ACL MTU: 377:10  SCO MTU: 16:0

   UP RUNNING PSCAN ISCAN 

   RX bytes:143 acl:0 sco:0 events:20 errors:0

   TX bytes:576 acl:0 sco:0 commands:20 errors:0

   Features: 0xff 0xfe 0x0d 0x38 0x08 0x08 0x00 0x00

   Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 

   Link policy: RSWITCH HOLD SNIFF PARK 

   Link mode: SLAVE ACCEPT 

   Name: 'BlueZ (0)'

   Class: 0x000100

   Service Classes: Unspecified

   Device Class: Computer, Uncategorized

   HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x309

   Manufacturer: Broadcom Corporation (15)

```

#  hciconfig hci0 revision

```

hci0:   Type: USB

   BD Address: 00:10:60:B0:7F:9A ACL MTU: 377:10  SCO MTU: 16:0

   Firmware 0.3.009

```

----------

## Moeller

Thank you for a nice and very usefull HOWTO.

I managed to connect my Logitech Bluetooth headset with my laptop, using this HOWTO and everything seems to work.

I'am using KDE 3.3.1 and Kbluetooh. Kbluetooth can be configured to run a custom script when a device is discovered and kbluetooth provides this script. 

```
#!/bin/sh

# This script will pop up a dialog whenever a device was found or lost.

# You can use this as a template for your own device discovery job.

# 

# When this script is called by kbluetoothd, there will be several

# special environment variables defined:

#

# $FOUND_DEVICES:

#     This is a list of bluetooth device addresses of all devices

#     which have been detected since the last invocation of the script.

# $LOST_DEVICES:

#     These are the devices which were reachable during the last run,

#     but have disappeared in the meantime.

# $CURRENT_DEVICES:

#     This is complete list of devices which are reachable at the moment.

# $JOB_PATH:

#     The full path name of the currently running script

# $JOB_DIR:

#     The directory in the user's home directory where the jobs are stored

# $JOB_TEMPLATE_DIR:

#     The directory containing the job templates

#

# This script will be called with one single parameter:

# "run": The script should be executed

# "configure": Lets the user configure the script.

case "$1" in

    run)

        # Look up the name for each found/lost device with the

        # device name cache of kbluetoothd via dcop

        FOUND=" "

        for dev in $FOUND_DEVICES ; do 

            FOUND="$FOUND $(dcop kbluetoothd DeviceNameCache getCachedDeviceName $dev)"

        done

        

        LOST=" "

        for dev in $LOST_DEVICES ; do 

            LOST="$LOST $(dcop kbluetoothd DeviceNameCache getCachedDeviceName $dev)"

        done

        

        # Display a notification dialog for the found/lost devices with kdialog

        if [ "$FOUND" != " " ] ; then

            kdialog --msgbox "Found devices:$FOUND" --title "Found devices"

        fi

        

        if [ "$LOST" != " " ] ; then

            kdialog --msgbox "Lost devices:$LOST" --title "Lost devices"

        fi

        ;;

        

    configure)

        # Simply run kedit let the user edit this script.

        # A more sophisticated solution might use kdialog to hide 

        # the shell script from the user

        kedit "$JOB_PATH"

        ;;

esac

   
```

I imagine that it would be possible to combine the kbluetooth script with the "Connect with one click" script described in this howto,  so that the headset automatically gets connected upon discovery, and disconnected when the connection is lost.

I don't know any thing about scripting  :Rolling Eyes:  , but if anyone wants to modify the script above, I will be very happy to test it  :Wink: . 

Best regards

Lars Moeller

----------

## jhgz1

When I end btsco with CTRL+C and even after removing snd-bt-sco, there still remains a process snd-bt-scod which I cannot kill and which prevents me from suspending-to-disk. 

Is this is a bug or my fault?

----------

## M.u.r.k.

 *jhgz1 wrote:*   

> When I end btsco with CTRL+C and even after removing snd-bt-sco, there still remains a process snd-bt-scod which I cannot kill and which prevents me from suspending-to-disk. 
> 
> Is this is a bug or my fault?

 

Hi.

I had the same problem and there is already a bug filed at sourceforge but as I didn't know if it will be fixed any time I made a small hack to the sources. NOTE: I don't know if this is the right way to do it but it works for me so if you want you can give some feedback.

In the source tree of btsco there is a kernel directory which holds the code for the module in btsco.c

Add the +ed lines to this file at line 809:

```

do {

+if (current->flags & PF_FREEZE)

+      refrigerator(PF_FREEZE);

+

if (signal_pending(current))

```

Hope this helps.

EDIT:

Since I have to unload the usb modules for suspend, my dongle gets disconnected during sleep so this only stops me from unloading the module and reloading it after resume (and from manually quitting kmix which makes a bad device-in-use-message when I try to unload this snd-bt-sco module). But I guess suspending the box while talking doesn't make much sense anyway  :Wink: 

Regards, Markus

----------

## jubo

I am having some issues after I modprobe snd-bt-sco.

hcitool scan properly detects my headset, but when I run sdptool I get the following

```

sdptool browse 00:0F:DE:46:A5:B3

Failed to connect to SDP server on 00:0F:DE:46:A7:4B: Permission denied

```

then when I run it with sudo i get:

```

sudo sdptool browse 00:0F:DE:46:A5:B3

Failed to connect to SDP server on 00:0F:DE:46:A7:4B: Too many levels of symbolic links

```

Does anyone know what's going on.  Could it be a udev issue with the /dev locations that get created?

```

Also, if I just try to guess the channel I get this:

sudo btsco -v 00:0F:DE:46:A5:B3 1

btsco v0.4a

Device is 1:0

Voice setting: 0x0060

Can't connect RFCOMM channel: Too many levels of symbolic links

```

----------

## mdeininger

alright, first: way thanks for this great howto, it really helped me out!  :Idea: 

my bluetooth headset is finally working (after i had to find out that my dongle was the thing that made it not work -- it was a belkin 10m dongle, so i got a new one from sitecom... working like a charm with my plantronics headset  :Wink:  )

okay, someone up there asked for a kbluetooth discovery script for having btsco start when your headset gets discovered, so i came up with this:

```

#!/bin/sh

# This script will start/stop btsco for your headset

SECONDS="5"

username="mynamehere"

case "$1" in

    run)

        for dev in $FOUND_DEVICES ; do 

            export SECONDS

            $JOB_TEMPLATE_DIR/Device_Notification.real $@

            sudo /sbin/start-stop-daemon --start --background --chuid $username --exec /usr/bin/btsco --pidfile /var/run/btsco.pid -- $dev

        done

        for dev in $LOST_DEVICES ; do 

            export SECONDS

            $JOB_TEMPLATE_DIR/Device_Notification.real $@

            sudo /sbin/start-stop-daemon --stop --oknodo --pidfile /var/run/btsco.pid

        done

   ;;        

        

    configure)

        kedit "$JOB_PATH"

        ;;

esac

   

```

i suppose you'll need to follow that /etc/sudoers part in the howto, and you need to set $username to your user -- works for me so i figured i'd just post it...

note: i've no idea how to figure out the device type from that script, so you need to add this script to your list of "discovery jobs" and select "listed devices only" under "watched devices" and then add your headset's address to the list, and you probably also need to add your headset's id to the non-discoverable devices (i suppose most headsets aren't searchable most of the time...)

have fun,

Magnus

----------

## nirax

@jubo

i had the same problem.

see my workaround here:

https://forums.gentoo.org/viewtopic-t-342739-highlight-bluetooth+headset.html

----------

## mdeininger

i remember someone having authentication problems in this thread... well, i ran into those too, after pairing the device in windows (duh)

uhm, thing worked after i did an rm /var/lib/bluetooth/* -R -- that's a bit drastic of course, but if you only have a headset and mobile to connect, that should work -- you'll be asked for the pins again and it tends to work afterwards, unless of course, you pair it on windows again....

EDIT: a less drastic method would be editing /var/lib/bluetooth/<youradaptersbaddr>/linkkeys and removing the line with your headset's baddr, or adding that file in... for example kbluetooth's pairing editor and doing it there... my bad  :Wink: 

----------

## jhgz1

OK, I got a new USB Bluetooth dongle, it is a TBW-102UB from Trendware which should work more or less, at least according to Google. However this is apparently a "2nd revision" and therefore hciconfig hci0 revision prints this:

```

hci0:   Type: USB

        BD Address: 00:0B:**:**:**:1B ACL MTU: 120:20 SCO MTU: 64:0

        Unsupported manufacturer

```

I know that the chances of this working are slim but maybe someone has a tiny clue for me (hours of googling didn't). What gave me hope was that I could get to the point that the connection was established with rfcomm and all I could hear the channel being opened once I tried to use Skype with it but no actual sound was transmitted. 

Thanks a lot(!!) for any ideas and thoughts on this.

btw: i tried bluez-libs&utils with version 2.19 and 2.20 under Kernel 2.13

----------

## pengi

 *the_g_cat wrote:*   

> Just wanted to know if I would be able to use the DBT-120 with the updated firmware from Apple (sigh) on my desktop, or if it would be better to get another one.

 

Well... I have the same question, and still interested in the answer...

Anyone knows?

TIA

----------

## Henning Rogge

My "AVM Bluefritz USB" says:

 *Quote:*   

> # hciconfig hci0 revision
> 
> hci0:   Type: USB
> 
>         BD Address: 00:04:0E:89:65:43 ACL MTU: 120:20 SCO MTU: 64:0
> ...

 

Does this mean it doesn't work at all with BlueZ or just not with bluetooth-alsa ?

----------

## mdeininger

i think that means that voice connections won't work but data connections might (that means: no bt-alsa, but you could probably sync your mobile). i don't buy avm hardware for their pricing policy, so i'm not 100% sure tho, albeit my old bluetooth dongle had about the same output, and i was only able to use it for data connections and only got static on voice connections (yes, it did connect, the headset did play this connect-tune, then all static); everything worked fine after buying a new one.

i can recommend dongles from sitecom, and you can get 'em under 20 bucks if you shop around so... go get one of those, they worked like a charm for me.

----------

## larmoe

Thank you for the kbluetooth script. Made my life a bit easier.   :Very Happy: 

Best regards

Lars Moeller

----------

## 0x4a47

hi,

i'm having a hard time getting my logitech hs01-v16 headset to work. i only get the beeps when it "logs off" or when adjusting the volume, but nothing else. i tried this with two different bluetooth dongles

one is a msi MS-6967, which works fine on my usb-hub with a nokia 6230. the other one is integrated in my laptop, same behaviour/problems.

```

hciconfig hci0 revision   # msi

hci0:   Type: USB

        BD Address: <address> ACL MTU: 192:8 SCO MTU: 64:8

        HCI 16.4

        Chip version: BlueCore02-External

        Max key size: 56 bit

        SCO mapping:  HCI

```

```

btsco2 <address>

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=13

Sending up speaker change 13

```

if i play a mp3 with "mplayer -ao alsa:device=hw=1", amarok or aplay it will just hang and do nothing.

this is the dmesg output when starting btsco2 and mplayer:

```

snd-bt-sco: playback_open

snd-bt-sco: prepare ok bps: 16000 size: 32768 count: 2048

snd-bt-sco: prepare ok bps: 16000 size: 32768 count: 2048

snd-bt-sco: playback_trigger 1

snd-bt-sco: setting playback to bspcm

snd-bt-sco: playback_trigger 0

snd-bt-sco: setting playback to NULL

```

anything i'm missing?

[edit - SOLVED] 

*no comment* i didn't wanna believe that it might not work with usb2 - but it really is that way  :Smile: 

i didn't compile ehci support in now, but only as a module and moved the module to a temporary location so i could let the msi adapter on my usb hub. otherwise it would always load the ehci module.

just skyped with echo123 without any problem  :Smile:  and works much better than under windows where i had distorted sound.

[/edit]

tx,

JG

----------

## avsokol

Hello all

I have a problem with my bluetooth headset.

I compiled module and btsco. Everything was fine. I loaded module and ran btsco. The output:

btsco v0.4c

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

recieved AT*ECBP=?

recieved AT+CLIP=1

recieved AT+CSCS="UTF-8"

recieved AT+CLAN?

recieved AT+CKPD=200

After a pressing a button on a headset I see just the same:

recieved AT+CKPD=200

again:

recieved AT+CKPD=200

As a result I cannot hear any sound from the headset, when I trying to play smth in xmms, I hear just a noise.

I have a SE HBH-300 headset, and MSI MS-6967 bluetooth dongle.

Does anyone have an idea?

Best regards, Alexander

----------

## asyr

I can not getting to work !

Here is my info:

```
# lsusb

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

Bus 001 Device 005: ID 2001:3c00 D-Link Corp. [hex]

Bus 001 Device 001: ID 0000:0000

# lsmod

Module                  Size  Used by

snd_bt_sco             11180  0

snd_hwdep               6944  1 snd_bt_sco

snd_pcm_oss            47008  0

snd_mixer_oss          16128  1 snd_pcm_oss

hci_usb                12040  4

ehci_hcd               27656  0

uhci_hcd               29456  0

bnep                   10752  0

rfcomm                 32412  6

l2cap                  19460  6 bnep,rfcomm

bluetooth              39044  10 hci_usb,bnep,rfcomm,l2cap

# modinfo snd_bt_sco

filename:       /lib/modules/2.6.13-suspend2-r5/extra/snd-bt-sco.ko

author:         Jonathan Paisley <jp@dcs.gla.ac.uk>

description:    Bluetooth SCO Headset Soundcard

license:        GPL

vermagic:       2.6.13-suspend2-r5 PENTIUMIII REGPARM gcc-3.4

depends:        snd-hwdep

parm:           index:Index value for Bluetooth SCO Headset Soundcard. (array of int)

# hcitool scan

Scanning ...

        00:0F:DE:F3:ED:3F       HBH-600

# btsco -v 00:0F:DE:F3:ED:3F 1

btsco v0.4c

Device is 1:0

Voice setting: 0x0060

Can't connect RFCOMM channel: Resource temporarily unavailable
```

I'm also getting 'LMP response timeout' from the kbluetothd.

Any suggestions?

----------

## Mben

i have similar problems to a couple people above with a logitech headset. 

i am using the ebuilds from bugzila, everythink connects fine but when i try to test the headset (press the play button in xmms) i get a beep in the headset and the following from btsco:

```

speaker volume: 13 mic volume: 1

speaker volume: 13 mic volume: 1

driver is in use

connected SCO channel

Done setting sco fd

recieved AT+VGS=13

Sending up speaker change 13

```

if i press play i get these lines:

```

driver is not in use

disconnected SCO channel

speaker volume: 13 mic volume: 1

driver is in use

Can't connect SCO audio channel

: Software caused connection abort

```

i tried using a usb1 hub as suggested above. i have a cheap 100m zonet bluetooth 1.2 dongle from newegg that has otherwise worked well.

suggestions? 

thanks

----------

## asyr

Finally I got it !

When I use 'btsco xx:.... 1' did n't worked, but with 'btsco xx:...' (without the RFCOMM channel) and a configuration for that BT addr to the /etc/bluetooth/rfcomm.conf it works !

The sound is not perfect (far than perfect) but it works.

----------

## flocchini

it works great  :Smile:   But only xmms plays fine, mplayer sounds choppy with "ao:alsa=hw=1,0"... Any solution? It's possible to play a movie audiostream trough bt?

----------

## Entropy42

 *Mben wrote:*   

> 
> 
> i tried using a usb1 hub as suggested above. i have a cheap 100m zonet bluetooth 1.2 dongle from newegg that has otherwise worked well.
> 
> suggestions? 
> ...

 

Try "hciconfig hci0 version"

If the Manufacturer: field reports anything other than Cambridge Silicon Radio (CSR), you need a new dongle.  The BlueZ/bluetooth-alsa people really need to update their FAQ from saying "CSR chipset reccommended" to "CSR chipset required".

Which reminds me, I need to order a CellLink BTA-6030 - It's one of the only Class 1 Bluetooth 2.0 dongles out there, and it's also pretty much the only CSR-based BT2.0 one out there.

----------

## Mben

```

# hciconfig hci0 version

hci0:   Type: USB

        BD Address: 00:02:72:C3:DD:5D ACL MTU: 377:10 SCO MTU: 16:0

        HCI Ver: 1.2 (0x2) HCI Rev: 0xa LMP Ver: 1.2 (0x2) LMP Subver: 0x309

        Manufacturer: Broadcom Corporation (15)

```

when I looked at the bluez website before I got my dongle they said it was supported. Oh well, guess thats my problem at least.

----------

## Entropy42

 *Mben wrote:*   

> 
> 
> ```
> 
> # hciconfig hci0 version
> ...

 

Non-CSR chipsets are supported for pretty much anything other than headsets.  Apparently headset audio works quite differently than most other BT connections.  In fact, SCO audio can be routed to PCM outputs on most Bluetooth chips rather than to the host controller (i.e. HCI), and for some reason the crackheads at most manufacturers other than CSR make routing to PCM the default.  In addition, the method for changing this mapping is apparently not standardized.  CSR is the only manufacturer who has released the info needed to map SCO audio properly.

In general, when talking about Linux, Broadcom products should be avoided at all costs.  I bought an IOGear BT dongle and returned it the minute I discovered it was Broadcom based.

----------

## Mben

interesting. i agree about the broadcom but its hard to tell what chip you are working with before you plug it in (i have a broadcom wifi card too). oh well   :Crying or Very sad:  . maybe i can get a different dongle for cheap on black friday in a couple weeks

----------

## Mirza

Hi,

I just  setup my bt-headset to work with xmms, skype, aplay etc on SLACKWARE with kernel 2.6.14.2. xmms sound quality is great, skype might be better. 

BT-Headset: Jabra 250v

USB: Built-In IBM ThinkPad X31

After 7-8 meters the quality is getting worse, but it is still OK. 

xmms stops playing sometimes after a song and btsco shows this message:

```
i/o needed: connecting sco...

Can't connect SCO audio channel

: Software caused connection abort

```

after pressing play button, everything is goes on without problems. 

howto:

```

<turn on bluetooth>

# modprobe snd_bt_sco

# modprobe sco

# modprobe snd-emu10k1

# esdctl stop

# hciconfig hci0 voice 0x0060

# btsco -r <btaddr>

```

volume up, volume down and phone button are identified. 

thanks for all comments, it was very useful.

M.

----------

## masterbrian

Hi,

I'm having some problem with a fresh install of gentoo. It seems that the btsco-cvs needs libtool 1.5.6, and it is not compatible with the actual 1.5.20 in portage.

BTW, I'm not sure, but there are probably some problem with the 2.6.14 kernels too.

Also, with the split ebuilt, I cannot download bluetooth-alsa-cvs... where I can find this? After many tries my ebuild failed to download... where I can find this?

Thank you

----------

## stip

Hi, 

I am trying to get a Jabra BT500 working with my laptop (and especially Skype). Followed the instructions on the first page and my headset is connected - according to kbluetoothd. However, I can't hear any sound when playing something with aplay.

All I get is a short beep when the headset is done. I removed USB2.0 now from the kernel (2.6.13-r3) as this solved a similar problem for someone else, but it makes no difference for me. Any help is greatly appreciated.

Output of btsco:

```

btsco 00:07:A4:BD:6D:4B 1 -v

btsco v0.4c

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

speaker volume: 11 mic volume: 15

i/o needed: connecting sco...

connected SCO channel

Done setting sco fd

recieved AT+VGS=11

Sending up speaker change 11

speaker volume: 11 mic volume: 15

driver is not in use

disconnected SCO channel

```

----------

## nivw

tried to emerge the cvs. bluetooth-alsa wnet by fine.

btsco did complite the emerge but there is NO btsco binary  :Sad: 

```

checking for correct ltmain.sh version... no

*** [Gentoo] sanity check failed! ***

*** libtool.m4 and ltmain.sh have a version mismatch! ***

*** (libtool.m4 = 1.5.20, ltmain.sh = 1.5.6) ***

Please run:

  libtoolize --copy --force

if appropriate, please contact the maintainer of this

package (or your distribution) for help.

make: *** No targets specified and no makefile found.  Stop.

>>> Test phase [not enabled]: net-wireless/btsco-cvs-0.4a

>>> Install btsco-cvs-0.4a into /var/tmp/portage/btsco-cvs-0.4a/image/ category 

net-wireless

>>> dobin: making btsco executable...

install: cannot stat `btsco': No such file or directory

man:

prepallstrip:

>>> Completed installing btsco-cvs-0.4a into /var/tmp/portage/btsco-cvs-0.4a/image/

```

my info:

 *Quote:*   

> 
> 
> Portage 2.0.53 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-ck6 
> 
> i686)
> ...

 

----------

## kEiNsTeiN

same problem here. No binary.

```
veitbook portage # emerge btsco-cvs

Calculating dependencies ...done!

>>> emerge (1 of 1) net-wireless/btsco-cvs-0.4a-r1 to /

>>> checksums files   ;-) btsco-cvs-0.4a-r1.ebuild

>>> checksums files   ;-) files/digest-btsco-cvs-0.4a-r1

>>> Unpacking source...

 * Fetching CVS module btsco into /usr/portage/distfiles/cvs-src ...

 * Running cvs -q -f -z3 -d ":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/bluetooth-alsa" login

Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/bluetooth-alsa

 * Running cvs -q -f -z3 -d ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/bluetooth-alsa" update -dP btsco

P btsco/Makefile.am

P btsco/a2play.c

P btsco/acinclude.m4

U btsco/avrcp.h

U btsco/avrecv.c

P btsco/bootstrap

P btsco/configure.in

U btsco/ltmain.sh

U btsco/alsa-plugins/Makefile.am

U btsco/alsa-plugins/pcm_a2dp.c

U btsco/alsa-plugins/pcm_headset.c

P btsco/bt/BUILD

cvs update: btsco/bt/a2dp.h is no longer in the repository

cvs update: btsco/bt/a2dp.patch is no longer in the repository

cvs update: btsco/bt/sbc_math.h is no longer in the repository

cvs update: btsco/bt/sbc_tables.h is no longer in the repository

P btsco/sbc/Makefile.am

P btsco/sbc/sbc.c

P btsco/sbc/sbc_math.h

P btsco/sbc/sbc_tables.h

cvs update: btsco/sbc/unroll-decoder.c is no longer in the repository

 * Copying btsco from /usr/portage/distfiles/cvs-src ...

 * CVS module btsco is now in /var/tmp/portage/btsco-cvs-0.4a-r1/work

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/btsco-cvs-0.4a-r1/work/btsco ...

/usr/local/portage/net-wireless/btsco-cvs/btsco-cvs-0.4a-r1.ebuild: line 26: cd: btsco: No such file or directory

[blabla]

checking for correct ltmain.sh version... no

configure: error:

*** [Gentoo] sanity check failed! ***

*** libtool.m4 and ltmain.sh have a version mismatch! ***

*** (libtool.m4 = 1.5.22, ltmain.sh = 1.5.6) ***

Please run:

  libtoolize --copy --force

if appropriate, please contact the maintainer of this

package (or your distribution) for help.

make: *** No targets specified and no makefile found.  Stop.

>>> Source compiled.

>>> Test phase [not enabled]: net-wireless/btsco-cvs-0.4a-r1

>>> Install btsco-cvs-0.4a-r1 into /var/tmp/portage/btsco-cvs-0.4a-r1/image/ category net-wireless

/usr/local/portage/net-wireless/btsco-cvs/btsco-cvs-0.4a-r1.ebuild: line 33: cd: btsco: No such file or directory

>>> dobin: making btsco executable...

install: cannot stat `btsco': No such file or directory

man:

prepallstrip:

>>> Completed installing btsco-cvs-0.4a-r1 into /var/tmp/portage/btsco-cvs-0.4a-r1/image/

>>> Merging net-wireless/btsco-cvs-0.4a-r1 to /

--- /usr/

--- /usr/bin/

--- /usr/share/

--- /usr/share/doc/

>>> /usr/share/doc/btsco-cvs-0.4a-r1/

>>> /usr/share/doc/btsco-cvs-0.4a-r1/COPYING.gz

>>> /usr/share/doc/btsco-cvs-0.4a-r1/INSTALL.gz

>>> /usr/share/doc/btsco-cvs-0.4a-r1/README.gz

>>> Regenerating /etc/ld.so.cache...

>>> net-wireless/btsco-cvs-0.4a-r1 merged.

>>> Recording net-wireless/btsco-cvs in "world" favorites file...

[blabla]
```

----------

## nivw

nachtmann: better get the new ebuild from the address in the first post,

It took me a day , and an email to grasp that the ebuild was changed,

after that it should install fine  :Smile: 

(still not tested with my headset, dam libdbus ... should complete emerging soon..)

Niv

----------

## kEiNsTeiN

Nivw: Nope, that didnt work. It just removed the "cd" errormessage, which was irrelevant.

I got it fixed by adding "libtoolize --copy --force" above the line "./bootstrap" in the ebuild....

edit: so, I finally got everything set up, but I have the same problem as many in here: I dont get any sound. The log-message say I should get sound, but XMMS doenst show any progress when pressing play, even though it doesnt freeze. I can hear that something happens to my headset, as I get a little crack when I press play. Right now my batteries are emtpy (lol), so I have to wait a little bit until I can try anything else.

BTW: I have a Logitech Mobile Pro Headset, using a Terratec Typhoon dongle, as recommended by the awesome german pc-magazine "c't".

```
veitbook portage # hciconfig hci0 revision

hci0:   Type: USB

        BD Address: 00:10:60:AB:5A:FA ACL MTU: 192:8 SCO MTU: 64:8

        HCI 16.14

        Chip version: BlueCore02-External

        Max key size: 56 bit

        SCO mapping:  HCI

veitbook portage # hciconfig -a

hci0:   Type: USB

        BD Address: 00:10:60:AB:5A:FA ACL MTU: 192:8 SCO MTU: 64:8

        UP RUNNING PSCAN ISCAN

        RX bytes:7556062 acl:250400 sco:0 events:255592 errors:0

        TX bytes:4531543 acl:250251 sco:0 commands:5045 errors:0

        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy:

        Link mode: SLAVE ACCEPT

        Name: 'BlueZ at veitbook (0)'

        Class: 0x000000

        Service Classes: Unspecified

        Device Class: Miscellaneous,

        HCI Ver: 1.1 (0x1) HCI Rev: 0x33c LMP Ver: 1.1 (0x1) LMP Subver: 0x33c

        Manufacturer: Cambridge Silicon Radio (10)
```

```
veitbook portage # btsco 00:0D:44:02:E9:2B -v

btsco v0.4c

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

speaker volume: 9 mic volume: 1

i/o needed: connecting sco...

connected SCO channel

Done setting sco fd

recieved AT+VGS=09

Sending up speaker change 9

recieved AT+CKPD=200

recieved AT+CKPD=200

recieved AT+CKPD=200

recieved AT+CKPD=200

recieved AT+CKPD=200
```

Those last commands result from pushing the button several times....

Do we not have any solution for that?

----------

## nivw

I got to the same resault as nachtmann.

I can upload the output which looks similar to the one posted.

I use the Zonet 6100C dongle and a logitech headset

I think we need to post this issue at the bug link in the first post.

I will wait for a day , to see if hothead replays here , and then post in the bug system

----------

## hothead

Take a look at the readme  for the supported headsets:

```
vim /usr/share/doc/btsco-cvs-0.4-r1/README.gz
```

If you've followed the readme and it doesn't work  talk to the pople of the bluetooth-alsa project.

http://bluetooth-alsa.sourceforge.net/

Unfortunately I can't help you with any hardware related problems.

nachtmann's output from btsco looks fine. 

Did you set the headset as output device in xmms?

Options ->  Settings -> Output- Plugin (Alsa) ->  Configure ->  Audio Device ('BT Headset' for me)

by the way here's an initscript to start the headset:

(save under /etc/init.d/headset and make executable 'chmod +x /etc/ini.d/heaset')

```

#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

depend() {

        need bluetooth alsasound

}

checkconfig() {

        # check that the configuration file has been configured.

        if [ -z "$BDADDR" ]; then

                eerror "You should setup BDADDR in /etc/conf.d/headset."

                return 1

        fi

        if ! [ -d /sys/module/snd_bt_sco ]; then

                ebegin "Loading bluetooth-alsa kernel module (snd_bt_sco)."

                        /sbin/modprobe snd-bt-sco

                eend $? || return 1

        fi

}

start() {

        checkconfig || return 1

        ebegin "Connecting to headset"

                start-stop-daemon --start \

                --make-pidfile --pidfile /var/run/btsco2 \

                --background --exec /usr/bin/btsco2 -- $BDADDR

                sleep 1

                ps -C btsco2 >/dev/null

        eend $?

}

stop() {

        ebegin "Stopping btsco2 daemon"

                start-stop-daemon --stop --quiet --pidfile /var/run/btsco2

        eend ${?}

}
```

put your headset address into /etc/conf.d/headset

```
BDADDR="xx:xx:xx:xx:xx:xx"
```

----------

## nivw

Thanks for the code (I am real keen on software reuse :->

My headset doesnt appear on the list - rather a privios module,

but I think - it does work

 *Quote:*   

> blacky niv # sdptool search --bdaddr 00:0D:XX:XX:E1:63 0x1108
> 
> Class 0x1108
> 
> Searching for 0x1108 on 00:0D:XX:XX:E1:63 ...
> ...

 

 *Quote:*   

> blacky niv #  btsco 00:0D:XX:XX:E1:63 1 -v
> 
> btsco v0.4c
> 
> Device is 1:0
> ...

 

Edit: I tried: 

```
$ hciconfig hci0 voice 0x0060
```

 and

```
$ alsamixer -c 1 -V all
```

to lift the volume, plaied with the agc and loopback,

 same problem

----------

## kEiNsTeiN

Is anybody filing a bug or got an idea?

This retarded headset is annoying the crap out of me...

(sorry, but I tried to get it to work for... hours... and it's still not working...very very frustrating)

----------

## nivw

just to puor positive karma, here is the link to the BlueZ mailing-list  which seems to have lots of info regarding bluetooth-alsa  :Smile: 

now this current post suggest that this may happen due an unsupported usb dongle

http://sourceforge.net/mailarchive/forum.php?forum_id=1883

So, just for the hell of it , I switched from my zonet 6100c adaptor to a billionton p/n USBBT02-B (1.1 old version)

I managed to find the headset using hcitool scan

btsco ran fine accrodring to dmesg,

but I didnt even got that click in the earpiece  :Sad: 

will try it again tommorow

any help would be welcome..

----------

## thesnowman

hothead thanks for the howto.

Can you please remove the fullstop from the link to the bug as it makes the link invalid.  Thanks.

----------

## Kalin

Well, for those of you that are not CCed on  bug #91558 please have a look and thry the new ebuilds.

My full overlay is available at:

rsync://rsync.tar.bz/gentoo-portage-pkalin

(or fetch rsync://rsync.tar.bz/gentoo-portage-pkalin/pkalin.syncsource )

Please comment on the bug or to me personally. Forms are better for other uses.

----------

## Kalin

As I said in https://bugs.gentoo.org/show_bug.cgi?id=91558#c26 at the moment, there are problems with the SourceForge CVS server, hope they are fixed soon.

Check this link  before you emerge: http://cvs.sourceforge.net/viewcvs.py/bluetooth-alsa

Kalin.

----------

## Tlaloc

There are no corresponding ebuilds in the overlay you made accessible.   :Crying or Very sad: 

Many thanks to all contributing to this!   :Very Happy: 

Bye, Val.

----------

## nivw

emm.... 

IT WORKS!

sorry, but I put some effort in to see this happen. I finely can hear mp3 in the BT headphone. Thanks A LOT hothead for starting this thread , and Kalin for upgrading the bug.

I think I now need to report that a logitech freedom mobile and Billionton USB dongle V.11 work!

I had to use the same pin at /etc/bluetooth/pin , as my headset, but I think I know how to solve it.

Now , I just recived the BT-mini-hs from the geeks yesterday http://www.geeks.com/details.asp?invtid=BT-MINI-HS

it can talk to the cellular like a regulat BT headset , as well as use the audio gateway profile, so I may use it for VoIP , aka. Skype

But It also does high quality audio!

I tested it on windows, and the resault is quite impressive, for a 28$ headset.

thanks again ppl,

Niv

----------

## Kalin

Ooops :-)

Sorry, I have forgotten that I need to sync the rsync server to the (internal) subversion repository that I use on all my boxen. Thank you for pointing out. Now works.

----------

## stip

Hi!

I'm trying to emerge the new ebuilds. 

```

emerge -at bluetooth-alsa-utils

These are the packages that I would merge, in reverse order:

Calculating dependencies ...done!

[ebuild  N    ] net-wireless/bluetooth-alsa-utils-0.2_alpha20060104

[ebuild  N    ]  net-wireless/bluetooth-alsa-kernel-0.2_alpha20060104

Do you want me to merge these packages? [Yes/No] y

>>> emerge (1 of 2) net-wireless/bluetooth-alsa-kernel-0.2_alpha20060104 to /

>>> md5 files   ;-) bluetooth-alsa-kernel-0.2_alpha20060104.ebuild

>>> md5 files   ;-) files/digest-bluetooth-alsa-kernel-0.2_alpha20060104

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.13-gentoo-r3

 * Checking for suitable kernel configuration options:

>>> Unpacking source...

 * Fetching CVS module btsco/kernel into /usr/portage/distfiles/cvs-src ...

 * Running  cvs -q -f -z3 -d ":pserver:anonymous:@cvs.sourceforge.net:/cvsroot/bluetooth-alsa" login

Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/bluetooth-alsa

cvs [login aborted]: reading from server: Connection reset by peer

!!! ERROR: net-wireless/bluetooth-alsa-kernel-0.2_alpha20060104 failed.

!!! Function cvs_fetch, Line 332, Exitcode 1

!!! cvs login command failed

!!! If you need support, post the topmost build error, NOT this status message.

```

Any ideas how to resolve this?

----------

## Kalin

The CVS server @ SF is again broken it seems...

If you follow this: http://sourceforge.net/cvs/?group_id=116589

You should be able to do it manaully:

```

$  cvs -f -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/bluetooth-alsa login

Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/bluetooth-alsa

CVS password: 

cvs [login aborted]: end of file from server (consult above messages if any)

```

However at the momemnt I cannot access it either. Try again later :-)

----------

## nivw

I recently bought headphones that can use the so called "high quality audio profile" in bluetooth.

I noticed a lot of ppl are asking bluez developers to support it.

any news on that feature?

Niv

----------

## Kalin

Did you try to use them?

Did you read http://bluetooth-alsa.sourceforge.net/  about A2DP?

I am not saying they will be working, but unless you try...

----------

## nivw

Sorry but I am still stuck with getting the headset to work.

I mean it did work, but now it just screems about can't getting a rfcomm channel. so, I posted to bluez list:

http://sourceforge.net/mailarchive/forum.php?forum_id=1883

as for using the headset with skype, I notice that running /usr/bin/skype is a script that tries to use Esound.

Now according to bluetooth-alsa.sourceforge.net one sould kill Esound to use the headset.

SO, we need to alter /usr/bin/skype to work with alsa-oss, this way:

1. make sure alsa-oss is installed in your pc

2. edit /usr/bin/skype to have this:

#!/bin/bash

#

# Wrapper script to run Skype with sound wrapper when possible

logfile="${HOME}/.Skype/skype.log"

progname="skype"

progpath="/opt/${progname}/"

progopts="--resources-path ${progpath}"

shellcheck1=` which artsshell 2> /dev/null `

shellcheck2=` which esd 2> /dev/null `

artsdcheck=` ps x | grep artsd | grep -v grep `

## We use ps ax for esd as esd can be used globaly for all users.

esdcheck=` ps ax | grep "esd ." | grep -v grep `

skypecmd="${progpath}${progname}.bin"

wrapsound="yes"

[ -d "$(dirname "${logfile}")" ] || mkdir "$(dirname "${logfile}")"

echo "===== " `date` " =====" > ${logfile}

#Going to "homedir"

cd ${progpath}

echo "${skypecmd} ${progopts}" >> ${logfile}

echo "=========================================="

${skypecmd} ${progopts} >> ${logfile} 2>> ${logfile}

if [[ $? -ne 0 ]] ; then

        echo "Running wrapped Skype failed, trying not-wrapped mode..."

        echo "=========================================="

        skypecmd="aoss ${progpath}${progname}.bin"

        ${skypecmd} ${progopts} >> ${logfile} 2>&1

fi

exit $?

I basicly throw away the esd and arts part, then told skype to load by OSS , but use alsa-oss.

this way alsa would be used.

----------

## nivw

after a day or two, I finally tracked down the reason nothing worked: dbus was not running.

therefor hcid didnt load

there for no bluetooth device was talking proparly

At /etc/init.d/bluetooth 

I added the line: need dbus

before the line : after coldplug

I am very new, should I post a bug ?

1. I am using a bluetooth USB adaptor named: billionton V1.1 P/N USBBT02-B (has the CSR core 02) the barcode reads 6  45988 25000  1

2. I can hear music on my logitech mobile freedom V1.2 (also worked on a V1.1 in the past) via btsco.

3. I can hear music on my CC&C Technologies, Inc BT-MINI-HS (picture is here: http://www.geeks.com/details.asp?invtid=BT-MINI-HS ).

I also managed to hear high quality audio (A2DP) on them 

Niv

----------

## mdeininger

I'm not quite sure if you should file a bug or not, weren't there extra startup scripts for that? well, i do suppose it'd be better to post one and have devs erase/ignore/deny it if you feel it's a bug.

either way, about throwing out esound/artsd:

it's likely that this isn't what you'd want to do. esound and artsd provide software mixing *on top of other drivers*. that means that esound and artsd will use alsa drivers to communicate with your sound card (or your bluetooth headset in this case). the problem is: unless your sound card can do hardware mixing and the driver knows how to do this (which i doubt is the case with those headsets) (yes, i know alsa can do software mixing too, but dmix never worked properly for me), you can't play more than one sound on the same device. this wouldn't normally be a problem in this case since you would probably play system sounds and music on your sound card through normal speakers while the only program using the bluetooth headset would be skype, but then again, wouldn't it be nice to be able to play music on your headset while skyping? after all, that's what you bought a headset with the high quality audio profile for, isn't it?

----------

## nivw

already open:

https://bugs.gentoo.org/show_bug.cgi?id=118786

----------

## kEiNsTeiN

yey, I just remerged it and its now working with the logitech-thingy! thanks!

----------

## nivw

Kalin: I am using net-wireless/bluetooth-alsa-utils-0.2_alpha20060104 

Today I read that some thing concering oss emulation in alsa was fixed in the recent release.

So I followed the gentoo alsa guide and switched to use alsa-driver.

If I try to emerge the ebuild I get:

SND_HWDEP is not set! Plese select a config like           SND_USB_AUDIO or

 SND_EMU10K1; see under Drivers|Sound|ALSA, see                 inside PCI or US

B

I use usb-audio fine via the alsa-driver. ovcurse it doent appear in the kernel .config

How can we fix it?

----------

## nivw

OK I am certain now. bluetooth-alsa cant work when using alsa-driver. Even when SND_HWDEP is included.

I cant use BT-alsa when I compile alsa as modules in the kernel.

I dont understand the difference.

Is it to do with new alsa-driver ?

----------

## Kalin

If you have problems, please report:

```

uname -a

equery l alsa

gzcat /proc/config.gz |grep SND_|grep =

```

Some of that may not work with your environment (`emerge gentoolkit` is needed for equery), but try to provide info on your kernel .config

Giys, plese be more specific when you report problems anywhere, not jsut here:

0. What did you want/try to achieve?

1. What did you do?

2. What happened?

3. Any additional thoughts, configs, info.

----------

## nivw

Went back to what worked:

```
uname -a
```

Linux blacky 2.6.14-ck8 #14 Tue Jan 17 01:43:12 IST 2006 i686 AMD Athlon(tm) XP

3200+ AuthenticAMD GNU/Linux

```
equery l alsa
```

[ Searching for package 'alsa' in all categories among: ]

 * installed packages

[I--] [  ] media-libs/alsa-lib-1.0.10 (0)

[I--] [  ] media-libs/alsa-oss-1.0.10-r1 (0)

[I--] [  ] media-sound/alsa-headers-1.0.11_rc2 (0)

[I--] [  ] media-sound/alsa-tools-1.0.10 (0.9)

[I--] [  ] media-sound/alsa-utils-1.0.10 (0.9)

```
gzcat /proc/config.gz |grep SND_|grep =
```

CONFIG_SND_TIMER=m

CONFIG_SND_PCM=m

CONFIG_SND_HWDEP=m

CONFIG_SND_RAWMIDI=m

CONFIG_SND_SEQUENCER=m

CONFIG_SND_OSSEMUL=y

CONFIG_SND_MIXER_OSS=m

CONFIG_SND_PCM_OSS=m

CONFIG_SND_RTCTIMER=m

CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y

CONFIG_SND_MPU401_UART=m

CONFIG_SND_OPL3_LIB=m

CONFIG_SND_AC97_CODEC=m

CONFIG_SND_AC97_BUS=m

CONFIG_SND_BT87X=m

CONFIG_SND_BT87X_OVERCLOCK=y

CONFIG_SND_CMIPCI=m

CONFIG_SND_VIA82XX=m

CONFIG_SND_USB_AUDIO=m

Here is what I did to see this issue:

1) went to /usr/src/linux and ran 'make menuconfig'

2) uncheck the "M" near alsa at the kernel

3) put this line in /etc/make.conf

ALSA_CARDS="via82xx usb-audio bt87x emu10k1"

4) emerge =media-sound/alsa-driver-1.0.11_rc2

5) reboot

6) alsa loads three sound devices OK

7) sudo modprobe snd-bt-sco

 :Cool:  dmesg looks ok

9) cat /proc/asound/cards - see the forth card

10) l2ping 00:0D:44:33:E1:63

Ping: 00:0D:44:33:E1:63 from 00:10:60:A8:86:A3 (data size 44) ...

44 bytes from 00:0D:44:33:E1:63 id 0 time 42.46ms

44 bytes from 00:0D:44:33:E1:63 id 1 time 41.56ms

44 bytes from 00:0D:44:33:E1:63 id 2 time 34.55ms

44 bytes from 00:0D:44:33:E1:63 id 3 time 50.53ms

44 bytes from 00:0D:44:33:E1:63 id 4 time 49.51ms

5 sent, 5 received, 0% loss

11) btsco -v 00:0D:44:33:E1:63

btsco v0.41

Error: control open (hw:4): No such device

Error: Can't find device. Bail

Sorry for being such an idiot,

Hope its enougth info , o/w I can this again and report.

Niv

----------

## nivw

just made a proper report in the bug (see first msg of this thread)

Niv

----------

## _markd

After two nights I got my headset to work  :Smile: 

btsco gave me all kinds of erros "Permission denied", "Function not implemented", "Connection timed out" etc. (btw, btsco <MAC ADDRESS> -v -i hci0 works for me, btsco2 <MAC ADDRESS> does not !!!)

Removing the content of /var/lib/bluetooth and setting up /etc/modules.d/alsa properly helped a lot. I already thought of buying a new dongle because I read some posts that the ISSC chipset is not well supported and the output of hciconfig hci0 revision was not very promising:

```

# hciconfig -a

hci0:   Type: USB

        BD Address: xx:xx:xx:yy:yy:yy ACL MTU: 678:8 SCO MTU: 48:10

        UP RUNNING PSCAN ISCAN

        RX bytes:37727230 acl:111 sco:739445 events:438 errors:0

        TX bytes:37699896 acl:108 sco:739153 commands:161 errors:0

        Features: 0xff 0xff 0x8d 0x78 0x08 0x18 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy: RSWITCH HOLD SNIFF PARK

        Link mode: SLAVE ACCEPT

        Name: 'ISSC BlueZ (xx:xx:xx:yy:yy:yy)'

        Class: 0x3e0100

        Service Classes: Networking, Rendering, Capturing

        Device Class: Computer, Uncategorized

        HCI Ver: 1.2 (0x2) HCI Rev: 0x1ae LMP Ver: 1.2 (0x2) LMP Subver: 0x1ae

        Manufacturer: Integrated System Solution Corp. (57)

# hciconfig hci0 revision

hci0:   Type: USB

        BD Address: xx:xx:xx:yy:yy:yy ACL MTU: 678:8 SCO MTU: 48:10

        Unsupported manufacturer

```

Here's some more output which makes me happy:)

```

 sdptool search --bdaddr xx:xx:xx:xx:xx:xx 0x1108

Class 0x1108

Searching for 0x1108 on xx:xx:xx:xx:xx:xx ...

Service Name: Logitech HS02-V07

Service RecHandle: 0x10000

Service Class ID List:

  "Headset" (0x1108)

  "Generic Audio" (0x1203)

Protocol Descriptor List:

  "L2CAP" (0x0100)

  "RFCOMM" (0x0003)

    Channel: 1

Language Base Attr List:

  code_ISO639: 0x656e

  encoding:    0x6a

  base_offset: 0x100

Profile Descriptor List:

  "Headset" (0x1108)

    Version: 0x0100

```

I can recommend the Logitech Mobile Freedom for Linux Users. It works like a charm now and the quality is far better than in Windows (tried it there first with the shipped and the widcomm bluetooth stack)

Also got skype running without problems (like the postings above already say: don't use any sound daemon and enter the right dsp device (/dev/dsp1 for me))

Here's my /etc/modules.d/alsa to make my posting complete:

```

# Alsa 0.9.X kernel modules' configuration file.

# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsa-modules.conf-rc,v 1.4 2004/11/16 01:31:22 eradicator Exp $

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

   alias snd-card-0 snd-intel8x0

   alias snd-card-1 snd-bt-sco

##  OSS/Free portion

   alias sound-slot-0 snd-card-0

   alias sound-slot-1 snd-card-1

##

# OSS/Free portion - card #1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

##  OSS/Free portion - card #2

 alias sound-service-1-0 snd-mixer-oss

 alias sound-service-1-1 snd-seq-oss

 alias sound-service-1-3 snd-pcm-oss

 alias sound-service-1-8 snd-seq-oss

 alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

options snd cards_limit=2

```

----------

## legatodnl

I'm trying to get a Nokia HS-11W to work with skype. But having some problems with the xmms test.

```
dan@chrono ~ $  btsco2 00:08:C6:60:51:30

Device is 2:0

Voice setting: 0x0060

RFCOMM channel 1 connected

recieved AT+CKPD=200

opened hwdep

Can't connect SCO audio channel: Protocol not supported
```

Then if i press the volume buttons I get

```
recieved AT+VGS=7

Sending up speaker change 7
```

But when I set xmms to play to the bt headset, the track doesn't play it stays paused on zero.

Any ideas guys?

----------

## mdeininger

well, yeah

```

 Can't connect SCO audio channel: Protocol not supported

```

i'd suppose your dongle isn't supported... what's the output of

```

 # hciconfig -a

 # hciconfig hci0 revision 

```

?

----------

## legatodnl

```
chrono dan # hciconfig -a 

hci0:   Type: USB

        BD Address: 00:0A:3A:64:D1:24 ACL MTU: 377:10 SCO MTU: 16:0

        UP RUNNING PSCAN ISCAN 

        RX bytes:245605 acl:7917 sco:0 events:16107 errors:0

        TX bytes:8238430 acl:38328 sco:0 commands:120 errors:0

        Features: 0xff 0xfe 0x0d 0x38 0x08 0x08 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 

        Link policy: RSWITCH HOLD SNIFF PARK 

        Link mode: SLAVE ACCEPT 

        Name: 'BlueZ (0)'

        Class: 0x3e0100

        Service Classes: Networking, Rendering, Capturing, Object Transfer, Audio

        Device Class: Computer, Uncategorized

        HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x309

        Manufacturer: Broadcom Corporation (15)

chrono dan # hciconfig hci0 revision 

hci0:   Type: USB

        BD Address: 00:0A:3A:64:D1:24 ACL MTU: 377:10 SCO MTU: 16:0

        Firmware 0.3 / 9

```

It is a broadcom and I have just read that broadcom is unsupported.  :Sad:  Anyone recommend a working dongle that can be quickly obtained in UK (aria.co.uy or dabs.com).

Dan

----------

## nivw

thanks _markd I have add your remak to the wiki.

cheers mate

----------

## madureira

Hello.

I am having problems setting up this Plantronics M2500 headset with a Belkin Bluetooth Version 2.0 dongle in Linux.

My output running btsco2 is:

./btsco2 00:03:89:77:6C:E0

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

Then after pushing the headset button:

recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=15

Sending up speaker change 15

Then I run Skype for example and when I try to make a call for the /dev/dsp1 device I dont hear any sound and I have the following error message from Skype:

write error, written = 256

write error, written = -1

When I do hciconfig hci0 I get:

hci0: Type: USB

BD Address: 00:00:3A:68:C0:C7 ACL MTU: 1017:8 SCO MTU: 64:0

UP RUNNING PSCAN ISCAN AUTH ENCRYPT

RX bytes:1573150 acl:87 sco:30795 events:101 errors:0

TX bytes:1618 acl:62 sco:0 commands:33 errors:0

Can anyone give me any idea?

Thank you very much.

Regards, Antonio.

----------

## mdeininger

[/quote]

It is a broadcom and I have just read that broadcom is unsupported.  :Sad:  Anyone recommend a working dongle that can be quickly obtained in UK (aria.co.uy or dabs.com).[/quote]

well, i've got a sitecom with 100 metres range, that seems to work fairly well, but i can't remember the version of the thing  :Sad: 

madureira: the good news is, i know the headset *can* work, the bad news is, i'm clueless as to your problem  :Smile: 

----------

## krosswindz

I have a Plantronics Voyager 510 Bluetooth Headset. I followed the instructions from here. It was a cake walk following those instructions. Thanks for the helps guys. I have all my devices working on my laptop now.[/url]

----------

## nivw

krosswindz: Glad I could be of help. pls add the devices that work for you in the chart of post them here and I will add them.

Niv

----------

## Maxwell

Just to tell that i've got it working.  :Very Happy: 

I've been testing with bmp and when the musics end btsco complains with:

 *Quote:*   

> Can't connect SCO audio channel
> 
> : Software caused connection abort
> 
> 

 

I tested it with alsa and oss. A funny thing is that i can't hear online radios... weird, i guess...

It's not a big problem for me, as i only want to use my headset Logitech HS02-V07 with skype. Just hope that Gaim-vv gets stable soon ...  :Very Happy: 

TIP: For the users behind a firewall, see this https://forums.gentoo.org/viewtopic-t-303039.html

----------

## stip

@madureira:

What does 

```

hciconfig hci0 version

```

tell you?

I also found this post https://forums.gentoo.org/viewtopic-p-1821952.html#1821952. Quoting elduderino

 *Quote:*   

> 
> 
> you should try a different usb-dongle. your SCO Mtu is 64:0 it must be 64:<0 like 64:8 or something to work.
> 
> 

 

You can set the SCO MTU manually or by modifying your kernel. I found something on that on one of the bluez mailing lists, but didn't work for me, so I forgot the link. It may work for you. On the other hand, if your dongle is Broadcom-based, you better get a new one. I have a Broadcom-based thingy, working fine in Windows (after changing to Widcomm-stack), but no good in Linux.

----------

## nivw

 *Quote:*   

> SCO MTU: 64:0

 

Marcell wrote on the BlueZ ML that he is to look into the broadcomm compatibility issue. 

However boardcomm are common in BT V.1.2 dongles , and now that V.2 is out - I belive it makes more sense developing in that direction.

After all , BT dongles are so cheap today, one may find a dongle that works fine in linux for 15$.

Did any1 actually managed to run beep media player with A2DP ( a2play ) ?

I tried to follow the advise , and een posted in the BMP ML , but it doesnt work.

Niv

----------

## madureira

Hello.

Thank you for your replies.

I didnt manage to put it working yet. I have seen a patch to change the sco_mtu in the alsa project webpage to be applied in a hci_event.c file. I have bluez libs 2.25 installed in my PC but I dont have this file. Where should I apply the patch then ?

I am needing this dongle for a research project, so I need it working surely and quickly. Can anyone tell me which dongle works for sure with a Plantronics 2500 headset ?

I also need to develop an application to automatically connect to the headset. btsco2 does this but it seems to stop if the user tries to disconnect the headset (stop the RFCOMM). So my idea is rebooting everything when the user closes an SCO link and starting again btsco2 as soon as the headset is in range again. Which steps are needed to reset the headset connection (killall btsco, hcitool dc, ... ) ?

Thank you very much.

----------

## madureira

Hello.

Does anyone know how to get rid of this btsco error ("Can't connect SCO audio channel: Address already in use")?

In the dmseg I get "snd-bt-sco: file_count is 2 (expected 3)".

Thank you very much.

----------

## tuxian

Today I got my Nokia HS-54W Headset and I already was able to use it in skype and xmms.

But it only works sometimes, I always must try arould for an half hour or longer to get it working (/etc/init.d/bluetooth restart, /etc/init.d/headset restart, turning the headset on and off).

I always can call the testuser in Skype but I don't hear anything. 

kbluetooth shows that I am connected to the headset.

Maybe it's a pairing problem??

I use the latest ebuilds (bluetooth-alsa-kernel-0.41.ebuild and bluetooth-alsa-utils-0.41.ebuild) and gentoo-sources-2.6.15-r1.

It's also doesn't work if I reboot my notebook and also the headset.

----------

## tuxian

 *tuxian wrote:*   

> Today I got my Nokia HS-54W Headset and I already was able to use it in skype and xmms.
> 
> But it only works sometimes, I always must try arould for an half hour or longer to get it working (/etc/init.d/bluetooth restart, /etc/init.d/headset restart, turning the headset on and off).
> 
> I always can call the testuser in Skype but I don't hear anything. 
> ...

 

It works fine now   :Very Happy:   :Very Happy:   :Very Happy: 

I changed the channel from 1 to 2.

markus@laptop: pts/1: 47 files 1,2Gb -> cat /etc/init.d/headset

#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

depend() {

        need bluetooth alsasound

}

checkconfig() {

        # check that the configuration file has been configured.

        if [ -z "$BDADDR" ]; then

                eerror "You should setup BDADDR in /etc/conf.d/headset."

                return 1

        fi

        if ! [ -d /sys/module/snd_bt_sco ]; then

                ebegin "Loading bluetooth-alsa kernel module (snd_bt_sco)."

                        /sbin/modprobe snd-bt-sco

                eend $? || return 1

        fi

}

start() {

        checkconfig || return 1

        ebegin "Connecting to headset"

                start-stop-daemon --start \

                --make-pidfile --pidfile /var/run/btsco2 \

                --background --exec /usr/bin/btsco2 -- $BDADDR $CHANNEL

                sleep 1

                ps -C btsco2 >/dev/null

        eend $?

}

stop() {

        ebegin "Stopping btsco2 daemon"

                start-stop-daemon --stop --quiet --pidfile /var/run/btsco2

        eend ${?}

}

markus@laptop: pts/1: 47 files 1,2Gb -> cat /etc/conf.d/headset

BDADDR="00:02:76:4B:1E:25"

CHANNEL="2"

 :Very Happy:   :Very Happy:   :Very Happy: 

The best thing is that my Nokia 6630 and this Headset work simultaneously via bluetooth.

I am able to use the Nokia 6630 as UMTS Modem over bluetooth and can call somebody with skype with the bluetooth headset:

http://www.layr.at/linux/headset.jpg

----------

## drutten

This looks like a nice thing if you have a bt headset, but since i don't i've got some questions.

Would i be able to use my phone (sony ericsson t610) as a microphone and use it to talk in skype and such?

I took a quick search on the thread but didn't see any notion of it.

That would be a nice feature, and maybe that could be built on so i could see on my phone and answer on it when i get a call on skype.

if this is already possibly maybe someone could point me in the right direction.

----------

## mdeininger

 *drutten wrote:*   

> This looks like a nice thing if you have a bt headset, but since i don't i've got some questions.
> 
> Would i be able to use my phone (sony ericsson t610) as a microphone and use it to talk in skype and such?
> 
> I took a quick search on the thread but didn't see any notion of it.
> ...

 

That probably depends on the phone and the bluetooth profiles it supports. I think it worked with my nokia 6310i (using it as a "headset" that is), because that supported some audio profiles. Just get a list of its supported audio profiles and then try to follow the guide, it might just work  :Very Happy: . On whether or not you can use it to pick up calls and things... I doubt that. I know some mobile phones have special software bundled that allows you to use them as a remote control for your computer, but I haven't seen one that would allow you to actually send small strings of text to its display... But then again, with some mobile phones starting to use linux, everything is possible I guess  :Very Happy: 

----------

## drutten

 *mdeininger wrote:*   

> That probably depends on the phone and the bluetooth profiles it supports. I think it worked with my nokia 6310i (using it as a "headset" that is), because that supported some audio profiles. Just get a list of its supported audio profiles and then try to follow the guide, it might just work . On whether or not you can use it to pick up calls and things... I doubt that. I know some mobile phones have special software bundled that allows you to use them as a remote control for your computer, but I haven't seen one that would allow you to actually send small strings of text to its display... But then again, with some mobile phones starting to use linux, everything is possible I guess 

 

Well I have a sony ericsson t610. as far as I know it supports profiles for headset and such, that is you can use a bluetooth headset with it, but i wan't the phone to be the "headset" and talk through my phone when using skype and such. I'll try to see if i can get any information on what the phone support.

About answering calls from skype, maybe it would be possible to make a program in java to put on the phone that would use bluetooth to talk to the computer?

And yes, a phone with linux would be great if I'd be able to customize it just the way I wan't it, but I don't have a phone like that yet.

----------

## curious_bob

Is there a list somewhere of compatible dongles?

----------

## bubbas

so after trying some hours got it know working with the "lutec bta-6030 V2.0" (CSR-Chip) dongle and Logitech-Mobile-Pro headset.

My Dlink-dbt-122 is not working (Broadcomchip)

thx all the people working for this!

vale

----------

## nivw

here is an odd ball:

I can use btsco from bluetooth alsa 0.41 with alsa build as modules in the kernel,

But If I turn it off in the kernel and install the alsa driver modules , btsco - just doesnt work.

in both case I  have the file:

/lib/modules/`uname -r`/alsa-driver/acore/snd-hwdep.ko

So is there a problem using btsco againt alsa 1.10 , while it works for 1.09?

Niv

----------

## nivw

 *curious_bob wrote:*   

> Is there a list somewhere of compatible dongles?

 

http://gentoo-wiki.com/HOWTO_use_a_bluetooth_headset#Hardware_Known_to_Work

----------

## nivw

 *bubbas wrote:*   

> so after trying some hours got it know working with the "lutec bta-6030 V2.0" (CSR-Chip) dongle and Logitech-Mobile-Pro headset.
> 
> My Dlink-dbt-122 is not working (Broadcomchip)
> 
> thx all the people working for this!
> ...

 

pls the first note in http://gentoo-wiki.com/HOWTO_use_a_bluetooth_headset#Troubleshooting on how to use broadcomm based adaptor. if it works, pls report.

----------

## erikderzweite

Hi!

First of all, txs for the great forum, it helped alot.

But for now, i am dealing with a problem i can't really handle.

I have the very same usb dongle as _markd (ID 1131:1001 Integrated

System Solution Corp.) and a Motorola Bluetooth H300 headset.

I am able to connect SCO channel, get no errors, but the sound stream is

broken - i hear sound only for about half a second, followed by a

half-second silence.

Of course, it is impossible to make a Skype call like that   :Smile: 

As i've told, i have no usual errors (not errors at all) listed in this

forum and in my outputs, but i'll post my hcitool -con output during the

connection:

```

< SCO 00:0B:2E:70:51:BE handle 2 state 1 lm SLAVE

< ACL 00:0B:2E:70:51:BE handle 1 state 1 lm SLAVE

```

and here is the small output of hcidump during active voice connection:

```

> SCO data: handle 2 dlen 48

< SCO data: handle 2 dlen 48

< SCO data: handle 2 dlen 48

< SCO data: handle 2 dlen 48

> SCO data: handle 2 dlen 48

> SCO data: handle 2 dlen 48

> SCO data: handle 2 dlen 48

< SCO data: handle 2 dlen 48

< SCO data: handle 2 dlen 48

< SCO data: handle 2 dlen 48

> SCO data: handle 2 dlen 48

> SCO data: handle 2 dlen 48

> SCO data: handle 2 dlen 48

> SCO data: handle 2 dlen 48

```

and so on... Looks normal for me, but the stream is still broken. Can anyone help me?

Oh, yes, i use a 2.6.15-r1-gentoo kernel bluez 2.25 and bluetooth-alsa 0.41.

P.S. Got it working once but can't make it again  :Smile: 

----------

## Tlaloc

 *nivw wrote:*   

>  *bubbas wrote:*   so after trying some hours got it know working with the "lutec bta-6030 V2.0" (CSR-Chip) dongle and Logitech-Mobile-Pro headset.
> 
> My Dlink-dbt-122 is not working (Broadcomchip)
> 
> thx all the people working for this!
> ...

 

Hooray, it works, thanks for pointing this possibility out.  :Very Happy:  Haven't tested it thouroughly, but skype test service worked. I had to use btsco, btsco2 didn't work, console output was " Can't connect RFCOMM channel" there. My bluetooth adapter is of the integrated USB type in an HP nx8220 and uses the bcm203x driver in the kernel.

```

Anbieter Kennung 0x3f0 (Hewlett Packard)

Produkt Kennung 0x11d

Revision 0.17

```

Bye, Val.[/code]

----------

## Mben

 *Tlaloc wrote:*   

>  *nivw wrote:*    *bubbas wrote:*   so after trying some hours got it know working with the "lutec bta-6030 V2.0" (CSR-Chip) dongle and Logitech-Mobile-Pro headset.
> 
> My Dlink-dbt-122 is not working (Broadcomchip)
> 
> thx all the people working for this!
> ...

 

The patch doesn't seem to help on with my zonet 100m usb adaptor (I can't remember the exact model, but it is broadcom based)

```

lsusb

.....

Bus 003 Device 002: ID 0a5c:200a Broadcom Corp.

```

It connects without problems and the headset (logitech cordless freedom) beeps a bit, but the most I get in the way of sound is a few pops now and then. xmms doesn't even seem to start playing. Hopefully someone will resolve this, If you need more info I will do my best to provide it. I can ping the headset if it matters.

----------

## nirax

did someone got it working for amd64 running 64bit??

if yes, how ?

greetings and thanks,

nirax

----------

## nirax

ok i got it working under 64bit / amd64.

basically what i did was to get all files from sourceforge and compile them manually for amd64 without problems. (even the kernel module snd-bt-sco.

the erazor-zone.de overlay is still plain x86, and i didnt checked all ebuild dependencies to check if it would break something on amd64.

greetings,

nirax

----------

## novazur

Hi,

I've spent all my day to try to make my headset giving sound.

I'll try to give you all informations, and it would be great if you could tell me if I have a chance to get it working or not.

My USB bluetooth is a TRENDNet model TBW-102UB : http://www.materiel.net/details_TBW-102UB.html

My headset is a Sonyericsson HBH-608 : http://www.ebizcuss.com/divers/CNETFICHEART_DESC.ASP?ProdID=S2761275

```
# uname -r

2.6.15-gentoo-r1
```

```
# grep SCO /usr/src/linux/.config

CONFIG_BT_SCO=m

CONFIG_BT_HCIUSB_SCO=y
```

```
# equery l bluetooth-alsa

[ Searching for package 'bluetooth-alsa' in all categories among: ]

 * installed packages

[I--] [  ] net-wireless/bluetooth-alsa-kernel-0.41 (0)

[I--] [  ] net-wireless/bluetooth-alsa-utils-0.41 (0)
```

```
# lspci -v

00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 02)

        Subsystem: Uniwill Computer Corp Unknown device 9011

        Flags: bus master, medium devsel, latency 0, IRQ 16

        I/O ports at e000 [size=256]

        I/O ports at e100 [size=64]

        Memory at 10100400 (32-bit, non-prefetchable) [size=512]

        Memory at 10100600 (32-bit, non-prefetchable) [size=256]

        Capabilities: [50] Power Management version 2
```

```
# epure /etc/modules.d/alsa (*)

alias snd-card-0 snd-intel8x0

alias snd-card-1 snd-bt-sco

alias sound-slot-0 snd-card-0

alias sound-slot-1 snd-card-1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

alias sound-service-1-0 snd-mixer-oss

alias sound-service-1-1 snd-seq-oss

alias sound-service-1-3 snd-pcm-oss

alias sound-service-1-8 snd-seq-oss

alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

options snd cards_limit=2
```

(*) epure is just a script to have file commentless

```
# lsmod | grep snd

snd_pcm_oss            41632  0

snd_mixer_oss          14208  1 snd_pcm_oss

snd_seq_oss            26880  0

snd_seq_midi_event      5632  1 snd_seq_oss

snd_seq                42128  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          6284  2 snd_seq_oss,snd_seq

snd_bt_sco             11180  0

snd_hwdep               6560  1 snd_bt_sco

snd_intel8x0           25500  0

snd_ac97_codec         78752  1 snd_intel8x0

snd_ac97_bus            1920  1 snd_ac97_codec

snd_pcm                69128  4 snd_pcm_oss,snd_bt_sco,snd_intel8x0,snd_ac97_codec

snd_timer              18564  2 snd_seq,snd_pcm

snd                    39780  11 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_bt_sco,snd_hwdep,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer

soundcore               7008  1 snd

snd_page_alloc          7688  3 snd_bt_sco,snd_intel8x0,snd_pcm
```

```
# epure /etc/bluetooth/hcid.conf

options {

        autoinit yes;

        security auto;

        pairing multi;

        pin_helper /usr/lib/kdebluetooth/kbluepin;

}

device {

        name "%h (%d)";

        class 0x300404;

        iscan enable; pscan enable;

        lm accept;

        lp rswitch,hold,sniff,park;

        auth disable;

        encrypt disable;

}
```

```
# epure /etc/bluetooth/rfcomm.conf

rfcomm0 {

        bind no;

        device 00:0F:DE:DF:7B:9A;

        channel 6;

        comment "Example Bluetooth device";

}

rfcomm1 {

        bind no;

        device 00:0F:DE:D4:CE:08;

        channel 1;

        comment "headset";

}
```

```
# hciconfig -a

hci0:   Type: USB

        BD Address: 00:0B:0D:06:F3:A3 ACL MTU: 120:20 SCO MTU: 64:0

        UP RUNNING PSCAN ISCAN

        RX bytes:964 acl:0 sco:0 events:29 errors:0

        TX bytes:366 acl:0 sco:0 commands:26 errors:0

        Features: 0xff 0xff 0x05 0x38 0x18 0x18 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy: RSWITCH HOLD SNIFF PARK

        Link mode: SLAVE ACCEPT

        Name: 'geri (0)'

        Class: 0x300404

        Service Classes:

        Device Class: Audio/Video, Device conforms to the Headset profile

        HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x757

        Manufacturer: Silicon Wave (11)
```

```
# l2ping 00:0F:DE:D4:CE:08

Ping: 00:0F:DE:D4:CE:08 from 00:0B:0D:06:F3:A3 (data size 44) ...

44 bytes from 00:0F:DE:D4:CE:08 id 0 time 61.67ms

44 bytes from 00:0F:DE:D4:CE:08 id 1 time 12.20ms

44 bytes from 00:0F:DE:D4:CE:08 id 2 time 20.17ms

44 bytes from 00:0F:DE:D4:CE:08 id 3 time 12.74ms

4 sent, 4 received, 0% loss
```

```
# btsco2 00:0F:DE:D4:CE:08

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected
```

When I hit button on the headset, I get :

```
recieved AT+CKPD=200

opened hwdep

connected SCO channel

Setting sco fd

Done setting sco fd

recieved AT+VGS=14

Sending up speaker change 14
```

I can change speaker volume :

```
recieved AT+VGS=15

Sending up speaker change 15
```

But, when I try to get sound :

```
# aplay -B 1000000 -D plughw:Headset /usr/share/sounds/gaim/redalert.wav

Playing WAVE '/usr/share/sounds/gaim/redalert.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono
```

stay blocking, and never give anything.

Tried to with :

```
# mpg123 --au - /musique/Top/son\ ki\ déchire/Track\ 1_0625154006.mp3 | a2play 00:0F:DE:D4:CE:08

subbands = 8 blocks = 16 bitpool = 32

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.

Version 0.59s-r9 (2000/Oct/27). Written and copyrights by Michael Hipp.

Uses code from various people. See 'README' for more!

THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!

Title  : artist - Track 1_0625154006     Artist:

Album  :                                 Year  :

Comment:                                 Genre : Other

Directory: /musique/Top/son ki déchire/

Playing MPEG stream from Track 1_0625154006.mp3 ...

MPEG 2.0 layer III, 80 kbit/s, 22050 Hz joint-stereo

len=2048

Header size=32

Sample Rate:22050

Channels:2

Using address: 00:0F:DE:D4:CE:08

Found A2DP Sink at the destination

Can't connect to 08:CE:D4:DE:0F:00. Connection refused(111)

cannot open psm_cmd = 25
```

Tried to do as explained here http://bluetooth-alsa.sourceforge.net/ :

```
# hciconfig hci0 class 0x200404 (or 0x300404)

# sdptool add A2SNK
```

with no result.

I don't know what to try else.

It is possible for someone to try to help me please ?

Tell me if you need more informations.

PS : sorry for my bad english.

[edit]

I tried too with :

```
# btsco -v 00:0F:DE:D4:CE:08

btsco v0.41

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

recieved AT+CKPD=200

speaker volume: 15 mic volume: 15

i/o needed: connecting sco...

connected SCO channel

Done setting sco fd

recieved AT+VGS=15

Sending up speaker change 15

speaker volume: 15 mic volume: 15

driver is not in use

disconnected SCO channel
```

The solution seems not so far, but I can't get it alone...  :Sad: 

[/edit]

[edit2]

I got it working now ! With the famous sco-mtu.patch, and I still have :

```
# hciconfig hci0 revision

hci0:   Type: USB

        BD Address: 00:0B:0D:06:F3:A3 ACL MTU: 120:20 SCO MTU: 64:8

        Unsupported manufacturer
```

It only works once. I have to unplug and replug usb bt-dongle after each use.

It only works with btsco and not with btsco2.

But it works !

I can now phone with kiax and my headset, and that's great !  :Wink: 

[/edit2]

----------

## Macce

Do you think it is possible to use a Symbian S60 phone (Nokia 6630) as the HF-device with a computer?

I got a connection between the phone and computer. The phone shows that a BT-connection is established and shows a HF-symbol. But if I try to play some music on the computer (xmms) it won't start. I get no error, but it just don't go further forward than 0s.

If I play music on the phone it comes from the phones own speaker.

----------

## UpooPoo

Just posting that I have gotten the Scala 500 by Cardo Systems working.  I am using the Dlink DBT-120(rev 4) adapter.

----------

## RuhrpottKai

The following configuration works:

MSI pc2pc bluetooth dongle, product number: I4L - MS6967 (ca. 20)

Plantronics Explorer 320 bluetooth headset (ca. 50)

kernel 2.6.15-gentoo-r1

net-wireless/bluez-libs-2.24

net-wireless/bluez-utils-2.24

btsco2 from cvs snapshot, can't remember the exact date  :Wink: 

tested audio play with xmms

tested audio record with TeamSpeak in loopback mode (great sound quality, at least what you expect from a bluetooth sound device  :Wink:  )

----------

## tuxian

```
root@laptop: pts/1: 22 files 3,1Mb -> emerge bluetooth-alsa-cvs

Calculating dependencies ...done!

>>> emerge (1 of 1) media-sound/bluetooth-alsa-cvs-1.6 to /

>>> md5 files   ;-) bluetooth-alsa-cvs-1.6.ebuild

>>> md5 files   ;-) files/digest-bluetooth-alsa-cvs-1.6

Proceed with enter to compile against running kernel.

You may also enter a different kernel version or type 'info' to get general information:

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.16-gentoo-r7

>>> Unpacking source...

 * Fetching CVS module btsco/kernel into /usr/portage/distfiles/cvs-src ...

 * Running  cvs -q -f -z4 -d ":pserver:anonymous:@cvs.sf.net:/cvsroot/bluetooth-alsa" login

Logging in to :pserver:anonymous@cvs.sf.net:2401/cvsroot/bluetooth-alsa

cvs [login aborted]: connect to cvs.sf.net(66.35.250.207):2401 failed: No route to host

!!! ERROR: media-sound/bluetooth-alsa-cvs-1.6 failed.

!!! Function cvs_fetch, Line 332, Exitcode 1

!!! cvs login command failed

!!! If you need support, post the topmost build error, NOT this status message.

```

Any solution?

----------

## RuhrpottKai

Sourceforge has added subdomains for CVS.

you can get the sourcecode now via:

```

>cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sf.net:/cvsroot/bluetooth-alsa login

>cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sf.net:/cvsroot/bluetooth-alsa co btsco 

```

----------

## tuxian

```
root@laptop: pts/1: 22 files 3,1Mb -> cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sf.net:/cvsroot/bluetooth-alsa login

Logging in to :pserver:anonymous@bluetooth-alsa.cvs.sf.net:2401/cvsroot/bluetooth-alsa

CVS password:

Unknown host bluetooth-alsa.cvs.sf.net.

```

----------

## tuxian

I had do change "sf" to "sourceforge" in the URL.

Which ebuild are the latest?

```
net-wireless/bluetooth-alsa-kernel-0.41

net-wireless/bluetooth-alsa-utils-0.41
```

??

In my opinion old ebuilds should be removed from the first posting in this thread because it is complex.

----------

## femtotech

I just wanted to let everyone know that I have the Linksys USBBT100 (ver 1) working great.  Version 1 is a bluetooth 1.1 dongle that uses the CSR chip.  I also have a USBBT100 ver 2 - bluetooth 1.2 using the Broadcom chip.  I have been unable to get the version 2 working, even with the sco-mtu patch.  I'm going to keep playing with it though...  Luckily I had both versions  :Smile: 

----------

## jhgz1

Just wanted to mention that the bluetooth device integrated in the new Macbook works flawlessly together with the two ebuilds. I don't know if they used the same adapter as in the Macbook Pro, so I can't make any promises for that one, but the Macbook works great.

----------

## dmvianna

No luck trying to install against 2.6.17-gentoo-r8 and alsa-driver. The link for www.hotheads.de is dead. Any suggestions?

In /etc/make.conf: 

```
ALSA_CARDS="hda-intel usb-audio
```

In /etc/modules.d/alsa:

```
# Alsa 0.9.X kernel modules' configuration file.

# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsa-modules.conf-rc,v 1.5 2006/06/13 10:18:25 uberlord Exp $

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `modules-update' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

alias char-major-116 snd

alias snd-card-0 snd-hda-intel

alias snd-card-1 snd-usb-audio

##

##  OSS/Free portion

alias sound-slot-0 snd-hda-intel

alias sound-slot-1 snt-usb-audio

##

## OSS/Free portion - card #1 (Intel HD Audio)

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

##

##  OSS/Free portion - card #2 (Bluetooth headset)

alias sound-service-1-0 snd-mixer-oss

alias sound-service-1-3 snd-pcm-oss

alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

##

## Set this to the correct number of cards

options snd cards_limit=2

options snd-hda-intel index=0

options snd-usb-audio index=1

```

In /usr/src/linux/.config:

```
CONFIG_BT=y

CONFIG_BT_L2CAP=m

CONFIG_BT_SCO=m

CONFIG_BT_RFCOMM=m

CONFIG_BT_RFCOMM_TTY=y

CONFIG_BT_BNEP=m

CONFIG_BT_BNEP_MC_FILTER=y

CONFIG_BT_BNEP_PROTO_FILTER=y

CONFIG_BT_HIDP=m

CONFIG_BT_HCIUSB=m

CONFIG_BT_HCIUSB_SCO=y

CONFIG_BT_HCIUART=m

CONFIG_BT_HCIUART_H4=y

CONFIG_BT_HCIUART_BCSP=y

CONFIG_BT_HCIBCM203X=m

CONFIG_BT_HCIBPA10X=m

CONFIG_BT_HCIBFUSB=m

CONFIG_BT_HCIVHCI=m

# CONFIG_VIDEO_BT848 is not set

# CONFIG_USB_KBTAB is not set

```

Result:   :Evil or Very Mad:  

```
>>> Emerging (1 of 1) net-wireless/bluetooth-alsa-cvs-1.6-r2 to /

 * checking ebuild checksums ;-) ...                                      [ ok ]

 * checking auxfile checksums ;-) ...                                     [ ok ]

 * checking miscfile checksums ;-) ...                                    [ ok ]

Proceed with enter to compile against running kernel.

You may also enter a different kernel version or type 'info' to get general information: 2.6.17-gentoo-r8

 * CONFIG_SND_HWDEP is not enabled.

 * The kernel source needs to be configured and installed with BT_SCO and SND_HWDEP enabled.

 * BT_SCO can be found under:

 * Device drivers -> Net. support -> Bluetooth subs. support -> SCO links support

 * If you have a usb bluetooth dongle you must also enable BT_HCIUSB_SCO:

 * Device drivers -> Net. support -> Bluetooth subs. support -> HCI USB driver -> SCO support

 * SND_HWDEP depends on special ALSA sound drivers

 * You can either choose the Tascam usb sound driver 'SND_USB_USX2Y'

 * or the soundblaster live driver 'SND_EMU10K1'.

!!! ERROR: net-wireless/bluetooth-alsa-cvs-1.6-r2 failed.

Call stack:

  ebuild.sh, line 1562:   Called dyn_setup

  ebuild.sh, line 665:   Called pkg_setup

  bluetooth-alsa-cvs-1.6-r2.ebuild, line 94:   Called choose_kernel

  bluetooth-alsa-cvs-1.6-r2.ebuild, line 90:   Called general_info

  bluetooth-alsa-cvs-1.6-r2.ebuild, line 35:   Called die

!!! (no error message)

!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! This ebuild is from an overlay: '/usr/local/portage'

```

----------

## fbcyborg

Hello all!

It seems my "USB" dongle bluetooth is supported... Notice that mine is an Integrated device. Anyway...

I have the following problem.

First of all I connect my headset with this command:

```
# btsco -v xx:xx:xx:xx:xx:xx

btsco v0.41

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 1 connected

```

Once I press the call button on the headset this happens:

```
recieved AT+CKPD=200

i/o needed: connecting sco...

Can't connect SCO audio channel

: Protocol not supported

```

In any case I think my bluetooth device (bluetooth receiver on my notebook) is supported.

```
# hciconfig -a

hci0:   Type: USB

        BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 384:8 SCO MTU: 64:8

        UP RUNNING PSCAN ISCAN

        RX bytes:17103 acl:313 sco:0 events:1313 errors:0

        TX bytes:10032 acl:272 sco:0 commands:888 errors:0

        Features: 0xff 0xff 0x8b 0xfe 0x9b 0xf9 0x00 0x80

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy:

        Link mode: SLAVE ACCEPT

        Name: 'CSR - bc4'

        Class: 0x000000

        Service Classes: Unspecified

        Device Class: Miscellaneous,

        HCI Ver: 2.0 (0x3) HCI Rev: 0x77b LMP Ver: 2.0 (0x3) LMP Subver: 0x77b

        Manufacturer: Cambridge Silicon Radio (10)

```

```
# hciconfig hci0 revision

hci0:   Type: USB

        BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 384:8 SCO MTU: 64:8

        HCI 19.2

        Chip version: BlueCore4-External

        Max key size: 56 bit

        SCO mapping:  HCI

```

Please, tell me how to solve this problem.

Thanks!

----------

## dreadhead

Do you have enabled SCO Support in your kernel config?

----------

## fbcyborg

Hi, 

yes I have:

```
# grep SCO /usr/src/linux/.config

# CONFIG_DISCONTIGMEM_MANUAL is not set

CONFIG_BT_SCO=m

CONFIG_BT_HCIUSB_SCO=y

```

I think I was forgiving to modprobe sco.

I'm going to retry my BT headset. Now it doesn't show any error message.

EDIT: now my headset works... but with skype sound is very bad. I have several delays and sound distorsion, like when I don't use BT headset.

Skype under linux is very bad.

----------

## dmvianna

 *fbcyborg wrote:*   

> EDIT: now my headset works... but with skype sound is very bad. I have several delays and sound distorsion, like when I don't use BT headset.
> 
> Skype under linux is very bad.

 

I was unsuccessfully trying to make my bt headset work with skype for a long time. Tried both Linux Skype and Windows Skype under Wine, different versions of both. Skype under Wine dies when I try to use the headset, works allright otherwise (no image support). Under Linux, Skype-1.3.0.53-r1 does not work at all, and Skype-1.2.0.21-r1 works perfectly well. The sound is as good as it gets. I'm using btsco-0.41 and btsco-kernel-0.41. btsco-cvs-0.4-r1 is installed as well (tried that before using btsco, did not uninstall before installing btsco and btsco-kernel).

[EDIT]:  Ah, forgot to tell. I'm using gentoo-sources 2.6.19-r2

----------

## agnitio

I could not get btsco-0.41 to work at all. Modprobe completely froze when trying to insert the module.

I'm currently testing the cvs-version of btsco wich does not use a kernel module, instead it works only using an alsa plugin. All seems well and I get it to connect with my headset and the headset beeps as when it recieves an incomming connection, but then there's no sound at all.

I tried using mplayer and I get theese error messages:

```
DEBUG: sco_pointer: returning bt_headset->hw_ptr=0
```

Has anyone else tried the 0.5 or cvs version of btsco? I will post my custom ebuilds that I used to install, please see if it works for you.

Follow the config instructions at: http://bluetooth-alsa.sourceforge.net/build.html

The files "asound.conf" and "sample.a2dprc", as mentioned in the guide, are installed to /usr/share/btsco.

net-wireless/sbc-9999.ebuild:

```

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/net-wireless/orinoco/orinoco-9999.ebuild,v 1.4 2005/12/12 16:31:19 brix Exp $

inherit cvs

ECVS_USER="anonymous"

ECVS_AUTH="pserver"

ECVS_SERVER="sbc.cvs.sourceforge.net:/cvsroot/sbc"

ECVS_MODULE="sbc"

S=${WORKDIR}/${ECVS_MODULE}

DESCRIPTION="Bluetooth low-complexity, subband codec"

HOMEPAGE="http://www.holtmann.org/linux/bluetooth/sbc.html"

SRC_URI=""

LICENSE="?"

SLOT="0"

KEYWORDS="-* ~x86"

IUSE=""

src_unpack() {

   cvs_src_unpack

}

src_compile() {

   ./bootstrap

   econf

   make || die "failed to build"

}

src_install() {

   make install DESTDIR=${D} || die "failed to install"

}

```

net-wireless/btsco-9999.ebuild:

```

# Copyright 1999-2006 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

inherit autotools cvs

ECVS_AUTH="pserver"

ECVS_SERVER="bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa"

ECVS_MODULE="plugz"

DESCRIPTION="A userspace daemon to send audio to a BT headset via ALSA"

HOMEPAGE="http://bluetooth-alsa.sourceforge.net/"

SRC_URI=""

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="-* ~x86"

IUSE="alsa ao"

RDEPEND=">=net-wireless/bluez-utils-2.19

   alsa? ( media-sound/alsa-utils )

   ao? ( >=media-libs/libao-0.8.5 )

"

DEPEND="sys-apps/gawk

   =net-wireless/sbc-9999

   ${RDEPEND}"

S=${WORKDIR}/${ECVS_MODULE}

src_unpack() {

   cvs_src_unpack

}

src_compile() {

   local myconf

   

   eautoreconf

   

   econf \

      $(use_enable alsa alsaplugin) \

      $(use_enable ao ) || die "econf failed"

   emake || die "emake failed"

}

src_install() {

   make install DESTDIR="${D}" || die "make install failed"

   mkdir -p ${D}/share/btsco

   cp ${S}/alsa-plugins/sample.a2dprc ${D}/share/btsco

   cp ${S}/alsa-plugins/asound.conf ${D}/share/btsco

}

```

----------

## gruftie

hi there,

 *agnitio wrote:*   

> I could not get btsco-0.41 to work at all. Modprobe completely froze when trying to insert the module.
> 
> I'm currently testing the cvs-version of btsco wich does not use a kernel module, instead it works only using an alsa plugin. All seems well and I get it to connect with my headset and the headset beeps as when it recieves an incomming connection, but then there's no sound at all.
> 
> I tried using mplayer and I get theese error messages:
> ...

 

i tried this (on amd64, so i added ~amd64 to the KEYWORDS)

sbc compiles fine, but btsco dies with the following error:

```
mv -f .deps/daemon.Tpo .deps/daemon.Po

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../..     -march=athlon64 -O3 -pipe -MT sdp.o -MD -MP -MF .deps/sdp.Tpo -c -o sdp.o sdp.c

states.c: In function `headsetIdleHandleApplConnReq':

states.c:300: error: `SDP_NON_BLOCKING' undeclared (first use in this function)

states.c:300: error: (Each undeclared identifier is reported only once

states.c:300: error: for each function it appears in.)

mv -f .deps/sdp.Tpo .deps/sdp.Po

make[3]: *** [states.o] Error 1

make[3]: *** Waiting for unfinished jobs....

make[3]: Leaving directory `/var/tmp/portage/net-wireless/btsco-9999/work/plugz/alsa-plugins/headsetd'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/var/tmp/portage/net-wireless/btsco-9999/work/plugz/alsa-plugins'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/net-wireless/btsco-9999/work/plugz'

make: *** [all] Error 2

!!! ERROR: net-wireless/btsco-9999 failed.

Call stack:

  ebuild.sh, line 1603:   Called dyn_compile

  ebuild.sh, line 961:   Called src_compile

  btsco-9999.ebuild, line 42:   Called die

!!! emake failed

!!! If you need support, post the topmost build error, and the call stack if relevant.

```

maybe it's amd64-related?

----------

## agnitio

I have never seen those errors during my testing so perhaps it is a x64-issue, I don't own that kind of hardware so unfortunately I cannot confirm anything.

ALSO: I finally got my bluetooth headset working using the above .ebuilds (they are not really great but they do the job), the problems were twofold.

1) My headset was broken and I didn't even get audio when using it with my cell phone (I know, I should've tried this first, heh).

2) Mplayer with -ao alsa:device=headset does not work for me at all. But audacious, configured to use the headset device worked just fine! So all is well.

I'll see if I can get those ebuilds updated with better versions soon.

----------

## stuntman

```
mv -f .deps/daemon.Tpo .deps/daemon.Po

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../..     -march=athlon64 -O3 -pipe -MT sdp.o -MD -MP -MF .deps/sdp.Tpo -c -o sdp.o sdp.c

states.c: In function `headsetIdleHandleApplConnReq':

states.c:300: error: `SDP_NON_BLOCKING' undeclared (first use in this function)

states.c:300: error: (Each undeclared identifier is reported only once

states.c:300: error: for each function it appears in.)

mv -f .deps/sdp.Tpo .deps/sdp.Po

make[3]: *** [states.o] Error 1

make[3]: *** Waiting for unfinished jobs....

make[3]: Leaving directory `/var/tmp/portage/net-wireless/btsco-9999/work/plugz/alsa-plugins/headsetd'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/var/tmp/portage/net-wireless/btsco-9999/work/plugz/alsa-plugins'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/net-wireless/btsco-9999/work/plugz'

make: *** [all] Error 2

!!! ERROR: net-wireless/btsco-9999 failed.

Call stack:

  ebuild.sh, line 1603:   Called dyn_compile

  ebuild.sh, line 961:   Called src_compile

  btsco-9999.ebuild, line 42:   Called die

!!! emake failed

!!! If you need support, post the topmost build error, and the call stack if relevant.

```

I read on the bluez-dev page that bluez-libs-0.3.5 and bluez-utils-0.3.5 or newer is needed or that error happens during compile.

this page has a overlay with 0.3.1 http://gentoo.zugaina.org/gpo/net-wireless.html.en

I just renamed the ebuilds to bluez-libs-0.3.9 and bluez-utils-0.3.9 ( the newest version available at the time of this post )

Now btsco-9999.ebuild compiles fine for me.

----------

## mudrii

 *gruftie wrote:*   

> hi there,
> 
>  *agnitio wrote:*   I could not get btsco-0.41 to work at all. Modprobe completely froze when trying to insert the module.
> 
> I'm currently testing the cvs-version of btsco wich does not use a kernel module, instead it works only using an alsa plugin. All seems well and I get it to connect with my headset and the headset beeps as when it recieves an incomming connection, but then there's no sound at all.
> ...

 

Try to compile with -fPIC it worked for me

----------

## Maxwell

Hi!

I'm a Gnome user and I'm trying to use my bluetooth headset (again). I had it working on my old laptop, but now I can't get it to work on my desktop.

My problem is (I think) pairing. At my first attempt I only had to pair my headset once. Now, my headset never connects to btsco (besides the first time I had it running, so it does work).

What software can I use to integrate bluetooth search and pairing in Gnome?

What is the stable version of bluetooth-alsa? The one provided by the ebuilds at first page or the ones at pkalin?

Thanks for the help!

----------

## hemna

I'm trying to get ebuild bluetooth-alsa-utils-0.5.ebuild digest to work, but it fails.

I pulled the .ebuild files from the bug.  bluetooth-alsa-kernel seems to digest just fine, but I get this....

```

localhost bluetooth-alsa-utils # ebuild bluetooth-alsa-utils-0.5.ebuild digest

RDEPEND: >=net-wireless/bluez-utils-2.19 skype? ( net-im/skype sys-apps/dbus ) media-sound/alsa-utils >=bluetooth-alsa-kernel-0.5

invalid atom: '>=bluetooth-alsa-kernel-0.5'

```

any ideas?

----------

## Oleksandr Byelkin

As it was asked in http://gentoo-wiki.com/HOWTO_use_a_bluetooth_headset I report that Jabra V250 works with http://overlays.gentoo.org/svn/dev/liquidx/net-wireless/btsco* overlays mentioned in the HOWTO and version 0.41 placed there at the moment.

And even more I got working it on ppc linux (Aluminium 15" 1.5GHz Powerbook). It need just manual fixing of the .ebuilds (btsco-kernel and btsco) to allow ppc architecture (maybe there is better way but sorry I am newby in the gentoo world).

Also bksco-kernel needed preparation of kernel modules but procedure was described in the error messages I got when tried emerge witout prepation.

I checked it with twinkle and it works much better then usual headphones (there is no clicks (caused by inperfect Internet connection as I think))

----------

## dmvianna

Does anyone knows if in-kernel drivers (as of 2.6.20-gentoo-r4) bt-sco and bt-hciusb-sco are sufficient to make a headset work, and if so, how?   :Rolling Eyes:  CONFIG_SND_USB_USX2Y seems to have disappeared from the kernel.   :Razz: 

----------

## dmvianna

OK, I ended up finding the right overlay, but now it does not compile under the 2.6.21 kernel. It is strange, because up to 2.6.20 it was working properly.   :Confused: 

----------

## WizNut

I've followed the guide on the wiki, and now I'm having the same problem that dmvianna had when trying to emerge net-wireless/btsco-kernel.

From what I can see,  I believe that the ebuild is looking in the .config file under /usr/src/linux in order to make sure that the prerequisite drivers are either compiled in or built as modules.  In the case of alsa-driver the modules are built separately from the kernel and are in there own directory under /lib/modules/<kernel-version>/alsa-driver.  The gentoo ALSA guide says to make sure that ALSA is not enabled in the kernel config when using the alsa-driver package.  Because btsco-kernel only checks the .config file, it of course sees that the neccessary support isn't there (even though it is) and refuses to compile.

Anyways,  just my $0.02

----------

## dmvianna

Just look at the above link, there's a patch that solves the problem.   :Smile:  <kernel>/include/sound/typedefs.h was removed in kernel version 2.6.21, but btsco relies on that. The patch puts it back.

----------

## WizNut

I was building against a 2.6.20 kernel.

----------

## dmvianna

Do you have

```
CONFIG_SND_USB_AUDIO=m

CONFIG_SND_USB_USX2Y=m
```

?

----------

## WizNut

According to the howto on gentoo-wiki.com,  you're expected to have used the alsa-driver method of getting alsa up and running.  In order to do that the ALSA guide says that you can't use the builtin support for ALSA in the kernel.  Otherwise, you get conflicts.  So obviously,  if I've used alsa-driver like the howto reccomended, neither of those is set.

----------

## dmvianna

Ahh, you're using the new method. I've never tried it, it's not explained well in the wiki. Actually, I hate that wiki page, I had cleaned it up somewhat when I had problems with 2.6.21 and realised how confuse it was previously. The way I know it works is to use the in-kernel driver AS MODULES, and then apply the overlays from the wiki (btsco-0.41 and btsco-kernel-0.41). Then you also have to install the init script, I use this:

/etc/init.d/headset

```
#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

depend() {

   need bluetooth alsasound

}

checkconfig() {

   # check that the configuration file has been configured.

   if [ -z "$BDADDR" ]; then

      eerror "You should setup BDADDR in /etc/conf.d/headset."

      return 1

   fi   

   # define BTSCO in /etc/conf.d/headset to be btsco or btsco2

   # defaults to btsco

   if [ -z "$BTSCO" ]; then

      BTSCO=btsco

   fi

   

   if ! [ -d /sys/module/snd_bt_sco ]; then

      ebegin "Loading bluetooth-alsa kernel module (snd_bt_sco)."

         /sbin/modprobe snd-bt-sco

      eend $? || return 1

   fi

}

start() {

   checkconfig || return 1

   ebegin "Connecting to headset"

           start-stop-daemon --start \

      --make-pidfile --pidfile /var/run/$BTSCO \

      --background --exec /usr/bin/$BTSCO -- $BDADDR

      sleep 1

      ps -C $BTSCO >/dev/null

   eend $?

}

stop() {

        ebegin "Stopping $BTSCO daemon"

      start-stop-daemon --stop --quiet --pidfile /var/run/$BTSCO

   eend ${?}

}

```

I hope that helps.   :Wink: 

----------

## novazur

 *WizNut wrote:*   

> According to the howto on gentoo-wiki.com,  you're expected to have used the alsa-driver method of getting alsa up and running.  In order to do that the ALSA guide says that you can't use the builtin support for ALSA in the kernel.  Otherwise, you get conflicts.  So obviously,  if I've used alsa-driver like the howto reccomended, neither of those is set.

 

That's the same for me, on amd64, and btsco doesn't compile.

what to do plz ?

----------

## novazur

 *mudrii wrote:*   

> Try to compile with -fPIC it worked for me

 

How can I do that please ?

----------

## ReDirEct__

hi all... i noticed that information in the first post are very old... i wolud to know if i need bloetooth-alsa for using the bluetooth headset mic with bluez 3.24... if not... how can get my mic headset working with bluez3.24??? Speaker work very well with mplayer (not with amarok).

----------

## dmvianna

 *ReDirEct__ wrote:*   

> hi all... i noticed that information in the first post are very old... i wolud to know if i need bloetooth-alsa for using the bluetooth headset mic with bluez 3.24... if not... how can get my mic headset working with bluez3.24??? Speaker work very well with mplayer (not with amarok).

 

Since the bluetooth driver was removed from the kernel, using a bluetooth headset has become even more experimental. Bluez is using the new alsa API, but few applications are prepared to share information through that. I had a very limited success with mplayer some time ago, and documented it here. I haven't tried since, maybe it's better now. Please share your experience with us if you have any success. The Bluez trac is also an invaluable resource. Good luck!   :Wink: 

----------

## ReDirEct__

i thought about sharing my experience... but also i would to have a completely working headset with mic  :Very Happy: ... i finally got working speaker following the gentoo wiki... and usig the kdeblutooth progam set... not so hard... my bluetooth headset it's a g2comm (not very expensive headset  :Wink:  )... i think i will put this information on the wiki...

no one know if need to use the alsa-bluetooth libs for the mic?

----------

## nutznboltz

 *dmvianna wrote:*   

> Please share your experience with us if you have any success. 

 

Finding this statement really helped me:

Note: you will not need bluetooth-alsa, plugz, btsco or the like for audio to work. They are obsolete.

----------

## Dusdan

Hi everybody, I realized this is the right place for my post:

https://forums.gentoo.org/viewtopic-t-704681.html

Do you have any ideas?

----------

## erikderzweite

I have recently turned back to btsco for it is IMO much more reliable than new methods. Besides, I'm on amd64 — skype and ekiga don't work with newer methods (ekiga requires patched pwlib/ptlib and skype — binary alsa-bluetooth libs to be compiled e.g. from 32-bit chroot). 

Thirdly, I haven't found a way to intercept headset key press without btsco and I use it to answer/drop calls in both skype and ekiga. If you want to use those scripts, see here: https://forums.gentoo.org/viewtopic-p-5385014.html#5385014

Here is a brief howto:

1. patch your kernel

you'll need following patch for 2.6.28:

btsco-2.6.28.patch

```
--- include/sound/core.h.orig   2008-12-16 23:31:29.000000000 +0100

+++ include/sound/core.h   2008-12-17 00:04:50.000000000 +0100

@@ -29,6 +29,7 @@

 #include <linux/pm.h>         /* pm_message_t */

 #include <linux/device.h>

 #include <linux/stringify.h>

+#include "typedefs.h"

 

 /* number of supported soundcards */

 #ifdef CONFIG_SND_DYNAMIC_MINORS

@@ -380,12 +381,30 @@

    printk(fmt ,##args)

 #endif

 

+/**                                                                                                        

+ * snd_assert - run-time assertion macro                                                                   

+ * @expr: expression                                                                                       

+ *                                                                                                         

+ * This macro checks the expression in run-time and invokes the commands                                   

+ * given in the rest arguments if the assertion is failed.                                                 

+ * When CONFIG_SND_DEBUG is not set, the expression is executed but                                        

+ * not checked.                                                                                            

+ */                                                                                                        

+#define snd_assert(expr, args...) do {                                 \

+       if (unlikely(!(expr))) {                                        \

+               snd_printk(KERN_ERR "BUG? (%s)\n", __ASTRING__(expr));  \

+               dump_stack();                                           \

+               args;                                                   \

+       }                                                               \

+} while (0)                                                                                                

+    

 #define snd_BUG()      WARN(1, "BUG?\n")

 #define snd_BUG_ON(cond)   WARN((cond), "BUG? (%s)\n", __stringify(cond))

 

 #else /* !CONFIG_SND_DEBUG */

 

 #define snd_printd(fmt, args...)   do { } while (0)

+#define snd_assert(expr, args...)      (void)(expr)

 #define snd_BUG()         do { } while (0)

 static inline int __snd_bug_on(void)

 {

--- include/sound/typedefs.h.orig   2008-12-17 00:15:10.000000000 +0100

+++ include/sound/typedefs.h   2008-12-16 23:46:03.000000000 +0100

@@ -0,0 +1,173 @@

+/* 

+ * Typedef's for backward compatibility (for out-of-kernel drivers) 

+ * 

+ * This file will be removed soon in future 

+ */ 

+ 

+/* core stuff */ 

+typedef struct snd_card snd_card_t; 

+typedef struct snd_device snd_device_t; 

+typedef struct snd_device_ops snd_device_ops_t; 

+typedef enum snd_card_type snd_card_type_t; 

+typedef struct snd_minor snd_minor_t; 

+ 

+/* info */ 

+typedef struct snd_info_entry snd_info_entry_t; 

+typedef struct snd_info_buffer snd_info_buffer_t; 

+ 

+/* control */ 

+typedef struct snd_ctl_file snd_ctl_file_t; 

+typedef struct snd_kcontrol snd_kcontrol_t; 

+typedef struct snd_kcontrol_new snd_kcontrol_new_t; 

+typedef struct snd_kcontrol_volatile snd_kcontrol_volatile_t; 

+typedef struct snd_kctl_event snd_kctl_event_t; 

+typedef struct snd_aes_iec958 snd_aes_iec958_t; 

+typedef struct snd_ctl_card_info snd_ctl_card_info_t; 

+typedef struct snd_ctl_elem_id snd_ctl_elem_id_t; 

+typedef struct snd_ctl_elem_list snd_ctl_elem_list_t; 

+typedef struct snd_ctl_elem_info snd_ctl_elem_info_t; 

+typedef struct snd_ctl_elem_value snd_ctl_elem_value_t; 

+typedef struct snd_ctl_event snd_ctl_event_t; 

+#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 

+typedef struct snd_mixer_oss snd_mixer_oss_t; 

+#endif 

+ 

+/* timer */ 

+typedef struct snd_timer snd_timer_t; 

+typedef struct snd_timer_instance snd_timer_instance_t; 

+typedef struct snd_timer_id snd_timer_id_t; 

+typedef struct snd_timer_ginfo snd_timer_ginfo_t; 

+typedef struct snd_timer_gparams snd_timer_gparams_t; 

+typedef struct snd_timer_gstatus snd_timer_gstatus_t; 

+typedef struct snd_timer_select snd_timer_select_t; 

+typedef struct snd_timer_info snd_timer_info_t; 

+typedef struct snd_timer_params snd_timer_params_t; 

+typedef struct snd_timer_status snd_timer_status_t; 

+typedef struct snd_timer_read snd_timer_read_t; 

+typedef struct snd_timer_tread snd_timer_tread_t; 

+ 

+/* PCM */ 

+typedef struct snd_pcm snd_pcm_t; 

+typedef struct snd_pcm_str snd_pcm_str_t; 

+typedef struct snd_pcm_substream snd_pcm_substream_t; 

+typedef struct snd_pcm_info snd_pcm_info_t; 

+typedef struct snd_pcm_hw_params snd_pcm_hw_params_t; 

+typedef struct snd_pcm_sw_params snd_pcm_sw_params_t; 

+typedef struct snd_pcm_channel_info snd_pcm_channel_info_t; 

+typedef struct snd_pcm_status snd_pcm_status_t; 

+typedef struct snd_pcm_mmap_status snd_pcm_mmap_status_t; 

+typedef struct snd_pcm_mmap_control snd_pcm_mmap_control_t; 

+typedef struct snd_mask snd_mask_t; 

+typedef struct snd_sg_buf snd_pcm_sgbuf_t; 

+ 

+typedef struct snd_interval snd_interval_t; 

+typedef struct snd_xferi snd_xferi_t; 

+typedef struct snd_xfern snd_xfern_t; 

+typedef struct snd_xferv snd_xferv_t; 

+ 

+typedef struct snd_pcm_file snd_pcm_file_t; 

+typedef struct snd_pcm_runtime snd_pcm_runtime_t; 

+typedef struct snd_pcm_hardware snd_pcm_hardware_t; 

+typedef struct snd_pcm_ops snd_pcm_ops_t; 

+typedef struct snd_pcm_hw_rule snd_pcm_hw_rule_t; 

+typedef struct snd_pcm_hw_constraints snd_pcm_hw_constraints_t; 

+typedef struct snd_ratnum ratnum_t; 

+typedef struct snd_ratden ratden_t; 

+typedef struct snd_pcm_hw_constraint_ratnums snd_pcm_hw_constraint_ratnums_t; 

+typedef struct snd_pcm_hw_constraint_ratdens snd_pcm_hw_constraint_ratdens_t; 

+typedef struct snd_pcm_hw_constraint_list snd_pcm_hw_constraint_list_t; 

+typedef struct snd_pcm_group snd_pcm_group_t; 

+typedef struct snd_pcm_notify snd_pcm_notify_t; 

+ 

+/* rawmidi */ 

+typedef struct snd_rawmidi snd_rawmidi_t; 

+typedef struct snd_rawmidi_info snd_rawmidi_info_t; 

+typedef struct snd_rawmidi_params snd_rawmidi_params_t; 

+typedef struct snd_rawmidi_status snd_rawmidi_status_t; 

+typedef struct snd_rawmidi_runtime snd_rawmidi_runtime_t; 

+typedef struct snd_rawmidi_substream snd_rawmidi_substream_t; 

+typedef struct snd_rawmidi_str snd_rawmidi_str_t; 

+typedef struct snd_rawmidi_ops snd_rawmidi_ops_t; 

+typedef struct snd_rawmidi_global_ops snd_rawmidi_global_ops_t; 

+typedef struct snd_rawmidi_file snd_rawmidi_file_t; 

+ 

+/* hwdep */ 

+typedef struct snd_hwdep snd_hwdep_t; 

+typedef struct snd_hwdep_info snd_hwdep_info_t; 

+typedef struct snd_hwdep_dsp_status snd_hwdep_dsp_status_t; 

+typedef struct snd_hwdep_dsp_image snd_hwdep_dsp_image_t; 

+typedef struct snd_hwdep_ops snd_hwdep_ops_t; 

+ 

+/* sequencer */ 

+typedef struct snd_seq_port_info snd_seq_port_info_t; 

+typedef struct snd_seq_port_subscribe snd_seq_port_subscribe_t; 

+typedef struct snd_seq_event snd_seq_event_t; 

+typedef struct snd_seq_addr snd_seq_addr_t; 

+typedef struct snd_seq_ev_volume snd_seq_ev_volume_t; 

+typedef struct snd_seq_ev_loop snd_seq_ev_loop_t; 

+typedef struct snd_seq_remove_events snd_seq_remove_events_t; 

+typedef struct snd_seq_query_subs snd_seq_query_subs_t; 

+typedef struct snd_seq_system_info snd_seq_system_info_t; 

+typedef struct snd_seq_client_info snd_seq_client_info_t; 

+typedef struct snd_seq_queue_info snd_seq_queue_info_t; 

+typedef struct snd_seq_queue_status snd_seq_queue_status_t; 

+typedef struct snd_seq_queue_tempo snd_seq_queue_tempo_t; 

+typedef struct snd_seq_queue_owner snd_seq_queue_owner_t; 

+typedef struct snd_seq_queue_timer snd_seq_queue_timer_t; 

+typedef struct snd_seq_queue_client snd_seq_queue_client_t; 

+typedef struct snd_seq_client_pool snd_seq_client_pool_t; 

+typedef struct snd_seq_instr snd_seq_instr_t; 

+typedef struct snd_seq_instr_data snd_seq_instr_data_t; 

+typedef struct snd_seq_instr_header snd_seq_instr_header_t; 

+ 

+typedef struct snd_seq_user_client user_client_t; 

+typedef struct snd_seq_kernel_client kernel_client_t; 

+typedef struct snd_seq_client client_t; 

+typedef struct snd_seq_queue queue_t; 

+ 

+/* seq_device */ 

+typedef struct snd_seq_device snd_seq_device_t; 

+typedef struct snd_seq_dev_ops snd_seq_dev_ops_t; 

+ 

+/* seq_midi */ 

+typedef struct snd_midi_event snd_midi_event_t; 

+ 

+/* seq_midi_emul */ 

+typedef struct snd_midi_channel snd_midi_channel_t; 

+typedef struct snd_midi_channel_set snd_midi_channel_set_t; 

+typedef struct snd_midi_op snd_midi_op_t; 

+ 

+/* seq_oss */ 

+typedef struct snd_seq_oss_arg snd_seq_oss_arg_t; 

+typedef struct snd_seq_oss_callback snd_seq_oss_callback_t; 

+typedef struct snd_seq_oss_reg snd_seq_oss_reg_t; 

+ 

+/* virmidi */ 

+typedef struct snd_virmidi_dev snd_virmidi_dev_t; 

+typedef struct snd_virmidi snd_virmidi_t; 

+ 

+/* seq_instr */ 

+typedef struct snd_seq_kcluster snd_seq_kcluster_t; 

+typedef struct snd_seq_kinstr_ops snd_seq_kinstr_ops_t; 

+typedef struct snd_seq_kinstr snd_seq_kinstr_t; 

+typedef struct snd_seq_kinstr_list snd_seq_kinstr_list_t; 

+ 

+/* ac97 */ 

+typedef struct snd_ac97_bus ac97_bus_t; 

+typedef struct snd_ac97_bus_ops ac97_bus_ops_t; 

+typedef struct snd_ac97_template ac97_template_t; 

+typedef struct snd_ac97 ac97_t; 

+ 

+/* opl3/4 */ 

+typedef struct snd_opl3 opl3_t; 

+typedef struct snd_opl4 opl4_t; 

+ 

+/* mpu401 */ 

+typedef struct snd_mpu401 mpu401_t; 

+ 

+/* i2c */ 

+typedef struct snd_i2c_device snd_i2c_device_t; 

+typedef struct snd_i2c_bus snd_i2c_bus_t; 

+ 

+typedef struct snd_ak4531 ak4531_t; 

+ 

--- include/linux/pid.h.orig   2008-12-17 01:33:29.000000000 +0100

+++ include/linux/pid.h   2008-12-17 01:40:10.000000000 +0100

@@ -111,6 +111,7 @@

  */

 extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns);

 extern struct pid *find_vpid(int nr);

+extern struct pid *find_pid(int nr);

 

 /*

  * Lookup a PID in the hash table, and return with it's count elevated.

--- kernel/pid.c.orig   2008-12-17 01:33:52.000000000 +0100

+++ kernel/pid.c   2008-12-17 01:36:41.000000000 +0100

@@ -309,6 +309,12 @@

 }

 EXPORT_SYMBOL_GPL(find_vpid);

 

+struct pid *find_pid(int nr)

+{

+       return find_pid_ns(nr, &init_pid_ns);

+}

+EXPORT_SYMBOL_GPL(find_pid);

+

 /*

  * attach_pid() must be called with the tasklist_lock write-held.

  */

--- include/linux/sched.h.orig   2008-12-17 00:10:02.000000000 +0100

+++ include/linux/sched.h   2008-12-17 00:10:57.000000000 +0100

@@ -1829,6 +1829,7 @@

 extern void force_sig_specific(int, struct task_struct *);

 extern int send_sig(int, struct task_struct *, int);

 extern void zap_other_threads(struct task_struct *p);

+extern int kill_proc(pid_t, int, int);

 extern struct sigqueue *sigqueue_alloc(void);

 extern void sigqueue_free(struct sigqueue *);

 extern int send_sigqueue(struct sigqueue *,  struct task_struct *, int group);

--- kernel/signal.c.orig   2008-12-17 01:43:48.000000000 +0100

+++ kernel/signal.c   2008-12-17 01:29:40.000000000 +0100

@@ -1237,6 +1237,17 @@

 }

 EXPORT_SYMBOL(kill_pid);

 

+int

+kill_proc(pid_t pid, int sig, int priv)

+{

+       int ret;

+

+       rcu_read_lock();

+       ret = kill_pid_info(sig, __si_special(priv), find_pid(pid));

+       rcu_read_unlock();

+       return ret;

+}

+

 /*

  * These functions support sending signals using preallocated sigqueue

  * structures.  This is needed "because realtime applications cannot

@@ -1929,6 +1940,7 @@

 EXPORT_SYMBOL_GPL(dequeue_signal);

 EXPORT_SYMBOL(flush_signals);

 EXPORT_SYMBOL(force_sig);

+EXPORT_SYMBOL(kill_proc);

 EXPORT_SYMBOL(send_sig);

 EXPORT_SYMBOL(send_sig_info);

 EXPORT_SYMBOL(sigprocmask);
```

2. Configure your kernel to use old version of HCI USB driver. My config looks as follows:

```
cat .config | grep CONFIG_BT

CONFIG_BT=m

CONFIG_BT_L2CAP=m

CONFIG_BT_SCO=m

CONFIG_BT_RFCOMM=m

CONFIG_BT_RFCOMM_TTY=y

CONFIG_BT_BNEP=m

CONFIG_BT_BNEP_MC_FILTER=y

CONFIG_BT_BNEP_PROTO_FILTER=y

CONFIG_BT_HIDP=m

CONFIG_BT_HCIUSB=m

CONFIG_BT_HCIUSB_SCO=y

# CONFIG_BT_HCIBTUSB is not set

CONFIG_BT_HCIBTSDIO=m

CONFIG_BT_HCIUART=m

# CONFIG_BT_HCIUART_H4 is not set

# CONFIG_BT_HCIUART_BCSP is not set

# CONFIG_BT_HCIUART_LL is not set

CONFIG_BT_HCIBCM203X=m

CONFIG_BT_HCIBPA10X=m

CONFIG_BT_HCIBFUSB=m

CONFIG_BT_HCIVHCI=m
```

compile your kernel as usual.

3. Add ebuilds to local overlay, emerge them and start the whole running as shown here: http://www.gentoo-wiki.info/Bluetooth_headset#Obsolete_method_2Last edited by erikderzweite on Tue Jan 13, 2009 7:42 pm; edited 3 times in total

----------

## fbcyborg

Hi erikderzweite!

your post makes me very happy in this moment, because I was just giving up my bluetooth headset after many unprofitable attempts to connect it to my amd64.

I'm trying to patch my kernel but I heve some little problem doing that.

These are the steps I've done:

I copied your patch into a file (such as /usr/src/snd_headset.patch);

```
cd /usr/src/linux

cat ../snd_headset.patch | patch -p1 --dry-run  
```

and this is the result:

```
can't find file to patch at input line 3

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|--- include/sound/core.h.orig   2008-12-16 23:31:29.000000000 +0100

|+++ include/sound/core.h   2008-12-17 00:04:50.000000000 +0100

--------------------------

File to patch:       
```

What's going on? I always patch kernel sources in that way, but now it seems to not find such a file that is present!

Thank you.

----------

## erikderzweite

fbcyborg, try -p 0 instead of -p 1:

```
cd /usr/src/linux 

 cat ../snd_headset.patch | patch -p0 --dry-run 
```

----------

## fbcyborg

Thank you very much, 

it seems to work now!

```
# cat ../snd_headset.patch | patch -p0 --dry-run

patching file include/sound/core.h

Hunk #1 succeeded at 29 with fuzz 1.

Hunk #2 FAILED at 381.

1 out of 2 hunks FAILED -- saving rejects to file include/sound/core.h.rej

patching file include/sound/typedefs.h

patching file include/linux/pid.h

patching file kernel/pid.c

patching file include/linux/sched.h

Hunk #1 succeeded at 1833 (offset 4 lines).

patching file kernel/signal.c

Hunk #2 succeeded at 1940 with fuzz 1.

```

Only one question: I can read "Hunk #2 FAILED at 381.". Is it a problem??? I guess something didn't go in the right way.

----------

## erikderzweite

What kernel do you use? The patch is for 2.6.28-gentoo (vanilla should work too though) 2.6.27 is a bit different:

btsco-2.6.27.patch

```
--- include/sound/typedefs.h.orig   2008-12-17 00:15:10.000000000 +0100

+++ include/sound/typedefs.h   2008-12-16 23:46:03.000000000 +0100

@@ -0,0 +1,173 @@

+/* 

+ * Typedef's for backward compatibility (for out-of-kernel drivers) 

+ * 

+ * This file will be removed soon in future 

+ */ 

+ 

+/* core stuff */ 

+typedef struct snd_card snd_card_t; 

+typedef struct snd_device snd_device_t; 

+typedef struct snd_device_ops snd_device_ops_t; 

+typedef enum snd_card_type snd_card_type_t; 

+typedef struct snd_minor snd_minor_t; 

+ 

+/* info */ 

+typedef struct snd_info_entry snd_info_entry_t; 

+typedef struct snd_info_buffer snd_info_buffer_t; 

+ 

+/* control */ 

+typedef struct snd_ctl_file snd_ctl_file_t; 

+typedef struct snd_kcontrol snd_kcontrol_t; 

+typedef struct snd_kcontrol_new snd_kcontrol_new_t; 

+typedef struct snd_kcontrol_volatile snd_kcontrol_volatile_t; 

+typedef struct snd_kctl_event snd_kctl_event_t; 

+typedef struct snd_aes_iec958 snd_aes_iec958_t; 

+typedef struct snd_ctl_card_info snd_ctl_card_info_t; 

+typedef struct snd_ctl_elem_id snd_ctl_elem_id_t; 

+typedef struct snd_ctl_elem_list snd_ctl_elem_list_t; 

+typedef struct snd_ctl_elem_info snd_ctl_elem_info_t; 

+typedef struct snd_ctl_elem_value snd_ctl_elem_value_t; 

+typedef struct snd_ctl_event snd_ctl_event_t; 

+#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 

+typedef struct snd_mixer_oss snd_mixer_oss_t; 

+#endif 

+ 

+/* timer */ 

+typedef struct snd_timer snd_timer_t; 

+typedef struct snd_timer_instance snd_timer_instance_t; 

+typedef struct snd_timer_id snd_timer_id_t; 

+typedef struct snd_timer_ginfo snd_timer_ginfo_t; 

+typedef struct snd_timer_gparams snd_timer_gparams_t; 

+typedef struct snd_timer_gstatus snd_timer_gstatus_t; 

+typedef struct snd_timer_select snd_timer_select_t; 

+typedef struct snd_timer_info snd_timer_info_t; 

+typedef struct snd_timer_params snd_timer_params_t; 

+typedef struct snd_timer_status snd_timer_status_t; 

+typedef struct snd_timer_read snd_timer_read_t; 

+typedef struct snd_timer_tread snd_timer_tread_t; 

+ 

+/* PCM */ 

+typedef struct snd_pcm snd_pcm_t; 

+typedef struct snd_pcm_str snd_pcm_str_t; 

+typedef struct snd_pcm_substream snd_pcm_substream_t; 

+typedef struct snd_pcm_info snd_pcm_info_t; 

+typedef struct snd_pcm_hw_params snd_pcm_hw_params_t; 

+typedef struct snd_pcm_sw_params snd_pcm_sw_params_t; 

+typedef struct snd_pcm_channel_info snd_pcm_channel_info_t; 

+typedef struct snd_pcm_status snd_pcm_status_t; 

+typedef struct snd_pcm_mmap_status snd_pcm_mmap_status_t; 

+typedef struct snd_pcm_mmap_control snd_pcm_mmap_control_t; 

+typedef struct snd_mask snd_mask_t; 

+typedef struct snd_sg_buf snd_pcm_sgbuf_t; 

+ 

+typedef struct snd_interval snd_interval_t; 

+typedef struct snd_xferi snd_xferi_t; 

+typedef struct snd_xfern snd_xfern_t; 

+typedef struct snd_xferv snd_xferv_t; 

+ 

+typedef struct snd_pcm_file snd_pcm_file_t; 

+typedef struct snd_pcm_runtime snd_pcm_runtime_t; 

+typedef struct snd_pcm_hardware snd_pcm_hardware_t; 

+typedef struct snd_pcm_ops snd_pcm_ops_t; 

+typedef struct snd_pcm_hw_rule snd_pcm_hw_rule_t; 

+typedef struct snd_pcm_hw_constraints snd_pcm_hw_constraints_t; 

+typedef struct snd_ratnum ratnum_t; 

+typedef struct snd_ratden ratden_t; 

+typedef struct snd_pcm_hw_constraint_ratnums snd_pcm_hw_constraint_ratnums_t; 

+typedef struct snd_pcm_hw_constraint_ratdens snd_pcm_hw_constraint_ratdens_t; 

+typedef struct snd_pcm_hw_constraint_list snd_pcm_hw_constraint_list_t; 

+typedef struct snd_pcm_group snd_pcm_group_t; 

+typedef struct snd_pcm_notify snd_pcm_notify_t; 

+ 

+/* rawmidi */ 

+typedef struct snd_rawmidi snd_rawmidi_t; 

+typedef struct snd_rawmidi_info snd_rawmidi_info_t; 

+typedef struct snd_rawmidi_params snd_rawmidi_params_t; 

+typedef struct snd_rawmidi_status snd_rawmidi_status_t; 

+typedef struct snd_rawmidi_runtime snd_rawmidi_runtime_t; 

+typedef struct snd_rawmidi_substream snd_rawmidi_substream_t; 

+typedef struct snd_rawmidi_str snd_rawmidi_str_t; 

+typedef struct snd_rawmidi_ops snd_rawmidi_ops_t; 

+typedef struct snd_rawmidi_global_ops snd_rawmidi_global_ops_t; 

+typedef struct snd_rawmidi_file snd_rawmidi_file_t; 

+ 

+/* hwdep */ 

+typedef struct snd_hwdep snd_hwdep_t; 

+typedef struct snd_hwdep_info snd_hwdep_info_t; 

+typedef struct snd_hwdep_dsp_status snd_hwdep_dsp_status_t; 

+typedef struct snd_hwdep_dsp_image snd_hwdep_dsp_image_t; 

+typedef struct snd_hwdep_ops snd_hwdep_ops_t; 

+ 

+/* sequencer */ 

+typedef struct snd_seq_port_info snd_seq_port_info_t; 

+typedef struct snd_seq_port_subscribe snd_seq_port_subscribe_t; 

+typedef struct snd_seq_event snd_seq_event_t; 

+typedef struct snd_seq_addr snd_seq_addr_t; 

+typedef struct snd_seq_ev_volume snd_seq_ev_volume_t; 

+typedef struct snd_seq_ev_loop snd_seq_ev_loop_t; 

+typedef struct snd_seq_remove_events snd_seq_remove_events_t; 

+typedef struct snd_seq_query_subs snd_seq_query_subs_t; 

+typedef struct snd_seq_system_info snd_seq_system_info_t; 

+typedef struct snd_seq_client_info snd_seq_client_info_t; 

+typedef struct snd_seq_queue_info snd_seq_queue_info_t; 

+typedef struct snd_seq_queue_status snd_seq_queue_status_t; 

+typedef struct snd_seq_queue_tempo snd_seq_queue_tempo_t; 

+typedef struct snd_seq_queue_owner snd_seq_queue_owner_t; 

+typedef struct snd_seq_queue_timer snd_seq_queue_timer_t; 

+typedef struct snd_seq_queue_client snd_seq_queue_client_t; 

+typedef struct snd_seq_client_pool snd_seq_client_pool_t; 

+typedef struct snd_seq_instr snd_seq_instr_t; 

+typedef struct snd_seq_instr_data snd_seq_instr_data_t; 

+typedef struct snd_seq_instr_header snd_seq_instr_header_t; 

+ 

+typedef struct snd_seq_user_client user_client_t; 

+typedef struct snd_seq_kernel_client kernel_client_t; 

+typedef struct snd_seq_client client_t; 

+typedef struct snd_seq_queue queue_t; 

+ 

+/* seq_device */ 

+typedef struct snd_seq_device snd_seq_device_t; 

+typedef struct snd_seq_dev_ops snd_seq_dev_ops_t; 

+ 

+/* seq_midi */ 

+typedef struct snd_midi_event snd_midi_event_t; 

+ 

+/* seq_midi_emul */ 

+typedef struct snd_midi_channel snd_midi_channel_t; 

+typedef struct snd_midi_channel_set snd_midi_channel_set_t; 

+typedef struct snd_midi_op snd_midi_op_t; 

+ 

+/* seq_oss */ 

+typedef struct snd_seq_oss_arg snd_seq_oss_arg_t; 

+typedef struct snd_seq_oss_callback snd_seq_oss_callback_t; 

+typedef struct snd_seq_oss_reg snd_seq_oss_reg_t; 

+ 

+/* virmidi */ 

+typedef struct snd_virmidi_dev snd_virmidi_dev_t; 

+typedef struct snd_virmidi snd_virmidi_t; 

+ 

+/* seq_instr */ 

+typedef struct snd_seq_kcluster snd_seq_kcluster_t; 

+typedef struct snd_seq_kinstr_ops snd_seq_kinstr_ops_t; 

+typedef struct snd_seq_kinstr snd_seq_kinstr_t; 

+typedef struct snd_seq_kinstr_list snd_seq_kinstr_list_t; 

+ 

+/* ac97 */ 

+typedef struct snd_ac97_bus ac97_bus_t; 

+typedef struct snd_ac97_bus_ops ac97_bus_ops_t; 

+typedef struct snd_ac97_template ac97_template_t; 

+typedef struct snd_ac97 ac97_t; 

+ 

+/* opl3/4 */ 

+typedef struct snd_opl3 opl3_t; 

+typedef struct snd_opl4 opl4_t; 

+ 

+/* mpu401 */ 

+typedef struct snd_mpu401 mpu401_t; 

+ 

+/* i2c */ 

+typedef struct snd_i2c_device snd_i2c_device_t; 

+typedef struct snd_i2c_bus snd_i2c_bus_t; 

+ 

+typedef struct snd_ak4531 ak4531_t; 

+ 

--- include/linux/pid.h.orig   2008-12-17 01:33:29.000000000 +0100

+++ include/linux/pid.h   2008-12-17 01:40:10.000000000 +0100

@@ -111,6 +111,7 @@

  */

 extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns);

 extern struct pid *find_vpid(int nr);

+extern struct pid *find_pid(int nr);

 

 /*

  * Lookup a PID in the hash table, and return with it's count elevated.

--- kernel/pid.c.orig   2008-12-17 01:33:52.000000000 +0100

+++ kernel/pid.c   2008-12-17 01:36:41.000000000 +0100

@@ -309,6 +309,12 @@

 }

 EXPORT_SYMBOL_GPL(find_vpid);

 

+struct pid *find_pid(int nr)

+{

+       return find_pid_ns(nr, &init_pid_ns);

+}

+EXPORT_SYMBOL_GPL(find_pid);

+

 /*

  * attach_pid() must be called with the tasklist_lock write-held.

  */

--- include/linux/sched.h.orig   2008-12-17 00:10:02.000000000 +0100

+++ include/linux/sched.h   2008-12-17 00:10:57.000000000 +0100

@@ -1829,6 +1829,7 @@

 extern void force_sig_specific(int, struct task_struct *);

 extern int send_sig(int, struct task_struct *, int);

 extern void zap_other_threads(struct task_struct *p);

+extern int kill_proc(pid_t, int, int);

 extern struct sigqueue *sigqueue_alloc(void);

 extern void sigqueue_free(struct sigqueue *);

 extern int send_sigqueue(struct sigqueue *,  struct task_struct *, int group);

--- kernel/signal.c.orig   2008-12-17 01:43:48.000000000 +0100

+++ kernel/signal.c   2008-12-17 01:29:40.000000000 +0100

@@ -1237,6 +1237,17 @@

 }

 EXPORT_SYMBOL(kill_pid);

 

+int

+kill_proc(pid_t pid, int sig, int priv)

+{

+       int ret;

+

+       rcu_read_lock();

+       ret = kill_pid_info(sig, __si_special(priv), find_pid(pid));

+       rcu_read_unlock();

+       return ret;

+}

+

 /*

  * These functions support sending signals using preallocated sigqueue

  * structures.  This is needed "because realtime applications cannot

@@ -1929,6 +1940,7 @@

 EXPORT_SYMBOL_GPL(dequeue_signal);

 EXPORT_SYMBOL(flush_signals);

 EXPORT_SYMBOL(force_sig);

+EXPORT_SYMBOL(kill_proc);

 EXPORT_SYMBOL(send_sig);

 EXPORT_SYMBOL(send_sig_info);

 EXPORT_SYMBOL(sigprocmask);

--- include/sound/core.h.orig   2008-12-17 02:14:18.000000000 +0100

+++ include/sound/core.h   2008-12-17 02:17:25.000000000 +0100

@@ -28,6 +28,7 @@

 #include <linux/rwsem.h>      /* struct rw_semaphore */

 #include <linux/pm.h>         /* pm_message_t */

 #include <linux/device.h>

+#include "typedefs.h"

 

 /* number of supported soundcards */

 #ifdef CONFIG_SND_DYNAMIC_MINORS

```

I have just tested the first patch on newly installed 2.6.28-tuxonice kernel

```

cd /usr/src/linux/

cat ../btsco-2.6.28.patch | patch -p0 --dry-run

patching file include/sound/core.h

patching file include/sound/typedefs.h

patching file include/linux/pid.h

patching file kernel/pid.c

patching file include/linux/sched.h

Hunk #1 succeeded at 1833 (offset 4 lines).

patching file kernel/signal.c
```

Offset is not a problem  :Smile: 

IIRC, the patch provided at http://www.gentoo-wiki.info/Bluetooth_headset#Obsolete_method_2  forks for kernels up to 2.6.26

P.S. should perhabs add a wiki entry some day...

P.P.S is there a way to put longer code in a compact codebox with scrollbars?

----------

## fbcyborg

Reply to P.P.S.: I don't think so.

Thank you. I use gentoo-sources-2.6.28.

----------

## erikderzweite

there must be some formatting error then: I have made a clean install of gentoo-sources-2.6.28 and my patch works fine. If I copypaste the code from my topic, I get all kind of errors. Will try to figure that out.

EDIT: just apply -l or --ignore-whitespace to the patch command

```
# cat ../snd_headset.patch | patch -p0 --dry-run --ignore-whitespace

patching file include/sound/core.h

patching file include/sound/typedefs.h

patching file include/linux/pid.h

patching file kernel/pid.c

patching file include/linux/sched.h

Hunk #1 succeeded at 1833 (offset 4 lines).

patching file kernel/signal.c
```

I that doesn't work, try remerging the kernel.

----------

## fbcyborg

It perfectly works now! Thank you.

----------

## fbcyborg

One more question. 

I emerged btsco and btsco-kernel successfully.

What method do you use/prefer, to connect your bluetooth headset? I tried to use /etc/init.d/headset init script but it seems to not work.

I also tried to manually pair my headset using btsco, and it's OK even though I didn't a mplayer test to hear some sound.

Thank you for your support.

----------

## erikderzweite

I use custom script which runs btsco -v BD:AD:DR:ES:SS and turns my bluetooth dongle off after I turn the headset off (I hate that blinking  :Smile:  ).

```
#!/bin/bash

sudo hciconfig hci0 up

btsco -v XX:XX:XX:XX:XX:XX

#It might be not necessary to disconnect explicitly but it won't do any harm

sudo hcitool dc XX:XX:XX:XX:XX:XX

sudo hciconfig hci0 down
```

I launch the script in command watch plasmoid on kde4 (good to have some verbosity). Headset script didn't work for me too, but I don't really need it as I don't mind making two clicks to connect to my headset.

I have bluez-libs and bluez-utils 3.36. You have to use passkey-agent with these version though to manage your pins. Alternatively you can use some GUI to authenticate to your headset. Bluez-gnome 0.28 did the job for me once. kdebluetooth-1.0_beta8 should work too.

----------

## fbcyborg

Thanks a lot erikderzweite. I appreciate your support very much.

I don't understand why, I'm not able to hear anything from my BT Headset even though it connects to my USB Bluetooth dongle without any complication.

KDEBluetooth allowed me to always authenticate the headset, as you told me in your last post.

Once it is connected, I can hear a low noise coming from the built in speaker when I go into the Skype Options->Sound Devices, but I'm not able to hear some sound using skype for calling.

I also tried to do as follows:

```
mplayer -ao alsa:device=hw=1.0 /usr/share/sounds/k3b_success1.wav
```

but nothing happens.

 :Sad: 

----------

## erikderzweite

- Check if you have snd-bt-sco module loaded.

- Secondly, check your /etc/bluetooth/hcid.conf. You'll need followings there (not a complete file, only relevant options):

```
autoinit yes;

security auto;

pairing multi;

passkey "0000";

# Default link mode

lm accept;

```

passkey is optional, I don't know if it is actually working but it does no harm (0000 is default pin for my headset)

Restart bluetooth if you needed to make some changes

start "btsco -v XX:XX:XX:XX:XX:XX"  from console and tell me the output. In my case it looks like this:

```
$ btsco -v XX:XX:XX:XX:XX:XX

btsco v0.41

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 2 connected
```

Change XX:XX:XX:XX:XX:XX to your headset's mac address, of course.

If you try to play sound then, you should see

```
i/o needed: connecting sco...

connected SCO channel

Done setting sco fd

```

Your mplayer code works for me. Check if Bluetooth SCO is registered as card №1 though:

```
$ cat /proc/asound/cards

 0 [Intel          ]: HDA-Intel - HDA Intel

                      HDA Intel at 0xfc400000 irq 22

 1 [Headset        ]: Bluetooth SCO - BT Headset    

                      BT Headset 1    
```

----------

## fbcyborg

Many thanks erikderzweite,

here's my /etc/bluetooth/hcid.conf:

```
options {

        autoinit yes;

        security auto;

        pairing multi;

        pin_helper /usr/lib/kdebluetooth/kbluepin

}

device {

        name "BlueZ at %h";

        class 0x100100;

        iscan disable; pscan disable;

        lm accept;

        lp rswitch,hold,sniff,park;

        auth enable;

        encrypt enable;

}
```

I didn't set passkey because I use the pin_helper which requires me the pin (it happened only once, because I clicked on Always authorize).

Anyway, it associates without any problem.

Now, I switch on my headset.

I can hear a beep (it always happen when it associates to my cell phone) and the kbluemon icon becomes blue. So the headset has been associated, actually I can read the tool tip text saying Connected to Nokia BH-900.

I start btsco.

```
btsco -v XX:XX:XX:XX:XX:XX

btsco v0.41

Device is 1:0

Voice setting: 0x0060

                     <--- blank spaces for few seconds...

Can't connect RFCOMM channel: Operation now in progress

```

Now, once again:

```
btsco -v XX:XX:XX:XX:XX:XX

btsco v0.41

Device is 1:0

Voice setting: 0x0060

RFCOMM channel 2 connected

```

I wonder why, it doesn't work at the first time.   :Confused: 

If i press some button on the headset...

```
recieved AT+CKPD=200

recieved AT+CKPD=200

recieved AT+CKPD=200
```

It seems all OK now.

Let's now play a sound. Opening another shell, this is what it happens:

```
mplayer -ao alsa:device=hw=1.0 /usr/share/sounds/k3b_success1.wav

MPlayer dev-SVN-r28058-4.1.2 (C) 2000-2008 MPlayer Team

CPU: AMD Athlon(tm) 64 Processor 3000+ (Family: 15, Model: 4, Stepping: 8)

CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1

Compiled for x86 CPU x86 with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

Playing /usr/share/sounds/k3b_success1.wav.

Detected Audio file only!

==========================================================================

Opening audio decoder: [pcm] Uncompressed PCM audio decoder

AUDIO: 8000 Hz, 1 ch, u8, 64.0 kbit/100.00% (ratio: 8000->8000)

Audio codec: [pcm] afm: pcm (Uncompressed PCM)

==========================================================================

[AO_ALSA] The u8 format isn't supported by hardware, trying the default one.

AO: [alsa] 8000Hz 1ch s16le (2 bytes per sample)

Video: no video!!!

Starting reproducing...

A:  -0.0 (unknown) of 5.0 (05.0)  0.0%

MPlayer interrupted by signal 2 in module: play_audio

MPlayer interrupted by signal 2 in module: play_audio

```

Maybe the problem is here:

[AO_ALSA] The u8 format isn't supported by hardware

So, this is what happens in the previous shell (the one I used to start btsco):

```
speaker volume: 0 mic volume: 0

i/o needed: connecting sco...

Can't connect SCO audio channel

: Connection timed out

speaker volume: 0 mic volume: 0
```

And this is what the /proc/asound/cards shows:

```
# cat /proc/asound/cards

 0 [Live           ]: EMU10K1 - SBLive 5.1 [SB0060]

                      SBLive 5.1 [SB0060] (rev.7, serial:0x80611102) at 0xb800, irq 17

 1 [Headset        ]: Bluetooth SCO - BT Headset

                      BT Headset 1

```

----------

## erikderzweite

What versions of bluez-libs, bluez-utils and kdebluetooth do you use?

Just a wild guess in case you are using bluez 2: — disable kbluetooth and try making clean pairing — put your headset in pairing mode and issue followings:

```
rm /var/lib/bluetooth/ -r

/etc/init.d/bluetooth restart

hcitool cc XX:XX:XX:XX:XX && hcitool auth XX:XX:XX:XX:XX
```

Your headset should pair.

Then try btsco again (don't start kbluetooth).

I use 3.36 version of bluez, both libs and utils. Version 2.25 worked for me too, IIRC.

----------

## fbcyborg

I use bluez and bluez-lib 3.36, and kdebluetooth-1.0_beta8.

I tried to do the same steps described before, closing kbluemon but nothing new.

----------

## erikderzweite

 *Quote:*   

> Maybe the problem is here: 
> 
>  [AO_ALSA] The u8 format isn't supported by hardware 

 

No, it's not the problem, I see the same when I play the wav.

 *Quote:*   

>  I wonder why, it doesn't work at the first time.  

 

Not an actual problem either, don't know why, but when it connects, it does it properly.

```
i/o needed: connecting sco... 

 Can't connect SCO audio channel 

 : Connection timed out 
```

That is the problem. I fail to see why it is happening though. Had similar behavior in the past when the dongle didn't get proper authorization...

Let us try followings (you'll need 3 terminals) and my /etc/bluetooth/hcid.conf

```
options {

        autoinit yes;

        security auto;

        pairing multi;

        passkey "0000";

}

device {

        name "BlueZ (%d)";

        class 0x000100;

        iscan enable; pscan enable;

        lm accept;

        lp rswitch,hold,sniff,park;

}
```

- Be sure to exit kbluetooth, kbluemon and similar.

- Unplug your dongle

- terminal 1: #rm /var/lib/bluetooth/  -r

- put your headset in pairing mode

- plug the dongle back

- terminal 1: #passkey-agent --default 0000

- terminal 2: $btsco -v 00:0B:2E:70:51:BE

(expected output: terminal1: "Passkey request for device 00:0B:2E:70:51:BE", dongle pairs successfully, terminal2 show normal connection log)

- terminal 3: $mplayer -ao alsa:device=hw=1.0 /usr/share/sounds/k3b_success1.wav

(expected result: you should hear it now)

If that doesn't help, provide the output of hciconfig -a, maybe the dongle doesn't support audio in the first place  :Smile: 

----------

## fbcyborg

All went as you wrote. Furthermore, at this time, I could connect at the first attempt using btsco.

All seems ok up to the last but one step.

When I try to listen for a wav or mp3 file, I can't hear anything. Only a low noise can be listened.

This is the output of the hciconfig -a:

```
hci0:   Type: USB

        BD Address: XX:XX:XX:XX:XX:XX ACL MTU: 120:20 SCO MTU: 0:0

        UP RUNNING PSCAN

        RX bytes:1433416 acl:28 sco:28061 events:84 errors:0

        TX bytes:745 acl:28 sco:0 commands:34 errors:0

        Features: 0xff 0xff 0x05 0x38 0x18 0x18 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy:

        Link mode: SLAVE ACCEPT

        Name: ''

        Class: 0x000000

        Service Classes: Unspecified

        Device Class: Miscellaneous,

        HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x757

        Manufacturer: Silicon Wave (11)
```

----------

## erikderzweite

 *fbcyborg wrote:*   

> All went as you wrote. Furthermore, at this time, I could connect at the first attempt using btsco.
> 
> All seems ok up to the last but one step.

 

You still can't connect to SCO audio channel?

```
hci0:   Type: USB

        BD Address: XX:XX:XX:XX:XX:XX ACL MTU: 120:20 SCO MTU: 0:0
```

Not good: SCO MTU should be more like 64:8... Try setting hciconfig hci0 scomtu 64:8 ACL MTU is  310:10 in my case, can be set with aclmtu option, but unlikely to matter.

```
Name: ''
```

The name is empty? Shouldn't be a problem though as you can pair the dongle

```
Manufacturer: Silicon Wave (11)
```

Cambridge Silicon Radio (10) is known to work particulary well. I haven't seen a Silicon Wave dongle before...

If setting scomtu doesn't solve the problem, you maybe should consider buying a new dongle, sorry   :Sad:  I use Hama Nano Bluetooth USB Adapter.

----------

## fbcyborg

 *erikderzweite wrote:*   

> 
> 
> You still can't connect to SCO audio channel?

 It seems to be not possible. After few seconds I get: 

```
i/o needed: connecting sco...

Can't connect SCO audio channel

: Connection timed out
```

But once I got the following messages:

```
speaker volume: 0 mic volume: 0

i/o needed: connecting sco...

connected SCO channel

Done setting sco fd

```

Nothing happened. I couldn't be able to listen any audio file.

 *erikderzweite wrote:*   

> 
> 
> ```
> hci0:   Type: USB
> 
> ...

 I tried to set up all necessary and here is the output of hciconfig -a hci0:

```
hci0:   Type: USB

        BD Address: 00:11:F6:05:3A:88 ACL MTU: 310:10 SCO MTU: 64:8

        UP RUNNING PSCAN

        RX bytes:1199 acl:0 sco:0 events:23 errors:0

        TX bytes:331 acl:0 sco:0 commands:23 errors:0

        Features: 0xff 0xff 0x05 0x38 0x18 0x18 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy:

        Link mode: SLAVE ACCEPT

        Name: 'USB-BT'

        Class: 0x000000

        Service Classes: Unspecified

        Device Class: Miscellaneous,

        HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x757

        Manufacturer: Silicon Wave (11)
```

I don't know how to set that values persistent. I don't want to manually set up values as it follows:

```
hciconfig hci0 aclmtu 310:10

hciconfig hci0 scomtu 64:8

hciconfig hci0 name USB-BT
```

 *erikderzweite wrote:*   

> 
> 
> ```
> Manufacturer: Silicon Wave (11)
> ```
> ...

 Me too! That dongle is a gift. *erikderzweite wrote:*   

> 
> 
> If setting scomtu doesn't solve the problem, you maybe should consider buying a new dongle, sorry   I use Hama Nano Bluetooth USB Adapter.

 

No problem!

Maybe I will buy one as soon as possible!  :Smile: 

Thanks a lot.

----------

## erikderzweite

In addition to proposed solution to use btsco as described here: https://forums.gentoo.org/viewtopic-p-5384984.html#5384984

It is possible to use btsco with newer kernels and new HCI USB driver. You just have to edit ebuild accordingly:

```
--- btsco-kernel-0.41.ebuild    2008-07-18 02:23:43.000000000 +0200                 

+++ btsco-kernel-0.41-r1.ebuild 2009-01-23 12:36:35.463663192 +0100

@@ -29,13 +29,13 @@

        fi

        # The wording below is checked for linux-2.6.14.4

-       CONFIG_CHECK="BT_SCO BT_HCIUSB_SCO SND_HWDEP"

+       CONFIG_CHECK="BT_SCO BT_HCIBTUSB SND_HWDEP"

        ERROR_BT_SCO="BT_SCO is not set! \n\

                Please select 'L2CAP protocol support' and 'SCO links support' under \n\

                Networking|Bluetooth subsystem support|SCO links support"

-       ERROR_BT_HCIUSB_SCO="BT_HCIUSB_SCO is not set! \n\

+       ERROR_BT_HCIBTUSB="BT_HCIBTUSB is not set! \n\

                Please select 'HCI USB driver' under \n\

-               Networking|Bluetooth subsystem support|Bluetooth device drivers|SCO (voice) support"

+               Networking|Bluetooth subsystem support|Bluetooth device drivers"

        ERROR_SND_HWDEP="SND_HWDEP is not set! \n\

                Please select a config like SND_USB_AUDIO or SND_EMU10K1; \n\

                look under Device drivers|Sound|ALSA|PCI"
```

That way you will be able to use btsco with new HCI USB in-kernel driver. Just tested it on linux-2.6.28-tunonice-r1, works fine.

----------

## Havin_it

 *erikderzweite wrote:*   

> In addition to proposed solution to use btsco as described here: https://forums.gentoo.org/viewtopic-p-5384984.html#5384984
> 
> It is possible to use btsco with newer kernels and new HCI USB driver. You just have to edit ebuild accordingly:
> 
> ```
> ...

 

Is it still necessary to use the kernel patch in this case?

----------

## erikderzweite

Yes it is. I even had a patch for 2.6.29 somewhere... But it's getting bigger and uglier all the time  :Smile: 

```
--- include/sound/typedefs.h.orig       2008-12-17 00:15:10.000000000 +0100

+++ include/sound/typedefs.h    2008-12-16 23:46:03.000000000 +0100        

@@ -0,0 +1,173 @@                                                          

+/*                                                                        

+ * Typedef's for backward compatibility (for out-of-kernel drivers)       

+ *                                                                        

+ * This file will be removed soon in future                               

+ */                                                                       

+                                                                          

+/* core stuff */                                                          

+typedef struct snd_card snd_card_t;                                       

+typedef struct snd_device snd_device_t;                                   

+typedef struct snd_device_ops snd_device_ops_t;                           

+typedef enum snd_card_type snd_card_type_t;                               

+typedef struct snd_minor snd_minor_t;                                     

+                                                                          

+/* info */                                                                

+typedef struct snd_info_entry snd_info_entry_t;                           

+typedef struct snd_info_buffer snd_info_buffer_t;                         

+                                                                          

+/* control */                                                             

+typedef struct snd_ctl_file snd_ctl_file_t;                               

+typedef struct snd_kcontrol snd_kcontrol_t;                               

+typedef struct snd_kcontrol_new snd_kcontrol_new_t;                       

+typedef struct snd_kcontrol_volatile snd_kcontrol_volatile_t;             

+typedef struct snd_kctl_event snd_kctl_event_t;                           

+typedef struct snd_aes_iec958 snd_aes_iec958_t;                           

+typedef struct snd_ctl_card_info snd_ctl_card_info_t;                     

+typedef struct snd_ctl_elem_id snd_ctl_elem_id_t;                         

+typedef struct snd_ctl_elem_list snd_ctl_elem_list_t;                     

+typedef struct snd_ctl_elem_info snd_ctl_elem_info_t;                     

+typedef struct snd_ctl_elem_value snd_ctl_elem_value_t;                   

+typedef struct snd_ctl_event snd_ctl_event_t;                             

+#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 

+typedef struct snd_mixer_oss snd_mixer_oss_t;                             

+#endif                                                                    

+                                                                          

+/* timer */                                                               

+typedef struct snd_timer snd_timer_t;                                     

+typedef struct snd_timer_instance snd_timer_instance_t;                   

+typedef struct snd_timer_id snd_timer_id_t;                               

+typedef struct snd_timer_ginfo snd_timer_ginfo_t;                         

+typedef struct snd_timer_gparams snd_timer_gparams_t;                     

+typedef struct snd_timer_gstatus snd_timer_gstatus_t;                     

+typedef struct snd_timer_select snd_timer_select_t;                       

+typedef struct snd_timer_info snd_timer_info_t;                           

+typedef struct snd_timer_params snd_timer_params_t;                       

+typedef struct snd_timer_status snd_timer_status_t;                       

+typedef struct snd_timer_read snd_timer_read_t;                           

+typedef struct snd_timer_tread snd_timer_tread_t;                         

+                                                                          

+/* PCM */                                                                 

+typedef struct snd_pcm snd_pcm_t;                                         

+typedef struct snd_pcm_str snd_pcm_str_t;                                 

+typedef struct snd_pcm_substream snd_pcm_substream_t;                     

+typedef struct snd_pcm_info snd_pcm_info_t;                               

+typedef struct snd_pcm_hw_params snd_pcm_hw_params_t;                     

+typedef struct snd_pcm_sw_params snd_pcm_sw_params_t;                     

+typedef struct snd_pcm_channel_info snd_pcm_channel_info_t;               

+typedef struct snd_pcm_status snd_pcm_status_t;                           

+typedef struct snd_pcm_mmap_status snd_pcm_mmap_status_t;                 

+typedef struct snd_pcm_mmap_control snd_pcm_mmap_control_t;               

+typedef struct snd_mask snd_mask_t;                                       

+typedef struct snd_sg_buf snd_pcm_sgbuf_t;                                

+                                                                          

+typedef struct snd_interval snd_interval_t;                               

+typedef struct snd_xferi snd_xferi_t;                                     

+typedef struct snd_xfern snd_xfern_t;                                     

+typedef struct snd_xferv snd_xferv_t;                                     

+                                                                          

+typedef struct snd_pcm_file snd_pcm_file_t;                               

+typedef struct snd_pcm_runtime snd_pcm_runtime_t;                         

+typedef struct snd_pcm_hardware snd_pcm_hardware_t;                       

+typedef struct snd_pcm_ops snd_pcm_ops_t;                                 

+typedef struct snd_pcm_hw_rule snd_pcm_hw_rule_t;                         

+typedef struct snd_pcm_hw_constraints snd_pcm_hw_constraints_t;           

+typedef struct snd_ratnum ratnum_t;                                       

+typedef struct snd_ratden ratden_t;                                       

+typedef struct snd_pcm_hw_constraint_ratnums snd_pcm_hw_constraint_ratnums_t; 

+typedef struct snd_pcm_hw_constraint_ratdens snd_pcm_hw_constraint_ratdens_t; 

+typedef struct snd_pcm_hw_constraint_list snd_pcm_hw_constraint_list_t;       

+typedef struct snd_pcm_group snd_pcm_group_t;                                 

+typedef struct snd_pcm_notify snd_pcm_notify_t;                               

+                                                                              

+/* rawmidi */                                                                 

+typedef struct snd_rawmidi snd_rawmidi_t;                                     

+typedef struct snd_rawmidi_info snd_rawmidi_info_t;                           

+typedef struct snd_rawmidi_params snd_rawmidi_params_t;                       

+typedef struct snd_rawmidi_status snd_rawmidi_status_t;                       

+typedef struct snd_rawmidi_runtime snd_rawmidi_runtime_t;                     

+typedef struct snd_rawmidi_substream snd_rawmidi_substream_t;                 

+typedef struct snd_rawmidi_str snd_rawmidi_str_t;                             

+typedef struct snd_rawmidi_ops snd_rawmidi_ops_t;                             

+typedef struct snd_rawmidi_global_ops snd_rawmidi_global_ops_t;               

+typedef struct snd_rawmidi_file snd_rawmidi_file_t;                           

+                                                                              

+/* hwdep */                                                                   

+typedef struct snd_hwdep snd_hwdep_t;                                         

+typedef struct snd_hwdep_info snd_hwdep_info_t;                               

+typedef struct snd_hwdep_dsp_status snd_hwdep_dsp_status_t;                   

+typedef struct snd_hwdep_dsp_image snd_hwdep_dsp_image_t;                     

+typedef struct snd_hwdep_ops snd_hwdep_ops_t;                                 

+                                                                              

+/* sequencer */                                                               

+typedef struct snd_seq_port_info snd_seq_port_info_t;                         

+typedef struct snd_seq_port_subscribe snd_seq_port_subscribe_t;               

+typedef struct snd_seq_event snd_seq_event_t;                                 

+typedef struct snd_seq_addr snd_seq_addr_t;                                   

+typedef struct snd_seq_ev_volume snd_seq_ev_volume_t;                         

+typedef struct snd_seq_ev_loop snd_seq_ev_loop_t;                             

+typedef struct snd_seq_remove_events snd_seq_remove_events_t;                 

+typedef struct snd_seq_query_subs snd_seq_query_subs_t;                       

+typedef struct snd_seq_system_info snd_seq_system_info_t;                     

+typedef struct snd_seq_client_info snd_seq_client_info_t;                     

+typedef struct snd_seq_queue_info snd_seq_queue_info_t;                       

+typedef struct snd_seq_queue_status snd_seq_queue_status_t;                   

+typedef struct snd_seq_queue_tempo snd_seq_queue_tempo_t;                     

+typedef struct snd_seq_queue_owner snd_seq_queue_owner_t;                     

+typedef struct snd_seq_queue_timer snd_seq_queue_timer_t;                     

+typedef struct snd_seq_queue_client snd_seq_queue_client_t;                   

+typedef struct snd_seq_client_pool snd_seq_client_pool_t;                     

+typedef struct snd_seq_instr snd_seq_instr_t;                                 

+typedef struct snd_seq_instr_data snd_seq_instr_data_t;                       

+typedef struct snd_seq_instr_header snd_seq_instr_header_t;                   

+                                                                              

+typedef struct snd_seq_user_client user_client_t;                             

+typedef struct snd_seq_kernel_client kernel_client_t;                         

+typedef struct snd_seq_client client_t;                                       

+typedef struct snd_seq_queue queue_t;                                         

+                                                                              

+/* seq_device */                                                              

+typedef struct snd_seq_device snd_seq_device_t;                               

+typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;                             

+                                                                              

+/* seq_midi */                                                                

+typedef struct snd_midi_event snd_midi_event_t;                               

+                                                                              

+/* seq_midi_emul */                                                           

+typedef struct snd_midi_channel snd_midi_channel_t;                           

+typedef struct snd_midi_channel_set snd_midi_channel_set_t;                   

+typedef struct snd_midi_op snd_midi_op_t;                                     

+                                                                              

+/* seq_oss */                                                                 

+typedef struct snd_seq_oss_arg snd_seq_oss_arg_t;                             

+typedef struct snd_seq_oss_callback snd_seq_oss_callback_t;                   

+typedef struct snd_seq_oss_reg snd_seq_oss_reg_t;                             

+                                                                              

+/* virmidi */                                                                 

+typedef struct snd_virmidi_dev snd_virmidi_dev_t;                             

+typedef struct snd_virmidi snd_virmidi_t;                                     

+                                                                              

+/* seq_instr */                                                               

+typedef struct snd_seq_kcluster snd_seq_kcluster_t;                           

+typedef struct snd_seq_kinstr_ops snd_seq_kinstr_ops_t;                       

+typedef struct snd_seq_kinstr snd_seq_kinstr_t;                               

+typedef struct snd_seq_kinstr_list snd_seq_kinstr_list_t;                     

+                                                                              

+/* ac97 */                                                                    

+typedef struct snd_ac97_bus ac97_bus_t;                                       

+typedef struct snd_ac97_bus_ops ac97_bus_ops_t;                               

+typedef struct snd_ac97_template ac97_template_t;                             

+typedef struct snd_ac97 ac97_t;                                               

+                                                                              

+/* opl3/4 */                                                                  

+typedef struct snd_opl3 opl3_t;                                               

+typedef struct snd_opl4 opl4_t;                                               

+                                                                              

+/* mpu401 */                                                                  

+typedef struct snd_mpu401 mpu401_t;                                           

+                                                                              

+/* i2c */                                                                     

+typedef struct snd_i2c_device snd_i2c_device_t;                               

+typedef struct snd_i2c_bus snd_i2c_bus_t;                                     

+                                                                              

+typedef struct snd_ak4531 ak4531_t;                                           

+                                                                              

--- include/linux/pid.h.orig    2008-12-17 01:33:29.000000000 +0100            

+++ include/linux/pid.h 2008-12-17 01:40:10.000000000 +0100                    

@@ -111,6 +111,7 @@                                                            

  */                                                                           

 extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns);             

 extern struct pid *find_vpid(int nr);                                         

+extern struct pid *find_pid(int nr);                                          

                                                                               

 /*                                                                            

  * Lookup a PID in the hash table, and return with it's count elevated.       

--- kernel/pid.c.orig   2008-12-17 01:33:52.000000000 +0100                    

+++ kernel/pid.c        2008-12-17 01:36:41.000000000 +0100                    

@@ -309,6 +309,12 @@                                                           

 }                                                                             

 EXPORT_SYMBOL_GPL(find_vpid);                                                 

                                                                               

+struct pid *find_pid(int nr)                                                  

+{                                                                             

+       return find_pid_ns(nr, &init_pid_ns);                                  

+}                                                                             

+EXPORT_SYMBOL_GPL(find_pid);                                                  

+                                                                              

 /*                                                                            

  * attach_pid() must be called with the tasklist_lock write-held.             

  */                                                                           

--- include/linux/sched.h.orig  2008-12-17 00:10:02.000000000 +0100            

+++ include/linux/sched.h       2008-12-17 00:10:57.000000000 +0100            

@@ -1893,6 +1893,7 @@                                                          

 extern void force_sig_specific(int, struct task_struct *);                    

 extern int send_sig(int, struct task_struct *, int);                          

 extern void zap_other_threads(struct task_struct *p);                         

+extern int kill_proc(pid_t, int, int);                                        

 extern struct sigqueue *sigqueue_alloc(void);                                 

 extern void sigqueue_free(struct sigqueue *);                                 

 extern int send_sigqueue(struct sigqueue *,  struct task_struct *, int group);

--- kernel/signal.c.orig        2008-12-17 01:43:48.000000000 +0100            

+++ kernel/signal.c     2008-12-17 01:29:40.000000000 +0100                    

@@ -1262,6 +1262,17 @@                                                         

 }                                                                             

 EXPORT_SYMBOL(kill_pid);                                                      

                                                                               

+int                                                                           

+kill_proc(pid_t pid, int sig, int priv)                                       

+{                                                                             

+       int ret;                                                               

+                                                                              

+       rcu_read_lock();                                                       

+       ret = kill_pid_info(sig, __si_special(priv), find_pid(pid));           

+       rcu_read_unlock();                                                     

+       return ret;                                                            

+}                                                                             

+                                                                              

 /*                                                                            

  * These functions support sending signals using preallocated sigqueue        

  * structures.  This is needed "because realtime applications cannot          

@@ -1960,6 +1971,7 @@                                                          

 EXPORT_SYMBOL_GPL(dequeue_signal);                                            

 EXPORT_SYMBOL(flush_signals);                                                 

 EXPORT_SYMBOL(force_sig);                                                     

+EXPORT_SYMBOL(kill_proc);                                                     

 EXPORT_SYMBOL(send_sig);                                                      

 EXPORT_SYMBOL(send_sig_info);                                                 

 EXPORT_SYMBOL(sigprocmask);                                                   

--- include/sound/core.h.orig   2008-12-16 23:31:29.000000000 +0100            

+++ include/sound/core.h        2008-12-17 00:04:50.000000000 +0100            

@@ -29,6 +29,7 @@                                                              

 #include <linux/pm.h>                  /* pm_message_t */                     

 #include <linux/device.h>                                                     

 #include <linux/stringify.h>                                                  

+#include "typedefs.h"                                                         

                                                                               

 /* number of supported soundcards */                                          

 #ifdef CONFIG_SND_DYNAMIC_MINORS                                              

@@ -381,6 +382,23 @@                                                           

 #endif                                                                        

                                                                               

 /**                                                                           

+ * snd_assert - run-time assertion macro                                      

+ * @expr: expression                                                          

+ *                                                                            

+ * This macro checks the expression in run-time and invokes the commands      

+ * given in the rest arguments if the assertion is failed.                    

+ * When CONFIG_SND_DEBUG is not set, the expression is executed but           

+ * not checked.                                                               

+ */

+#define snd_assert(expr, args...) do {                                 \

+       if (unlikely(!(expr))) {                                        \

+               snd_printk(KERN_ERR "BUG? (%s)\n", __ASTRING__(expr));  \

+               dump_stack();                                           \

+               args;                                                   \

+       }

+} while (0)

+

+/**

  * snd_BUG - give a BUG warning message and stack trace

  *

  * Calls WARN() if CONFIG_SND_DEBUG is set.

@@ -408,6 +426,7 @@

 #else /* !CONFIG_SND_DEBUG */

 #define snd_printd(fmt, args...)       do { } while (0)

+#define snd_assert(expr, args...)      (void)(expr)

 #define snd_BUG()                      do { } while (0)

 static inline int __snd_bug_on(int cond)

 {

```

----------

## erikderzweite

Here is a solution of getting headset work on my Gentoo installation I currently use.

Caution: doesn't work with skype on 64-bit system (at least on my system it doesn't).

As seen on pulseaudio's mailing list: https://tango.0pointer.de/pipermail/pulseaudio-discuss/2009-April/003531.html

 *Quote:*   

> So you want to get BT audio working with PA? Then please make sure to
> 
> run the following minimal versions:
> 
>     bluez 4.35
> ...

 

You can safely use net-wireless/blueman instead of gnome-bluetooth though. If you're a hardcore KDE fan, net-wireless/kdebluetooth4 from kde-testing overlay works too. You need to unmask it along with bluez-4* and put a modified version of pulseaudio ebuild to your local overlay as the in-tree-ebuild requires bluez-libs and bluez-utils instead of bluez package.

```

--- /usr/portage/media-sound/pulseaudio/pulseaudio-0.9.15.ebuild        2009-04-17 14:08:49.000000000 +0200

+++ /usr/local/portage/media-sound/pulseaudio/pulseaudio-0.9.15.ebuild  2009-04-26 21:12:50.192746598 +0200

@@ -39,7 +39,7 @@

        )

        app-admin/eselect-esd

        bluetooth? (

-               >=net-wireless/bluez-libs-3

+               >=net-wireless/bluez-4

                >=sys-apps/dbus-1.0.0

        )

        policykit? ( sys-auth/policykit )

@@ -64,7 +64,7 @@

        sys-apps/openrc

        gnome-extra/gnome-audio

        alsa? ( media-sound/alsa-utils )

-       bluetooth? ( >=net-wireless/bluez-utils-3 )"

+       bluetooth? ( >=net-wireless/bluez-4 )"

 pkg_setup() {

        enewgroup audio 18 # Just make sure it exists
```

Kernel patch mentioned in the mailing list has to be applied manually, of course. Follow gentoo's pulseaudio HOWTO to set the whole thing up and enjoy! Works pretty stable and reliable for me, headset is detected as both source and sink automatically upon connection.

----------

## fbcyborg

Hello, 

I tried that patch on my 2.6.29 gentoo sources but I get the following:

```
patching file include/sound/typedefs.h

patching file include/linux/pid.h

Hunk #1 FAILED at 111.

1 out of 1 hunk FAILED -- saving rejects to file include/linux/pid.h.rej

patching file kernel/pid.c

Hunk #1 FAILED at 309.

1 out of 1 hunk FAILED -- saving rejects to file kernel/pid.c.rej

patching file include/linux/sched.h

Hunk #1 FAILED at 1893.

1 out of 1 hunk FAILED -- saving rejects to file include/linux/sched.h.rej

patching file kernel/signal.c

Hunk #1 FAILED at 1262.

Hunk #2 FAILED at 1971.

2 out of 2 hunks FAILED -- saving rejects to file kernel/signal.c.rej

patching file include/sound/core.h

Hunk #1 FAILED at 29.

Hunk #2 FAILED at 382.

Hunk #3 FAILED at 426.

3 out of 3 hunks FAILED -- saving rejects to file include/sound/core.h.rej

```

----------

## erikderzweite

forgot about the formatting issue, add --ignore-whitespace to your patch options.

----------

## fbcyborg

Oh, thank you!!!

I forget it every time!  :Smile: 

I should print the "--ignore-whitespace" and put it on the wall somewhere in front of me!!! 

Thanks a lot, it works.

----------

## sushyad

Hi erikderzweite,

I am using bluez-4.39 with gentoo-sources-2.6.28-r1 kernel. I am able to record using two different headsets, but aplay fails. The logs are full of 

```

hci_scodata_packet: hci0 SCO packet for unknown connection handle 0

bluetoothd[6156]: No matching connection found for handle 1
```

hciconfig -a produces:

```
hci0:   Type: USB

        BD Address: 00:16:38:CA:0D:AF ACL MTU: 1017:8 SCO MTU: 64:0

        UP RUNNING PSCAN

        RX bytes:53702 acl:237 sco:852 events:329 errors:5

        TX bytes:5617 acl:216 sco:0 commands:150 errors:0

        Features: 0xff 0xff 0x8d 0xfe 0x9b 0xfd 0x00 0x80

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy: RSWITCH HOLD SNIFF PARK

        Link mode: SLAVE ACCEPT

        Name: 'tuxc2d-0'

        Class: 0x0a0104

        Service Classes: Networking, Capturing

        Device Class: Computer, Desktop workstation

        HCI Ver: 2.0 (0x3) HCI Rev: 0x208f LMP Ver: 2.0 (0x3) LMP Subver: 0x415c

        Manufacturer: Broadcom Corporation (15)
```

I patched the sco.c file in the kernel to use type=SCO_LINK only but the messages keep repeating. The dongle is Targus ACB10. Is it possible that it doesn't support audio playback?

Have you ever come across this type of playback error?

Thanks!

----------

## erikderzweite

 *sushyad wrote:*   

> 
> 
> Have you ever come across this type of playback error?
> 
> Thanks!

 

No, I can't recall such a problem. I'm not up-to-date with Broadcom chipset status though. Do you use pulseaudio or alsa method to connect to your headset? Have you tried 

```
mplayer -ao alsa:device=bluetooth some.file
```

----------

## sushyad

Hi erikderzweite,

I am using alsa method. I've tried mplayer and aplay with no success. The heaset beeps but doesn't play anything. Recording works just fine. I just finished testing it on Windows XP, and I am able to hear the audio using the headset, so there is something in my gentoo setup that is messed up. I tried going back to btsco too, but using that, even recording was not working. It's an amd64 build.

Thanks!

----------

## linbox

I was just wondering if I still need to patch the 2.6.30-gentoo-r2 kernel and where would I find the patch for this kernel?

thanks

----------

## fbcyborg

Have you already tried to use the same patch you used for a previous kernel?

----------

## jemi

Hi all, I'm trying to get a bluetooth headset working in Gentoo and I haven't found any info more recent than 2009. Could someone more knowledgeable please post an updated guide that applies now? The original posting in this thread is ridiculously old. Thanks.

----------

## fbcyborg

Hi jemi, you are right, but I gave up since I've never be able to get it working. It seems to be very hard (read "impossible") now.

----------

## erikderzweite

 *fbcyborg wrote:*   

> Hi jemi, you are right, but I gave up since I've never be able to get it working. It seems to be very hard (read "impossible") now.

 

Quite the contrary, it got much easier now. You don't need any of the oldschool hackery, you just need pulseaudio with appropriate flags and e.g. blueman. In my case no tinkering needed at all. Once you've connected to the headset it will be recognized by pulseaudio as sink/source and you can move sound streams around.

My advice ̣— forget this forum and use pulse for your headset. The patch won't be maintained anymore as it is not needed.

----------

## fbcyborg

Woow! What a great news!

I will try to see if doing what is dealed here, will bring me to use my bluetooth headset finally.

Thanks a lot.

EDIT: I tried to setup pulseaudio but it caused my system to not play any sound anymore. I came back to the previous configuration.

----------

