# Troubles with audio: Vaio GRX, ALSA and cpudyn (Linux 2.6.x)

## basquiat

It seems to be a never ending story: Proper sound on my Sony Vaio notebook (GRX-416G).

Using Linux 2.6.3 and ALSA, the sound is crappy and noisy, sometimes "overlapping", like an echo.

After compiling several kernel versions, I hunted down the problem to the use of cpudyn. Without cpudyn enabled, everything works fine (even though not perfect, but with less irritating noises).

OSS doesn't seem to care about cpudyn, but it's playback is in general a few percent too slow. As I want to use ALSA for different reasons in the future, OSS is not an option for me unless it's able to solve my problems in a perfect way.

If anyone here has successfully managed to get dynamic CPU throttling _and_ proper sound on a Vaio GRX with Linux 2.6.x (or on any other notebook, if faced and solved similar problems), I would be very interested in a short description of the setup.

A few details on my system and configurations:

```
> emerge info

Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.3-gentoo-r1)

=================================================================

System uname: 2.6.3-gentoo-r1 i686 Intel(R) Pentium(R) 4 Mobile CPU 1.80GHz

Gentoo Base System version 1.4.3.13

ACCEPT_KEYWORDS="x86 ~x86"
```

```
> lspci -v

0000:00:1f.5 Multimedia audio controller: 

Intel Corp. 82801CA/CAM AC'97 Audio Controller (rev 02)

        Subsystem: Sony Corporation: Unknown device 80fa

        Flags: bus master, medium devsel, latency 0, IRQ 9

        I/O ports at 1c00

        I/O ports at 18c0 [size=64]
```

```
cat /proc/asound/cards:

  0 [I82801CAICH3   ]: ICH - Intel 82801CA-ICH3

                       Intel 82801CA-ICH3 at 0x1c00, irq 9

cat /proc/asound/version:

  Advanced Linux Sound Architecture Driver Version 1.0.2c

  (Thu Feb 05 15:41:49 2004 UTC).

  Compiled on Feb 23 2004 for kernel 2.6.3-gentoo-r1.

cat /proc/asound/timers

  G0: system timer : 1000.000us (10000000 ticks)

  G1: RTC timer : 976.562us (100000000 ticks)

  P0-0-0: PCM playback 0-0-0 : SLAVE

  P0-0-1: PCM capture 0-0-1 : SLAVE

  P0-1-1: PCM capture 0-1-1 : SLAVE

```

```
dmesg

ALSA sound/pci/ac97/ac97_codec.c:1858: MC'97 1 converters and GPIO not ready (0xff00)

intel8x0_measure_ac97_clock: measured 49300 usecs

intel8x0: clocking to 48000

ALSA device list:

  #0: Intel 82801CA-ICH3 at 0x1c00, irq 9
```

I put the complete output of dmesg and my kernel .config on my server, so anyone who thinks he can help can have a look at it:

The output of dmesg and the kernel .config of my Vaio GRX.

This problem is really drivin' me nuts, so if anyone knows how to do CPU throttling and proper audio output with ALSA, I'd be very thankful for his report.   :Wink: 

regards,

basquiat

----------

## Helena

Why don't you use the kernel built-in powersavers from Power Management / CPU frequency scaling?

----------

## basquiat

Hm, I always thought they were just drivers or interfaces to use with programs like cpudyn, not throttling independently?

----------

## Helena

I admit I'm not doing much with cpufreq so I wouldn't know. Have you looked into the directory /usr/src/linux/Documentation/cpu-freq? The kernel config doesn't seem to suggest any additional programs to me...

----------

## adante

 *basquiat wrote:*   

> It seems to be a never ending story: Proper sound on my Sony Vaio notebook (GRX-416G).
> 
> Using Linux 2.6.3 and ALSA, the sound is crappy and noisy, sometimes "overlapping", like an echo.
> 
> 

 

I am in a similar situation (Vaio GRX5P, it is an australian model rebadged for perverse reasons, but I think it is much the same as the US GRX line), running 2.6.3-rc2-mm1

For me, cpudyn causes constant skipping in playback of mp3's (it seems like more skipping the higher the bitrate, but that may be my imagination), and while OSS is less, it is still far from perfect. Like you, stopping cpudyn (and restarting sound) makes sound fine (I am no audio buff, but I have no complains about the quality)

Now that I've gotten your hopes up, I don't have a solution either  :Sad:  although I don't recall having this problem in 2.4.

It seem like a timing problem however, like alsa is using cpu clocking to determine time, and as these change things go funny (this is a wild guess). Some things I experience which may be related:

I used to have massive drift in system time every day, like 1/2 hour or something. Since I started using ntp-client this is no longer a problem, but I've now disabled it to see if it is still happening, and maybe figure out how to fix it.

Whenever I use the gamecon module for my psx->parallel controller, sound goes staticy for certain games (stepmania). gamecon makes quite a lot of delayus calls, which may be mucking up timing as well.

Anyway just wanted to let you know you're not alone  :Smile:  and I'm looking into this aswell. If I uncover anything I'll be sure to let you know.

----------

## dani139

Hello

You guys are really not alone with this sound problem on SONY Vaio's, especially since 2.6.x kernelz.

I have a GRX316MP with gentoo-dev-sources 2.6.3. With or without cpudyn running, the sound on my machine has a very bad quality  :Evil or Very Mad: 

Unfortunately I don't have a solution yet.

What about your cpufreq setting. My cpuinfo_min_freq file has a value of 1200000. Can

I lower that number ex. to 800000 and how?

thx

----------

## adante

 *dani139 wrote:*   

> Hello
> 
> You guys are really not alone with this sound problem on SONY Vaio's, especially since 2.6.x kernelz.
> 
> I have a GRX316MP with gentoo-dev-sources 2.6.3. With or without cpudyn running, the sound on my machine has a very bad quality 
> ...

 

can you describe exactly what you mean by bad quality? static? distortion? something else?

if it's constantly present and not caused by dynamic clock speeds then it might not be "this problem" that bascquiat and I are experiencing (of course my symptoms are a little different than bascquiat's anyway, hehe)

as for clock speed, I assuming you're using the nonenhanced speedstep driver? this can only do 2 speeds, mine is 1.2ghz and 2.0. you can adjust to anything in that range by doing

```

echo "1500000:1600000:performance" > /proc/cpufreq
```

and somesuch - do a forum search its all over the place

if you can want more dynamic speeds use the p4 clockmod driver - you can scale from 10-100% of your speed in 10% increments - however, there is little or no power saving so there's not much point in doing it

[/b]

----------

## dani139

ok, what I have found out.

I use the intel8x0 sound driver. And for listening sound in KDE 3.2 I have selected in section "sound system" ALSA. Because I read somewhere that KDE has some troubles to autodetect soundsystem.

So, If I play wav music the sound quality is quite good, but there is some background noise...

Now during playing mp3 files the quality is worse. There are lots of pauses for some micro seconds and also background noises.

cpudyn doesn't affect this sound problems. Cpudyn ON or OFF there are the same results on my machine.

greetings

----------

