ALSA: pcm_lib - fix xrun functionality
PATCH 1/1 ALSA: pcm_lib - fix xrun functionality
The commit 4d96eb255c53ab5e39b37fd4d484ea3dc39ab456 broke the interrupt time xrun functionality (stream stop etc.) if the CONFIG_SND_PCM_XRUN_DEBUG is not set. This is because the xrun() is null defined without it.
Fix this by letting the function xrun() to be always defined as it was before.
--- sound/core/pcm_lib.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
sound/core/pcm_lib.c +4 -2
@@ -148,6 +148,9 @@ static void pcm_debug_name(struct snd_pcm_substream *substream,#define xrun_debug (substream, mask) \ ((substream)->pstr->xrun_debug & (mask)) +#else +#define xrun_debug (substream, mask) 0 +#endif #define dump_stack_on_xrun (substream) do { \ if (xrun_debug(substream, XRUN_DEBUG_STACK)) \
@@ -169,6 +172,7 @@ static void xrun(struct snd_pcm_substream *substream) } } +#ifdef CONFIG_SND_PCM_XRUN_DEBUG #define hw_ptr_error(substream, fmt, args...) \ do { \ if (xrun_debug(substream, XRUN_DEBUG_BASIC)) { \
@@ -255,8 +259,6 @@ static void xrun_log_show(struct snd_pcm_substream *substream)#else /* ! CONFIG_SND_PCM_XRUN_DEBUG */ -#define xrun_debug (substream, mask) 0 -#define xrun (substream) do { } while (0) #define hw_ptr_error(substream, fmt, args...) do { } while (0)#define xrun_log (substream, pos) do { } while (0)#define xrun_log_show (substream) do { } while (0)
Signature · 1 line
1.7.0
At Fri, 26 Mar 2010 16:07:25 +0200,
Quoted 7 lines · Jarkko Nikula
The commit
4d96eb255c53ab5e39b37fd4d484ea3dc39ab456broke the interrupt time xrun functionality (stream stop etc.) if theCONFIG_SND_PCM_XRUN_DEBUGis not set. This is because thexrun()is null defined without it.Fix this by letting the function
xrun()to be always defined as it was before.
Thanks, that's likely the problem Pavel has seen, but never reproduced on Jaroslav or my machine.
Applied now to sound git tree.
Takashi
Quoted 40 lines
Signed-off-by Jarkko Nikula <[email protected]>Cc Jaroslav Kysela <[email protected]>--- sound/core/pcm_lib.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)sound/core/pcm_lib.c +4
-2@@ -148,6 +148,9 @@ static void pcm_debug_name(struct snd_pcm_substream *substream,#define xrun_debug (substream, mask) \ ((substream)->pstr->xrun_debug & (mask)) +#else +#define xrun_debug (substream, mask) 0 +#endif #define dump_stack_on_xrun (substream) do { \ if (xrun_debug(substream, XRUN_DEBUG_STACK)) \@@ -169,6 +172,7 @@ static void xrun(struct snd_pcm_substream *substream) } } +#ifdef CONFIG_SND_PCM_XRUN_DEBUG #define hw_ptr_error(substream, fmt, args...) \ do { \ if (xrun_debug(substream, XRUN_DEBUG_BASIC)) { \@@ -255,8 +259,6 @@ static void xrun_log_show(struct snd_pcm_substream *substream)#else /* ! CONFIG_SND_PCM_XRUN_DEBUG */ -#define xrun_debug (substream, mask) 0 -#define xrun (substream) do { } while (0) #define hw_ptr_error(substream, fmt, args...) do { } while (0)#define xrun_log (substream, pos) do { } while (0)#define xrun_log_show (substream) do { } while (0)Signature · 1 line
1.7.0
Quoted 7 lines · On Fri, 26 Mar 2010 15:29:56 +0100 Takashi Iwai <[email protected]> wrote:
At Fri, 26 Mar 2010 16:07:25 +0200,
Quoted 5 lines · Jarkko Nikula
The commit
4d96eb255c53ab5e39b37fd4d484ea3dc39ab456broke the interrupt time xrun functionality (stream stop etc.) if theCONFIG_SND_PCM_XRUN_DEBUGis not set. This is because thexrun()is null defined without it.
Quoted 6 lines
Quoted 2 lines
Fix this by letting the function
xrun()to be always defined as it was before.Thanks, that's likely the problem Pavel has seen, but never reproduced on Jaroslav or my machine.
Yeah, I just tested and my patch is fixing that [1] too :-)
Signature · 3 lines
Jarkko 1. http://mailman.alsa-project.org/pipermail/alsa-devel/2010-March/026155.html
Quoted 7 lines · Takashi Iwai
At Fri, 26 Mar 2010 16:07:25 +0200,
Quoted 5 lines · Jarkko Nikula
The commit
4d96eb255c53ab5e39b37fd4d484ea3dc39ab456broke the interrupt time xrun functionality (stream stop etc.) if theCONFIG_SND_PCM_XRUN_DEBUGis not set. This is because thexrun()is null defined without it.
Quoted 5 lines
Quoted 2 lines
Fix this by letting the function
xrun()to be always defined as it was before.Thanks, that's likely the problem Pavel has seen, but never reproduced on Jaroslav or my machine.
Yes, I hand-applied the patch, and problem went away. Thanks!
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Jaroslav Kysela
maintainerQuoted 9 lines · Jarkko Nikula
The commit
4d96eb255c53ab5e39b37fd4d484ea3dc39ab456broke the interrupt time xrun functionality (stream stop etc.) if theCONFIG_SND_PCM_XRUN_DEBUGis not set. This is because thexrun()is null defined without it.Fix this by letting the function
xrun()to be always defined as it was before.Signed-off-by Jarkko Nikula <[email protected]>Cc Jaroslav Kysela <[email protected]>
Oops. This is why I didn't see the broken behaviour in my tests (compiling everything with debug mode ;-). I applied this patch to my GIT tree. Thanks.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.