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
Testing Sound Channels

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

Last week we learned how to configure soundcards for playback with ALSA. It's easy, it works on all Linuxes, it doesn't create conflicts or introduce latency, and it doesn't require the X Window System. Today we're going to use ALSA for recording, and learn how to test our sound system.

A quick and horrid way to see if sound is working is to pipe the contents of a file to dev/dsp:

$ cat  /dev/urandom > /dev/dsp

A more pleasant way is to use alsa-utils. It includes a number of useful commands for testing your setup. The speaker-test command tests your speaker channels. This example is for a simple two-speaker stereo setup:

$ speaker-test -t wav -D plug:front -c2 -l2  

speaker-test 1.0.14

Playback device is plug:front
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 16 to 16384
Period size range from 8 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
 0 - Front Left
 1 - Front Right
Time per period = 2.731660
 0 - Front Left
 1 - Front Right
Time per period = 2.986495

You should hear a pleasant woman's voice saying "Front left, front right". -c2 means two channels, and -l2 means run the test twice.

It's common to have 5:1 surround sound even with onboard sound chips, so you can test this too:

$ speaker-test -t wav -D plug:surround51 -c6 -l2 

Note how the different channels are numbered. To test a single speaker, select it with the -s option. This example generates a sine wave tone at 45 Hz, which sounds like power hum, on the LFE channel:

$ speaker-test -t sine -f 45 -D plug:surround51 -c6 -s6 

Beware the channel-numbering gotcha- speaker-test output numbers from zero, but the -s option starts from one. Aren't computers fun!

LFE means Low Frequency Effects, which usually means your subwoofer. Of course it's more complex than that; see What is the LFE Channel? for more information.

Next: Digging Into Sound Cards »

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