Trying now several days to get the i2s-tdm working in 8chan dsp_b mode, but I get it not running.
I have create a new DT and add following elements :
tdm_sound {
compatible = "simple-audio-card";
simple-audio-card,name = "rockpis-tdm";
simple-audio-card,format = "dsp_b";
simple-audio-card,mclk-fs = < 0x100 >;
simple-audio-card,bitclock-master = <&i2s_tdm>;
simple-audio-card,frame-master = <&i2s_tdm>;
status = "okay";
simple-audio-card,cpu {
sound-dai = < &i2s_tdm 0>;
system-clock-frequency = <12288000 >;
system-clock-direction = "out";
dai-tdm-slot-num = <8>;
dai-tdm-slot-with = <16>;
};
dailink0_master: simple-audio-card,codec {
sound-dai = <&dummy_codec>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-with = <16>;
};
};
dummy_codec: dummy-codec {
status = "okay";
compatible = "rockchip,dummy-codec";
#sound-dai-cells = < 0x00 >;
clocks = <0x02 0x4c>;
clock-names = "mclk";
phandle = < 0x139 >;
};
It seems to enumerate without error:
[ 1.658822] dummy_codec dummy-codec: get mclk success
[ 1.722213] of_get_named_gpiod_flags: can’t parse ‘simple-audio-card,hp-det-gpio’ property of node ‘/tdm_sound[0]’
[ 1.723300] of_get_named_gpiod_flags: can’t parse ‘simple-audio-card,mic-det-gpio’ property of node ‘/tdm_sound[0]’
[ 1.725529] asoc-simple-card tdm_sound: dummy_codec <-> ff300000.i2s mapping ok
[ 1.747649] ALSA device list:
[ 1.747967] #0: Loopback 1
[ 1.748248] #1: rockpis-tdm
asound.conf:
pcm.!default {
type hw
card 1
channels 8
}
ctl.!default {
type hw
card 1
}
aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
[Loopback skipped]
Karte 1: rockpistdm [rockpis-tdm], Gerät 0: ff300000.i2s-dummy_codec dummy_codec-0 []
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0
aplay -L
[loopback skipped]
sysdefault:CARD=rockpistdm
rockpis-tdm,
Default Audio Device
dmix:CARD=rockpistdm,DEV=0
rockpis-tdm,
Direct sample mixing device
dsnoop:CARD=rockpistdm,DEV=0
rockpis-tdm,
Direct sample snooping device
hw:CARD=rockpistdm,DEV=0
rockpis-tdm,
Direct hardware device without any conversions
plughw:CARD=rockpistdm,DEV=0
rockpis-tdm,
Hardware device with all software conversions
But speaker-test drops a error and stop:
speaker-test -c8 -twav
speaker-test 1.1.8
Wiedergabe-Gerät ist default
Stream-Parameter sind 48000 Hz, S16_LE, 8 Kanäle
WAV-Datei(en)
Rate ist 48000 Hz (angefordert: 48000 Hz)
Puffergröße von 32 bis 32768
Periodengröße von 16 bis 16384
Verwende maximale Puffergröße 32768
Perioden = 4
Fehler beim Setzen der Hardware-Parameter: Das Argument ist ungültig
Fehler beim Setzen der Hardware-Parameter: Das Argument ist ungültig
[ 160.838793] rockchip-i2s-tdm ff300000.i2s: ASoC: can’t set ff300000.i2s hw params: -22
On logic analyser, I can see that the clock is there for a short period.
Hopefully, that someone got it working may give a hint whats wrong
Edit-1:
when removing dai-tds-slots it is running in 2 channel mode using dsp_b
framesync so far.
When try to play 4,6,8 channel, I got a write error
when using the mutichannel-codec i got a kernel-crash leads to a boot-loop:
tdm-sound {
compatible = "rockchip,multicodecs-card";
rockchip,card-name = "rockpis-tdm";
rockchip,codec-hp-det;
rockchip,mclk-fs = < 0x100 >;
rockchip,cpu = < 0xbe >;
rockchip,codec = < 0x139 >;
phandle = < 0x13d >;
};
[ 1.661387] [] driver_probe_device+0x190/0x274
[ 1.661394] [] __driver_attach+0x4c/0x90
[ 1.661402] [] bus_for_each_dev+0x80/0x90
[ 1.661410] [] driver_attach+0x20/0x28
[ 1.661418] [] bus_add_driver+0x194/0x1d8
[ 1.661425] [] driver_register+0x98/0xd0
[ 1.661433] [] __platform_driver_register+0x48/0x50
[ 1.661444] [] rockchip_multicodecs_driver_init+0x18/0x20
[ 1.661453] [] do_one_initcall+0x170/0x178
[ 1.661463] [] kernel_init_freeable+0x228/0x22c
[ 1.661472] [] kernel_init+0x10/0xf8
[ 1.661480] [] ret_from_fork+0x10/0x50
[ 1.661487] ------------[ cut here ]------------
[ 1.661490] WARNING: at kernel/workqueue.c:1486
[ 1.661494] Modules linked in:
[ 1.661495]
[ 1.661503] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G W 4.4.143-57-rockchip-g4b8d0571d76e #1
[ 1.661510] Hardware name: Radxa ROCK Pi S (DT)
[ 1.661514] task: ffffffc01f898000 task.stack: ffffffc01f8a0000
[ 1.661521] PC is at __queue_delayed_work+0xb0/0x104
[ 1.661528] LR is at queue_delayed_work_on+0x50/0x74
[ 1.661534] pc : [] lr : [] pstate: 000001c5
[ 1.661536] sp : ffffffc01f8a3a10
I start to think 8 channel audio is not working with this board.
Does anyone knows a board having a working 8 channel tdm and USB-OTG ?