Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [patch] snd-pcsp: silent misleading warning
       [not found]                         ` <482EC93E.7080702@infracom.it>
@ 2008-05-17 15:50                           ` Stas Sergeev
  2008-05-18  7:44                             ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Stas Sergeev @ 2008-05-17 15:50 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, LKML, Roberto Oppedisano

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

Hello.

Roberto Oppedisano wrote:
> I noticed that when I run
> aplay -D plughw:2,0 /usr/share/sounds/KDE_Logout.wav
>  I get a flood of:
> [  417.338143] PCSP: playback_ptr inconsistent (4642 4661 18645)
It turns out that the buffer size you
get, is not evenly devided by period size.
18645 % 4661 = 1.
That (wrongly) triggers the warning.
This may very well be an alsa bug, or
may not, but the code in the driver is
handling that properly, so there is no
need for such a verbose warning.

The attached patch shuts down the warning.
Takashi, could you please apply?

[-- Attachment #2: pcsp_fixwarn.diff --]
[-- Type: text/x-patch, Size: 1124 bytes --]

# HG changeset patch
# User Stas Sergeev <stsp@users.sourceforge.net>
# Date 1211038849 -14400
# Node ID 2278b9a6058f5b45081f8227902df585474a81a6
# Parent  49d310de8ac42e5c495cf39440f4fde307b39c75
It appears that alsa allows a sound buffer with size not
evenly devided by the period size. This triggers a warning in
snd-pcsp and floods the log. As a quick fix, the warning should
be disabled.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>

diff -r 49d310de8ac4 -r 2278b9a6058f drivers/pcsp/pcsp_lib.c
--- a/drivers/pcsp/pcsp_lib.c	Sat May 17 02:04:12 2008 +0400
+++ b/drivers/pcsp/pcsp_lib.c	Sat May 17 19:40:49 2008 +0400
@@ -119,9 +119,11 @@ enum hrtimer_restart pcsp_do_timer(struc
 	chip->playback_ptr += PCSP_INDEX_INC() * fmt_size;
 	periods_elapsed = chip->playback_ptr - chip->period_ptr;
 	if (periods_elapsed < 0) {
-		printk(KERN_WARNING "PCSP: playback_ptr inconsistent "
+#if PCSP_DEBUG
+		printk(KERN_INFO "PCSP: buffer_bytes mod period_bytes != 0 ? "
 			"(%zi %zi %zi)\n",
 			chip->playback_ptr, period_bytes, buffer_bytes);
+#endif
 		periods_elapsed += buffer_bytes;
 	}
 	periods_elapsed /= period_bytes;

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] snd-pcsp: silent misleading warning
  2008-05-17 15:50                           ` [patch] snd-pcsp: silent misleading warning Stas Sergeev
@ 2008-05-18  7:44                             ` Takashi Iwai
  2008-05-18 17:32                               ` Stas Sergeev
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2008-05-18  7:44 UTC (permalink / raw)
  To: Stas Sergeev; +Cc: alsa-devel, LKML, Roberto Oppedisano

At Sat, 17 May 2008 19:50:42 +0400,
Stas Sergeev wrote:
> 
> Hello.
> 
> Roberto Oppedisano wrote:
> > I noticed that when I run
> > aplay -D plughw:2,0 /usr/share/sounds/KDE_Logout.wav
> >  I get a flood of:
> > [  417.338143] PCSP: playback_ptr inconsistent (4642 4661 18645)
> It turns out that the buffer size you
> get, is not evenly devided by period size.
> 18645 % 4661 = 1.
> That (wrongly) triggers the warning.
> This may very well be an alsa bug, or
> may not, but the code in the driver is
> handling that properly, so there is no
> need for such a verbose warning.

The right fix would be to add a hw_constraint to align the buffer
size.  The simplest way is to add the following in PCM open callback.

	snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] snd-pcsp: silent misleading warning
  2008-05-18 17:32                               ` Stas Sergeev
@ 2008-05-18 16:28                                 ` Takashi Iwai
  2008-05-18 16:49                                   ` Stas Sergeev
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2008-05-18 16:28 UTC (permalink / raw)
  To: Stas Sergeev; +Cc: alsa-devel, LKML, Roberto Oppedisano

At Sun, 18 May 2008 21:32:39 +0400,
Stas Sergeev wrote:
> 
> Hello.
> 
> Takashi Iwai wrote:
> >>> [  417.338143] PCSP: playback_ptr inconsistent (4642 4661 18645)
> >> It turns out that the buffer size you
> >> get, is not evenly devided by period size.
> >> 18645 % 4661 = 1.
> >> That (wrongly) triggers the warning.
> >> This may very well be an alsa bug, or
> >> may not, but the code in the driver is
> >> handling that properly, so there is no
> >> need for such a verbose warning.
> > The right fix would be to add a hw_constraint to align the buffer
> > size.  The simplest way is to add the following in PCM open callback.
> But what does this fix? That's only a
> warning, the driver itself doesn't care
> at all. The fix you propose, will need
> more testing, at least a confirmation
> from the reporter. I simply thought this
> can't happen. Now you say its a perfectly
> sane situation, and then there is nothing
> to care about, just shut up the warning.
> No?

Well, judging from your previous comment, I thought that it's no sane
situation for *your* driver.  But if the driver doesn't care in
practice, your fix should be fine.  I'll queue it on my tree. 

thanks,

Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] snd-pcsp: silent misleading warning
  2008-05-18 16:28                                 ` Takashi Iwai
@ 2008-05-18 16:49                                   ` Stas Sergeev
  0 siblings, 0 replies; 5+ messages in thread
From: Stas Sergeev @ 2008-05-18 16:49 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, LKML, Roberto Oppedisano

Hello.

Takashi Iwai wrote:
> Well, judging from your previous comment, I thought that it's no sane
> situation for *your* driver.
Only by wrongly triggering a warning
that was supposed for the different
purpose. :)

> But if the driver doesn't care in
> practice, your fix should be fine.  I'll queue it on my tree. 
Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] snd-pcsp: silent misleading warning
  2008-05-18  7:44                             ` Takashi Iwai
@ 2008-05-18 17:32                               ` Stas Sergeev
  2008-05-18 16:28                                 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Stas Sergeev @ 2008-05-18 17:32 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, LKML, Roberto Oppedisano

Hello.

Takashi Iwai wrote:
>>> [  417.338143] PCSP: playback_ptr inconsistent (4642 4661 18645)
>> It turns out that the buffer size you
>> get, is not evenly devided by period size.
>> 18645 % 4661 = 1.
>> That (wrongly) triggers the warning.
>> This may very well be an alsa bug, or
>> may not, but the code in the driver is
>> handling that properly, so there is no
>> need for such a verbose warning.
> The right fix would be to add a hw_constraint to align the buffer
> size.  The simplest way is to add the following in PCM open callback.
But what does this fix? That's only a
warning, the driver itself doesn't care
at all. The fix you propose, will need
more testing, at least a confirmation
from the reporter. I simply thought this
can't happen. Now you say its a perfectly
sane situation, and then there is nothing
to care about, just shut up the warning.
No?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-05-18 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <482737BE.20502@infracom.it>
     [not found] ` <4827415A.7060101@aknet.ru>
     [not found]   ` <482756F0.8020609@infracom.it>
     [not found]     ` <48275D8D.10500@aknet.ru>
     [not found]       ` <4827F0A1.9090600@infracom.it>
     [not found]         ` <48288ACC.1020909@aknet.ru>
     [not found]           ` <48299F08.2060702@infracom.it>
     [not found]             ` <4829B6A1.90707@infracom.it>
     [not found]               ` <s5h7idycfmf.wl%tiwai@suse.de>
     [not found]                 ` <482A7A17.8070706@infracom.it>
     [not found]                   ` <s5hwslxb3t8.wl%tiwai@suse.de>
     [not found]                     ` <482C9A3E.3000009@infracom.it>
     [not found]                       ` <482C9F3E.4050104@aknet.ru>
     [not found]                         ` <482EC93E.7080702@infracom.it>
2008-05-17 15:50                           ` [patch] snd-pcsp: silent misleading warning Stas Sergeev
2008-05-18  7:44                             ` Takashi Iwai
2008-05-18 17:32                               ` Stas Sergeev
2008-05-18 16:28                                 ` Takashi Iwai
2008-05-18 16:49                                   ` Stas Sergeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox