Skip to contentSkip to conversation

Unable to set number of SCO buffers : please upgrade your Kernel !

Bluez-devel Brandon Philips 4 participants 8 messages Apr 15, 2007 – Apr 29, 2007 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello-

I am running 2.6.21-rc6 with sco-flowcontrol-v4.2.diff applied and I am getting the following error when trying to use my Platronics 640 headset. The computer is a Thinkpad x60s running Debian unstable.

Any suggestions? I am willing to test patches, etc.

Cheers,

Brandon

philips@plankton:~$ aplay -D headset /usr/share/sounds/ekiga/busytone.wav
Playing WAVE '/usr/share/sounds/ekiga/busytone.wav' : Signed 16 bit
Little Endian, Rate 8000 Hz, Mono
ALSA lib pcm_sco.c:273:(sco_headset_hw_params) Unable to set number of
SCO buffers : please upgrade your Kernel !
aplay: set_params:965: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 8000
PERIOD_TIME: 3000
PERIOD_SIZE: 24
PERIOD_BYTES: 48
PERIODS: 167
BUFFER_TIME: 501000
BUFFER_SIZE: 4008
BUFFER_BYTES: 8016
TICK_TIME: [0 0]
philips@plankton:~$ headsetd -n
headsetd[6326]: Bluetooth headset daemon version 0.5
headsetd[6326]: Configuration phase ended: target bdaddr is
00:03:89:59:DE:F9, timeout is 6000 ms
headsetd[6326]: Changing state: Idle-->Paging
headsetd[6326]: Changing state: Paging-->Connecting
headsetd[6326]: Changing state: Connecting-->Ready
headsetd[6326]: Changing state: Ready-->Opening
headsetd[6326]: SCO channel opened handle=0x0001 mtu=64
headsetd[6326]: Changing state: Opening-->Streaming
headsetd[6326]: Appli closed socket
headsetd[6326]: Changing state: Streaming-->Zombie
headsetd[6326]: Nobody uses SCO channel anymore, closing it.
headsetd[6326]: Changing state: Zombie-->Connected

Relevant dmesg output:
hci_scodata_packet: hci0 SCO packet for unknown connection handle 1

~/.asoundrc
pcm.headset {
@args [BDADDR TIMEOUT]

# The Bluetooth device address for target headset, used for # Audio Gateway (PC) initiated connections
# Please note that this value is ignored when the connection is # Headset initiated
@args.BDADDR {
type string
default 00:03:89:59:XX:XX # XX:XX for privacy
}

# This value represents how long we will try to reach the # headset, until we give up.
# Value is in milliseconds
@args.TIMEOUT {
type integer
default 6000
}

type sco
bdaddr $BDADDR
timeout $TIMEOUT
}

ctl.headset {
type sco
}

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

Brandon

cvs update your plugz to head and it should work.

brad

Quoted 2 lines

ALSA lib pcm_sco.c:273:(sco_headset_hw_params) Unable to set number of SCO buffers : please upgrade your Kernel !

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw
Quoted 3 lines · Brad Midgley

Brandon

cvs update your plugz to head and it should work.

Thanks- it seems the Debian package in unstable was a few revisions behind.

Now I have mplayer playing great- mpd is broken though. It connects to my headset but then quickly dies. I will have to ping the developers on that.

Thanks!

Brandon

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw
In reply to Brandon Philips
Quoted 3 lines · Brandon Philips

I am running 2.6.21-rc6 with sco-flowcontrol-v4.2.diff applied and I am getting the following error when trying to use my Platronics 640 headset. The computer is a Thinkpad x60s running Debian unstable.

I have exactly the same issue on a hp notebook, also running Debian unstable. I exported current CVS HEAD, applied the Debian .diff and built a local package, and I still have the same problem. Only that the "Unable to set number of SCO buffers" error message now has pcm_sco.c:277 as line number.

Any more hints?

Greetings
Marc

Signature · 14 lines
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
#4 lore raw

Marc Haber <mh+bluez-devel <at> zugschlus.de> writes:
[...]

Quoted 3 lines

I still have the same problem. Only that
the "Unable to set number of SCO buffers" error message now has pcm_sco.c:277 as line number.

I have the same problem on 2.6.21 with the patch applied.

I looked a little into the problem and it appears that everything is actually working as it is intended - but that doesn't help us much.

In plugz/../pcm_sco.c: sco_headset_hw_params(),
setsockopt(...,SOL_SCO,...) is called, but it fails with ENOPROTOOPT
"Protocol not available".

setsockopt() for protocol level SOL_SCO is implemented in the kernel in
net/bluetooth/sco.c: sco_sock_setsockopt(), but this function only does one thing - it returns ENOPROTOOPT:

...

        switch (optname) {
        default:
                err = -ENOPROTOOPT;
                break;
        }

...

I am a bit curious - how can this work for anybody?

BR, Klaus

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw
Quoted 8 lines · Klaus <projectu <at> gmail.com> writes:

In plugz/../pcm_sco.c: sco_headset_hw_params(),
setsockopt(...,SOL_SCO,...) is called, but it fails with ENOPROTOOPT
"Protocol not available".

setsockopt() for protocol level SOL_SCO is implemented in the kernel in
net/bluetooth/sco.c: sco_sock_setsockopt(), but this function only does one thing - it returns ENOPROTOOPT:

If the method isn't implemented in the kernel, then IMHO, the obvious thing to do is to remove the offending calls to setsockopt() from pcm_sco.c.

And - surprice surprice, it works - there is sound in the headset. But the joy is short.

----

 $ mplayer -ao alsa:device=headset ~/eyes_on_me.ogg
[...]
Playing /home/kp/eyes_on_me.ogg.
Audio file file format detected.
[...]
AO: [alsa] 8000Hz 1ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 334.3 (05:34.3) of 333.0 (05:33.0)  1.2%        
----

mplayer stops playing after a few sec, and then after another few secs this happens:

pingus kernel: invalid opcode: 0000 [#1]
[...]

In syslog it looks like this:
----

Apr 29 17:01:00 pingus headsetd[3175]: Bluetooth headset daemon version 0.5
Apr 29 17:01:17 pingus headsetd[3175]: Configuration phase ended: target bdaddr
is 00:02:76:80:27:1F, timeout is 6000 ms
Apr 29 17:01:17 pingus headsetd[3175]: Changing state: Idle-->Paging
Apr 29 17:01:18 pingus headsetd[3175]: Changing state: Paging-->Connecting
Apr 29 17:01:18 pingus hcid[2230]: link_key_request (sba=00:01:53:00:CF:08,
dba=00:02:76:80:27:1F)
Apr 29 17:01:18 pingus headsetd[3175]: Changing state: Connecting-->Ready
Apr 29 17:01:18 pingus kernel: Bluetooth: SCO (Voice Link) ver 0.5
Apr 29 17:01:18 pingus kernel: Bluetooth: SCO socket layer initialized
Apr 29 17:01:18 pingus headsetd[3175]: Changing state: Ready-->Opening
Apr 29 17:01:19 pingus headsetd[3175]: SCO channel opened handle=0x002d mtu=64
Apr 29 17:01:19 pingus headsetd[3175]: Changing state: Opening-->Streaming
Apr 29 17:01:26 pingus headsetd[3175]: Appli closed socket
Apr 29 17:01:26 pingus headsetd[3175]: Changing state: Streaming-->Zombie
Apr 29 17:01:30 pingus headsetd[3175]: Nobody uses SCO channel anymore, 
  closing it.
Apr 29 17:01:30 pingus headsetd[3175]: Changing state: Zombie-->Connected
Apr 29 17:01:30 pingus kernel: hci_scodata_packet: hci0 SCO packet for unknown
  connection handle 45
Apr 29 17:01:30 pingus last message repeated 2 times
Apr 29 17:01:45 pingus kernel: usb 1-1: USB disconnect, address 3
Apr 29 17:01:45 pingus kernel: __tx_submit: hci0 tx submit failed urb c1e722bc
  type 3 err -19
Apr 29 17:01:45 pingus kernel: __tx_submit: hci0 tx submit failed urb c1e722bc
  type 3 err -19
Apr 29 17:01:45 pingus kernel: slab error in verify_redzone_free(): cache
  `size-512': memory outside object was overwritten
Apr 29 17:01:45 pingus kernel:  [<c04061e9>] show_trace_log_lvl+0x1a/0x2f
Apr 29 17:01:45 pingus kernel:  [<c04067ad>] show_trace+0x12/0x14
Apr 29 17:01:45 pingus kernel:  [<c0406831>] dump_stack+0x16/0x18
Apr 29 17:01:45 pingus kernel:  [<c04791e6>] __slab_error+0x29/0x2b
Apr 29 17:01:45 pingus kernel:  [<c047979a>] cache_free_debugcheck+0xa9/0x19d
Apr 29 17:01:45 pingus kernel:  [<c0479ae0>] kfree+0x74/0xc2
Apr 29 17:01:45 pingus kernel:  [<e098d34b>] hci_usb_close+0xc2/0x121 [hci_usb]
Apr 29 17:01:45 pingus kernel:  [<e098dd0e>] hci_usb_disconnect+0x2a/0x6f
   [hci_usb]
Apr 29 17:01:45 pingus kernel:  [<c057a61e>] usb_unbind_interface+0x30/0x63
Apr 29 17:01:45 pingus kernel:  [<c05628ba>] __device_release_driver+0x74/0x90
Apr 29 17:01:45 pingus kernel:  [<c0562d39>] device_release_driver+0x35/0x4c
Apr 29 17:01:45 pingus kernel:  [<c05622c7>] bus_remove_device+0x73/0x82
Apr 29 17:01:45 pingus kernel:  [<c056090e>] device_del+0x16e/0x1d2
Apr 29 17:01:45 pingus kernel:  [<c057840c>] usb_disable_device+0x5f/0xbc
Apr 29 17:01:45 pingus kernel:  [<c057514b>] usb_disconnect+0x9a/0x119
Apr 29 17:01:45 pingus kernel:  [<c0575df2>] hub_thread+0x2e2/0x992
Apr 29 17:01:45 pingus kernel:  [<c043832b>] kthread+0xb3/0xdc
Apr 29 17:01:45 pingus kernel:  [<c0405cd3>] kernel_thread_helper+0x7/0x10
Apr 29 17:01:45 pingus kernel:  =======================
Apr 29 17:01:45 pingus kernel: c0c27ca5: redzone 1:0x5a5a5a5a, 
  redzone 2:0x46c05ac8.
Apr 29 17:01:45 pingus kernel: ------------[ cut here ]------------
Apr 29 17:01:45 pingus kernel: kernel BUG at mm/slab.c:2877!
Apr 29 17:01:45 pingus kernel: invalid opcode: 0000 [#1]
Apr 29 17:01:45 pingus kernel: SMP 
Apr 29 17:01:45 pingus kernel: last sysfs file:

/devices/pci0000:00/0000:00:02.0/usb1/idVendor
[...]
----

Klaus

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw
In reply to Klaus

Klaus

Quoted 9 lines

In plugz/../pcm_sco.c: sco_headset_hw_params(),
setsockopt(...,SOL_SCO,...) is called, but it fails with ENOPROTOOPT
"Protocol not available".

setsockopt() for protocol level SOL_SCO is implemented in the kernel in
net/bluetooth/sco.c: sco_sock_setsockopt(), but this function only does one thing - it returns ENOPROTOOPT:

...

Quoted 8 lines
        switch (optname) {
        default:
                err = -ENOPROTOOPT;
                break;
        }

...

I am a bit curious - how can this work for anybody?

you're looking at the upatched sco.c or maybe one hunk failed. sco-flowcontrol-v4.2.diff has changes for setsockopt() around line 550.

we did actually change the constants for the setsockopt call, but if you have a recently updated plugz it should actually try both the old and new constants.

brad

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#7 lore raw
Quoted 3 lines · Brad Midgley <bmidgley <at> xmission.com> writes:

you're looking at the upatched sco.c or maybe one hunk failed. sco-flowcontrol-v4.2.diff has changes for setsockopt() around line 550.

hrmp, my fault! You are so right, and everything is working fine with the patch!

Now I just have to figure out how to use the headset from Ekiga.

(If you are curious, then I had updated my Fedora kernel-2.6.spec file with the patch - but forgot the %patchxxx to actually enable the patch).

Thanks, Klaus

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel