Re: [alsa-devel] Ask for help. ARM:mvebu (CM-A510), add sound support using TLV320AIC23 audio-codec
[adding alsa-devel and Jean-Francois]
Gabriel,
you should try to add people and lists you expect help from.
On 23.02.2015 21:27, Gabriel Dobato wrote:
I am trying to set the sound system using "simple-audio-card" and TLV320AIC23B audio codec in Compulab CM-510 SoM.
This is my structure in DT, according to ./KERNEL/Documentation/devicetree/bindings/sound/simple-card.txt, /KERNEL/Documentation/devicetree/bindings/sound/widgets.txt and the source code of the audio-codec ./KERNEL/sound/soc/codecs/tlv320aic23.c :
sound { compatible = "simple-audio-card"; simple-audio-card,name = "OnboardTLV320AIC23B"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&dailink_master>; simple-audio-card,frame-master = <&dailink_master>; simple-audio-card,widgets = "Microphone", "Mic Input", "Line", "Line Input", "Line", "Line Out", "Speaker", "Speaker", "Headphone", "Headphone Jack";
simple-audio-card,routing = "Line Out", "LOUT", "Line Out", "ROUT", "Line Out", "RHPOUT", "Line Out", "LHPOUT", "LLINEIN","Line Input", "RLINEIN","Line Input", "MICIN","Mic Input"; simple-audio-card,cpu { sound-dai = <&audio0 0>; }; dailink_master: simple-audio-card,codec { sound-dai = <&opt_audio>; }; };
};
/* TLV320AIC23 */ &opt_audio { status = "okay"; #sound-dai-cells= <0>; };
The full node looks like: opt_audio: audio@1a { compatible = "ti,tlv320aic23"; reg = <0x1a>; #sound-dai-cells= <0>; status = "okay"; };
And this is the kernel trace:
... tlv320aic23-codec 0-001a: Control not supported for path LLINEIN -> [NULL] -> Line Input tlv320aic23-codec 0-001a: ASoC: no dapm match for LLINEIN --> NULL --> Line Input tlv320aic23-codec 0-001a: ASoC: Failed to add route LLINEIN -> NULL -> Line Input tlv320aic23-codec 0-001a: Control not supported for path RLINEIN -> [NULL] -> Line Input tlv320aic23-codec 0-001a: ASoC: no dapm match for RLINEIN --> NULL --> Line Input tlv320aic23-codec 0-001a: ASoC: Failed to add route RLINEIN -> NULL -> Line Input tlv320aic23-codec 0-001a: Control not supported for path MICIN -> [NULL] -> Mic Input tlv320aic23-codec 0-001a: ASoC: no dapm match for MICIN --> NULL --> Mic Input tlv320aic23-codec 0-001a: ASoC: Failed to add route MICIN -> NULL -> Mic Input usb 2-1.2: new high-speed USB device number 3 using orion-ehci asoc-simple-card sound: tlv320aic23-hifi <-> i2s mapping ok ...
ALSA device list: #0: OnboardTLV320AIC23B ...
[....] Setting up ALSA...amixer: Invalid command!
It doesn't help much without knowing what amixer is trying to do.
I think I have written the node according to the documentation, but probably I miss something.
Looking at sound/soc/codecs/tlv320aic23.c:
static const struct snd_soc_dapm_route tlv320aic23_intercon[] = { /* Output Mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, {"Output Mixer", "Playback Switch", "DAC"}, {"Output Mixer", "Mic Sidetone Switch", "Mic Input"},
/* Outputs */ {"RHPOUT", NULL, "Output Mixer"}, {"LHPOUT", NULL, "Output Mixer"}, {"LOUT", NULL, "Output Mixer"}, {"ROUT", NULL, "Output Mixer"},
/* Inputs */ {"Line Input", "NULL", "LLINEIN"}, {"Line Input", "NULL", "RLINEIN"},
{"Mic Input", "NULL", "MICIN"},
/* input mux */ {"Capture Source", "Line", "Line Input"}, {"Capture Source", "Mic", "Mic Input"}, {"ADC", NULL, "Capture Source"},
};
The lines with the failing routes really look suspicious, i.e. there is strings "NULL" where I'd expect plain NULL.
What happens if you amend the three lines and replace the "NULL" with NULL?
Sebastian
I think that the lack of space in all three input routings can make a difference. Please let know if adding it helps.
Best regards, Marcin
Marcin,
Thank you for your answer!. It seems that space does not matter (I have checked it), but yes, it is necessary to be careful with this kind of things..
On 24/02/15 09:41, Sebastian Hesselbarth wrote:
The full node looks like: opt_audio: audio@1a { compatible = "ti,tlv320aic23"; reg = <0x1a>; #sound-dai-cells= <0>; status = "okay"; };
Yes, sorry. And regarding to audio0, the full node looks like:
audio0: audio-controller@b0000 { compatible = "marvell,dove-audio"; reg = <0xb0000 0x2210>; interrupts = <19>, <20>; clocks = <&gate_clk 12>; clock-names = "internal"; #sound-dai-cells= <1>; status = "okay"; };
Looking at sound/soc/codecs/tlv320aic23.c:
static const struct snd_soc_dapm_route tlv320aic23_intercon[] = { /* Output Mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, {"Output Mixer", "Playback Switch", "DAC"}, {"Output Mixer", "Mic Sidetone Switch", "Mic Input"},
/* Outputs */ {"RHPOUT", NULL, "Output Mixer"}, {"LHPOUT", NULL, "Output Mixer"}, {"LOUT", NULL, "Output Mixer"}, {"ROUT", NULL, "Output Mixer"}, /* Inputs */ {"Line Input", "NULL", "LLINEIN"}, {"Line Input", "NULL", "RLINEIN"}, {"Mic Input", "NULL", "MICIN"}, /* input mux */ {"Capture Source", "Line", "Line Input"}, {"Capture Source", "Mic", "Mic Input"}, {"ADC", NULL, "Capture Source"},
};
The lines with the failing routes really look suspicious, i.e. there is strings "NULL" where I'd expect plain NULL.
What happens if you amend the three lines and replace the "NULL" with NULL?
Sebastian
Sebastian,
You were right, as always :) , I have changed them and now errors are not reported. Now, in the boot trace I find:
... asoc-simple-card sound: tlv320aic23-hifi <-> i2s mapping ok ...
... ALSA device list: #0: OnboardTLV320AIC23B ...
but after rootfs is up, this msg appears in dmesg:
platform sound: Driver asoc-simple-card requests probe deferral
In reference to the card, I get the following info:
root@192:~#cat /proc/asound/cards 0 [OnboardTLV320AI]: OnboardTLV320AI - OnboardTLV320AIC23B OnboardTLV320AIC23B
root@192:~# tree /proc/asound/card0/ /proc/asound/card0/ |-- id |-- pcm0c | |-- info | `-- sub0 | |-- hw_params | |-- info | |-- status | `-- sw_params `-- pcm0p |-- info `-- sub0 |-- hw_params |-- info |-- status `-- sw_params
4 directories, 11 files
And if I try to reproduce some noise:
root@192:~# cat /dev/urandom | aplay Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono set_sample_rate_control:Invalid rate 48000,48000 requested tlv320aic23-codec 1-001a: ASoC: can't set tlv320aic23-hifi hw params: -22 aplay: set_params:1145: Unable to install hw params: ACCESS: RW_INTERLEAVED FORMAT: U8 SUBFORMAT: STD SAMPLE_BITS: 8 FRAME_BITS: 8 CHANNELS: 1 RATE: 8000 PERIOD_TIME: (125333 125334) PERIOD_SIZE: (1002 1003) PERIOD_BYTES: (1002 1003) PERIODS: (3 4) BUFFER_TIME: 500000 BUFFER_SIZE: 4000 BUFFER_BYTES: 4000 TICK_TIME: 0
Gabriel
On 24.02.2015 22:16, Gabriel Dobato wrote:
Looking at sound/soc/codecs/tlv320aic23.c:
static const struct snd_soc_dapm_route tlv320aic23_intercon[] = { /* Output Mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, {"Output Mixer", "Playback Switch", "DAC"}, {"Output Mixer", "Mic Sidetone Switch", "Mic Input"},
/* Outputs */ {"RHPOUT", NULL, "Output Mixer"}, {"LHPOUT", NULL, "Output Mixer"}, {"LOUT", NULL, "Output Mixer"}, {"ROUT", NULL, "Output Mixer"}, /* Inputs */ {"Line Input", "NULL", "LLINEIN"}, {"Line Input", "NULL", "RLINEIN"}, {"Mic Input", "NULL", "MICIN"}, /* input mux */ {"Capture Source", "Line", "Line Input"}, {"Capture Source", "Mic", "Mic Input"}, {"ADC", NULL, "Capture Source"},
};
The lines with the failing routes really look suspicious, i.e. there is strings "NULL" where I'd expect plain NULL.
You were right, as always :) , I have changed them and now errors are not reported. Now, in the boot trace I find:
Mind to send a proper patch fixing the above? Make sure you run ./scripts/checkpatch.pl and ./scripts/get_maintainer.pl on the patch. It should give you an idea of proper code style and what people/lists to send it to. I am sure, google will help you with how to prepare proper kernel patches, too.
but after rootfs is up, this msg appears in dmesg:
platform sound: Driver asoc-simple-card requests probe deferral
This is, as always, a missing dependency of simple-card node.
Either you are missing drivers for Dove audio (kirkwood-i2s) or one of the drivers involved in your simple-card fails.
Look for errors in your dmesg output - also please name the kernel version you are working with. There have been some changes in clk handling that break a bunch of drivers in 4.0-rc1.
Sebastian
participants (2)
-
Gabriel Dobato
-
Sebastian Hesselbarth