Difference between revisions of "CS4299"

From ThinkWiki
Jump to: navigation, search
(switched categorization)
 
(11 intermediate revisions by 4 users not shown)
Line 4: Line 4:
 
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;">
 
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;">
 
=== CS4299 ===
 
=== CS4299 ===
This is a Cirrus Logic AC'97 Audio controller
+
This is a Cirrus Logic AC'97 Audio codec
  
 
This chip is sometimes incorrectly called CS4229 in IBM documentation
 
This chip is sometimes incorrectly called CS4229 in IBM documentation
 +
 
=== Features ===
 
=== Features ===
 
* Chipset: CS4299
 
* Chipset: CS4299
Line 13: Line 14:
 
|style="vertical-align:top" |
 
|style="vertical-align:top" |
 
|}
 
|}
 +
=== Linux ALSA driver ===
 +
This sound chip is supported by the snd-intel8x0 kernel module.
  
=== Linux OSS driver ===
+
=== T23 Fast Sound ===
This sound chip is supported by the i810_audio kernel module.
+
On at least one t23 (mine) the ALSA intel8x0 driver plays sound too fast.  The following {{path|/etc/asound.conf}} restores normal operation: 
 +
 
 +
  pcm.intel8x0-hw {
 +
  type hw
 +
  card 0
 +
  }
 +
 
 +
  pcm.!default {
 +
  type plug
 +
  slave.pcm "intel8x0"
 +
  }
 +
 
 +
  pcm.intel8x0 {
 +
  type dmix
 +
  ipc_key 1234
 +
  slave {
 +
  pcm "hw:0,0"
 +
  period_time 0
 +
  period_size 512
 +
  buffer_size 4096
 +
  rate 44100
 +
  }
 +
  }
 +
 
 +
  ctl.intel8x0-hw {
 +
  type hw
 +
  card 0
 +
  }
  
=== Linux ALSA driver ===
 
This sound chip is supported by the snd-intel8x0 kernel module.
 
  
==== Dmixing ====
+
=== Dmixing ===
Please note that dmixing will make alsa (as userland program) do the work esd or arts did to get the same effects, dmixing will load your CPU.
+
The CS4299 is not capable of hardware mixing. This means that only one sound stream can be played at any time.
 +
You must get the software to do the mixing for it (this will load your CPU).
 +
The ALSA implementation of this is called DMIX. You can also run sound servers like ESD or ArtsD, but not all applications will use them.
 +
Recent ALSA distributions have dmixing setup and enabled by default.  
  
Just add the following to {{path|/etc/asound.conf}} :
+
Otherwise just add the following to {{path|/etc/asound.conf}} :
 
   pcm.dsp0 {
 
   pcm.dsp0 {
 
       type plug
 
       type plug
Line 35: Line 66:
 
   }
 
   }
  
=== ThinkPad's this chip may be found in ===
+
Now the only problem is how to tell applications to use the DMIX channel instead of dsp0. Most applications work by specifying "dmix" as the device. For command line apps use "aoss".
 +
 
 +
Hint: XMMS does not work well with dmix and the intel8x0. You will probably need to patch and recompile.
 +
 
 +
See: [http://bugs.xmms.org/show_bug.cgi?id=1716 XMMS bug 1716], [http://bugs.xmms.org/show_bug.cgi?id=2009 XMMS bug 2009] and [http://bugs.xmms.org/show_bug.cgi?id=1991 XMMS bug 1991]
 +
 
 +
You also need to disable mmap and increase the buffer and period time in the advanced options.
 +
 
 +
=== No sound after suspending to RAM ===
 +
Fortunately it is not necessary to remove and reinsert the snd-intel8x0 module. Simply mute and unmute all the mixer controls using alsamixer or amixer. You might want to create the following script and run it after your suspend commands:
 +
#!/bin/bash
 +
mixers="Master PCM CD"
 +
for mixer in $mixers ; do
 +
  amixer sset $mixer mute
 +
  amixer sset $mixer unmute
 +
done
 +
 
 +
Other mixers you might want to add are Line (Line in on the laptop) and Aux (Line in on the docking station).
 +
Note that the case of the mixer names is important ("Master" not "master").
 +
 
 +
=== ThinkPads this chip may be found in ===
 
* {{A21e}}, {{A22e}}
 
* {{A21e}}, {{A22e}}
 
* {{A30}}, {{A30p}}
 
* {{A30}}, {{A30p}}
Line 43: Line 94:
 
* {{i1300}}, {{i1330}}, {{i1370}}
 
* {{i1300}}, {{i1330}}, {{i1370}}
  
[[Category:Components]]
+
[[Category:Audio Devices]]

Latest revision as of 14:20, 15 November 2020

CS4299

This is a Cirrus Logic AC'97 Audio codec

This chip is sometimes incorrectly called CS4229 in IBM documentation

Features

  • Chipset: CS4299
  • Interface: AC'97 2.1

Linux ALSA driver

This sound chip is supported by the snd-intel8x0 kernel module.

T23 Fast Sound

On at least one t23 (mine) the ALSA intel8x0 driver plays sound too fast. The following /etc/asound.conf restores normal operation:

  pcm.intel8x0-hw {
  type hw
  card 0
  }
  
  pcm.!default {
  type plug
  slave.pcm "intel8x0"
  }
  
  pcm.intel8x0 {
  type dmix
  ipc_key 1234
  slave {
  pcm "hw:0,0"
  period_time 0
  period_size 512
  buffer_size 4096
  rate 44100
  }
  }
  
  ctl.intel8x0-hw {
  type hw
  card 0
  }


Dmixing

The CS4299 is not capable of hardware mixing. This means that only one sound stream can be played at any time. You must get the software to do the mixing for it (this will load your CPU). The ALSA implementation of this is called DMIX. You can also run sound servers like ESD or ArtsD, but not all applications will use them. Recent ALSA distributions have dmixing setup and enabled by default.

Otherwise just add the following to /etc/asound.conf :

  pcm.dsp0 {
      type plug
      slave.pcm dmix
  }
  # mixer0 can stay unchanged, because
  # it isn't used anyway, I guess ;)
  ctl.mixer0 {
      type hw
      card 0
  }

Now the only problem is how to tell applications to use the DMIX channel instead of dsp0. Most applications work by specifying "dmix" as the device. For command line apps use "aoss".

Hint: XMMS does not work well with dmix and the intel8x0. You will probably need to patch and recompile.

See: XMMS bug 1716, XMMS bug 2009 and XMMS bug 1991

You also need to disable mmap and increase the buffer and period time in the advanced options.

No sound after suspending to RAM

Fortunately it is not necessary to remove and reinsert the snd-intel8x0 module. Simply mute and unmute all the mixer controls using alsamixer or amixer. You might want to create the following script and run it after your suspend commands:

#!/bin/bash
mixers="Master PCM CD"
for mixer in $mixers ; do
  amixer sset $mixer mute
  amixer sset $mixer unmute
done

Other mixers you might want to add are Line (Line in on the laptop) and Aux (Line in on the docking station). Note that the case of the mixer names is important ("Master" not "master").

ThinkPads this chip may be found in