Linux/Sparc audio
Sound for your Sparc
Everything you wanted to know about audio for Sun SparcStations and clones running Linux, and then some.
Linux/Sparc audio drivers
Linux/Sparc is at the forefront of audio support for free operating systems for the Sparc platform. Why? Because we like music just as much as you do. (Me more than most, perhaps?)
There's no reason you shouldn't be able to use your Sparc hardware every bit as fully in this respect as a PC (at least with the more recent systems.)
All you need to get started is a machine running one of the Linux distributions for Sparc processors. Grab an audio snapshot from ftp://ftp.dementia.org/pub/linux/sparc/audio, compile, set up devices, and start enjoying audio.
Heck, if you have a recent 2.2 or 2.3 kernel, you probably don't even need to do this, what you have should just work!
While some older kernels don't match the minor device assignments currently used, the audio snapshots do, and you should be using these anyway.
All devices are character devices with major number 14.
mixer: 0
sequencer: 1 (not supported)
midi: 2 (not supported)
dsp: 3
audio: 4
dsp16: 5 (untested)
sndstat: 6 (not supported)
audioctl:7
sequencer l2: 8 (not supported)
sndproc: 9 (not supported)
Additional sound devices are offset 16 (e.g. mixer1 is 16, audio1 is 20, etc.).
The audioctl device is for compatibility with SunOS and Solaris, and allows only ioctls, not reading or writing.
Its name is the audio device plus the string "ctl", so properly the audioctl device for the second audio card would be audio1ctl.
audio0 and audio0ctl links to the first set of devices may be useful.
Sun audio applications expect that the AUDIODEV environment variable can be used to override the default /dev/audio choice.
Sparc audio hardware
CS4231
Sun calls the audio hardware in the SS4, SS5 and the Ultras "audiocs".
It supports monaural microphone and stereo line in, headphone, and line out ports.
There is support for direct audio input from the internal cdrom on some systems;
Sun claims NO UltraSparc systems support it, but I have not verified this.
The SS10/LX speakerbox units do not work with this audio hardware.
There is no way to determine if headphone or microphone are plugged in.
The SS4 does not ship with audio support;
Instead an add-on module must be purchased and installed.
The SunMicrophone II (and not the I) is appropriate for use with this hardware.
This microphone does not provide a battery like the older microphones, instead relying on the audio hardware to provide power.
Sparc machines with audiocs have a Crystal Semiconductor 4231A codec.
Machines with an sbus use an APC (STP2024) DMA controller.
PCI machines use the ebus for DMA.
DBRI
The LX, SS10, and SS20, as well as the Tadpole Sparcbook 3 and the Sun SparcStation Voyager portables use dbri for audio.
Some of these machines have onboard isdn provided by the DBRI.
Most DBRI-equipped systems have an interface for the Sun SpeakerBox.
It provides a speaker, and stereo line out, stereo line in, stereo headphone, and monaural microphone connections.
LX systems also have a codec onboard (SpeakerBoxes have one integral) and so can be used without the SpeakerBox.
The onboard interface lacks line in and line out support.
DBRI systems should utilize the SunMicrophone I.
Sparc machines with dbri have an AT&T T5900FC isdn interface.
LX machines and Sun SpeakerBoxes have Crystal Semiconductor 4215 codecs.
The 4215 uses a time-based data transfer mechanism with pipes fed by the DBRI.
AMD 79c30
All sun4c machines, the SparcServer 6xx series, and the SparcClassic use the AM79C30A Digital Subscriber Controller (an isdn chip) for audio.
Machines provide connectors for microphone and headphone.
The 79c30 supports only monaural audio;
Some machines also have an onboard monaural speaker.
As I already mentioned, the 79C30 is actually an isdn controller that Sun used for audio on these machines.
It uses byte-at-a-time data transfer, which effectively makes it very slow.
Recap
If you didn't get it above, here's the info in table form.
For some reason Lynx hates these tables. I apologize.
Who's got what
Model |
amd |
dbri |
4231(apc) |
4231(ebus) |
sun4c pizza boxes |
SS1 |
X |
|
|
|
SS1+ |
X |
|
|
|
SS2 |
X |
|
|
|
sun4c monitor boxes |
SLC |
X |
|
|
|
ELC |
X |
|
|
|
sun4c cake boxes |
IPC |
X |
|
|
|
IPX |
X |
|
|
|
sun4m cake boxes |
Classic (LC) |
X |
|
|
|
LX (ZX) |
|
X |
|
|
sun4m portables |
Voyager |
|
X |
|
|
sun4m pizza boxes |
10 |
|
X |
|
|
20 |
|
X |
|
|
4 |
|
|
X* |
|
5 |
|
|
X |
|
sun4u deep dish pizza boxes |
Ultra 1 |
|
|
X |
|
Ultra 2 |
|
|
X |
|
sun4u pci machines |
Ultra 5 |
|
|
|
X |
Ultra 10 |
|
|
|
X |
Ultra 30 |
|
|
|
X |
Ultra 60 |
|
|
|
X |
* - Requires purchase of SS4 audio module.
Support in Linux/Sparc
audio hardware |
kernel version |
dma |
play |
record |
16 bit |
isdn |
amd 79c30 |
2.2 |
| X
| X
|
| X
|
amd 79c30 |
2.3 |
| X
| X
|
| X
|
dbri |
2.2 |
| X
|
|
|
|
dbri |
2.3 |
| X
|
|
|
|
cs4231 (ebus dma) |
2.2 |
X
| X
| X
| X
|
|
cs4231 (ebus dma) |
2.3 |
X
| X
| X
| X
|
|
cs4231 (apc dma) |
2.2 |
X
| X
| X
| X
|
|
cs4231 (apc dma) |
2.3 |
X
| X
| X
| X
|
|
State of audio support
We currently have:
- Support for SunOS, Solaris, OSS PCM, some NetBSD, and some OSS Mixer ioctls
- Support for SunOS/Solaris audio streams emulation for binary compatibility.
The OSS mixer ioctl support was heavily reworked in August 1999 to behave more like a PC, and to simply behave better. Control of each input and output is now possible using e.g. aumix.
The SunOS emulation allows raplayer to work; Hopefully rvplayer (5.0) will work under Solaris emulation.
Linux/Sparc audio info in a Sun world
While I won't say I "miss" audio on my SunOS machine, there were certain tools it had that I really liked. One was audiotool. Another were the play/record that the audio demos had. The really useful one, especially now that we have a dummy audio driver which you can cat from, is raw2audio.
Currently I use audioctl as a replacement for audiotool. It's ported from the NetBSD version of same, with slight changes for SparcLinux.
tplay makes a nice replacement for play, but sadly does not come with trecord. One of these days...
raw2audio is a small wrapper around sox which will put an AU header on a raw audio file.
Linux/Sparc audio people
The folks responsible for the bulk of what's present in the Linux/Sparc audio subsystem are:
- Tom Dyas
: - Wrote amd driver and audio midlevel.
- Rudolf Koenig
: - Implemented (incomplete but substantial) DBRI driver.
- Brent Baccala
: - Redesigned significant portion of amd driver to accomodate ISDN; Completing DBRI driver and working on ISDN support.
- David Miller
: - Did most of the work on the cs4231/ebus driver.
- Derrick Brashear
: - Wrote cs4231 driver; Rewrote portions of midlevel to support binary compatibility and DMA.
Other info
We don't have a monopoly on audio support for Sparc.
The good folks who brought you NetBSD support the 4231/apc and the amd79c30 on their systems as well.
If we can't put you behind the wheel of a Linux system today, please give them a try.
4Front Technology supports Linux/x86 and Solaris as well as other platforms.
You might also want to check out the Advanced Linux Sound Architecture project. It's a reasonable alternative to the support that comes bundled in the Linux kernel.
Send questions and comments to shadow@dementia.org.
Last update: November 8, 1998