Jump to content

i2s audio on cubietruck with Mainline - need help


sgufa

Recommended Posts

I think proper capture support never landed in mainline kernel, and old patches will need significant rework to be applied on top of current driver.

As for I2S - here are your references: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/devicetree/bindings/sound

1 hour ago, sgufa said:

No one tried it yet?

Looks like some people did try it: 

 

Link to comment
Share on other sites

Guest HeinrichG

First of all you have to enable i2s, so add something like this:


&i2s0 {
    pinctrl-names = "default";
    pinctrl-0 = <&i2s0_mclk_pins_a>, <&i2s0_data_pins_a>;
    status = "okay";
};

at the end of your dts-file. But, check the pinctl-0 pin names.

Then, you have to define a codec, you can do this under "i2c0" oder "i2c" or wherever your DAC/SPDIF-Transceiver/... is connected to.

After that your have to have to "connect" i2s-device (this is cpu-side) with your codec (this is your output side). So just create a sound card with "compatible = "simple-audio-card"; ".

 

To see the exactly definition format, check Documentation/devicetree/bindings/sound/simple-card.txt

 

It's pretty easy.

Link to comment
Share on other sites

Guest HeinrichG

@zador.blood.stained

Actually I'm designing an AddOn board with Cirrus/WolfsonMicro WM8741, CAN-Transceiver for LowSpeed and HighSpeed, SPDIF output (electrical and optical), FRAM ic, ... So a kind of "all in one thing".

I've activated I2S with an "pseudo codec", so connect I2S to "himself" and it looks good.

 

But my another thing with LVDS-dispay has a higher priority.

Link to comment
Share on other sites

Hi,

I have similar problem. I am trying to run simple PCM5102 based DAC over I2S on BananaPro board but I got errors when I am try to play something.

I have added to dts file:

    pcm5102a: pcm5102a {
        #sound-dai-cells = <0>;
        compatible = "ti,pcm5102a";
        status = "okay";
    };
       
    sound {
        compatible = "simple-audio-card";
        simple-audio-card,format = "i2s";
        simple-audio-card,cpu {
            sound-dai = <&i2s0>;
        };
 
        simple-audio-card,codec {
            sound-dai = <&pcm5102a>;
        };  
    };

and

&i2s0 {
	pinctrl-names = "default";
	pinctrl-0 = <&i2s0_pins_a>;
	status = "okay";
};

After replacing dtb file and rebooting card is visible:

# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=sun4icodec
    sun4i-codec,
    Default Audio Device
sysdefault:CARD=sun4icodec
    sun4i-codec,
    Default Audio Device
default:CARD=D1c22400i2spcm5
    1c22400.i2s-pcm5102a-hifi,
    Default Audio Device
sysdefault:CARD=D1c22400i2spcm5
    1c22400.i2s-pcm5102a-hifi,
    Default Audio Device

but when I'm trying to play something I got error messages. Below I put output from aplay and speaker-test commands.

# aplay -c 2 -D hw:1,0 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1305: Channels count non available

# speaker-test -t wav -c 2 -D hw:1

speaker-test 1.1.3

Playback device is hw:1
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 16384
Using max buffer size 131072
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument

After speaker-test I got following kernel message:

sun4i-i2s 1c22400.i2s: ASoC: can't set 1c22400.i2s hw params: -22

Anybody knows what is wrong with my configuration?

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines