How to add new sound card with ASoC generic driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add new sound card with ASoC generic driver

6,532 Views
claudiocasagran
Contributor I

Hello all,

I'm new to Linux world. I'm working on iMX6Q and I need to add a new sound card and recognized from alsamixer.

I spent days on internet looking for examples and tutorials but at the moment alsa never see my sound card.

This is one of the tutorials I followed Linux source code: Documentation/devicetree/bindings/sound/simple-card.txt (v4.5) - Bootlin 

What I've done?

- Activated support for generic sound board on menuconfig

- Added new "sound" node in device tree file with minimal properties/subnotes

By the way, the project is a Yocto project.

Is this enough for let alsa see the sound card? or something is missing?

Thanks to all for the help.

Labels (1)
0 Kudos
4 Replies

4,181 Views
claudiocasagran
Contributor I

I made some others test. I added this dt for my sound card

sound-fda2100 {
        compatible = "simple-audio-card";
        simple-audio-card,name = "MTC-FDA2100-Card";
        simple-audio-card,format = "i2s";
        simple-audio-card,codec {
            sound-dai = <&codec>;
        };
    };

where "codec" is already defined. At boot the system try to add the new sound-fda2100 but it fails, this is the log

asoc-simple-card sound-fda2100: asoc_simple_card_dai_link_of: Can't find simple-audio-card,codec DT node
asoc-simple-card sound-fda2100: parse error -22
asoc-simple-card: probe of sound-fda2100 failed with error -22

0 Kudos

4,181 Views
claudiocasagran
Contributor I

I found this thread too

[alsa-devel] Simple-card without codec for testing purpose 

but the result is now the i.mx6q doesn't boot and shows this error

"cs42xx8 1-0048: found device, revision 4
fsl-asoc-card sound-cs42888: phandle missing or invalid
fsl-asoc-card: probe of sound-cs42888 failed with error -22
fsl-asrc 2034000.asrc: driver registered
clk: failed to reparent ssi1_sel to ipu2: -22"

0 Kudos

4,181 Views
claudiocasagran
Contributor I

Thank you Igor, I've read the thread you link, it seem my use case. So I added these nodes only for the purpose of recognizing the card by Alsa

codec_simple: max98357a@0 {
            compatible = "maxim,max98357a";
            #sound-dai-cells = <0>;
    };

    sound {
        compatible = "simple-audio-card";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_audmux>;
        simple-audio-card,name = "Test Card";
        simple-audio-card,format = "i2s";
            simple-audio-card,widgets = "Speaker", "Speakers";
            simple-audio-card,routing = "Speakers", "Speaker";
            simple-audio-card,bitclock-master = <&cpu_dai>;
            simple-audio-card,frame-master = <&cpu_dai>;
            cpu_dai: simple-audio-card,cpu {
                sound-dai = <&ssi1>;
                system-clock-frequency = <883200>;
                dai-tdm-slot-num = <2>;
                dai-tdm-slot-width = <16>;
            };
            codec_dai: simple-audio-card,codec {
                sound-dai = <&codec_simple>;
            };
    };

I had the necessity to rename codec node just because it is already defined in an imported dtsi file.

At the moment Alsa doesn't recognize the card. Are there some others setup to add to make it possible?

Thanks for you help.

0 Kudos

4,181 Views
igorpadykov
NXP Employee
NXP Employee

Hi Claudio

one can look at such example on

i.MX6 and MA98357a with simple-audio-card 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos