Tool/software: Linux
Hello,
I have been fighting with this for awhile now, i know it am probably just forgetting something simple but can't seem to put my finger on it. I thought maybe it was related to one of my prior posts (https://e2e.ti.com/support/processors/f/791/t/313430), but messing with the num-evt properties doesn't seem to help : /.
Anyways, my setup is i am using McASP0 and the AM335x is a slave and the master is only capable of I2S. I have 1 output serializer (2 channels) and 3 input serializers (6 channels). The 1 output channel works great, i can play audio via my codec no problem. The issue is with the capture channels. When i record from the any of the capture channels everything is all messed up. For example Serializer 1 it seems to be putting both left and right channels together on channel 0 and for serializer 2 one of the channels is on channel 3 and the other is on channel 5? That is why i thought it might be a similar issue to my other post because it seems like everything is all out of order : /.
Here is the related code:
Device Tree:
sound {
compatible = "ti,am335x-hoho";
ti,model = "QRS WM8580";
ti,audio-codec = <&wm8580 &wm8580>;
ti,mcasp-controller = <&mcasp0 &mcasp0>;
ti,codec-clock-rate = <12000000>;
ti,codec-num-links = <2>;
ti,audio-routing =
"Front", "VOUT1L",
"Front", "VOUT1R",
"DREAML", "DreamIn",
"DREAMR", "DreamIn",
"MICL", "MicIn",
"MICR", "MicIn",
"AINL", "LineIn",
"AINR", "LineIn";
};
mcasp0_audio_pins: mcasp0_audio_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx - MCASP BCLK*/
AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx - MCASP FRAME SYNC*/
AM33XX_IOPAD(0x998, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr0.mcasp0_axr0 - MCASP DATA OUT*/
AM33XX_IOPAD(0x9A8, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr1.mcasp0_axr1 - MCASP DATA IN CODEC*/
AM33XX_IOPAD(0x9A0, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mcasp0_aclkr.mcasp0_axr2 - MCASP DATA IN MIC*/
AM33XX_IOPAD(0x9A4, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mcasp0_fsr.mcasp0_axr3 - MCASP DATA IN DREAM*/
>;
};
&mcasp0 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&mcasp0_audio_pins>;
status = "okay";
op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
/* 16 serializers */
/* 0: INACTIVE, 1: TX, 2: RX */
serial-dir = <
1 2 2 2
0 0 0 0
0 0 0 0
0 0 0 0
>;
tx-num-evt = <32>;
rx-num-evt = <32>;
};
Then the setup in the codec driver:
static struct snd_soc_dai_driver wm8580_dai[] = {
{
.name = "wm8580-hifi-playback",
.id = WM8580_DAI_PAIFRX,
.playback = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000,
.formats = WM8580_FORMATS,
},
.ops = &wm8580_dai_ops_playback,
},
{
.name = "wm8580-hifi-capture",
.id = WM8580_DAI_PAIFTX,
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 6,
.rates = SNDRV_PCM_RATE_8000_192000,
.formats = WM8580_FORMATS,
},
.ops = &wm8580_dai_ops_capture,
},
};
And finally my asound.conf:
#Our main 6 channel input mixer/controller
pcm.imixed {
type dsnoop
ipc_key 3025
ipc_perm 0666
slave {
pcm "hw:0,1"
channels 6
format S32_LE
rate 48000
}
bindings {
0 0
1 1
2 2
3 3
4 4
5 5
}
}
#Define the 2 channel line-in
pcm.lineinx {
type plug
slave {
pcm "imixed"
channels 6
}
ttable.0.0 1
ttable.1.1 1
}
#Define the 2 channel dream-in
pcm.dreaminx {
type plug
slave {
pcm "imixed"
channels 6
}
ttable.0.2 1
ttable.1.3 1
}
#Define the 2 channel mic-in
pcm.micinx {
type plug
slave {
pcm "imixed"
channels 6
}
ttable.0.4 1
ttable.1.5 1
}
I will keep working at it, but i am just hoping maybe a someone else has done something similar with multiple input serializers on McASP using I2S and has some information that may be helpful!
