This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM625:TI-Linux-6.6.58 McASP:无法将两个 Rx 串行器用于具有双速率模式的编解码器

Guru**** 2344370 points
Other Parts Discussed in Thread: PCM3168A
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1511814/am625-ti-linux-6-6-58-mcasp-unable-to-use-two-rx-serializers-for-codec-with-dual-rate-mode

器件型号:AM625
主题中讨论的其他器件:PCM3168A

工具/软件:

作为编解码器、使用 pcm3168a 并与 DOUT1/2端口连接。

编解码器配置:
格式:左对齐模式
采样率:96kHz
SCKI 速率: 256

McASP 通过两个 Rx 串行器配置为4时隙 TDM 模式。
我希望从编解码器接收所有6个 ADC 通道。
不过、我只能通过第一个串行器接收四个通道。

$ arecord -f s24_3le -r 96000 -c 6 -D hw:0,0 a.wav
arecord: set_params:1398: Channels count non available

所用的设备树:
simple-audio-card,dai-link {
    format = "left_j";
    mclk-fs = <256>;

    cpu {
        bitclock-master;
        frame-master;
        dai-tdm-slot-num = <6>;
        dai-tdm-slot-width = <32>;
        dai-tdm-slot-tx-mask = <0 0 0 0 0 0>;
        dai-tdm-slot-rx-mask = <1 1 1 1 1 1>;
        sound-dai = <&mcasp1>;
    };

    codec {
        clocks = <&audio_refclk0>;
        sound-dai = <&pcm3168a 1>;
    };
};

&mcasp1 {
    pinctrl-names = "default";
    pinctrl-0 = <&mcasp1_pins>;
    op-mode = <0>;
    serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
        2 2 0 0
        0 0 0 0
        0 0 0 0
        0 0 0 0
    >;
    tdm-slots = <4>;
    #sound-dai-cells = <0>;

    /*
     * assign mcasp0 clocks because pcm3168a uses audio_refclk0
     */
    clocks = <&k3_clks 190 0>;
    clock-names = "fck";
    assigned-clocks = <&k3_clks 190 0>;
    assigned-clock-parents = <&k3_clks 190 2>;
    assigned-clock-rates = <24576000>;

    status = "okay";
};

在挖掘`davinci-McASP.c`驱动程序后、我发现必须设置 Rx/TX 掩码、但这使驱动程序抱怨 tdm_slot 大小和掩码大小不匹配。
davinci-mcasp 2b10000.audio-controller: Bad tdm mask tx: 0x00000000 rx: 0x0000003f slots 4

我`d` ai-tdm-slot `属性将覆盖 McASP` tdm-slot 属性。 这似乎导致无法按我想要的方式配置驱动器、因此我删除了覆盖。
我将`dai-tdm-slot`属性读作每个串行器所需 tdm-slot 的总数、并将`tdm-slot`属性读作 tdm-slot 的总数。
davinci-mcasp.c
-    mcasp->tdm_slots = slots;
+    // mcasp->tdm_slots = slots;

应用此补丁后,我能够从第6个频道录制音频,但样本分散在3个频道上。
这是通过一个连接到编解码器上 ADC 通道6的信号发生器进行记录的。



  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    如果每个 ADC 在 MCASP 的每个数据线路上为您提供立体声通道、则需要配置3个串行器来接收6个通道。  

    由于配置了2个串行器、因此您是否能够捕获4通道音频? 使用-c 4的录制命令在上述设置中是否正常工作?

    此致、

    Suren