All of lore.kernel.org
 help / color / mirror / Atom feed
* IMX6Q add new sound simple sound card
@ 2018-07-05 15:03 Riccardo Casagrande
  2018-07-16  8:32 ` nick83ola
  0 siblings, 1 reply; 5+ messages in thread
From: Riccardo Casagrande @ 2018-07-05 15:03 UTC (permalink / raw)
  To: yocto


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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: IMX6Q add new sound simple sound card
  2018-07-05 15:03 IMX6Q add new sound simple sound card Riccardo Casagrande
@ 2018-07-16  8:32 ` nick83ola
       [not found]   ` <eb7b2d7e7e26216676b91b86d2d33b14@multiconn.it>
  0 siblings, 1 reply; 5+ messages in thread
From: nick83ola @ 2018-07-16  8:32 UTC (permalink / raw)
  To: riccardo.casagrande; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 2083 bytes --]

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 <
riccardo.casagrande@multiconn.it> 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.
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 3061 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Spam - Sospetto] Re: IMX6Q add new sound simple sound card
       [not found]   ` <eb7b2d7e7e26216676b91b86d2d33b14@multiconn.it>
@ 2018-07-17  9:25     ` nick83ola
  2018-07-18  8:05       ` Riccardo Casagrande
  2018-07-18  8:31       ` Riccardo Casagrande
  0 siblings, 2 replies; 5+ messages in thread
From: nick83ola @ 2018-07-17  9:25 UTC (permalink / raw)
  To: riccardo.casagrande; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 5380 bytes --]

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 <
riccardo.casagrande@multiconn.it> 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" <nick83ola@gmail.com>
> A: riccardo.casagrande@multiconn.it
> Cc: yocto@yoctoproject.org
> 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 <
> riccardo.casagrande@multiconn.it  <riccardo.casagrande@multiconn.it> >
> 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
>> <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
>> yocto@yoctoproject.org  <yocto@yoctoproject.org>
>> https://lists.yoctoproject.org/listinfo/yocto
>> <https://lists.yoctoproject.org/listinfo/yocto>
>>
>
>
>

[-- Attachment #2: Type: text/html, Size: 8233 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Spam - Sospetto] Re: IMX6Q add new sound simple sound card
  2018-07-17  9:25     ` [Spam - Sospetto] " nick83ola
@ 2018-07-18  8:05       ` Riccardo Casagrande
  2018-07-18  8:31       ` Riccardo Casagrande
  1 sibling, 0 replies; 5+ messages in thread
From: Riccardo Casagrande @ 2018-07-18  8:05 UTC (permalink / raw)
  To: nick83ola; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 5547 bytes --]


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" <nick83ola@gmail.com>
A: riccardo.casagrande@multiconn.it
Cc: yocto@yoctoproject.org
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 < riccardo.casagrande@multiconn.it > 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" < nick83ola@gmail.com > 
A: riccardo.casagrande@multiconn.it 
Cc: yocto@yoctoproject.org 
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 < riccardo.casagrande@multiconn.it  > 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. 



-- 
_______________________________________________ 
yocto mailing list 
yocto@yoctoproject.org  
https://lists.yoctoproject.org/listinfo/yocto  
  
 




[-- Attachment #2: Type: text/html, Size: 9386 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: IMX6Q add new sound simple sound card
  2018-07-17  9:25     ` [Spam - Sospetto] " nick83ola
  2018-07-18  8:05       ` Riccardo Casagrande
@ 2018-07-18  8:31       ` Riccardo Casagrande
  1 sibling, 0 replies; 5+ messages in thread
From: Riccardo Casagrande @ 2018-07-18  8:31 UTC (permalink / raw)
  To: nick83ola; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 5813 bytes --]


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" <nick83ola@gmail.com>
A: riccardo.casagrande@multiconn.it
Cc: yocto@yoctoproject.org
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 < riccardo.casagrande@multiconn.it > 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" < nick83ola@gmail.com > 
A: riccardo.casagrande@multiconn.it 
Cc: yocto@yoctoproject.org 
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 < riccardo.casagrande@multiconn.it  > 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. 



-- 
_______________________________________________ 
yocto mailing list 
yocto@yoctoproject.org  
https://lists.yoctoproject.org/listinfo/yocto  
  
 




[-- Attachment #2: Type: text/html, Size: 9664 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-18  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05 15:03 IMX6Q add new sound simple sound card Riccardo Casagrande
2018-07-16  8:32 ` nick83ola
     [not found]   ` <eb7b2d7e7e26216676b91b86d2d33b14@multiconn.it>
2018-07-17  9:25     ` [Spam - Sospetto] " nick83ola
2018-07-18  8:05       ` Riccardo Casagrande
2018-07-18  8:31       ` Riccardo Casagrande

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.