This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux: Speech output via bt headset, basic steps

Tool/software: Linux

Hi,

I have OMAPL-138 board with proc sdk 05.01.00.11, kernel 4.14.67 and bluez-4.101. I'm newbie in bluetooth, I need to connect bluetooth headset for playing sound. What are the basic steps I should do? For now I've done the following, please correct me if I've do some wrong:

1) make a file named .asoundrc in home directory for alsa can output to headset

2) hciconfig hci0 up piscan - bring up hci0

3) bluetoothd -d -n - start bluetooth daemon (Question: how to make debug output more verbose?? It prints just a small amount of info)

4) sdptool add hs - I think this enables Headset profile (?)

5) power on headset and enter pairable mode on it

6) hcitool cc 00:1C:EF:9F:86:BC - try to connect to headset, there is no any output from the command and I don't know is it successful or not?

7) then I immediately call hcitool con and see

Connections:
        < ACL 00:1C:EF:9F:86:BC handle 43 state 1 lm MASTER
but a few seconds later subsequent call of hcitool con returns nothing connected.

No debug output in dmesg or from bluetoothd seen. What may be the reason of connection goes down? Any suggestions appreciated, I'm stuck on this.

8) Then I try to play aplay -D btheadset ./testsound.wav, but it failed (it's no wonder):

bt_audio_service_open: connect() failed: Connection refused (111)
aplay: main:722: audio open error: Connection refused

.asoundrc contents:

pcm.btheadset {
	type plug
	slave {
		pcm {
			type bluetooth
			device "00:1C:EF:9F:86:BC"
			profile "auto"
		}
	}
	hint {
		show on
		description "Bluetooth Headset"
	}
}

ctl.btheadset {
	type bluetooth
}