HFP Noise issue: BCM4356 with imx8qm-mek on Android 9 automotive

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HFP Noise issue: BCM4356 with imx8qm-mek on Android 9 automotive

1,392 Views
amit251291
Contributor IV

We are working on imx8qm-mek board running with Android 9 automotive. We have integrated BCM4356 and it seems to be working fine. We could successfully run BT_Audio (A2DP). Audio gets played via CS42888 codec. 

However when we tried to make a call we are only getting Noise on the speaker connected to above codec. 

What could be the issue here ?  

Please find below logs. I see that proper sampling is taking place for the audio stream. 

I see that there is one warning for rx and tx threads as pthread_create sched_setscheduler(1, {3}) call failed: Operation not permitted . But at the same time i see that  threads are running successfully. 

Should this be a problem because of which we are getting the noise ?

I request you to throw some light here. 

04-17 07:00:49.041 1826 2029 D audio_hw_primary: adev_set_parameters: enter: hfp_enable=true
04-17 07:00:49.041 1826 2029 I audio_hw_primary: prepare bt rx task
04-17 07:00:49.041 1826 2029 D audio_hw_primary: get_card_for_name: name: bt-sai-audio, card: 2
04-17 07:00:49.041 1826 2029 I audio_hw_primary: set pcm_config_sco_in.period_size to 32
04-17 07:00:49.041 1826 2029 I audio_hw_primary: open sco for read, card 2, port 0
04-17 07:00:49.041 1826 2029 I audio_hw_primary: rate 8000, channel 2, period_size 0x20, period_count 8
04-17 07:00:49.048 1826 2029 I audio_hw_primary: after pcm open, rate 8000, channel 2, period_size 0x24, period_count 8
04-17 07:00:49.048 1826 2029 I audio_hw_primary: create_resampler rsmpl_sco_rx, in rate 8000, out rate 48000
04-17 07:00:49.049 1838 1936 E display : updateScreen invalid drmfd
04-17 07:00:49.050 1826 2029 W libc : pthread_create sched_setscheduler(1, {3}) call failed: Operation not permitted
04-17 07:00:49.050 1826 2029 I audio_hw_primary: sco_rx_task create ret 0, tid_sco_rx -261097104
04-17 07:00:49.050 1826 2029 I audio_hw_primary: prepare bt tx task
04-17 07:00:49.050 1826 2029 D audio_hw_primary: get_card_for_name: name: bt-sai-audio, card: 2
04-17 07:00:49.050 1826 2029 I audio_hw_primary: open sco for write, card 2, port 0
04-17 07:00:49.050 1826 2029 I audio_hw_primary: rate 8000, channel 2, period_size 0xc0
04-17 07:00:49.050 1826 3718 I audio_hw_primary: enter sco_rx_task, pcm_sco_rx frames 36, szie 144
04-17 07:00:49.050 1826 3718 I audio_hw_primary: SelectPcm, curDev 0x1000000, standby 1, hdmi pcm 0x0, normal pcm 0x0
04-17 07:00:49.050 1826 3718 I audio_hw_primary: SelectPcm, primary output is standy, open it
04-17 07:00:49.050 1826 3718 I audio_hw_primary: start_output_stream_primary... 0xf15d1000, device 16777216, address bus0_media_out, mode 2
04-17 07:00:49.053 1826 2029 W audio_hw_primary: open mic, card 0, port 0
04-17 07:00:49.053 1826 2029 W audio_hw_primary: rate 48000, channel 2, period_size 0x480
04-17 07:00:49.064 1838 1936 E display : updateScreen invalid drmfd
04-17 07:00:49.072 1826 3718 W audio_hw_primary: card 0, port 0 device 0x1000000
04-17 07:00:49.072 1826 3718 W audio_hw_primary: rate 48000, channel 2 period_size 0xc0
04-17 07:00:49.072 1826 2029 I audio_hw_primary: create_resampler rsmpl_sco_tx, in rate 48000, out rate 8000
04-17 07:00:49.073 1826 2029 W libc : pthread_create sched_setscheduler(1, {3}) call failed: Operation not permitted
04-17 07:00:49.073 1826 2029 I audio_hw_primary: sco_tx_task create ret 0, tid_sco_tx -262137488
04-17 07:00:49.073 1826 2029 I audio_hw_primary: sco_task_create, ret 0
04-17 07:00:49.073 1826 2029 D audio_hw_primary: adev_set_parameters: exit with code(0)
04-17 07:00:49.073 1826 3719 I audio_hw_primary: enter sco_tx_task, pcm_cap frames 1152, szie 4608
04-17 07:00:49.075 1965 2381 I MediaFocusControl: requestAudioFocus() from uid/pid 1002/2975 clientId=android.media.AudioManager@e6272de callingPack=com.android.bluetooth req=2 flags=0x0 sdk=28
04-17 07:00:49.076 1826 2029 D audio_hw_primary: adev_set_parameters: enter: hfp_volume=11
04-17 07:00:49.076 1826 2029 D audio_hw_primary: adev_set_parameters: exit with code(0)
04-17 07:00:49.077 1826 3718 V audio_hw_primary: sco_rx_task, resample_from_input, in frames 36, 36, out_frames 384, 216
04-17 07:00:49.078 2195 2472 D CachedBluetoothDevice: onProfileStateChanged: profile HEADSET_CLIENT newProfileState 2
04-17 07:00:49.078 3361 3361 D CachedBluetoothDevice: onProfileStateChanged: profile HEADSET_CLIENT newProfileState 2
04-17 07:00:49.081 1826 3718 V audio_hw_primary: sco_rx_task, resample_from_input, in frames 36, 36, out_frames 384, 216
04-17 07:00:49.090 1826 3718 I chatty : uid=1041(audioserver) HwBinder:1826_2 identical 2 lines
04-17 07:00:49.095 1826 3718 V audio_hw_primary: sco_rx_task, resample_from_input, in frames 36, 36, out_frames 384, 216
04-17 07:00:49.098 1826 3719 V audio_hw_primary: sco_tx_task, resample_from_input, in frames 1152, 1152, out_frames 384, 192
04-17 07:00:49.099 1826 3718 V audio_hw_primary: sco_rx_task, resample_from_input, in frames 36, 36, out_frames 384, 216
04-17 07:00:49.108 1826 3718 I chatty : uid=1041(audioserver) HwBinder:1826_2 identical 2 lines

5 Replies

1,121 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Amit,

    I have ever experienced the similar question as yours, there exists huge noisies when I use PCM audio to communicate with remote one, only difference with yours is what I used is 3G/4G PCM audio, but yours is BT PCM.

vIf your situation is like this, then you can try my suggestion:
--- You can hear normal voice, but it is also accompanied by a lot of noise.

---------------------------------

On the four signal lines of BCLK, FS_CLK, TXD and RXD, add an 8pF ~ 22pF capacitor to GND. This approach can filter out high-frequency noise interference.

----------------------------------

Hope the suggestion is helpful for you.

Have a nice day!

B.R,

Weidong

0 Kudos

1,121 Views
amit251291
Contributor IV

Thanks weidong.sun‌ for your reply. My condition is bit different here. I dont here voice at all. Its only 'ghrrr' sound if i speak something on the BT call. 

Im suspecting issue in real time scheduling. As seen in the log, there is a warning for the same (in bold). I seek input for adding CAP_SYS_NICE capabilities to audio_hw_primary. Do you know how do i add it ?

0 Kudos

1,121 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Amit,

I investigated the situation and asked the Android team for advice:

1. QCA modue 1CQ HFP is supported by Android 9 BSP, which works fine.

2. The problem you encountered may be caused by the mismatch between the parameters of BT fw and xtor sound card. You may need to try to adjust the relevant parameters.

3. dummy machine driver imx-xtor.c is for BT HFP, whose audio will be routed to real audio codec.

Hope above information is helpful for you.

Have a nice day!

B.R

Weidong

1,121 Views
amit251291
Contributor IV

Dear Wigros Sun,

I looked at xtor sound card but i didn't find anything weird there. Could you please let me know what parameters you are talking about here ? Which parameters i should look into exactly ? 

0 Kudos

1,121 Views
amit251291
Contributor IV

Thank you so mcuh weidong.sun‌ for your guidelines. I will look into this driver. 
Just would like to know if you have any working logs for 'HFP client' with QCA module 1CQ with Android 9?  If yes kindly provide the same as that will help us to understand the flow. 

0 Kudos