Hi,
I have created a module in HAL layer for hfp & modify the audio policy to go to hfp HAL. For the HFP data, code flow is going to pcm_write continuously but fails.
I am getting the following error for PCM write in HAL layer. Please let me know the possible reasons for failure.
W/audio_hw_hfp( 139): ret -1, pcm write 768 error cannot write stream data: I/O error
E/audio_hw_hfp( 139): write error, sleep few ms
W/AudioFlinger( 139): write blocked for 10022 msecs, 2 delayed writes, thread 0x73401000
E/AudioFlinger( 139): track 4097 s=00001f01 [OK] on thread 0x73401000
W/audio_hw_hfp( 139): ret -1, pcm write 768 error cannot prepare channel: Device or resource busy
E/audio_hw_hfp( 139): write error, sleep few ms
E/AudioFlinger( 139): track 4097 s=0000200a [OK] on thread 0x73401000
W/audio_hw_hfp( 139): ret -1, pcm write 768 error cannot prepare channel: Device or resource busy
E/audio_hw_hfp( 139): write error, sleep few ms
E/AudioFlinger( 139): track 4097 s=00002113 [OK] on thread 0x73401000
W/audio_hw_hfp( 139): ret -1, pcm write 768 error cannot prepare channel: Device or resource busy
E/audio_hw_hfp( 139): write error, sleep few ms
In case if above error is due to improper initialization in kernel. I have mention the way how I am doing in kernel. Please let me know the above error is in kernel or in android.
I have created two sound cards. first for normal audio & second for bluetooth sco data & I can see both sound cards are created properly.
the device tree entry are as follows:
&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux_1>;
pinctrl-1 = <&pinctrl_audmux_4>;
status = "okay";
};
sound {
compatible = "fsl,imx-audio-tlv320aic32x4";
model = "imx6q-tlv320aic32x4";
cpu-dai = <&ssi2>;
audio-codec = <&codec>;
audio-routing =
"Headphone Jack", "HPL",
"Headphone Jack", "HPR",
"IN3_R", "Mic Jack";
mux-int-port = <2>;
mux-ext-port = <4>;
};
dummy_codec: bt_codec {
compatible = "fsl,bt-sco";
status = "okay";
};
sound-bt {
compatible = "fsl,imx-audio-bt";
model = "imx6q-bt-sco";
cpu-dai = <&ssi1>;
audio-codec = <&dummy_codec>;
audio-routing =
"Headphone Jack", "TX",
"RX", "Mic Jack";
mux-int-port = <1>;
mux-ext-port = <6>;
};
ALSA device list:
#0: imx6q-tlv320aic32x4
#1: imx6q-bt-sco
Thanks,
Praveen