LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-18-2006, 04:39 PM   #1
Murdock1979
Member
 
Registered: Oct 2003
Distribution: Slackware Debian VectorLinux
Posts: 429
Blog Entries: 2

Rep: Reputation: 30
Alsa device files


Hello!

My ALSA is working ok, but when I try to
cat soundfile > /dev/snd/pcmC0D0c
it doesn't work. I tried to cat to the other pcmD0C0 files in the directory, and cat returns invalid argument or invalid descriptor error.

Are these the correct ALSA device files? If so, how do I access them?

Thanks,
Murdock
 
Old 03-18-2006, 05:56 PM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
try /dev/dsp
which is a symlink to:
/dev/sound/dsp
or /dev/audio
which is a symlink to:
/dev/sound/audio
 
Old 03-18-2006, 06:04 PM   #3
dmartins
Member
 
Registered: Oct 2005
Location: Ontario, Canada
Distribution: Arch, Gentoo
Posts: 98

Rep: Reputation: 15
/dev/dsp is for OSS, or for ALSA with OSS emulation.
If you want to stick with ALSA, try the aplay command. It accepts files on it's standard input so you could try cat soundfile | aplay or even just aplay soundfile.
 
Old 03-19-2006, 12:23 AM   #4
Murdock1979
Member
 
Registered: Oct 2003
Distribution: Slackware Debian VectorLinux
Posts: 429

Original Poster
Blog Entries: 2

Rep: Reputation: 30
Thanks All!

However, there are many programs that need to access the device files directly, such as recording programs, and aplay is insufficient.

For these programs, I could active OSS emulation, and send it to /dev/dsp, but there must be a better way.

aplay in fact does work, but I need to access Alsa files as I would OSS device files.

Also, why can't I access them through pcmC0D0 files?

Thanks,
Murdock
 
Old 03-19-2006, 12:33 AM   #5
bluelightning
Member
 
Registered: Mar 2006
Location: Redmond, WA
Distribution: FC4, WinXP Pro
Posts: 37

Rep: Reputation: 15
Someone may have a more technical answer for why you can't use pcmC0D0, but as I understand it, the file is in the wrong format.

I too find kernel OSS emulation insufficient. The problem is that only one device can use the emulation at a time. You also cannot use software mixing, routing, or any othe other asound configuration options with it.

I've found aoss to work better. It will emulate the OSS devices on a per application basis, and it will redirect them to your default ALSA device (which could be a software mixing dmix device).
 
Old 03-19-2006, 07:39 AM   #6
Murdock1979
Member
 
Registered: Oct 2003
Distribution: Slackware Debian VectorLinux
Posts: 429

Original Poster
Blog Entries: 2

Rep: Reputation: 30
I'll look into aoss.

You see, in the KDE sound control tab, if I want to override the default device, what should I put in? In fact, what is the default device anyway?

I'm not using OSS, so it's not dsp or the equivalent.

Thanks,
Murdock
 
Old 03-19-2006, 11:39 PM   #7
bluelightning
Member
 
Registered: Mar 2006
Location: Redmond, WA
Distribution: FC4, WinXP Pro
Posts: 37

Rep: Reputation: 15
Sorry, I don't know much about KDE, but on my computer it supports several different APIs to access the sound card. OSS and ALSA are among those. Assuming you decide to use ALSA, the default device is "default" (no quotes). Other likely choices are "hw:0,0", "hw:1,0", and "hw:0,1".

The correct way to configure ALSA devices is through the asound.conf file. You'll see that the default device is defined in there. You can also rearrange the speakers or enable software mixing in asound.conf.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Able to write files to MP3 player but no files written into actual device? olnex Linux - Hardware 0 11-11-2005 06:32 AM
default alsa device? tw001_tw Slackware 3 10-21-2004 11:20 AM
ut2004 alsa device korq7 Linux - Software 0 09-29-2004 03:28 PM
ALSA error: ALSA device "default" is already in use by another program. darkleaf Linux - Software 2 07-20-2004 04:34 PM
Where is my device with alsa? HoT_BeL Slackware 12 02-23-2004 08:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration