Skip to contentSkip to conversation

IMX6Q add new sound simple sound card

DISCUSSION Riccardo Casagrande 2 participants 5 messages Jul 5, 2018 – Jul 18, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hello all,

I'm new to Linux/Yocto 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 https://elixir.bootlin.com/linux/v4.5/source/Documentation/devicetree/bindings/sound/simple-card.txt

What I've done?
- Activated support for generic sound board on menuconfig
- Added new "sound" node in device tree file with minimal properties/subnotes
- Compiled the kernel
- Compiled and flashed the image

but alsamixer still doesn't recognize my sound card, what am I missing?

Thanks.

#1 lore raw

Hi,
how is your sound card connected?
If you look at the devicetree for a sound card to work you have to configure

- system clock
- device that handle the communication with the sound card (f ex i2s, or i2c or usb, or whatever) (sound-dai)
- the soundcard itself (codec?)

So you need more information regarding your hardware, the codec, how is connected, etc etc

Look at the source of the simple audio card driver and maybe at some other driver in the kernel source

Cheers
Nick

-----------------------------------------------------------------------------------------------------
sound {
*simple-audio-card,cpu* {
sound-dai = <&*sh_fsi2 0*>;
};

dailink0_master: simple-audio-card,*codec* {
sound-dai = <&*ak4648*>;
clocks = <&*osc*>;
};
};

&i2c0 {
ak4648: ak4648@12 {
#sound-dai-cells = <0>;
*compatible = "asahi-kasei,ak4648";*
reg = <0x12>;
};
};

sh_fsi2: sh_fsi2@ec230000 {
#sound-dai-cells = <1>;
*compatible = "renesas,sh_fsi2";*
reg = <0xec230000 0x400>;
interrupt-parent = <&gic>;
interrupts = <0 146 0x4>;
};

Quoted 32 lines · Riccardo Casagrande

Hello all,

I'm new to Linux/Yocto 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
https://elixir.bootlin.com/linux/v4.5/source/Documentation/devicetree/bindings/sound/simple-card.txt

What I've done?
- Activated support for generic sound board on menuconfig
- Added new "sound" node in device tree file with minimal properties/subnotes
- Compiled the kernel
- Compiled and flashed the image

but alsamixer still doesn't recognize my sound card, what am I missing?

Thanks.

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi,
the chip has his internal "codec" you can see from the datasheet that has an i2s for the audio and an i2c interface for configuration. the codec that you select *ak4648* needs an initialization phase that is done usually via i2c.
If the driver can't find the codec it will simply disable itself (and you don't see the alsa audio card)

First try to make the dummy codec work.
If its working you should be able to see that alsa recognize the dummy soundcard and to be able to play something and see the i2s signal on the board with an oscilloscope/logic analyzer

After that you probably need to develop a codec driver for that particular chip.

Probably the alsa mailing list is the right place to get help regarding this.

You can have a look at my previous post on those topics (I was in the same boat as you :-) )
https://community.nxp.com/thread/391216
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/108068.html

Cheers
Nick

Quoted 151 lines · Riccardo Casagrande

Hello Nick

the i.MX6Q is not connected to a codec but directly to 3 FDA2100 from STMicroelectronics, these chips are digital power amplifiers. On input I have 2 input from ADCs.
I wrote several sound nodes but at moment the best result is no error at boot, the sound card listed under /proc/device-tree but not in alsa.

This is the device-tree sub node

sound-fda2100 {
        compatible = "simple-audio-card";
        simple-audio-card,name = "MTC-FDA2100-Card";
        simple-audio-card,format = "i2s";
        simple-audio-card,widgets =
            "Microphone", "Microphone Jack",
            "Headphone", "Headphone Jack",
            "Speaker", "External Speaker";
        simple-audio-card,routing =
            "MIC_IN", "Microphone Jack",
            "Headphone Jack", "HP_OUT",
            "External Speaker", "LINE_OUT";

        simple-audio-card,bitclock-master = <&cpu_dai>;
            simple-audio-card,frame-master = <&cpu_dai>;
            cpu_dai: simple-audio-card,cpu {
                sound-dai = <&ssi1 0>;
            };
           codec_dai: simple-audio-card,codec {
                sound-dai = <&codec_test>;
            };
    };
codec_test: codec_test {
    compatible = "linux,snd-soc-dummy";
        #sound-dai-cells = <0>;
     };

And last week I found that "dummy codec is not supported in NXP linux release" as reported here https://community.nxp.com/thread/466938

------------------------------
----- Messaggio Originale -----
Da: "nick83ola" <[email protected]>
A: [email protected]
Cc: [email protected]
Data: 16/07/2018 10:37
Oggetto: [Spam - Sospetto] Re: [yocto] IMX6Q add new sound simple sound card

Hi,
how is your sound card connected?
If you look at the devicetree for a sound card to work you have to configure

- system clock
- device that handle the communication with the sound card (f ex i2s, or i2c or usb, or whatever) (sound-dai)
- the soundcard itself (codec?)

So you need more information regarding your hardware, the codec, how is connected, etc etc

Look at the source of the simple audio card driver and maybe at some other driver in the kernel source

Cheers
Nick

-----------------------------------------------------------------------------------------------------

sound {
* simple-audio-card,cpu* {
sound-dai = <& * sh_fsi2 0* >;
};

dailink0_master: simple-audio-card, * codec* {
sound-dai = <& * ak4648* >;
clocks = <& * osc* >;
};
};

&i2c0 {
ak4648: ak4648@12 {
#sound-dai-cells = <0>;
* compatible = "asahi-kasei,ak4648";*
reg = <0x12>;
};
};

sh_fsi2: sh_fsi2@ec230000 {
#sound-dai-cells = <1>;
* compatible = "renesas,sh_fsi2";*
reg = <0xec230000 0x400>;
interrupt-parent = <&gic>;
interrupts = <0 146 0x4>;
};

Quoted 34 lines · On Thu, 5 Jul 2018 at 16:13, Riccardo Casagrande <…

Hello all,

I'm new to Linux/Yocto 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
https://elixir.bootlin.com/linux/v4.5/source/Documentation/devicetree/bindings/sound/simple-card.txt
<https://elixir.bootlin.com/linux/v4.5/source/Documentation/devicetree/bindings/sound/simple-card.txt>

What I've done?
- Activated support for generic sound board on menuconfig
- Added new "sound" node in device tree file with minimal properties/subnotes
- Compiled the kernel
- Compiled and flashed the image

but alsamixer still doesn't recognize my sound card, what am I missing?

Thanks.

--
_______________________________________________
yocto mailing list
[email protected] <[email protected]>
https://lists.yoctoproject.org/listinfo/yocto
<https://lists.yoctoproject.org/listinfo/yocto>

#4 lore raw

Hi Nick,

I followed yours links and created new sound card and driver imx-itel. Now the new sound card is installed and listed by ALSA but without any kind of volume control, any suggestions? Anyway, now I'm going to check if outputs send I2S data.

Riccardo

----- Messaggio Originale -----
Da: "nick83ola" <[email protected]>
A: [email protected]
Cc: [email protected]
Data: 17/07/2018 11:24
Oggetto: Re: [Spam - Sospetto] Re: [yocto] IMX6Q add new sound simple sound card

Hi,
the chip has his internal "codec" you can see from the datasheet that has an i2s for the audio and an i2c interface for configuration. the codec that you select ak4648 needs an initialization phase that is done usually via i2c.
If the driver can't find the codec it will simply disable itself (and you don't see the alsa audio card)


First try to make the dummy codec work.
If its working you should be able to see that alsa recognize the dummy soundcard and to be able to play something and see the i2s signal on the board with an oscilloscope/logic analyzer


After that you probably need to develop a codec driver for that particular chip.


Probably the alsa mailing list is the right place to get help regarding this.


You can have a look at my previous post on those topics (I was in the same boat as you :-) )
https://community.nxp.com/thread/391216

http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/108068.html


Cheers
Nick



On Mon, 16 Jul 2018 at 10:38, Riccardo Casagrande < [email protected] > wrote:

Hello Nick


the i.MX6Q is not connected to a codec but directly to 3 FDA2100 from STMicroelectronics, these chips are digital power amplifiers. On input I have 2 input from ADCs. I wrote several sound nodes but at moment the best result is no error at boot, the sound card listed under /proc/device-tree but not in alsa.


This is the device-tree sub node

sound-fda2100 { 
        compatible = "simple-audio-card"; 
        simple-audio-card,name = "MTC-FDA2100-Card"; 
        simple-audio-card,format = "i2s"; 
        simple-audio-card,widgets = 
            "Microphone", "Microphone Jack", 
            "Headphone", "Headphone Jack", 
            "Speaker", "External Speaker"; 
        simple-audio-card,routing = 
            "MIC_IN", "Microphone Jack", 
            "Headphone Jack", "HP_OUT", 
            "External Speaker", "LINE_OUT"; 

        simple-audio-card,bitclock-master = <&cpu_dai>; 
            simple-audio-card,frame-master = <&cpu_dai>; 
            cpu_dai: simple-audio-card,cpu { 
                sound-dai = <&ssi1 0>; 
            }; 
           codec_dai: simple-audio-card,codec { 
                sound-dai = <&codec_test>; 
            }; 
    }; 

codec_test: codec_test { 
    compatible = "linux,snd-soc-dummy"; 
        #sound-dai-cells = <0>; 
     }; 


And last week I found that "dummy codec is not supported in NXP linux release" as reported here https://community.nxp.com/thread/466938

----- Messaggio Originale -----
Da: "nick83ola" < [email protected] >
A: [email protected]
Cc: [email protected]
Data: 16/07/2018 10:37
Oggetto: [Spam - Sospetto] Re: [yocto] IMX6Q add new sound simple sound card

Hi,
how is your sound card connected?

If you look at the devicetree for a sound card to work you have to configure

- system clock
- device that handle the communication with the sound card (f ex i2s, or i2c or usb, or whatever) (sound-dai)

- the soundcard itself (codec?)
So you need more information regarding your hardware, the codec, how is connected, etc etc


Look at the source of the simple audio card driver and maybe at some other driver in the kernel source


Cheers
Nick


-----------------------------------------------------------------------------------------------------

sound {
simple-audio-card,cpu {
sound-dai = <& sh_fsi2 0>;
};

dailink0_master: simple-audio-card, codec {
sound-dai = <& ak4648>;
clocks = <& osc>;
};
};

&i2c0 {
ak4648: ak4648@12 {
#sound-dai-cells = <0>;
compatible = "asahi-kasei,ak4648";
reg = <0x12>;
};
};

sh_fsi2: sh_fsi2@ec230000 {
#sound-dai-cells = <1>;
compatible = "renesas,sh_fsi2";
reg = <0xec230000 0x400>;
interrupt-parent = <&gic>;
interrupts = <0 146 0x4>;
};

On Thu, 5 Jul 2018 at 16:13, Riccardo Casagrande < [email protected]  > wrote:

Hello all,

I'm new to Linux/Yocto 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 https://elixir.bootlin.com/linux/v4.5/source/Documentation/devicetree/bindings/sound/simple-card.txt

What I've done?
- Activated support for generic sound board on menuconfig
- Added new "sound" node in device tree file with minimal properties/subnotes
- Compiled the kernel
- Compiled and flashed the image

but alsamixer still doesn't recognize my sound card, what am I missing?

Thanks.

Signature · 6 lines
_______________________________________________ 
yocto mailing list 
[email protected]  
https://lists.yoctoproject.org/listinfo/yocto  
  
 
#5 lore raw
In reply to nick83ola

Hi Nick,

moreover, I just tested the sound card with aplay command and this is the output:
--> ITEL imx-itel-hw-params NAME=202c000.ssi
 VALUE=0x00004001 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS

--> ITEL imx-itel-hw-params set tdm slots channels=20

--> ITEL imx-audmux-config set sysclk NAME=202c000.ssi
aplay: pcm_write:1940: write error: Input/output error

I'm working on an evaluation board of NXP, our hardware is not ready yet. Is this the reason of the fail?

Riccardo

----- Messaggio Originale -----
Da: "nick83ola" <[email protected]>
A: [email protected]
Cc: [email protected]
Data: 17/07/2018 11:24
Oggetto: Re: [Spam - Sospetto] Re: [yocto] IMX6Q add new sound simple sound card

Hi,
the chip has his internal "codec" you can see from the datasheet that has an i2s for the audio and an i2c interface for configuration. the codec that you select ak4648 needs an initialization phase that is done usually via i2c.
If the driver can't find the codec it will simply disable itself (and you don't see the alsa audio card)


First try to make the dummy codec work.
If its working you should be able to see that alsa recognize the dummy soundcard and to be able to play something and see the i2s signal on the board with an oscilloscope/logic analyzer


After that you probably need to develop a codec driver for that particular chip.


Probably the alsa mailing list is the right place to get help regarding this.


You can have a look at my previous post on those topics (I was in the same boat as you :-) )
https://community.nxp.com/thread/391216

http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/108068.html


Cheers
Nick



On Mon, 16 Jul 2018 at 10:38, Riccardo Casagrande < [email protected] > wrote:

Hello Nick


the i.MX6Q is not connected to a codec but directly to 3 FDA2100 from STMicroelectronics, these chips are digital power amplifiers. On input I have 2 input from ADCs. I wrote several sound nodes but at moment the best result is no error at boot, the sound card listed under /proc/device-tree but not in alsa.


This is the device-tree sub node

sound-fda2100 { 
        compatible = "simple-audio-card"; 
        simple-audio-card,name = "MTC-FDA2100-Card"; 
        simple-audio-card,format = "i2s"; 
        simple-audio-card,widgets = 
            "Microphone", "Microphone Jack", 
            "Headphone", "Headphone Jack", 
            "Speaker", "External Speaker"; 
        simple-audio-card,routing = 
            "MIC_IN", "Microphone Jack", 
            "Headphone Jack", "HP_OUT", 
            "External Speaker", "LINE_OUT"; 

        simple-audio-card,bitclock-master = <&cpu_dai>; 
            simple-audio-card,frame-master = <&cpu_dai>; 
            cpu_dai: simple-audio-card,cpu { 
                sound-dai = <&ssi1 0>; 
            }; 
           codec_dai: simple-audio-card,codec { 
                sound-dai = <&codec_test>; 
            }; 
    }; 

codec_test: codec_test { 
    compatible = "linux,snd-soc-dummy"; 
        #sound-dai-cells = <0>; 
     }; 


And last week I found that "dummy codec is not supported in NXP linux release" as reported here https://community.nxp.com/thread/466938

----- Messaggio Originale -----
Da: "nick83ola" < [email protected] >
A: [email protected]
Cc: [email protected]
Data: 16/07/2018 10:37
Oggetto: [Spam - Sospetto] Re: [yocto] IMX6Q add new sound simple sound card

Hi,
how is your sound card connected?

If you look at the devicetree for a sound card to work you have to configure

- system clock
- device that handle the communication with the sound card (f ex i2s, or i2c or usb, or whatever) (sound-dai)

- the soundcard itself (codec?)
So you need more information regarding your hardware, the codec, how is connected, etc etc


Look at the source of the simple audio card driver and maybe at some other driver in the kernel source


Cheers
Nick


-----------------------------------------------------------------------------------------------------

sound {
simple-audio-card,cpu {
sound-dai = <& sh_fsi2 0>;
};

dailink0_master: simple-audio-card, codec {
sound-dai = <& ak4648>;
clocks = <& osc>;
};
};

&i2c0 {
ak4648: ak4648@12 {
#sound-dai-cells = <0>;
compatible = "asahi-kasei,ak4648";
reg = <0x12>;
};
};

sh_fsi2: sh_fsi2@ec230000 {
#sound-dai-cells = <1>;
compatible = "renesas,sh_fsi2";
reg = <0xec230000 0x400>;
interrupt-parent = <&gic>;
interrupts = <0 146 0x4>;
};

On Thu, 5 Jul 2018 at 16:13, Riccardo Casagrande < [email protected]  > wrote:

Hello all,

I'm new to Linux/Yocto 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 https://elixir.bootlin.com/linux/v4.5/source/Documentation/devicetree/bindings/sound/simple-card.txt

What I've done?
- Activated support for generic sound board on menuconfig
- Added new "sound" node in device tree file with minimal properties/subnotes
- Compiled the kernel
- Compiled and flashed the image

but alsamixer still doesn't recognize my sound card, what am I missing?

Thanks.

Signature · 6 lines
_______________________________________________ 
yocto mailing list 
[email protected]  
https://lists.yoctoproject.org/listinfo/yocto