Home | Hardware | Internet News |Web Hosting |IT Management |Network Storage
LinuxPlanet
Search 
  Power Search | Tips 

 Front Door
 Discussion
 LinuxEngine
 Opinions
 Reports
 Reviews
 Tutorials
 News
 Technology Jobs

 Browse by subject.
Free Newsletter

Linux Planet
Linux Today
More Free Newsletters

Be a Commerce Partner


















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Print this article
Email this article

   LinuxPlanet / Tutorials



Better Linux Sound Managment With ALSA, Part 2
Digging Into Sound Cards

Carla Schroder
Thursday, March 6, 2008 09:28:40 AM

How do you know what type of output your sound card supports? aplay tells the tale:

$ aplay -L
front:CARD=V8237,DEV=0
    VIA 8237, VIA 8237
    Front speakers
surround40:CARD=V8237,DEV=0
    VIA 8237, VIA 8237
    4.0 Surround output to Front and Rear speakers
surround41:CARD=V8237,DEV=0
    VIA 8237, VIA 8237
    4.1 Surround output to Front,
        Rear and Subwoofer speakers
surround50:CARD=V8237,DEV=0
    VIA 8237, VIA 8237
    5.0 Surround output to Front, 
        Center and Rear speakers
surround51:CARD=V8237,DEV=0
    VIA 8237, VIA 8237
    5.1 Surround output to Front, Center, 
       Rear and Subwoofer speakers
iec958:CARD=V8237,DEV=0
    VIA 8237, VIA 8237
    IEC958 (S/PDIF) Digital Audio Output

If you ever need to specify the PCM device, this is where you find it: front, surround40, surround41, and so forth are PCM devices that should have been created automatically at startup. You could test these with aplay, like this:

$ aplay -D front test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian,
 Rate 44100 Hz, Stereo

You may also also test playback by using the card+device numbers. This is sort of a "raw" test, since it doesn't depend on having a correct PCM devices configuration, but uses the card IDs assigned by the kernel. aplay -l shows the "raw" card+device numbers. 0,0 is the first device, 1,0 is the second device, and so on:

$ aplay -D hw:1,0 test.wav
If you have a second sound device, such as a USB headset, you can configure the PCM device names either globally in /etc/asound.conf or per-user in ~.asoundrc. Something as simple as this works just fine:
pcm.v8237 {type hw card V8237}
ctl.v8237 {type hw card V8237}
pcm.headset {type hw card Headset}
ctl.headset {type hw card Headset}

For pcm.v8237, the pcm part is required. The v8237 can be anything you want, and the same goes for the ctl lines. type hw card is required; V8237 and Headset come from the output of aplay -l. You could also use asoundconf:

$ asoundconf list
Names of available sound cards:
V8237
Headset

Now instead of using aplay -D hw:1,0 test.wav I can use aplay -D headset test.wav. You want to use the names (V8237, Headset) in your configuration file instead of the kernel IDs (0,0- 1,0), because the kernel IDs can change, especially udev devices.

Next: Recording With ALSA »

Skip Ahead

1 Testing Sound Channels
2 Digging Into Sound Cards
3 Recording With ALSA





Linux is a trademark of Linus Torvalds.


internet.com home | search | help! | about us

Jupiter Online Media

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers