Re: HSP and HFP profiles for hands-free telephony

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Georg,

Thanks for the quick response.

You should consider using ofono to connect your phone to the PC. It has all the
telephony functions you need and it works well together with PA. See here
for a short introduction:
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/

I have tried using ofono for connection, but below error is coming continuously when call is initiated
$ /ofono/test/enable-modem

Bluetooth: hci0 SCO packet for unknown connection handle 0

Below are command used for connection

:~# hciconfig hci0 up
connected phone using ofono

~# /ofono/test/enable-modem
Connecting modem /hfp/org/bluez/hci0/dev_78_C3_E9_21_1B_0B...
:~# hcidump &
[1] 4057
:~# HCI sniffer - Bluetooth packet analyzer ver 5.49
device: hci0 snap_len: 1500 filter: 0xffffffffffffffff

~# > ACL data: handle 2 flags 0x02 dlen 22
L2CAP(d): cid 0x0041 len 18 [psm 0]
> ACL data: handle 2 flags 0x02 dlen 19
L2CAP(d): cid 0x0041 len 15 [psm 0]
< ACL data: handle 2 flags 0x00 dlen 17
L2CAP(d): cid 0x0041 len 13 [psm 0]
< HCI Command: Exit Sniff Mode (0x02|0x0004) plen 2
handle 2
> HCI Event: Command Status (0x0f) plen 4
Exit Sniff Mode (0x02|0x0004) status 0x00 ncmd 1
> ACL data: handle 2 flags 0x02 dlen 22
L2CAP(d): cid 0x0041 len 18 [psm 0]
> HCI Event: Mode Change (0x14) plen 6
status 0x00 handle 2 mode 0x00 interval 0
Mode: Active
> ACL data: handle 2 flags 0x02 dlen 22
L2CAP(d): cid 0x0041 len 18 [psm 0]
> ACL data: handle 2 flags 0x02 dlen 22
L2CAP(d): cid 0x0041 len 18 [psm 0]
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 2 packets 1
> ACL data: handle 2 flags 0x02 dlen 22
L2CAP(d): cid 0x0041 len 18 [psm 0]
> ACL data: handle 2 flags 0x02 dlen 15
L2CAP(d): cid 0x0041 len 11 [psm 0]
< ACL data: handle 2 flags 0x00 dlen 16
L2CAP(d): cid 0x0041 len 12 [psm 0]
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 2 packets 1
> HCI Event: Connect Request (0x04) plen 10
bdaddr 78:C3:E9:21:1B:0B class 0x000000 type eSCO
< HCI Command: Reject Synchronous Connection (0x01|0x002a) plen 7
bdaddr 78:C3:E9:21:1B:0B reason 0x0d
Reason: Connection Rejected due to Limited Resources
> HCI Event: Command Status (0x0f) plen 4
Reject Synchronous Connection (0x01|0x002a) status 0x00 ncmd 1
> HCI Event: Synchronous Connect Complete (0x2c) plen 17
status 0x0d handle 0 bdaddr 78:C3:E9:21:1B:0B type eSCO
Error: Connection Rejected due to Limited Resources
> HCI Event: Max Slots Change (0x1b) plen 3
handle 2 slots 1
> HCI Event: Connect Request (0x04) plen 10
bdaddr 78:C3:E9:21:1B:0B class 0x000000 type eSCO
< HCI Command: Reject Synchronous Connection (0x01|0x002a) plen 7
bdaddr 78:C3:E9:21:1B:0B reason 0x0d
Reason: Connection Rejected due to Limited Resources
> HCI Event: Command Status (0x0f) plen 4
Reject Synchronous Connection (0x01|0x002a) status 0x00 ncmd 1
> HCI Event: Synchronous Connect Complete (0x2c) plen 17
status 0x0d handle 0 bdaddr 78:C3:E9:21:1B:0B type eSCO
Error: Connection Rejected due to Limited Resources
> HCI Event: Max Slots Change (0x1b) plen 3
handle 2 slots 5
> HCI Event: Max Slots Change (0x1b) plen 3
handle 2 slots 5
> ACL data: handle 2 flags 0x02 dlen 36
L2CAP(d): cid 0x0041 len 32 [psm 0]
> ACL data: handle 2 flags 0x02 dlen 14
L2CAP(d): cid 0x0041 len 10 [psm 0]
> HCI Event: Max Slots Change (0x1b) plen 3
handle 2 slots 3
> HCI Event: Connect Request (0x04) plen 10
bdaddr 78:C3:E9:21:1B:0B class 0x000000 type SCO
< HCI Command: Reject Synchronous Connection (0x01|0x002a) plen 7
bdaddr 78:C3:E9:21:1B:0B reason 0x0d
Reason: Connection Rejected due to Limited Resources
> HCI Event: Command Status (0x0f) plen 4
Reject Synchronous Connection (0x01|0x002a) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
status 0x0d handle 0 bdaddr 78:C3:E9:21:1B:0B type SCO encrypt 0x01
Error: Connection Rejected due to Limited Resources
> HCI Event: Max Slots Change (0x1b) plen 3
handle 2 slots 5
> HCI Event: Max Slots Change (0x1b) plen 3
handle 2 slots 3
> HCI Event: Connect Request (0x04) plen 10
bdaddr 78:C3:E9:21:1B:0B class 0x000000 type SCO
< HCI Command: Reject Synchronous Connection (0x01|0x002a) plen 7
bdaddr 78:C3:E9:21:1B:0B reason 0x0d
Reason: Connection Rejected due to Limited Resources
> HCI Event: Command Status (0x0f) plen 4
Reject Synchronous Connection (0x01|0x002a) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
status 0x0d handle 0 bdaddr 78:C3:E9:21:1B:0B type SCO encrypt 0x01
Error: Connection Rejected due to Limited Resources
> HCI Event: Max Slots Change (0x1b) plen 3
handle 2 slots 5
> HCI Event: Mode Change (0x14) plen 6
status 0x00 handle 2 mode 0x02 interval 800
Mode: Sniff
> HCI Event: Sniff Subrate (0x2e) plen 11
status 0x00 handle 2
max latency transmit 800 receive 800
min timeout remote 0 local 2

Then connected with phone using bluetoothctl and then enabled modem on ofono using command

This looks like an error from the bluetooth stack, probably pulseaudio
cannot correct it. I experienced problems with some Bluetooth dongles,
have you tried another one?
I havent tried with other module, The Module which i am using is QCA6174A, which will support HFP profile as per documents. 
Do we need to route SCO audio as mentioned on section 5.0 in  https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth ?

On Fri, Mar 22, 2019 at 12:19 PM Georg Chini <georg@xxxxxxxx> wrote:
On 22.03.19 05:33, Mohammed Sha wrote:

Hi All,

I am attempting to implement hands-free telephony on my board, I successfully connected my android phone to the board via bluetooth module in phone and media audio sharing mode.


You should consider using ofono to connect your phone to the PC. It has all the
telephony functions you need and it works well together with PA. See here
for a short introduction:
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/


I was able to play media files via bluetooth by this. But when a call connected the bluetooth speaker works properly, i.e. I can hear what is said on the Mobile Phone, but audio is not transmitted from Board to Mobile Phone is not heard ( I guess there is some error in getting the data from mic or in transmitting data from bluetooth device). I get the following log message keeps appearing many times as soon as a call is initiated

"***Bluetooth: hci0 SCO packet for unknown connection handle 0***

***Bluetooth: hci0 sending frame failed (-27)***

***Bluetooth: hci0 sending frame failed (-27)***"


This looks like an error from the bluetooth stack, probably pulseaudio
cannot correct it. I experienced problems with some Bluetooth dongles,
have you tried another one?


The microphone on the phone is also not functioning(after bluetooth connection is established). Also in *hciconfig -a* it is found as follows

hci0:   Type: Primary  Bus: USB
    BD Address: 00:0E:8E:76:00:55  ACL MTU: 1024:8  SCO MTU: 50:8
    UP RUNNING PSCAN 
    RX bytes:810924 acl:982 sco:18885 events:670 errors:0
    **TX bytes:528349 acl:530 sco:10271 commands:108 errors:111**
    Features: 0xff 0xfe 0x8f 0xfe 0xd8 0x3f 0x5b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH HOLD SNIFF 
    Link mode: SLAVE ACCEPT 
    Name: mydevice
    Class: 0x2c041c
    Service Classes: Rendering, Capturing, Audio
    Device Class: Audio/Video, Portable Audio
    HCI Version: 4.2 (0x8)  Revision: 0x0
    LMP Version: 4.2 (0x8)  Subversion: 0x25a
    Manufacturer: Qualcomm 

How can I solve this and implement proper hands-free telephony?

The Bluetooth device is connected via USB interface, Below is the device package configuration,
pulseaudio --version

pulseaudio 11.1
 bluetoothctl --version
bluetoothctl: 5.49

ofonod --version
1.22

The steps I followed to setup connection are as follows

    $ hciconfig hci0 up
    $ pactl list sources short
    $ pactl list sinks short
    $ bluetoothctl
    agent on
    scan on
    scan off
    pair <address>
    connect<address>


--
Thanks & Regards
Mohammed Sha Ebrahim
VVDN Technologies Pvt.Ltd




--
Thanks & Regards
Mohammed Sha Ebrahim
VVDN Technologies Pvt.Ltd

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux