LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 07-24-2009, 08:28 AM   #1
chethangm84
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
Underrun in alsa audio (wake_up() is not working in linux-2.6.25)


Issue:

If I play the wav file using "aplay", underrun error occurs.

I am suspecting the issue in driver or in kernel code.

I am using the following setup:

a) Application and Library:
aplay in alsa-utils-1.0.16 and alsa-lib-1.0.16.
b) Platform: imx27
c) kernel: linux-2.6.25

Hardware & Software parameters for aplay:

cat /proc/asound/card0/pcm0p/sub0/sw_params
tstamp_mode: NONE
period_step: 1
avail_min: 2048
start_threshold: 8192
stop_threshold: 8192
silence_threshold: 0
silence_size: 0
boundary: 1073741824

cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 2048
buffer_size: 8192

observation:

1. When the aplay task going to wait state by calling following set of
functions in the audio driver,

static int wait_for_avail_min(struct snd_pcm_substream *substream,
snd_pcm_uframes_t *availp)
{
set_current_state(TASK_INTERRUPTIBLE);
snd_pcm_stream_unlock_irq(substream);
tout = schedule_timeout(msecs_to_jiffies(10000));
.
.
}

(file: linux-2.6.25/sound/core/pcm_lib.c)

Its not coming out from "schedule_timeout()" for a while in error
scenario (underrun condition).

2. What I observed is, in "try_to_wake_up()" of kernel/sched.c
its not enqueueing the "aplay" task in the "runqueue".

3. When the audio buffer is free the callback function
"snd_pcm_update_hw_ptr_post()" is calling "wake_up" to schedule,
here in error scenario its not actually
enqueueing our task in the "runqueue"

4. And Here I observed old_state and current task state (p->state)
mismatch for "aplay" context.

Is any one faced similar problem?

Can any one suggest me if any kernel patch for this issue.

I am stuck up here.

Thanks in advance
Chethan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Soft lockup of Kernel on CentOS when tryin to wake_up() akshaynm87 Linux - Kernel 1 07-21-2009 08:59 PM
ALSA Mixer problem: underrun kaibs Slackware 1 07-19-2007 10:59 AM
ALSA: buffer underrun error ashlesha Linux - Software 0 04-22-2007 09:41 AM
audio THD detection in linux with ALSA monohouse Linux - Software 0 02-16-2005 12:03 PM
audio problem - underrun goglu Linux - General 0 01-16-2005 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration