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.

Linux/TAS2552SW-LINUX: How to use ALSA System on Chip (ASoC)

Part Number: TAS2552SW-LINUX
Other Parts Discussed in Thread: TAS2552

Tool/software: Linux

We want to use TAS2552 Amplifier and Converter with an ARM based embedded Linux.

However, after configuring DTS there is a ALSA Souncard, but aplay gives an error:

aplay: set_params:1305: Channels count non available

We configured two Items in DTS:

       tas2552_sound: tas2552-sound {
                status = "okay";
                compatible = "simple-audio-card";
                model = "ti-tas2550";

                audio-routing =
                        "Ext Spk", "OUT" ,
                        "Int Mic", "IN";
                simple-audio-card,format = "i2s";
                simple-audio-card,name = "P5tas2552";
                simple-audio-card,cpu {
                        sound-dai = <&i2s0>;
                };
                simple-audio-card,codec {
                        sound-dai = <&tas2552>;
                };
        };

&i2c2 {
        status = "okay";
        clock-frequency = <400000>;

        tas2552: tas2552@40 {
                compatible = "ti,tas2552";
                reg = <0x40>;
                #sound-dai-cells = <0>;
                vbat-supply = <&vdda_codec>;
                iovdd-supply = <&vccadc_ref>;
                avdd-supply= <&vccadc_ref>;
        };
};

This is an excerpt of messages during boot of the Board:

...
[    0.189809] Advanced Linux Sound Architecture Driver Initialized.
...
[    4.876924] asoc-simple-card hdmi-codec: i2s-hifi <-> ff8a0000.i2s mapping ok
[    4.888926] asoc-simple-card tas2552-sound: tas2552-amplifier <-> ff880000.i2s mapping ok
...
 [    5.131152] ALSA device list:
[    5.139035]   #0: HDMI-CODEC
[    5.146635]   #1: P5tas2552


[  OK  ] Reached target Sound Card.

To use TAS2552 as default, I created /etc/asound.conf:

# cat /etc/asound.conf
pcm.!default {
    type hw
    card 1
}

ctl.!default {
    type hw
    card 1
}

Accessing with Alsa-Tools:

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMICODEC [HDMI-CODEC], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: P5tas2552 [P5tas2552], device 0: ff880000.i2s-tas2552-amplifier tas2552-amplifier-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
# # aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=HDMICODEC
    HDMI-CODEC,
    Default Audio Device
sysdefault:CARD=P5tas2552
    P5tas2552,
    Default Audio Device
# amixer  set 'Speaker Driver' 100%
Simple mixer control 'Speaker Driver',0
  Capabilities: pvolume pvolume-joined
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 31 [100%] [24.00dB]
# amixer set 'Input selection' "Digital"
Simple mixer control 'Input selection',0
  Capabilities: enum
  Items: 'Digital' 'Analog'
  Item0: 'Digital'
# aplay  -v  -c 1 -t raw  /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1305: Channels count non available

 

Any hints will  be greatly appreciated.

  • Hi user5129649,

    On which TI device exactly you are running the embedded Linux?

    Regards,
    Pavel
  • Hallo!

    The Linux is running on another CPU (RK3399 - sorry), but the  ASoC is working with HDMI.

    We think TI TAS2552 can be driven by any SoC which has I2S and I2C interfaces.

    We create the rootfs with buildroot, the kernel is also compiled by us.

    The following exerpt of DTS sounds on HDMI. This is why I ASoC should be working with RK3399.

            dw_hdmi_audio: dw-hdmi-audio {
                    status = "enabled";
                    compatible = "rockchip,dw-hdmi-audio";
                    #sound-dai-cells = <0>;
            };
    
            hdmi_codec: hdmi-codec {
                    compatible = "simple-audio-card";
                    simple-audio-card,format = "i2s";
                    simple-audio-card,mclk-fs = <256>;
                    simple-audio-card,name = "HDMI-CODEC";
    
                    simple-audio-card,cpu {
                            sound-dai = <&i2s2>;
                    };
    
                    simple-audio-card,codec {
                            sound-dai = <&hdmi>;
                    };
            };
    
            hdmi_sound: hdmi-sound {
                    status = "disabled";
                    compatible = "simple-audio-card";
                    simple-audio-card,format = "i2s";
                    simple-audio-card,mclk-fs = <256>;
                    simple-audio-card,name = "rockchip,hdmi";
    
                    simple-audio-card,cpu {
                            sound-dai = <&i2s2>;
                    };
                    simple-audio-card,codec {
                            sound-dai = <&hdmi>;
                    };
            };
    

    With best regards,

    Klaus

  • Klaus,

    This question seems specific for TAS2552 Amplifier. I would suggest you to ask/post in the Audio Amplifiers forum:

    e2e.ti.com/.../6

    Regards,
    Pavel