主题中讨论的其他器件:TLV320DAC3100、
工具与软件:
我将 tlv320dac3100集成到 Linux IMX93QS93电路板中。 它正在工作、我可以测试扬声器并播放一些 wav 文件。 但是、当我第一次打开主板和编解码器电源时、在测试时遇到错误、并且在测试扬声器时仅听到噪音。 我把它们关闭然后重新打开,并且神奇的是编解码器工作正常,没有任何错误,我听到正确的声音从扬声器出来。
我得到的错误:
~# aplay -D plughw:0,0 /usr/share/sounds/alsa/Rear_Right.wav Playing WAVE '/usr/share/sounds/alsa/Rear_Right.w[ 38.619370] tlv320aic31xx-codec 1-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic31xx-codec.1-0018 for register: [0x00000040] -5 av' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
当我测试扬声器时、我收到一个错误、但我只能听到噪音:
~# speaker-test -D plughw:0,0 -c 2 -r 48000 -F S16_LE -t sine -f 500 speaker-test 1.2.8 Playback device is plughw:0,0 Stream parameters are 48000[ 156.926645] tlv320aic31xx-codec 1-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic31xx-codec.1-0018 for register: [0x00000040] -5 Hz, S16_LE, 2 channels Sine wave rate is 500.0000Hz Rate set to 48000Hz (requested 48000Hz) Buffer size range from 32 to 131072 Period size range from 16 to 8184 Using max buffer size 131072 Periods = 4 was set period_size = 4096 was set buffer_size = 131072 0 - Front Left 1 - Front Right Time per period = 3.264035
这是我的 DT 配置:
`μ A
audio_clk: audio-clk { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <12000000>; }; codec_audio: sound { compatible = "simple-audio-card"; simple-audio-card,name = "tlv320dac3100-codec"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&cpu_dai>; simple-audio-card,frame-master = <&cpu_dai>; simple-audio-card,widgets = "Line", "Line Out", "Headphone", "Headphone Jack", "Speaker", "Speaker Out"; simple-audio-card,routing = "Line Out", "HPL", "Line Out", "HPR", "Headphone Jack", "HPL", "Headphone Jack", "HPR"; status = "okay"; cpu_dai: simple-audio-card,cpu { sound-dai = <&sai1>; }; codec_dai: simple-audio-card,codec { sound-dai = <&audio_codec>; clocks = <&audio_clk>; }; }; }; &sai1 { #sound-dai-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai1>; assigned-clocks = <&clk IMX93_CLK_SAI1>; assigned-clock-parents = <&clk IMX93_CLK_AUDIO_PLL>; assigned-clock-rates = <12288000>; fsl,sai-mclk-direction-output; status = "okay"; }; &lpi2c2 { clock-frequency = <400000>; pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_lpi2c2>; status = "okay"; // Add TLV320AIC3100 audio codec node audio_codec: codec@18 { compatible = "ti,tlv320dac3100"; pinctrl-names = "default"; reg = <0x18>; #sound-dai-cells = <0>; reset-gpios = <&gpio4 9 GPIO_ACTIVE_LOW>; HPVDD-supply = <®_audio_pwr_3v3>; // 1.8V in the schematic BUT 3.3V in the TLV320AIC3100 datasheet ! AVDD-supply = <®_audio_pwr_3v3>; DVDD-supply = <®_audio_pwr_1v8>; IOVDD-supply = <®_audio_pwr_3v3>; SPRVDD-supply = <®_audio_pwr_3v3>; SPLVDD-supply = <®_audio_pwr_3v3>; SPKVDD-supply = <®_audio_pwr_5v>; }; }; pinctrl_lpi2c2: lpi2c2grp { fsl,pins = < MX93_PAD_I2C2_SCL__LPI2C2_SCL 0x40001a1e MX93_PAD_I2C2_SDA__LPI2C2_SDA 0x40001a1e >; };
什么 ID 这里的问题,有什么我遗漏的东西吗? 可能缺少了与器件初始化相关的内容!!