Hi,
I'm having difficulty in configuring the PCM line on the BT unit cc2564b and this is my configuration:
----
HCI_VS_Write_CODEC_Config (0xFD06):
88 00 - 136 KHz - 00 88 - PCM Clk Rate
01 - PCM Clk direction : Input
50 05 00 00 - Frame Syn Freq - 1360 Hz - 00 00 05 50
46 00 - Frame Sync Duty Cycle - 70 - 00 46
01 - Frame Sync Edge - falling edge
00 - Frame Sync Polarity - Active High
00 - Reserved
10 00 - Channel 1 data out size - 16 - 00 10
00 00 - Channel 1 data out offset - 0
01 - Channel 1 data out edge - falling - 01
10 00 - Channel 1 data in size - 16 - 00 10
00 00 - Channel 1 data in offset - 0
00 - Channel 1 data in edge - rising - 00
00 - Reserved
00 00 - Channel 2 data out size - 16
00 00 - Channel 2 data out offset - 0
00 - Channel 2 data out edge - falling - 01
00 00 - Channel 2 data in size - 16
00 00 - Channel 2 data in offset - 0
00 - Channel 2 data in edge - rising - 00
00 - Reserved
ret = bt_run_command("hcitool -i hci0 cmd 3F 106 88 00 01 50 05 00 00 46 00 01 00 00 10 00 00 00 01 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", "Setup PCM Link: ", &ret_str, &cmd_ret);
----
After I've done the above configuration I unpair, pair, connect, play with a BT headset device and can hear a channel open with background noise active.
Then I proceed with configuring the Telit Modem with the DVI voice setup as described in their doc: Telit_GE910_Family_Digital_Voice_Interface_Application_Note_r2.pdf, i.e.:
----
Configure the module in Master-Burst (PCM) Mode
AT#DVI=1,1,1
OK
1 enable DVI interface
1 use DVI port 1 (mandatory)
1 set the module DVI as Master (factory setting)
AT#DVIEXT=0,0,0,0,1
OK
0 Burst Mode (PCM)
0 sample rate 8 KHz (mandatory)
0 16 bits per sample
0 Mono Mode
1 the rising edge of the clock is used to shift out the next data to transmit. The received data bit is captured
on the falling edge of the clock (0 has the same behavior).
----
And the BitClockFrequency is set to 136KHz.
So both the BT unit and Modem is configured with the "correct" or "matching" setup requirements, i.e. samplerate = 8KHz, 16bits PCM data frame size, Clock freq = 136KHz, but still can't get a voice call over to the BT headset.
I've verified with a Oscilloscope the PCM lines IN, OUT, SYNC, CLK, and as soon as a phone call is setup on the Telit Modem, I can see the correct frequencies on the scope for the PCM lines CLK of 136KHz and SYNC=8KHz and the IN line with datastream and frequency of 15KHz.
When I speak on the BT headset side the PCM OUT line is always set to 0V or low-level on the scope, whereas I expect a voice datastream, but nothing.
The Modem does configure the PCM lines and work as expected but not the CC2564B unit, Please tell me what I am doing wrong. I am on a very tight schedule to get this working, please do escalate this to higher prio ASAP.
-----
This is the console output, you will see that the BT module is being initialized, device MAC address is set, PCM Link setup is done, unpair, pair, connect, play, Telit Modem config is done (which is setting the above mentioned AT-commands). Right at where it says "Agent has been released" I can hear the channel noise on the BT device headset.
Then, right after time "700101 00:01:54.0690" I make a phone call and it is answered at the Modem and I can see the PCM lines CLK, SYNC, IN have "data" with expected frequency as described in the DVI Telit manual as mentioned earlier. But no voice is relayed from the PCM IN port on the CC2564B to the BT headset device.
[700101 00:01:02.0898 Note] ptbt.c:1412: handle_bt_test, new_state: 0, bt_state: 0
[700101 00:01:06.3053 Note] ptbt.c:1379: - handle_bt_test: 0
[700101 00:01:06.3056 Note] ptbt.c:715: - handle_idle_state
[700101 00:01:06.3059 Note] ptbt.c:1412: handle_bt_test, new_state: 6, bt_state: 0
[700101 00:01:10.0070 Note] ptbt.c:1379: - handle_bt_test: 6
[700101 00:01:10.0079 Note] ptbt.c:1250: - handle_normal_state: 11
[700101 00:01:10.0083 Note] ptbt.c:1265: - SET Device MAC frame : 0
[700101 00:01:10.0086 Note] ptbt.c:1286: - SET Device MAC ret_val : 0
[700101 00:01:10.0088 Note] ptbt.c:1287: - SET Device MAC new_state : 6
[700101 00:01:10.0091 Note] ptbt.c:1365: ret_val: 0
[700101 00:01:10.0094 Note] ptbt.c:1412: handle_bt_test, new_state: 6, bt_state: 6
Error: Invalid signal id
Can't get device info: No such device
killall: hciattach: no process killed
Found a Texas Instruments' chip!
Firmware file : /lib/firmware/TIInit_6.7.16.bts
Loaded BTS script version 1
texas: changing baud rate to 115200, flow control to 0
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: SCO (Voice Link) ver 0.6
Bluetooth: SCO socket layer initialized
Bluetooth: HCI UART driver ver 2.2
Bluetooth: HCI H4 protocol initialized
Bluetooth: HCI BCSP protocol initialized
Bluetooth: HCILL protocol initialized
Warning: unknown command - "scan"
[700101 00:01:10.9071 Note] ptbt.c:1379: - handle_bt_test: 6
[700101 00:01:10.9074 Note] ptbt.c:1250: - handle_normal_state: 11
[700101 00:01:10.9077 Note] ptbt.c:1265: - SET Device MAC frame : 1
[700101 00:01:10.9087 Note] ptbt.c:295: - startup_bluetooth_normal
[700101 00:01:10.9095 Note] ptbt.c:1856: - bt_init_chip
[700101 00:01:10.9104 Note] ptbt.c:1821: - bt_find_hw_type
[700101 00:01:10.9107 Note] ptbt.c:1822: Find out which bt chip we have
[700101 00:01:10.9111 Note] ptbt.c:216: - bt_run_any_command
[700101 00:01:10.9161 Note] ptbt.c:221: ioctrl BT_RST_N
[700101 00:01:10.9238 Note] ptbt.c:234: Probing for BT_RST_N: child exit status 1
[700101 00:01:10.9241 Note] ptbt.c:216: - bt_run_any_command
[700101 00:01:10.9252 Note] ptbt.c:221: ioctrl BT_NSHUTD_EN
[700101 00:01:10.9358 Note] ptbt.c:225: Probing for BT_SHUTDOWN_N 0
[700101 00:01:10.9378 Note] ptbt.c:234: Probing for BT_SHUTDOWN_N: child exit status 0
[700101 00:01:10.9381 Note] ptbt.c:1837: TI CC2564B chip
[700101 00:01:10.9384 Note] ptbt.c:1766: - bt_init_cc2564b_chip
[700101 00:01:10.9387 Note] ptbt.c:1767: Initialize bluetooth,
[700101 00:01:10.9500 Note] ptbt.c:1775: nSHUTD to low: 0
[700101 00:01:11.1144 Note] ptbt.c:1787: nSHUTD to high: 0
[700101 00:01:11.1163 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1240 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1320 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1400 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1480 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1560 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1640 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1720 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1800 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1880 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.1960 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.2040 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.2120 Note] ptbt.c:132: - bt_check_cts
[700101 00:01:11.2200 Note] ptbt.c:1802: CTS res = 0
[700101 00:01:11.2203 Note] ptbt.c:170: - bt_run_command
[700101 00:01:11.2214 Note] ptbt.c:175: /etc/init.d/dbus-1 start
[700101 00:01:11.3564 Note] ptbt.c:179: Start dbus: Starting system message bus: dbus.
[700101 00:01:11.3578 Note] ptbt.c:188: Start dbus: : child exit status 0
[700101 00:01:11.3581 Note] ptbt.c:303: - bluetoothd
[700101 00:01:11.3584 Note] ptbt.c:170: - bt_run_command
[700101 00:01:11.3595 Note] ptbt.c:175: bluetoothd
[700101 00:01:11.4166 Note] ptbt.c:188: Bring up bluetoothd: : child exit status 0
[700101 00:01:11.4169 Note] ptbt.c:170: - bt_run_command
[700101 00:01:11.4180 Note] ptbt.c:175: hciconfig hci0 down
[700101 00:01:11.4569 Note] ptbt.c:188: Bring down hci: : child exit status 1
[700101 00:01:11.4572 Note] ptbt.c:170: - bt_run_command
[700101 00:01:11.4583 Note] ptbt.c:175: killall hciattach
[700101 00:01:11.5300 Note] ptbt.c:188: Bring down hciattach: : child exit status 1
[700101 00:01:11.5303 Note] ptbt.c:170: - bt_run_command
[700101 00:01:11.5314 Note] ptbt.c:175: hciattach ttyPSC3 texas
[700101 00:01:13.1853 Note] ptbt.c:179: Attach to hci: Device setup complete
[700101 00:01:13.1877 Note] ptbt.c:188: Attach to hci: : child exit status 0
[700101 00:01:13.6920 Note] ptbt.c:170: - bt_run_command
[700101 00:01:13.6931 Note] ptbt.c:175: hciconfig hci0 up
[700101 00:01:13.7066 Note] ptbt.c:188: Bring up hci: : child exit status 0
[700101 00:01:13.7601 Note] ptbt.c:170: - bt_run_command
[700101 00:01:13.7612 Note] ptbt.c:175: hciconfig hci0 scan
[700101 00:01:13.7742 Note] ptbt.c:179: Set hci discoverable: hci0: Type: BR/EDR Bus: UART
[700101 00:01:13.7745 Note] ptbt.c:179: Set hci discoverable: BD Address: A0:E6:F8:15:9C:9E ACL MTU: 1021:4 SCO MTU: 180:4
[700101 00:01:13.7749 Note] ptbt.c:179: Set hci discoverable: UP RUNNING PSCAN
[700101 00:01:13.7752 Note] ptbt.c:179: Set hci discoverable: RX bytes:797 acl:0 sco:0 events:37 errors:0
[700101 00:01:13.7755 Note] ptbt.c:179: Set hci discoverable: TX bytes:811 acl:0 sco:0 commands:37 errors:0
[700101 00:01:13.7758 Note] ptbt.c:179: Set hci discoverable:
[700101 00:01:13.7804 Note] ptbt.c:188: Set hci discoverable: : child exit status 0
[700101 00:01:13.8320 Note] ptbt.c:1286: - SET Device MAC ret_val : 0
[700101 00:01:13.8323 Note] ptbt.c:1287: - SET Device MAC new_state : 6
[700101 00:01:13.8326 Note] ptbt.c:1365: ret_val: 0
[700101 00:01:13.8329 Note] ptbt.c:1412: handle_bt_test, new_state: 6, bt_state: 6
Agent has been released
sh: can't kill pid 1226: No such process
[700101 00:01:14.1043 Note] ptbt.c:1379: - handle_bt_test: 6
[700101 00:01:14.1046 Note] ptbt.c:1250: - handle_normal_state: 16
[700101 00:01:14.1054 Note] ptbt.c:1068: - handle_texas_bt_play_test_state
[700101 00:01:14.1057 Note] ptbt.c:170: - bt_run_command
[700101 00:01:14.1068 Note] ptbt.c:175: hcitool -i hci0 cmd 3F 106 88 00 01 50 05 00 00 46 00 01 00 00 10 00 00 00 01 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[700101 00:01:14.1244 Note] ptbt.c:179: Setup PCM Link: < HCI Command: ogf 0x3f, ocf 0x0106, plen 34
[700101 00:01:14.1248 Note] ptbt.c:179: Setup PCM Link: 88 00 01 50 05 00 00 46 00 01 00 00 10 00 00 00 01 10 00 00
[700101 00:01:14.1251 Note] ptbt.c:179: Setup PCM Link: 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[700101 00:01:14.1445 Note] ptbt.c:179: Setup PCM Link: > HCI Event: 0x0e plen 4
[700101 00:01:14.1448 Note] ptbt.c:179: Setup PCM Link: 01 06 FD 00
[700101 00:01:14.1469 Note] ptbt.c:188: Setup PCM Link: : child exit status 0
[700101 00:01:19.2040 Note] ptbt.c:170: - bt_run_command
[700101 00:01:19.2051 Note] ptbt.c:175: ./bluetooth.sh unpair 30:17:C8:8D:35:7F
[700101 00:01:19.3711 Note] ptbt.c:179: BT Unpair: method return sender=:1.0 -> dest=:1.5 reply_serial=2
[700101 00:01:19.3748 Note] ptbt.c:188: BT Unpair:: child exit status 0
[700101 00:01:24.4320 Note] ptbt.c:170: - bt_run_command
[700101 00:01:24.4331 Note] ptbt.c:175: ./bluetooth.sh pair 30:17:C8:8D:35:7F
[700101 00:01:34.5752 Note] ptbt.c:188: BT pair:: child exit status 0
[700101 00:01:39.6320 Note] ptbt.c:170: - bt_run_command
[700101 00:01:39.6331 Note] ptbt.c:175: ./bluetooth.sh connect 30:17:C8:8D:35:7F
[700101 00:01:43.6647 Note] ptbt.c:179: BT connect: method return sender=:1.0 -> dest=:1.12 reply_serial=2
[700101 00:01:43.6676 Note] ptbt.c:188: BT connect:: child exit status 0
[700101 00:01:48.7240 Note] ptbt.c:170: - bt_run_command
[700101 00:01:48.7251 Note] ptbt.c:175: ./bluetooth.sh play 30:17:C8:8D:35:7F
[700101 00:01:48.8681 Note] ptbt.c:179: BT play: method return sender=:1.0 -> dest=:1.15 reply_serial=2
[700101 00:01:48.8729 Note] ptbt.c:188: BT play:: child exit status 0
[700101 00:01:54.0690 Note] ptbt.c:1183: - BT configuring PCM on modem success!!
[700101 00:02:01.0760 Note] ptbt.c:1365: ret_val: 0
[700101 00:02:01.0763 Note] ptbt.c:1412: handle_bt_test, new_state: 7, bt_state: 6
[700101 00:02:01.1029 Note] ptbt.c:1379: - handle_bt_test: 7
[700101 00:02:01.1032 Note] ptbt.c:1412: handle_bt_test, new_state: 7, bt_state: 7
[700101 00:02:01.1275 Note] ptbt.c:1379: - handle_bt_test: 7
Regards,
Nasser