Author Topic: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)  (Read 9651 times)

CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #30 on: July 06, 2009, 07:05:53 PM »
Hi Travis..

Thanks for popping by to watch us both pull what's left of our hair out..  ;D ;D :P

Anyway, I followed your post and things have improved in PCLOS anyway..

Skype now shows bluetooth correctly and even connects (online) where it stayed disconnected before and had to be xkill'ed..

I like the toggle script btw.. Very nice..

When trying the test call it says there is a problem with the audio device though..

So I'm gonna try the same settings in Mythbuntu..


Cheers,



CtrlAltDel

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #31 on: July 07, 2009, 02:37:10 AM »
Hi Travis .... yet again!   ;D ;D

I cannot get past

Code: [Select]
# hcitool cc 00:0D:44:02:E1:80
Can't create connection: Input/output error

For some reason I cannot connect either on CLi or using any of the installed BT GUI packages.

Until I get past this I cannot play with the sound. The last time I played with this, the dang thing paired ...... now it won't!!!!!

All suggestions welcome!

Travis ..... is the a2dp setup for stereo only? Should maybe sco be used for an earpiece? or maybe I am totally misunderstanding the whole thing ....... ?!?

When the BT dongle is paired does it produce a sound card device reference that can be used to direct audio to it? ...... does it appear when you search using aplay -l or arecord -l ?
Is it necessary to set refcomm into voice mode first?

regards

CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #32 on: July 07, 2009, 04:00:05 AM »
Quote
For some reason I cannot connect either on CLi or using any of the installed BT GUI packages.
Until I get past this I cannot play with the sound. The last time I played with this, the dang thing paired ...... now it won't!!!!!

I had to remove the existing pairing first.. Then it worked for me..

Cheers,


CtrlAltDel

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #33 on: July 07, 2009, 04:06:00 AM »
Quote
For some reason I cannot connect either on CLi or using any of the installed BT GUI packages.
Until I get past this I cannot play with the sound. The last time I played with this, the dang thing paired ...... now it won't!!!!!

I had to remove the existing pairing first.. Then it worked for me..

Cheers,


CtrlAltDel

Duh!     never tried that!     Must go try .......

.... how to feel really stupid in one easy lesson!!!!!!

KBT connected to the device .........  Aaaaaaaarrrrrrggggggggggghhhhhhhh
« Last Edit: July 07, 2009, 04:11:37 AM by JohnBoy »

CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #34 on: July 07, 2009, 06:06:36 AM »
Quote
KBT connected to the device .........  Aaaaaaaarrrrrrggggggggggghhhhhhhh


Hehe..  It got me too until I realised that you can only pair the same device once..

So now we are at a point (all 3 of us) where we've nearly got them working..

I'm on Mythbuntu now..  Gonna try to apply Travis's idea here..

Cheers,


CtrlAltDel

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #35 on: July 07, 2009, 06:29:43 AM »
The output below when I try sending a mono audio file to the earpiece using alsaplayer.

I don't know what the significance of error on set_channels (2) is. The player eventually loads and plays through the speakers.

Code: [Select]
$ alsaplayer --verbose -d pcm.bluetooth -l 0.1 ~/Desktop/haha.mp3
AlsaPlayer 0.99.80
(C) 1999-2004 Andy Lo A Foe <andy@alsaplayer.org> and others.
Failed to load output plugin "hw:2,0". Trying defaults.
Output plugin: ALSA output v1.9.0beta12
error on set_channels (2)
Unavailable hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 8000
PERIOD_TIME: (0 2147483625]
PERIOD_SIZE: (0 17179869]
PERIOD_BYTES: (0 34359738]
PERIODS: [2 200]
BUFFER_TIME: [125 4294967250]
BUFFER_SIZE: [1 34359738]
BUFFER_BYTES: [2 68719476]
TICK_TIME: ALL
error on set_channels (2)
Unavailable hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 8000
PERIOD_TIME: (0 2147483625]
PERIOD_SIZE: (0 17179869]
PERIOD_BYTES: (0 34359738]
PERIODS: [2 200]
BUFFER_TIME: [125 4294967250]
BUFFER_SIZE: [1 34359738]
BUFFER_BYTES: [2 68719476]
TICK_TIME: ALL
failed to configure output device...trying OSS
Output plugin: OSS output v1.0
Loading reader plugin: File reader v1.1
Loading reader plugin: HTTP reader v1.3
Loading Input plugin: Audio File Library player v0.2.1
Loading Input plugin: Ogg Vorbis player v1.2
Loading Input plugin: MAD MPEG audio plugin v1.01
Loading Input plugin: WAV player v1.01
Loading Input plugin: libsndfile plugin v0.1
Loading Input plugin: CDDA player v1.2
Loading Input plugin: MikMod player v1.0
Loading Input plugin: flac player v1.1.3/1.1.4/1.2
Interface plugin: GTK+-2.x interface

CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #36 on: July 07, 2009, 07:28:29 AM »
Hi again..

Progress but still no sound..

Check to see that /dev/rfcomm0 exists first..  If not, then, as root:

Code: [Select]
mknod --mode=666 /dev/rfcomm0 c 216 0
Code: [Select]
rfcomm connect 0 [color=red]00:0D:FD:17:3A:E8[/color] 1
Code: [Select]
rfcomm
The last command should give an output like:

Quote
rfcomm0: 00:11:67:CE:DC:56 -> 00:0D:FD:17:3A:E8 channel 1 connected [reuse-dlc release-on-hup tty-attached]

Still no sound though..  I'll keep trying though..

Also, in the /etc/bluetooth/rfcomm.conf   set the Bind = Yes


Cheers,


CtrlAltDel



Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #37 on: July 07, 2009, 01:46:58 PM »
OK at this stage my Earpiece is pairing and connecting to the USB dongle, and that info is shown when I hover over the "K" icon in the tray.

I set up my /.asoundrc file thus

Code: [Select]
# Bluetooth A2DP and SCO device
# A2DP is stereo output at 44100 Hz; SCO is mono input-output at 8000 Hz.

pcm.btheadset {
   type plug
   slave {
   pcm btheadsetraw
   }
}

pcm.btheadsetraw {
   type bluetooth
   device 00:0D:$4:02:E1:80
   profile "voice"
}

No other entries.
I created a small WAV file with a sample rate of 8000.

I then try to play that file in the earpiece using alsaplayer's command line "aplay" and this is what I get

Code: [Select]
$ aplay -v -D btheadset  ~/Desktop/hehe.wav
ALSA lib pcm_bluetooth.c:1593:(bluetooth_init) BT_GETCAPABILITIES failed : Input/output error(5)
aplay: main:608: audio open error: Input/output error

If I use a null device this is what I get

Code: [Select]
$ aplay -v -D null  ~/Desktop/hehe.wav
Playing WAVE '/home/sean/Desktop/hehe.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Null PCM
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 16
  buffer_size  : 4000
  period_size  : 1000
  period_time  : 125000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1000
  period_event : 0
  start_threshold  : 4000
  stop_threshold   : 4000
  silence_threshold: 0
  silence_size : 0
  boundary     : 2097152000

I can with a change of the -D option play the file through my speakers.

So I am happy the sound file is OK.
The problem is getting access to the Earpiece.

Nothing seems to recognise that it exists as a PCM device ........

Any pointers?

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #38 on: July 07, 2009, 02:56:03 PM »
Just as an addition for information sake. It seems to indicate what the earpiece is capable of .....

Code: [Select]
$ sdptool records 00:0D:44:02:E1:80
Service Name: Logitech HS01-V14
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

Service Name: Logitech HS01-V14
Service RecHandle: 0x10001
Service Class ID List:
  "Handsfree" (0x111e)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Handsfree" (0x111e)
    Version: 0x0101


CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #39 on: July 07, 2009, 03:07:24 PM »
Hi JohnBoy..

Have you tried changing the /etc/bluetooth/rfcomm.conf to channel 2?

I'm gonna try it now and see if that makes any difference..

Cheers,


CtrlAltDel

CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #40 on: July 07, 2009, 03:46:19 PM »
Hi AGAIN!!!!   ;D ;D

This is the error I get when I run skype from a console..
Quote
skype
ALSA lib pcm_bluetooth.c:1569:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_bluetooth.c:1569:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib ../../../src/control/control.c:909:(snd_ctl_open_noupdate) Invalid CTL btheadset
ALSA lib ../../../src/control/control.c:909:(snd_ctl_open_noupdate) Invalid CTL btheadsetraw
ALSA lib pcm_bluetooth.c:1569:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_bluetooth.c:1569:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib ../../../src/control/control.c:909:(snd_ctl_open_noupdate) Invalid CTL btheadset
ALSA lib ../../../src/control/control.c:909:(snd_ctl_open_noupdate) Invalid CTL btheadsetraw
ALSA lib pcm_bluetooth.c:1569:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_bluetooth.c:1569:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib ../../../src/control/control.c:909:(snd_ctl_open_noupdate) Invalid CTL btheadset
ALSA lib ../../../src/control/control.c:909:(snd_ctl_open_noupdate) Invalid CTL btheadsetraw


Have a look at /etc/bluetooth/main.conf

I think we may have to replace device ids there somewhere..

Cheers,


CtrlAltDel

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #41 on: July 07, 2009, 03:47:55 PM »
Hi JohnBoy..

Have you tried changing the /etc/bluetooth/rfcomm.conf to channel 2?

I'm gonna try it now and see if that makes any difference..

Cheers,


CtrlAltDel

Possible the Mic is 1 and the speaker 2?

CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #42 on: July 07, 2009, 03:52:36 PM »
Quote
Possible the Mic is 1 and the speaker 2?

Duh.. I never thought of that!!  Made no difference when i changed them anyway..

From your earlier post:

Quote
$ sdptool records 00:0D:44:02:E1:80
Service Name: Logitech HS01-V14
Service RecHandle: 0x10000
Service Class ID List:
  "Headset" (0x1108)
  "Generic Audio" (0x1203)

Do you think we might need this (in red) in /etc/bluetooth/main.conf


CtrlAltDel

CtrlAltDel

  • Guest
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #43 on: July 07, 2009, 04:30:08 PM »
Quote
www.bluez.org

Release of bluez-4.45
7th July 2009, 09:00 pm by Marcel Holtmann

The previous release had a bug with the udev rules installation. This has been fixed now.


Installed on Mythbuntu Jaunty..  Only difference is that Skype doesn't freeze up and have to be xkill'ed..

Cheers,


CtrlAltDel

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: Sending Sound to and From a Bluetooth Headset/Earpiece (mono)
« Reply #44 on: July 07, 2009, 04:56:42 PM »
Quote
Possible the Mic is 1 and the speaker 2?

Duh.. I never thought of that!!  Made no difference when i changed them anyway..

From your earlier post:

Quote
$ sdptool records 00:0D:44:02:E1:80
Service Name: Logitech HS01-V14
Service RecHandle: 0x10000
Service Class ID List:
  "Headset" (0x1108)
  "Generic Audio" (0x1203)

Do you think we might need this (in red) in /etc/bluetooth/main.conf


CtrlAltDel

I don't have that file I think.