Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

TAS2505: AM6234: aplay: pcm_write:2146: write error: Input/output error

Part Number: TAS2505

Tool/software:

Hi TI,

When I use the "aplay" command for audio driver testing, the following error will be reported:

root@tiny:~# aplay sample-3s.wav
Playing WAVE 'sample-3s.wav' : [   25.317396] tas2505-codec 2-0018: tas2505_hw_params: bit width = 16
Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
[   25.347392] davinci-mcasp 2b10000.audio-controller: Sample-rate is off by 400 PPM
[   25.357478] tas2505-codec 2-0018: tas2505_set_bias_level:power on
aplay: pcm_write:2146: write error: Input/output error
[   45.737567] tas2505-codec 2-0018: tas2505_set_bias_level:SND_SOC_BIAS_STANDBY
[   45.747864] tas2505-codec 2-0018: tas2505_set_bias_level:power off
root@tiny:~#

The driver for tas2505 is from this link: https://git.ti.com/cgit/lpaa-android-drivers/tas2505-linux-driver/ ,and the device tree configuration is also configured based on this link.But the "clk_mcasp" node in the device tree has an "enable-gpios" node that I don't know which pin on our own board it corresponds to, so it's not configured.

/{	
	clk_mcasp1_fixed: clk_mcasp1_fixed {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <24576000>;
	};

	clk_mcasp1: clk_mcasp1 {
		#clock-cells = <0>;
		compatible = "gpio-gate-clock";
		clocks = <&clk_mcasp1_fixed>;
		//enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
	};

	codec_audio: sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "AM62x-SKEVM";
		simple-audio-card,dai-link@0 {
			format = "i2s";
			bitclock-master = <&sound0_master>;
			frame-master = <&sound0_master>;
			sound0_master: cpu {
				sound-dai = <&mcasp1>;
				clocks = <&clk_mcasp1>;
			};

			codec {
				sound-dai = <&tas2505>;
			};
		};
	};
};

Due to the ''enable-gopios'' node not being configured, the boot log will have the following error:

[    0.813168] clk_mcasp1: gpio_clk_driver_probe: Can't get 'enable' named GPIO property
[    0.821220] gpio-clk: probe of clk_mcasp1 failed with error -2

I would like to ask, what is the reason for the error message "aplay: pcm_write: 2146: write error: Input/output error"? Is it related to the fact that the node ''enable-gpios'' is not configured? If it's relevant, can you tell me how to configure the ''enable-gopios’' node?

The sound card information and device node information are as follows:

root@tiny:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: AM62xSKEVM [AM62x-SKEVM], device 0: davinci-mcasp.0-tas2505-hifi tas2505-hifi-0 [davinci-mcasp.0-tas2505-hifi tas2505-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@tiny:~# cat /proc/asound/
AM62xSKEVM/  card0/       cards        devices      pcm          timers       version
root@tiny:~# cat /proc/asound/cards
 0 [AM62xSKEVM     ]: simple-card - AM62x-SKEVM
                      AM62x-SKEVM
root@tiny:~# ls /dev/snd/
controlC0  pcmC0D0p   timer
root@tiny:~#