# Intel HDA: short drops listening to audio content [SOLVED]

## VinzC

Hi.

I've got a Dell Studio XPS (1640, I think) and I always notice audio "drops" when the disk is accessed. For instance, when I play an audio CDROM or an audio file (either local or remote) I can hear very small interruptions (a few milliseconds maybe). These "drops" can happen when I start moving the mouse pointer, wheen I switch applications in Xfce4 and also when idle...

I've now been able to reproduce the problem at will when using my local apache web server (i.e. on my laptop). Those drops happen each time I reload a page. So if I keep reloading the same page again, the interruption gets much longer and much more perceptible. This had led me to think about a possible bus congestion or a scheduler problem. Of course this is just a supposition, nothing I'm sure of.

In case, here's my scheduling configuration.

```
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y

CONFIG_GROUP_SCHED=y

CONFIG_FAIR_GROUP_SCHED=y

CONFIG_USER_SCHED=y

CONFIG_IOSCHED_NOOP=y

CONFIG_IOSCHED_CFQ=y

CONFIG_DEFAULT_IOSCHED="cfq"

CONFIG_SCHED_OMIT_FRAME_POINTER=y

CONFIG_SCHED_SMT=y

CONFIG_SCHED_MC=y

CONFIG_SCHED_HRTICK=y

CONFIG_NET_SCHED=y

CONFIG_USB_EHCI_TT_NEWSCHED=y
```

I'm using gentoo-sources-2.6.30-r4.

```
snd_seq_oss            28384  0 

snd_seq_midi_event      6784  1 snd_seq_oss

snd_seq                50080  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          6900  2 snd_seq_oss,snd_seq

snd_pcm_oss            38368  0 

snd_mixer_oss          17056  1 snd_pcm_oss

snd_hda_codec_atihdmi     4000  1 

snd_hda_codec_idt      62348  1 

snd_hda_intel          25992  4 

snd_hda_codec          56160  3 snd_hda_codec_atihdmi,snd_hda_codec_idt,snd_hda_intel

snd_pcm                73528  4 snd_pcm_oss,snd_hda_intel,snd_hda_codec

snd_page_alloc          9072  2 snd_hda_intel,snd_pcm
```

I've noticed there needn't be a physical disk access, a cache hit is enough -- my hard disk led doesn't light all the time when I hear these "drops".

Thanks in advance for any hint/suggestion.

----------

## eccerr0r

Though my server does not appear to be afflicted, what are:

CONFIG_PREEMPT_NONE=y

# CONFIG_PREEMPT_VOLUNTARY is not set

# CONFIG_PREEMPT is not set

set to?  Also what are

# CONFIG_HZ_100 is not set

# CONFIG_HZ_250 is not set

CONFIG_HZ_300=y

# CONFIG_HZ_1000 is not set

CONFIG_HZ=300

set to?

I hear short drops on my eee, and as far as I can tell, they're attributed to its really slow "disk"...

----------

## VinzC

```
CONFIG_PREEMPT_NOTIFIERS=y

CONFIG_NO_HZ=y

CONFIG_PREEMPT=y

CONFIG_HZ_250=y

CONFIG_HZ=250

CONFIG_DEBUG_PREEMPT=y
```

The disk on the Dell laptop isn't supposed to deserve the qualifier «slow»  :Smile:  -- IIRC it's a SATA 7200 rpm (ST9500420ASG). Or is it that it's too fast?  :Laughing: 

----------

## eccerr0r

I'd have to admit I have no clue at this point.  Another thing to try is to disable all debug, debugging statements can add to latency as it's more code to execute.  In any case it's definitely some underrun issue, but nothing points to something obviously wrong.  Has this machine worked under Linux before?  Any other kernels work?

I'm not familiar with all the Intel HDA codecs.  Some may have a smaller buffer, requiring lower interrupt latency to keep full... but I don't know way too much about how HDA works...

----------

## VinzC

 *eccerr0r wrote:*   

> Has this machine worked under Linux before?

 

I don't know, this is the first time I ever got that machine and the first time I put GNU/Linux on it.

 *eccerr0r wrote:*   

> Any other kernels work?

 

I'm not sure that problem occurred with 2.6.29 but I'm not sure I had used 2.6.29 on that machine either... I might as well try 2.6.31 or 2.6.29 for good.

----------

## pappy_mcfae

Look at kernel seed settings for speed and preemption. I use 1000Hz, nothing less. I set for full preemption. Fair Scheduling isn't helping, either. It slows machines down well...that's about it. 

If you need, post your kernel, the results of lspci -n and cat /proc/cpuinfo, as well as your etc/fstab file, and I'll take a look.

Blessed be!

Pappy

----------

## VinzC

 *pappy_mcfae wrote:*   

> Look at kernel seed settings for speed and preemption. I use 1000Hz, nothing less. I set for full preemption. Fair Scheduling isn't helping, either. It slows machines down well...that's about it. 

 

Thanks a lot Sir! I'll try and tell you.

----------

## krinn

you have specific version for dell soundcard hda implementation.

look for ALSA doc in kernel as

```
cat /usr/src/linux/Documentation/sound/alsa/ALSA-Configuration.txt | grep dell
```

will gives plenty models (depending your kernel version)

----------

## VinzC

 *krinn wrote:*   

> you have specific version for dell soundcard hda implementation.
> 
> look for ALSA doc in kernel as

 

```
cat /usr/src/linux/Documentation/sound/alsa/ALSA-Configuration.txt | grep dell
```

Well, currently that doesn't give many results

 *Quote:*   

>     Module for Creative Emu10k1X (SB Live Dell OEM version)
> 
>     known hardware like Dell Latitude LS and Sony PCG-F305, this
> 
>     Note: Dell Latitude CSx laptops have another problem regarding

 

Note I'm familiar with Intel HDA since my first Inspiron 6000. So I've taken a quick look to the documentation though and to HD-Audio.txt as well. These are big files to read carefully. I'll fall back onto them if Pappy's hint doesn't give the expected results.

Thanks for reminding me  :Smile:  .

----------

## VinzC

 *pappy_mcfae wrote:*   

> Look at kernel seed settings for speed and preemption. I use 1000Hz, nothing less. I set for full preemption. Fair Scheduling isn't helping, either. It slows machines down well...that's about it. 

 

 *VinzC wrote:*   

> Thanks a lot Sir! I'll try and tell you.

 

I've tried setting preempting frequency to 1000Hz and to select Anticipatory scheduler, no change. Sound still chops from time to time. I'll try your seeds next.

----------

## depontius

This jogged my memory just a bit.

When the talk of "fair scheduler" came up, it appears that you made the assumption he was talking about the I/O scheduler.  He may have been talking about the CPU scheduler, instead.  Many of us have found that the fair CPU scheduler isn't that bad, but "fair group scheduling" is an absolute killer.  Go back into your kernel build and make sure that stuff is turned off:

```
# CONFIG_GROUP_SCHED is not set

# CONFIG_CGROUPS is not set
```

and see if that makes a difference.

From what I understand, group scheduling really needs a userspace daemon to make it act right.  I've seen some gropes at one, but nothing yet to be called the "official" one.

----------

## pappy_mcfae

 *depontius wrote:*   

> From what I understand, group scheduling really needs a userspace daemon to make it act right.  I've seen some gropes at one, but nothing yet to be called the "official" one.

 

Yes, absolutely. Fair scheduling and group scheduling are worthless machine slow-downs. I've heard it compared to really interesting plumbing without any fixtures. For now, that seems as good a comparison as any. 

Blessed be!

Pappy

----------

## VinzC

I've disabled CPU grouping and group scheduling as well. I'll see what happens. I've also tried the seeds but I got a kernel panic -- probably due to missing EXT4 support, I haven't checked.

EDIT: Currently my laptop's under Deadline I/O scheduler and the problem seems gone. I'll wait a little before bringing up the champ...^Wbeer  :Smile:  .

EDIT: I'm now suspecting I/O CFQ to introduce that latency. I've got no definite clue about that yet. Still trying...

----------

## VinzC

I'm confirming CFQ induced these annoyances while playing audio. Switching to the “Deadline I/O scheduler” fixed it all. Thanks for the hints, guys.

----------

## pappy_mcfae

Good to read. 

Blessed be!

Pappy

----------

