大家好、我正在尝试将 tlv320aic3110集成到 stm32mp135板中。 到目前为止、我已经使它能够将芯片识别为声卡:
~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: MySound [MySound], device 0: 44004000.audio-controller-tlv320aic31xx-hifi tlv320aic31xx-hifi [44004000.audio-controller-tlv320aic31xx-hifi tlv320aic31xx-hifi] Subdevices: 1/1 Subdevice #0: subdevice #0
我已经为器件树编写了以下内容:
sound0: sound@0 { compatible = "simple-audio-card"; simple-audio-card,name = "MySound"; simple-audio-card,widgets = "Microphone", "Microphone Jack", "Headphone", "Headphone Jack", "Speaker", "Speaker"; simple-audio-card,routing = "MIC1LP", "Microphone Jack", "MIC1RP", "Microphone Jack", "MIC1LP", "MICBIAS", "MIC1RP", "MICBIAS", "Headphone Jack", "HPL", "Headphone Jack", "HPR", "Speaker", "SPL", "Speaker", "SPR"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&sound0_master>; simple-audio-card,frame-master = <&sound0_master>; simple-audio-card,bitclock-inversion; simple-audio-card,cpu { sound-dai = <&i2s1>; system-clock-frequency = <12000000>; }; sound0_master: simple-audio-card,codec { sound-dai = <&codec>; system-clock-frequency = <12000000>; }; }; ... &pinctrl { codec_pins_a: codec_pins_a { pins1 { pinmux = <STM32_PINMUX('F', 8, GPIO)>; /* AUDIO_PWR_EN1 */ bias-pull-up; }; pins2 { pinmux = <STM32_PINMUX('F', 6, GPIO)>; /* RESET */ bias-disable; }; pins3 { pinmux = <STM32_PINMUX('A', 3, AF5)>, /* I2S1_SDO */ <STM32_PINMUX('A', 6, AF5)>, /* I2S1_SDI */ <STM32_PINMUX('B', 1, AF5)>, /* I2S1_BITCLK / I2S1_CK */ <STM32_PINMUX('B', 0, AF5)>, /* I2S1_WORDCLK / I2S1_MCK */ <STM32_PINMUX('D', 9, AF13)>, /* CLK1_A / LCD_CLK */ <STM32_PINMUX('B', 10, GPIO)>; /* K81_AUD_MUTE */ }; }; }; &i2s1 { // pinctrl-names = "default"; // pinctrl-0 = <&i2s1_pins>; status = "okay"; #clock-cells = <0>; clock-names = "pclk", "i2sclk", "x8k", "x11k"; clocks = <&rcc SPI5>, <&rcc SPI1_K>, <&rcc SAI1_K>, <&rcc SAI2_K>; }; &i2c1 { codec: codec@18 { compatible = "ti,tlv320aic3110"; reg = <0x18>; // pinctrl-names = "default"; pinctrl-0 = <&codec_pins_a>; #sound-dai-cells = <0>; status = "okay"; system-clock-frequency = <100000>; ai31xx-micbias-vg = <MICBIAS_2_0V>; reset-gpios = <&gpiof 6 GPIO_ACTIVE_LOW>; /* Regulators */ HPVDD-supply = <&scmi_v3v3_sw>; SPRVDD-supply = <&scmi_vdd_usb>; SPLVDD-supply = <&scmi_vdd_usb>; AVDD-supply = <&scmi_v3v3_sw>; IOVDD-supply = <&scmi_v3v3_sw>; DVDD-supply = <&scmi_v1v8_periph>; }; };
修改amixer
/中显示的参数后alsamixer
、我终于能够听到一些声音、但在我尝试播放 wav 文件或speaker-test
命令后、这只是一个短暂的"咔嗒"声。 顺便说一下、两个命令都保持"被阻止"。 如果我在计算机上运行它们、则播放声音、然后自行关闭、在板上、它们将保持执行状态、直到我手动停止它们。
这里也是我amixer
的输出:
Simple mixer control 'Speaker Analog',0 Capabilities: pvolume Playback channels: Front Left - Front Right Limits: Playback 0 - 127 Mono: Front Left: Playback 127 [100%] [0.00dB] Front Right: Playback 127 [100%] [0.00dB] Simple mixer control 'Speaker Driver',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 3 Mono: Front Left: Playback 3 [100%] [24.00dB] [on] Front Right: Playback 3 [100%] [24.00dB] [on] Simple mixer control 'Speaker Left',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Speaker Right',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Mic PGA',0 Capabilities: cvolume cvolume-joined Capture channels: Mono Limits: Capture 0 - 119 Mono: Capture 119 [100%] [59.50dB] Simple mixer control 'ADC',0 Capabilities: cvolume cvolume-joined cswitch cswitch-joined Capture channels: Mono Limits: Capture 0 - 64 Mono: Capture 64 [100%] [12.00dB] [on] Simple mixer control 'ADC Fine',0 Capabilities: cvolume cvolume-joined Capture channels: Mono Limits: Capture 0 - 4 Mono: Capture 4 [100%] [0.40dB] Simple mixer control 'DAC',0 Capabilities: pvolume Playback channels: Front Left - Front Right Limits: Playback 0 - 175 Mono: Front Left: Playback 175 [100%] [24.00dB] Front Right: Playback 175 [100%] [24.00dB] Simple mixer control 'DAC Left Input',0 Capabilities: enum Items: 'Off' 'Left Data' 'Right Data' 'Mono' Item0: 'Mono' Simple mixer control 'DAC Right Input',0 Capabilities: enum Items: 'Off' 'Right Data' 'Left Data' 'Mono' Item0: 'Mono' Simple mixer control 'HP Analog',0 Capabilities: pvolume Playback channels: Front Left - Front Right Limits: Playback 0 - 127 Mono: Front Left: Playback 127 [100%] [0.00dB] Front Right: Playback 127 [100%] [0.00dB] Simple mixer control 'HP Driver',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 9 Mono: Front Left: Playback 9 [100%] [9.00dB] [on] Front Right: Playback 9 [100%] [9.00dB] [on] Simple mixer control 'HP Left',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'HP Output Driver Power-On time',0 Capabilities: enum Items: '0us' '15.3us' '153us' '1.53ms' '15.3ms' '76.2ms' '153ms' '304ms' '610ms' '1.22s' '3.04s' '6.1s' Item0: '6.1s' Simple mixer control 'HP Output Driver Ramp-up step',0 Capabilities: enum Items: '0ms' '0.98ms' '1.95ms' '3.9ms' Item0: '3.9ms' Simple mixer control 'HP Right',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'MIC1LM M-Terminal',0 Capabilities: enum Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm' Item0: 'FFR 10 Ohm' Simple mixer control 'MIC1LM P-Terminal',0 Capabilities: enum Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm' Item0: 'FFR 10 Ohm' Simple mixer control 'MIC1LP P-Terminal',0 Capabilities: enum Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm' Item0: 'FFR 10 Ohm' Simple mixer control 'MIC1RP P-Terminal',0 Capabilities: enum Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm' Item0: 'FFR 10 Ohm' Simple mixer control 'Output Left From Left DAC',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Output Left From MIC1LP',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Output Left From MIC1RP',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Output Right From MIC1RP',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Output Right From Right DAC',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Volume Soft Stepping',0 Capabilities: enum Items: 'fast' 'slow' 'disabled' Item0: 'fast'
和i2cdump
我的输出:
~# i2cdump -f -y 0 0x18 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 00 00 01 56 03 91 07 14 90 00 00 90 82 00 80 80 ..?V?????..??.?? 10: 08 00 90 82 80 80 04 00 00 00 01 0c 00 08 88 00 ?.?????...??.??. 20: 00 00 00 00 80 33 11 00 00 00 00 00 00 00 00 00 ....?3?......... 30: 00 00 00 02 32 12 03 02 02 11 10 00 01 04 00 3c ...?2??????.??.< 40: 0c 30 30 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3 ?00.o8.....???~? 50: 00 00 00 28 00 00 00 00 7f 00 00 00 00 00 00 00 ...(....?....... 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 70: 00 00 00 00 00 54 00 00 00 00 00 00 00 00 00 00 .....T.......... 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
您能否检查一下我是否做了一些错误的事情、对吧? 如果您需要更多信息、请告诉我
谢谢你