From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [PATCH v5] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches Date: Mon, 9 Jan 2017 11:21:23 -0800 Message-ID: <20170109192123.GN2630@atomide.com> References: <20170105015918.21621-1-matt@ranostay.consulting> <1372efd2-5319-e6c4-629e-6ed5f2e2fe29@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1372efd2-5319-e6c4-629e-6ed5f2e2fe29@ti.com> 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: Peter Ujfalusi Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, Matt Ranostay List-Id: linux-omap@vger.kernel.org * Peter Ujfalusi [170109 05:13]: > On 01/05/2017 03:59 AM, Matt Ranostay wrote: > > We can get audio errors if hitting deeper idle states on omaps: > > > > [alsa.c:230] error: Fatal problem with alsa output, error -5. > > [audio.c:614] error: Error in writing audio (Input/output error?)! > > > > This seems to happen with off mode idle enabled as power for the > > whole SoC may get cut off between filling the McBSP fifo using DMA. > > While active DMA blocks deeper idle states in hardware, McBSP > > activity does not seem to do so. > > > > Basing the QoS latency calculation on the FIFO size, threshold, > > sample rate, and channels. > > Looks good to me, thank you! > > Acked-by: Peter Ujfalusi Noticed the following about 10 seconds into playing an mp3 file with mpg123 though: BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:21 in_atomic(): 1, irqs_disabled(): 128, pid: 351, name: mpg123 2 locks held by mpg123/351: #0: (snd_pcm_link_rwlock){......}, at: [] snd_pcm_stream_lock+0x20/0x50 [snd_pcm] #1: (&(&substream->self_group.lock)->rlock){......}, at: [] snd_pcm_lib_write1+0x1ac/0x30c [snd_pc] irq event stamp: 20082 hardirqs last enabled at (20081): [] snd_pcm_stream_unlock_irq+0x20/0x28 [snd_pcm] hardirqs last disabled at (20082): [] snd_pcm_stream_lock_irq+0x28/0x38 [snd_pcm] softirqs last enabled at (17808): [] __do_softirq+0x240/0x564 softirqs last disabled at (17767): [] irq_exit+0xe4/0x160 CPU: 0 PID: 351 Comm: mpg123 Not tainted 4.10.0-rc2-next-20170109+ #726 Hardware name: Generic OMAP36xx (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xac/0xe0) [] (dump_stack) from [] (___might_sleep+0x17c/0x2a4) [] (___might_sleep) from [] (down_read+0x20/0x90) [] (down_read) from [] (__blocking_notifier_call_chain+0x2c/0x60) [] (__blocking_notifier_call_chain) from [] (blocking_notifier_call_chain+0x18/0x20) [] (blocking_notifier_call_chain) from [] (pm_qos_update_target+0x120/0x34c) [] (pm_qos_update_target) from [] (omap_mcbsp_start+0x2a8/0x334 [snd_soc_omap_mcbsp]) [] (omap_mcbsp_start [snd_soc_omap_mcbsp]) from [] (omap_mcbsp_dai_trigger+0x5c/0x90 [snd_) [] (omap_mcbsp_dai_trigger [snd_soc_omap_mcbsp]) from [] (soc_pcm_trigger+0xd0/0x11c [snd_) [] (soc_pcm_trigger [snd_soc_core]) from [] (snd_pcm_action_single+0x38/0x78 [snd_pcm]) [] (snd_pcm_action_single [snd_pcm]) from [] (snd_pcm_lib_write1+0x2c8/0x30c [snd_pcm]) [] (snd_pcm_lib_write1 [snd_pcm]) from [] (snd_pcm_lib_write+0x60/0x74 [snd_pcm]) [] (snd_pcm_lib_write [snd_pcm]) from [] (snd_pcm_playback_ioctl1+0x38c/0x6f0 [snd_pcm]) [] (snd_pcm_playback_ioctl1 [snd_pcm]) from [] (do_vfs_ioctl+0x90/0xa0c) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x6c/0x7c) [] (SyS_ioctl) from [] (__sys_trace_return+0x0/0x10) Any ideas? Tony