Other Parts Discussed in Thread: AM5728, BEAGLEBOARD-X15, WL1837
Tool/software: Linux
Hello experts,
We have a PCM routing problem while using handfree profile. We have followed the website's instructions and unfortunately stuck in this problem for couple weeks.
Here are the steps we made on AM5728 GP EVM board.
Initially, following website's instructions, we have to update patch to route the Audio in HFRM Demo App on Sitara platform. The patch file is 0001-New-Feature-BT-PCM-integration-on-the-AM335x-EVM.PATCH
We referenced patch file and modified device tree: am57xx-beagle-x15-common.dtsi and modified kernel driver to support BT codec which we added wilink8-bt.c to kernel/sound/soc/codecs and modified davinci-evm.c to probe it. Then we put new zImage, dtb and kernel modules into files system to test. Before testing, we have to replace original sample of LinuxHFRM_HF which routes audio to device=plughw:AM335xEVM with device=plughw:BeagleBoardX15. Now it's ready to see log message
[ 2.597028] asoc-simple-card sound@0: tlv320aic3x-hifi <-> 48468000.mcasp mapping ok
[ 2.645051] ALSA device list:
[ 2.652598] #0: BeagleBoard-X15
[ 7.187355] omap-hdmi-audio omap-hdmi-audio.0.auto: snd-soc-dummy-dai <-> 58040000.encoder mapping ok
[ 7.323000] [DBG] DO evm_init
[ 7.326371] [DBG] DO davinci_evm_probe
[ 7.336751] davinci_evm btwilink_sound: wilink8_bt-hifi <-> 48478000.mcasp mapping ok
Those messages show we correctly probe all codec drivers which are connected to relevant mcasp. And using aplay -L command to display all devices we have is shown below
root@am57xx-evm:~# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
default:CARD=BeagleBoardX15
BeagleBoard-X15,
Default Audio Device
sysdefault:CARD=BeagleBoardX15
BeagleBoard-X15,
Default Audio Device
default:CARD=H58040000encode
HDMI 58040000.encoder,
Default Audio Device
sysdefault:CARD=H58040000encode
HDMI 58040000.encoder,
Default Audio Device
default:CARD=WILINK8BT
WILINK8_BT,
Default Audio Device
sysdefault:CARD=WILINK8BT
WILINK8_BT,
Default Audio Device
Before we test WILINK8BT codec, we test BeagleBoardX15 first. Setup codec audio gain by following commands
amixer sset 'PCM',0, 0 100% 100%
amixer sset 'PGA',0, 0 100% 100%
and use arecord -Dplughw:BeagleBoardX15 -r16000 | aplay -Dplughw:BeagleBoardX15 to do loopback test and it works perfectly.
Move to test WILINK8BT, we play a pcm file to WILINK8BT by aplay -Dplughw:WILINK8BT –r16000 test.pcm command to make sure this codec driver connected to WL1837. We can measure the signal from BT_AUD_IN pin and think CPU -> WL1837 path is good. So we move on to pair and test handfree profile. Here are steps tp setup handfree profile:
./SS1BTPM & //start handler
./ LinuxHFRM_HF_WL18XX (which is modified to route audio to BeagleBoardX15)
Initialize 1
SetDevicePower 1
echo 132 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio132/direction
echo 0 > /sys/class/gpio/gpio132/value
echo 1 > /sys/class/gpio/gpio132/value
echo 0 > /sys/class/gpio/gpio132/value
echo 1 > /sys/class/gpio/gpio132/value
BT COMM PORT (/dev/ttyS7): 1
Changing HCI baud rate to 3000000
Status: Executing BTS Script /lib/firmware/TIInit_11.8.32.bts.
Status: BTS Script successfully executed.
DEVM_PowerOnDevice() Success: 0.
[DBG] Route audio 16K on EVM
Device Powered On.
killall: gst-launch-1.0: no process killed
Setting pipeline to PAUSED ...
[ 556.177004] [DBG] DO evm_startup // to make sure davinci_evm is started
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
[ 556.185701] [DBG] DO evm_wilink8_bt_hw_params // to make sure wilink8_bt_hw is set
GStreamer route 16KHz success
Setting pipeline to PAUSED ...
[ 556.990176] [DBG] DO evm_startup
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
[ 557.004822] [DBG] DO evm_wilink8_bt_hw_params /
RegisterAuthentication
ChangeSimplePairingParameters 3 0
HFRRegisterEventCallback 1
HFRRegisterDataCallback
SetDiscoverable 1 100
SetConnectable 1 100
SetPairable 1 100
Then we pair WL18XX Device by phone and device is connected well.
hetHFRServiceLevelConnectionEstablished, BD_ADDR: 4C7C5F4C0700, Type: hctHandsFree, RemoteSupportedFeaturesValid: TRUE
RemoteSupportedFeatures bifield = 0x7ef
RemoteSupportedFeatures:
THREE_WAY_CALLING SOUND_ENHANCEMENT VOICE_RECOGNITION INBAND_RINGING REJECT_CALL ENHANCED_CALL_STATUS ENHANCED_CALL_CONTROL EXTENDED_ERROR_RESULT_CODES
RemoteCallHoldMultipartySupport:
RELEASE_ALL_HELD_CALLS RELEASE_ALL_ACTIVE_CALLS_ACCEPT_WAITING_CALL PLACE_ALL_ACTIVE_CALLS_ON_HOLD_ACCEPT_THE_OTHER ADD_A_HELD_CALL_TO_CONVERSATION RELEASE_SPECIFIED_ACTIVE_CALL_ONLY REQUEST_PRIVATE_CONSULTATION_MODE
hetHFRServiceLevelConnectionEstablished, BD_ADDR: 4C7C5F4C0700, Type: hctHandsFree, RemoteSupportedFeaturesValid: TRUE
RemoteSupportedFeatures bifield = 0x7ef
RemoteSupportedFeatures:
THREE_WAY_CALLING SOUND_ENHANCEMENT VOICE_RECOGNITION INBAND_RINGING REJECT_CALL ENHANCED_CALL_STATUS ENHANCED_CALL_CONTROL EXTENDED_ERROR_RESULT_CODES
The final step is to make a call by following command
DialNumber 4C7C5F4C0700 0988123456(any phone number)
hetHFRAudioConnected, BD_ADDR: 4C7C5F4C0700, Type: hctHandsFree.
[DBG]Configure PCM 16KHz
hetHFRAudioConnected, BD_ADDR: 4C7C5F4C0700, Type: hctHandsFree.
[DBG]Configure PCM 16KHz
hetHFRSpeakerGainIndication, BD_ADDR: 4C7C5F4C0700, Type: hctHandsFree, Speaker Gain: 7.
hetHFRControlIndicatorStatusIndication, BD_ADDR: 4C7C5F4C0700, Description: SIGNAL, Value: 4.
hetHFRControlIndicatorStatusIndication, BD_ADDR: 4C7C5F4C0700, Description: SIGNAL, Value: 5.
hetHFRControlIndicatorStatusIndication, BD_ADDR: 4C7C5F4C0700, Description: CALLSETUP, Value: 3.
hetHFRControlIndicatorStatusIndication, BD_ADDR: 4C7C5F4C0700, Description: CALL, Value: TRUE.
hetHFRControlIndicatorStatusIndication, BD_ADDR: 4C7C5F4C0700, Description: CALLSETUP, Value: 0.
After answered call by phone, we hear nothing either from phone or EVM board. We can't figure out what problem occurs here.
Additional information: SDK ver: 3.02, Kernel ver: 4.4.32
We can't find any solution on Sitarra platform, please have a try on GP EVM and give us a suggestion. Thank you for any help.