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
Solved! Go to Solution.
Hi igor,
Thanks for the reply.
The Problem has been solved by modification to audmux entry:
Initially i was using audmux like this:
&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux_1>;
pinctrl-1 = <&pinctrl_audmux_4>;
status = "okay";
};
later I made the following changes & pcm_write started working
1. Removed pinctrl-1 entry.
&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux_1>;
status = "okay";
};
2. Added the "pinctrl_audmux_4" entries with the "pinctrl_audmux_1".
pinctrl_audmux_1: audmux-1 {
fsl,pins = <
/* pinctrl 1*/
MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
/* pinctrl 4 */
MX6QDL_PAD_DI0_PIN15__AUD6_TXC 0x130b0
MX6QDL_PAD_DI0_PIN3__AUD6_TXFS 0x130b0
MX6QDL_PAD_DI0_PIN2__AUD6_TXD 0x130b0
MX6QDL_PAD_DI0_PIN4__AUD6_RXD 0x130b0
>;
};
Regards,
praveen
Hi prav
I think this may be due to kernel settings, please check
attached Linux Guide sect.7.4 Pulseaudio input/output settings
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igor,
Thanks for the reply.
The Problem has been solved by modification to audmux entry:
Initially i was using audmux like this:
&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux_1>;
pinctrl-1 = <&pinctrl_audmux_4>;
status = "okay";
};
later I made the following changes & pcm_write started working
1. Removed pinctrl-1 entry.
&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux_1>;
status = "okay";
};
2. Added the "pinctrl_audmux_4" entries with the "pinctrl_audmux_1".
pinctrl_audmux_1: audmux-1 {
fsl,pins = <
/* pinctrl 1*/
MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
/* pinctrl 4 */
MX6QDL_PAD_DI0_PIN15__AUD6_TXC 0x130b0
MX6QDL_PAD_DI0_PIN3__AUD6_TXFS 0x130b0
MX6QDL_PAD_DI0_PIN2__AUD6_TXD 0x130b0
MX6QDL_PAD_DI0_PIN4__AUD6_RXD 0x130b0
>;
};
Regards,
praveen