您尚未登录。

楼主 # 2024-04-21 13:53:09

cjia
会员
注册时间: 2021-12-29
已发帖子: 5
积分: 11

求教 t113如何使用外置声卡如wm8960

自制的t113开发板,现状alse已经能识别到了wm8960,

[    1.718394] ALSA device list:
[    1.721733]   #0: audiocodec
[    1.724960]   #1: snddmic
[    1.727893]   #2: wlf,wm8960

但是无法播放音频,aplay 报错。

root@TinaLinux:/mnt/UDISK# aplay -Dhw:2,0 -vvv ./3R2.wav 
Playing WAVE './3R2.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Hardware PCM card 2 'wlf,wm8960' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 24000
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 1572864000
  appl_ptr     : 0
  hw_ptr       : 0
Max peak (12000 samples): 0x00000001 #                    0%
Max peak (12000 samples): 0x00000001 #                    0%
Max peak (12000 samples): 0x00000001 #                    0%
Max peak (12000 samples): 0x00000001 #                    0%
Max peak (64 samples): 0x00000001 #                    0%
aplay: pcm_write:1980: write error: I/O error

设备树

&twi2 { 
        clock-frequency = <400000>;
        pinctrl-0 = <&twi2_pins_a>;
        pinctrl-1 = <&twi2_pins_b>;
        pinctrl-names = "default", "sleep";
        dmas = <&dma 45>, <&dma 45>;
        dma-names = "tx", "rx";
        status = "okay";
    wm8960: wm8960@1a {
        #sound-dai-cells = <0>;
        compatible = "wlf,wm8960";
        reg = <0x1a>;
        clock-names = "mclk";
        wlf,shared-lrclk;
    };
};
&daudio2 {
    mclk_div    = <0x01>;
    frametype   = <0x00>;
    tdm_config  = <0x01>;
    sign_extend     = <0x00>;
    msb_lsb_first   = <0x00>;
    pcm_lrck_period = <0x80>;
    slot_width_select = <0x20>;
    pinctrl-names   = "default", "sleep";
    pinctrl-0       = <&daudio2_pins_a &daudio2_pins_b &daudio2_pins_c>;
    pinctrl-1       = <&daudio2_pins_d>;
    pinctrl_used    = <0x1>;
    status = "okay";
};
&sounddaudio2 {
    status = "okay";
    compatible = "sunxi,simple-audio-card";
    simple-audio-card,name = "wlf,wm8960";
    simple-audio-card,format = "i2s";
    simple-audio-card,bitclock-master = <&daudio2_master>;
    simple-audio-card,frame-master = <&daudio2_master>;
    simple-audio-card,widgets =
        "Microphone", "Mic Jack",
        "Line", "Line In",
        "Line", "Line Out",
        "Speaker", "Speaker",
        "Headphone", "Headphone Jack";
    simple-audio-card,routing =
        "Headphone Jack", "HP_L",
        "Headphone Jack", "HP_R",
        "Speaker", "SPK_LP",
        "Speaker", "SPK_LN",
        "Speaker", "SPK_RP",
        "Speaker", "SPK_RN",
        "LINPUT1", "Mic Jack",
        "LINPUT3", "Mic Jack",
        "RINPUT1", "Mic Jack",
        "RINPUT2", "Mic Jack";
    simple-audio-card,cpu {
     sound-dai = <&daudio2>;
    };
    daudio2_master: simple-audio-card,codec {
        /* sound-dai = <&ac108>; */
        sound-dai = <&wm8960>;
    };
};
    daudio2_pins_a: daudio2@0 {
        /* I2S_PIN: MCLK, BCLK, LRCK */
        pins = "PB7", "PB5", "PB6";
        function = "i2s2";
        drive-strength = <100>;
        bias-disable;
    };
    daudio2_pins_b: daudio2@1 {
        /* I2S_PIN: DIN0 */
        pins = "PB3";
        function = "i2s2_din";
        drive-strength = <100>;
        bias-disable;
    };
    daudio2_pins_c: daudio2@2 {
        /* I2S_PIN: DOUT0 */
        pins = "PB4";
        function = "i2s2_dout";
        drive-strength = <100>;
        bias-disable;
    };
    daudio2_pins_d: daudio2_sleep@0 {
        pins = "PB7", "PB6", "PB5", "PB4", "PB3";
        function = "io_disabled";
        drive-strength = <100>;
        bias-disable;
    };

经过查询得知说是音频通路没有设置对,
向各位大连求教,如何设置音频通路

最近编辑记录 cjia (2024-04-21 14:13:42)

离线

#1 2024-04-21 15:06:57

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,348
积分: 9202

Re: 求教 t113如何使用外置声卡如wm8960

amixer 命令读出通路配置,然后对照wm8960手册设置。

最快的办法还是找一下其他开发板现成的配置





离线

楼主 #2 2024-04-22 13:27:18

cjia
会员
注册时间: 2021-12-29
已发帖子: 5
积分: 11

Re: 求教 t113如何使用外置声卡如wm8960

晕哥 说:

amixer 命令读出通路配置,然后对照wm8960手册设置。

最快的办法还是找一下其他开发板现成的配置

又排查了一下,发现是i2s_dout没有输出,其他的mclk sck,bclk,都有输出,现在也不知道该如何解决。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn