From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH 00/14] SPDIF support Date: Sat, 31 Aug 2013 20:34:31 +0100 Message-ID: <20130831193431.GI6617@n2100.arm.linux.org.uk> References: <20130831123458.GF6617@n2100.arm.linux.org.uk> <52220B9A.9000007@metafoo.de> <20130831191414.GG6617@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [78.32.30.218]) by alsa0.perex.cz (Postfix) with ESMTP id 593F8261B19 for ; Sat, 31 Aug 2013 21:34:49 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20130831191414.GG6617@n2100.arm.linux.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Lars-Peter Clausen Cc: Thomas Petazzoni , Andrew Lunn , alsa-devel@alsa-project.org, Jason Cooper , Jean-Francois Moine , Takashi Iwai , Liam Girdwood , Mark Brown , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth List-Id: alsa-devel@alsa-project.org On Sat, Aug 31, 2013 at 08:14:14PM +0100, Russell King - ARM Linux wrote: > On Sat, Aug 31, 2013 at 05:28:26PM +0200, Lars-Peter Clausen wrote: > > On 08/31/2013 02:34 PM, Russell King - ARM Linux wrote: > > [...] > > > The same conditions apply as per my previous posting - the DAI link > > > needs to be setup and the associated DAPM routes to tell the CPU DAI > > > which outputs are in use, like this: > > > > > > DAI link: > > > .name = "S/PDIF1", > > > .stream_name = "IEC958 Playback", > > > .platform_name = "mvebu-audio.1", > > > .cpu_dai_name = "mvebu-audio.1", > > > .codec_dai_name = "dit-hifi", > > > .codec_name = "spdif-dit", > > > > > > static const struct snd_soc_dapm_route routes[] = { > > > { "Playback", NULL, "spdifdo" }, > > > }; > > > > This is still not exactly the right way to implement this though. Add a > > second DAI to your CPU driver, like this: > > What you're suggesting is the DPCM solution. > > That would be fine _if_ it works, which it doesn't. Not only does it > cause the kernel to spit out various warnings (caused by the creation > of multiple procfs files with the same name) but it also causes a kernel > oops when VLC tries to use it (due to NULL ops in the ALSA PCM.) Here's the warning I get - I've left the syslog stamp in these as evidence for how long this has been known - and I reported these to Mark when I found them: Aug 10 15:17:18 cubox kernel: WARNING: at /home/rmk/git/linux-cubox/fs/proc/generic.c:356 proc_register+0xac/0x128() Aug 10 15:17:18 cubox kernel: proc_dir_entry 'asound/oss' already registered Aug 10 15:17:18 cubox kernel: Modules linked in: snd_soc_spdif_tx m25p80 orion_wdt mtd snd_soc_kirkwood snd_soc_kirkwood_spdif Aug 10 15:17:18 cubox kernel: CPU: 0 PID: 388 Comm: kworker/u2:2 Not tainted 3.10.0+ #645 Aug 10 15:17:18 cubox kernel: Workqueue: deferwq deferred_probe_work_func Aug 10 15:17:18 cubox kernel: [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14) Aug 10 15:17:18 cubox kernel: [] (show_stack+0x10/0x14) from [] (warn_slowpath_common+0x4c/0x68) Aug 10 15:17:18 cubox kernel: [] (warn_slowpath_common+0x4c/0x68) from [] (warn_slowpath_fmt+0x30/0x40) Aug 10 15:17:18 cubox kernel: [] (warn_slowpath_fmt+0x30/0x40) from [] (proc_register+0xac/0x128) Aug 10 15:17:18 cubox kernel: [] (proc_register+0xac/0x128) from [] (proc_create_data+0x90/0xac) Aug 10 15:17:18 cubox kernel: [] (proc_create_data+0x90/0xac) from [] (snd_info_register+0x54/0xf0) Aug 10 15:17:18 cubox kernel: [] (snd_info_register+0x54/0xf0) from [] (snd_pcm_oss_register_minor+0xcc/0x1cc) Aug 10 15:17:18 cubox kernel: [] (snd_pcm_oss_register_minor+0xcc/0x1cc) from [] (snd_pcm_dev_register+0x1ac/0x290) Aug 10 15:17:18 cubox kernel: [] (snd_pcm_dev_register+0x1ac/0x290) from [] (snd_device_register_all+0x40/0x80) Aug 10 15:17:18 cubox kernel: [] (snd_device_register_all+0x40/0x80) from [] (snd_card_register+0x24/0x228) Aug 10 15:17:18 cubox kernel: [] (snd_card_register+0x24/0x228) from [] (snd_soc_instantiate_card+0x7b4/0x868) Aug 10 15:17:18 cubox kernel: [] (snd_soc_instantiate_card+0x7b4/0x868) from [] (snd_soc_register_card+0x26c/0x324) Aug 10 15:17:18 cubox kernel: [] (snd_soc_register_card+0x26c/0x324) from [] (kirkwood_spdif_probe+0x88/0xd8 [snd_soc_kirkwood_spdif]) Aug 10 15:17:18 cubox kernel: [] (kirkwood_spdif_probe+0x88/0xd8 [snd_soc_kirkwood_spdif]) from [] (platform_drv_probe+0x18/0x1c) Aug 10 15:17:18 cubox kernel: [] (platform_drv_probe+0x18/0x1c) from [] (really_probe+0x74/0x1f4) Aug 10 15:17:18 cubox kernel: [] (really_probe+0x74/0x1f4) from [] (driver_probe_device+0x30/0x48) Aug 10 15:17:18 cubox kernel: [] (driver_probe_device+0x30/0x48) from [] (bus_for_each_drv+0x60/0x8c) Aug 10 15:17:18 cubox kernel: [] (bus_for_each_drv+0x60/0x8c) from [] (device_attach+0x80/0xa4) Aug 10 15:17:18 cubox kernel: [] (device_attach+0x80/0xa4) from [] (bus_probe_device+0x88/0xac) Aug 10 15:17:18 cubox kernel: [] (bus_probe_device+0x88/0xac) from [] (deferred_probe_work_func+0x6c/0x9c) Aug 10 15:17:18 cubox kernel: [] (deferred_probe_work_func+0x6c/0x9c) from [] (process_one_work+0x190/0x3f4) Aug 10 15:17:18 cubox kernel: [] (process_one_work+0x190/0x3f4) from [] (worker_thread+0xf4/0x318) Aug 10 15:17:18 cubox kernel: [] (worker_thread+0xf4/0x318) from [] (kthread+0xa8/0xb4) Aug 10 15:17:18 cubox kernel: [] (kthread+0xa8/0xb4) from [] (ret_from_fork+0x14/0x2c) Aug 10 15:17:18 cubox kernel: ---[ end trace 174d2956b4f53cd5 ]--- Aug 10 15:17:18 cubox kernel: ------------[ cut here ]------------ Aug 10 15:17:18 cubox kernel: WARNING: at /home/rmk/git/linux-cubox/fs/proc/generic.c:356 proc_register+0xac/0x128() Aug 10 15:17:18 cubox kernel: proc_dir_entry 'asound/oss' already registered Aug 10 15:17:18 cubox kernel: Modules linked in: snd_soc_spdif_tx m25p80 orion_wdt mtd snd_soc_kirkwood snd_soc_kirkwood_spdif Aug 10 15:17:18 cubox kernel: CPU: 0 PID: 388 Comm: kworker/u2:2 Tainted: G W 3.10.0+ #645 Aug 10 15:17:18 cubox kernel: Workqueue: deferwq deferred_probe_work_func Aug 10 15:17:18 cubox kernel: [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14) Aug 10 15:17:18 cubox kernel: [] (show_stack+0x10/0x14) from [] (warn_slowpath_common+0x4c/0x68) Aug 10 15:17:18 cubox kernel: [] (warn_slowpath_common+0x4c/0x68) from [] (warn_slowpath_fmt+0x30/0x40) Aug 10 15:17:18 cubox kernel: [] (warn_slowpath_fmt+0x30/0x40) from [] (proc_register+0xac/0x128) Aug 10 15:17:18 cubox kernel: [] (proc_register+0xac/0x128) from [] (proc_create_data+0x90/0xac) Aug 10 15:17:18 cubox kernel: [] (proc_create_data+0x90/0xac) from [] (snd_info_register+0x54/0xf0) Aug 10 15:17:18 cubox kernel: [] (snd_info_register+0x54/0xf0) from [] (snd_pcm_oss_register_minor+0xcc/0x1cc) Aug 10 15:17:18 cubox kernel: [] (snd_pcm_oss_register_minor+0xcc/0x1cc) from [] (snd_pcm_dev_register+0x1ac/0x290) Aug 10 15:17:18 cubox kernel: [] (snd_pcm_dev_register+0x1ac/0x290) from [] (snd_device_register_all+0x40/0x80) Aug 10 15:17:18 cubox kernel: [] (snd_device_register_all+0x40/0x80) from [] (snd_card_register+0x24/0x228) Aug 10 15:17:18 cubox kernel: [] (snd_card_register+0x24/0x228) from [] (snd_soc_instantiate_card+0x7b4/0x868) Aug 10 15:17:18 cubox kernel: [] (snd_soc_instantiate_card+0x7b4/0x868) from [] (snd_soc_register_card+0x26c/0x324) Aug 10 15:17:18 cubox kernel: [] (snd_soc_register_card+0x26c/0x324) from [] (kirkwood_spdif_probe+0x88/0xd8 [snd_soc_kirkwood_spdif]) Aug 10 15:17:18 cubox kernel: [] (kirkwood_spdif_probe+0x88/0xd8 [snd_soc_kirkwood_spdif]) from [] (platform_drv_probe+0x18/0x1c) Aug 10 15:17:18 cubox kernel: [] (platform_drv_probe+0x18/0x1c) from [] (really_probe+0x74/0x1f4) Aug 10 15:17:18 cubox kernel: [] (really_probe+0x74/0x1f4) from [] (driver_probe_device+0x30/0x48) Aug 10 15:17:18 cubox kernel: [] (driver_probe_device+0x30/0x48) from [] (bus_for_each_drv+0x60/0x8c) Aug 10 15:17:18 cubox kernel: [] (bus_for_each_drv+0x60/0x8c) from [] (device_attach+0x80/0xa4) Aug 10 15:17:18 cubox kernel: [] (device_attach+0x80/0xa4) from [] (bus_probe_device+0x88/0xac) Aug 10 15:17:18 cubox kernel: [] (bus_probe_device+0x88/0xac) from [] (deferred_probe_work_func+0x6c/0x9c) Aug 10 15:17:18 cubox kernel: [] (deferred_probe_work_func+0x6c/0x9c) from [] (process_one_work+0x190/0x3f4) Aug 10 15:17:18 cubox kernel: [] (process_one_work+0x190/0x3f4) from [] (worker_thread+0xf4/0x318) Aug 10 15:17:18 cubox kernel: [] (worker_thread+0xf4/0x318) from [] (kthread+0xa8/0xb4) Aug 10 15:17:18 cubox kernel: [] (kthread+0xa8/0xb4) from [] (ret_from_fork+0x14/0x2c) I also get a load of these: Aug 10 16:09:27 cubox kernel: S!PDIF1: ASoC: no backend DAIs enabled for S/PDIF1 from time to time as there's no way to tell ASoC in a DPCM confirmation that although the CPU DAI has capture capability, the capture side is not connected to any codec. And here's the oops: Aug 10 22:06:17 cubox kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000008 Aug 10 22:06:17 cubox kernel: pgd = d2450000 Aug 10 22:06:17 cubox kernel: [00000008] *pgd=12285831, *pte=00000000, *ppte=00000000 Aug 10 22:06:17 cubox kernel: Internal error: Oops: 17 [#1] PREEMPT ARM Aug 10 22:06:17 cubox kernel: Modules linked in: fuse bnep rfcomm bluetooth ext2 ext3 jbd snd_soc_spdif_tx m25p80 orion_wdt mtd snd_soc_kirkwood snd_soc_kirkwood_spdif Aug 10 22:06:17 cubox kernel: CPU: 0 PID: 2514 Comm: vlc Not tainted 3.10.0+ #652 Aug 10 22:06:17 cubox kernel: task: d8102800 ti: d38fa000 task.ti: d38fa000 Aug 10 22:06:17 cubox kernel: PC is at snd_pcm_info+0xc8/0xd8 Aug 10 22:06:17 cubox kernel: LR is at 0x30232065 Aug 10 22:06:17 cubox kernel: pc : [] lr : [<30232065>] psr: a00f0013 Aug 10 22:06:17 cubox kernel: sp : d38fbea8 ip : d8c2ead0 fp : c05de6d8 Aug 10 22:06:17 cubox kernel: r10: c05de7d0 r9 : fffffdfd r8 : 00000000 Aug 10 22:06:17 cubox kernel: r7 : d8c268a8 r6 : d8c26800 r5 : d8c26c00 r4 : d8c2ea00 Aug 10 22:06:17 cubox kernel: r3 : 00000000 r2 : d8c2ea00 r1 : 00000001 r0 : d8c26c00 Aug 10 22:06:17 cubox kernel: Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Aug 10 22:06:17 cubox kernel: Control: 10c5387d Table: 12450019 DAC: 00000015 Aug 10 22:06:17 cubox kernel: Process vlc (pid: 2514, stack limit = 0xd38fa248) Aug 10 22:06:17 cubox kernel: Stack: (0xd38fbea8 to 0xd38fc000) Aug 10 22:06:17 cubox kernel: bea0: c0af7144 d8c2ea00 d8c26c00 ab5032b8 00000001 c030f768 Aug 10 22:06:17 cubox kernel: bec0: 00000000 d8c20000 ab5032b8 c030a67c 0000001b d116b840 d8380330 c1205531 Aug 10 22:06:17 cubox kernel: bee0: 0000001b d116b840 d8263fc0 d8c20000 ab5032b8 c03056b0 00000001 c05e6e80 Aug 10 22:06:17 cubox kernel: bf00: c05e6e88 c05be828 00020120 00000000 d38fa000 600f0013 00000001 0000001b Aug 10 22:06:17 cubox kernel: bf20: d38fa000 00020000 ab5032b8 c0088fec 00000001 00000000 d38fa000 00000000 Aug 10 22:06:17 cubox kernel: bf40: 600f0013 ca17c380 0000001b ab5032b8 d8380330 0000001b d38fa000 00020000 Aug 10 22:06:17 cubox kernel: bf60: ab5032b8 c00e50bc c00edecc 00020000 ab5032b8 00000001 ca17c380 ab5032b8 Aug 10 22:06:17 cubox kernel: bf80: c1205531 c00e5394 ab50366c 00000001 00000000 000120b0 ab50366c 00000036 Aug 10 22:06:17 cubox kernel: bfa0: c000e5a8 c000e3e0 00000000 000120b0 0000001b c1205531 ab5032b8 a91a3e10 Aug 10 22:06:17 cubox kernel: bfc0: 00000000 000120b0 ab50366c 00000036 ab503454 00000001 00000000 ab5032b8 Aug 10 22:06:17 cubox kernel: [] (snd_pcm_info+0xc8/0xd8) from [] (snd_pcm_info_user+0x34/0x9c) Aug 10 22:06:17 cubox kernel: [] (snd_pcm_info_user+0x34/0x9c) from [] (snd_pcm_control_ioctl+0x274/0x280) Aug 10 22:06:17 cubox kernel: [] (snd_pcm_control_ioctl+0x274/0x280) from [] (snd_ctl_ioctl+0xc0/0x55c) Aug 10 22:06:17 cubox kernel: [] (snd_ctl_ioctl+0xc0/0x55c) from [] (do_vfs_ioctl+0x80/0x31c) Aug 10 22:06:17 cubox kernel: [] (do_vfs_ioctl+0x80/0x31c) from [] (SyS_ioctl+0x3c/0x60) Aug 10 22:06:17 cubox kernel: [] (SyS_ioctl+0x3c/0x60) from [] (ret_fast_syscall+0x0/0x48) Aug 10 22:06:17 cubox kernel: Code: e1a00005 e59530dc e3a01001 e1a02004 (e5933008) This is caused because substream->ops is NULL. Why that's the case, I don't know, but I believe the PCM which is trying to be operated on is the one registered against the backend (by snd_pcm_new_internal). This is why I'm soo frustrated with Mark: Mark just churns the same old useless statements out without _listening_ to anything I've said or providing anything useful to help with the problems I find.