您尚未登录。

#1 Re: 全志 SOC » 求教 t113如何使用外置声卡如wm8960 » 2024-04-22 13:27:18

晕哥 说:

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

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

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

#2 全志 SOC » 求教 t113如何使用外置声卡如wm8960 » 2024-04-21 13:53:09

cjia
回复: 2

自制的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;
    };

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

#3 全志 SOC » t113-s3内核串口如何修改 » 2024-02-28 18:44:25

cjia
回复: 0

我自制的t113开发板,用PD21,PD22的uart1作为串口,用的百问网的tina,现在是boot0和uboot都有输出,到了内核就没有了。

sys_config.fex
[uart_para]

uart_debug_port = 1
uart_debug_tx   = port:PD21<4><1><default><default>
uart_debug_rx   = port:PD22<4><1><default><default>

env.cfg

earlyprintk=sunxi-uart,0x02500400
initcall_debug=1
console=ttyS1,115200

board.dts

	uart1_pins_a: uart1_pins@0 {  /* For EVB1 board */
		pins = "PD21", "PD22";
		function = "uart1";
		drive-strength = <10>;
		bias-pull-up;
	};

	uart1_pins_b: uart1_pins@1 {  /* For EVB1 board */
		pins = "PD21", "PD22";
		function = "gpio_in";
	};

&uart0 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&uart0_pins_a>;
	pinctrl-1 = <&uart0_pins_b>;
	status = "disabled";
};

&uart1 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&uart1_pins_a>;
	pinctrl-1 = <&uart1_pins_b>;
	status = "okay";
};

&uart2 {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&uart2_pins_a>;
        pinctrl-1 = <&uart2_pins_b>;
        status = "disabled";
};

&uart3 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&uart3_pins_a>;
	pinctrl-1 = <&uart3_pins_b>;
	status = "disabled";
};

.config

CONFIG_DEBUG_LL=y
# CONFIG_DEBUG_SUNXI_UART0 is not set
CONFIG_DEBUG_SUNXI_UART1=y
# CONFIG_DEBUG_SUNXI_UART2 is not set
# CONFIG_DEBUG_ICEDCC is not set
# CONFIG_DEBUG_SEMIHOSTING is not set
# CONFIG_DEBUG_LL_UART_8250 is not set
# CONFIG_DEBUG_LL_UART_PL01X is not set
CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
CONFIG_DEBUG_UART_8250=y
CONFIG_DEBUG_UART_PHYS=0x02500400
CONFIG_DEBUG_UART_VIRT=0xf2500400
CONFIG_DEBUG_UART_8250_SHIFT=2

串口输出日志

[20]HELLO! BOOT0 is starting!
[22]BOOT0 commit : 88480af-dirty
[25]set pll start
[31]periph0 has been enabled
[34]set pll end
[36][pmu]: bus read error
[38]board init ok
[40]ZQ value = 0x30
[42]get_pmu_exist() = -1
[45]ddr_efuse_type: 0xa
[47]trefi:7.8ms
[49][AUTO DEBUG] single rank and full DQ!
[53]ddr_efuse_type: 0xa
[55]trefi:7.8ms
[58][AUTO DEBUG] rank 0 row = 13 
[61][AUTO DEBUG] rank 0 bank = 8 
[64][AUTO DEBUG] rank 0 page size = 2 KB 
[68]DRAM BOOT DRIVE INFO: V0.33
[71]DRAM CLK = 936 MHz
[73]DRAM Type = 3 (2:DDR2,3:DDR3)
[76]DRAMC read ODT  off.
[79]DRAM ODT value: 0x42.
[81]ddr_efuse_type: 0xa
[84]DRAM SIZE =128 M
[86]dram_tpr4:0x0
[88]PLL_DDR_CTRL_REG:0xf8004d00
[91]DRAM_CLK_REG:0xc0000000
[94][TIMING DEBUG] MR2= 0x20
[101]DRAM simple test OK.
[104]rtc standby flag is 0x0, super standby flag is 0x0
[109]dram size =128
[111]card no is 0
[113]sdcard 0 line count 4
[116][mmc]: mmc driver ver 2021-05-21 14:47
[125][mmc]: Wrong media type 0x0
[128][mmc]: ***Try SD card 0***
[138][mmc]: HSSDR52/SDR25 4 bit
[141][mmc]: 50000000 Hz
[143][mmc]: 29664 MB
[145][mmc]: ***SD/MMC 0 init OK!!!***
[217]Loading boot-pkg Succeed(index=0).
[221]Entry_name        = u-boot
[227]Entry_name        = optee
[231]Entry_name        = dtb
[233]mmc not para
[235]Jump to second Boot.
M/TC: OP-TEE version: 6aef7bb2-dirty (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05)) #1 Fri Jul 23 09:25:11 UTC 2021 arm


U-Boot 2018.05-g24521d6-dirty (Feb 28 2024 - 10:13:08 +0800) Allwinner Technology

[00.288]CPU:   Allwinner Family
[00.291]Model: sun8iw20
I2C:   FDT ERROR:fdt_set_all_pin:[twi0]-->FDT_ERR_BADPATH
FDT ERROR:fdt_set_all_pin:[twi1]-->FDT_ERR_BADPATH
ready
[00.313]DRAM:  128 MiB
[00.316]Relocation Offset is: 04f01000
[00.335]secure enable bit: 0
[00.338]smc_tee_inform_fdt failed with: -65526[00.343]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, APB1=100Mhz  MBus=300Mhz
[00.349]gic: sec monitor mode
[00.352]flash init start
[00.354]workmode = 0,storage type = 1
[00.357][mmc]: mmc driver ver uboot2018:2021-11-19 15:38:00
[00.363][mmc]: get sdc_type fail and use default host:tm1.
[00.369][mmc]: can't find node "mmc0",will add new node
[00.373][mmc]: fdt err returned <no error>
[00.377][mmc]: Using default timing para
[00.381][mmc]: SUNXI SDMMC Controller Version:0x50310
[00.399][mmc]: card_caps:0x3000000a
[00.402][mmc]: host_caps:0x3000003f
[00.406]sunxi flash init ok
[00.419]Loading Environment from SUNXI_FLASH... OK
[00.450]Item0 (Map) magic is bad
[00.453]the secure storage item0 copy0 magic is bad
[00.469]Item0 (Map) magic is bad
[00.472]the secure storage item0 copy1 magic is bad
[00.476]Item0 (Map) magic is bad
secure storage read widevine fail
[00.482]secure storage read widevine fail with:-1
secure storage read ec_key fail
[00.490]secure storage read ec_key fail with:-1
secure storage read ec_cert1 fail
[00.497]secure storage read ec_cert1 fail with:-1
secure storage read ec_cert2 fail
[00.504]secure storage read ec_cert2 fail with:-1
secure storage read ec_cert3 fail
[00.512]secure storage read ec_cert3 fail with:-1
secure storage read rsa_key fail
[00.519]secure storage read rsa_key fail with:-1
secure storage read rsa_cert1 fail
[00.527]secure storage read rsa_cert1 fail with:-1
secure storage read rsa_cert2 fail
[00.534]secure storage read rsa_cert2 fail with:-1
secure storage read rsa_cert3 fail
[00.542]secure storage read rsa_cert3 fail with:-1
[00.546]usb burn from boot
delay time 0
weak:otg_phy_config
[00.558]usb prepare ok
[00.727]usb sof ok
[00.729]usb probe ok
[00.731]usb setup ok
set address 0xc
set address 0xc ok
[03.736]do_burn_from_boot usb : have no handshake
root_partition is rootfs
set root to /dev/mmcblk0p5
[03.746]update part info
[03.749]update bootcmd
[03.753]change working_fdt 0x43ec0e70 to 0x43ea0e70
disable nand error: FDT_ERR_BADPATH
[03.774]update dts
Hit any key to stop autoboot:  0 
[06.946]no vendor_boot partition is found
Android's image name: t113-100ask
[06.956]Starting kernel ...

[06.959][mmc]: MMC Device 2 not found
[06.962][mmc]: mmc 2 not find, so not exit

#4 全志 SOC » f1c200s 能否使用i2s驱动音频芯片,类似wm8960. » 2023-07-17 14:45:32

cjia
回复: 1

目前还处在设计电路图设计阶段,看各位开源项目的音频输出都是直接从芯片里出的,想用外挂的i2s音频芯片做输出,不知道行不行。

页脚

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

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