LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-31-2006, 10:37 AM   #1
crep
Member
 
Registered: Aug 2004
Location: US
Distribution: Fedora, FBSD, Solaris
Posts: 46

Rep: Reputation: 15
Unhappy /dev/dsp gives just silence


Hello,

I have FC5 on two different laptops (sorry, I don't have a desktop at the moment to test this on).

Both laptops play sound properly.

When I open and read /dev/dsp, however, I simply get silence. /dev/dsp gives values between 0 and 255 (its an 8 bit interface), and when I read it the values are always 127-128, with no variation.

For those of you who aren't coders, here's another proof: 'cat /dev/urandom > /dev/dsp' creates a godawful noise, but 'cat /dev/dsp > file', then 'cat file > /dev/dsp' is just silence.

I've gone through every system menu I can find to enable microphone or line inputs, tryed disabling and enabling software mixing, to no avail.

Anyone know what's up? Thanks a lot...

-Jack Carrozzo
http://www.crepinc.com/
 
Old 08-31-2006, 12:15 AM   #2
MonkeeSage
LQ Newbie
 
Registered: Aug 2006
Distribution: Gentoo
Posts: 4

Rep: Reputation: 0
Same problem here...

Quote:
Originally Posted by crep
Both laptops play sound properly.

When I open and read /dev/dsp, however, I simply get silence. /dev/dsp gives values between 0 and 255 (its an 8 bit interface), and when I read it the values are always 127-128, with no variation.
I'm having the same problem here, using Gentoo (~x86).

For example, I play a sound file:

# play test.wav

and I can hear it fine. Then from another terminal, while it is still playing I do:

# cat /dev/dsp > test.raw

...then after a few seconds I ^C.

test.raw is 80k or so, should have some audio data. But when I cat it back to /dev/dsp...nothing but silence.

Looking at the output:

# python -c "f=open('test.raw', 'rb'); print([ord(c) for c in f.read()]); f.close()"

[128, 128, 128, ..., 128]

:\

vsound doesn't work, either:

# vsound -f test.wav mpg321 -o oss test.mp3
About to start the application. The output will not be available
until the application exits.
...
Missing file ./vsound30269.au.
This means that the libvsound wrapper did not work correctlty.
...

My sndstat looks like:

# cat /proc/asound/oss/sndstat
Sound Driver:3.8.1a-980706 (ALSA v1.0.11rc4 emulation code)
Kernel: Linux SageWare 2.6.17-gentoo-r6 #1 PREEMPT Sun Aug 27 01:36:53 CDT 2006 i686
Config options: 0

Installed drivers:
Type 10: ALSA emulation

Card config:
C-Media PCI CMI8738-MC6 (model 55) at 0xe000, irq 20

Audio devices:
0: C-Media PCI DAC/ADC (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers:
7: system timer

Mixers:
0: CMedia PCI

Regards,
Jordan

Last edited by MonkeeSage; 08-31-2006 at 02:06 AM.
 
Old 08-31-2006, 12:35 AM   #3
crep
Member
 
Registered: Aug 2004
Location: US
Distribution: Fedora, FBSD, Solaris
Posts: 46

Original Poster
Rep: Reputation: 15
yup looks like the same issue to me.

too bad no one has posted any ideas about it...
 
Old 08-31-2006, 01:50 AM   #4
MonkeeSage
LQ Newbie
 
Registered: Aug 2006
Distribution: Gentoo
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by crep
yup looks like the same issue to me.

too bad no one has posted any ideas about it...
Yeah, I know...where are all the linux gurus when you needs 'em (j/k!)

Another strange thing is that I (seemingly) randomly get:

/dev/dsp: Device or resource busy

I mean, I'll be listening to an album in xfmedia (based on libxine), and on one song 'cat /dev/dsp' will throw that error, but 10 minutes later it won't. And /dev/dsp is just a udev alias for /dev/sound/dsp on my system, which is really strange, since when I get that error when trying to read from /dev/dsp, I don't get it when reading from /dev/sound/dsp! Still only silence though...

Oh yeah, and lsof -V /dev/dsp always shows (even when I get the access error listed above):

lsof: no file use located: /dev/dsp

Huh?!! What the...?

My desktop is a few years old shuttle microATX G series, and uses a built-in C-Media sound chip. You're having the same problem on laptops (c-media or ess1371 chips I assume?). Seems like it might be something to do with the alsa driver + our hardware. Like it's not actually using the full duplex (but thinks it is!) or something...just a guess.

Regards,
Jordan

Last edited by MonkeeSage; 08-31-2006 at 02:08 AM.
 
Old 08-31-2006, 10:10 AM   #5
crep
Member
 
Registered: Aug 2004
Location: US
Distribution: Fedora, FBSD, Solaris
Posts: 46

Original Poster
Rep: Reputation: 15
It makes sense that you can't cat /dev/dsp while playing another song, because playing a song puts it in 44.1kHz mode. When you access it directly like we are, generally it's just in "phone" mode, which I beleive is 20 kHz and 8-bit.
 
Old 08-31-2006, 02:01 PM   #6
crep
Member
 
Registered: Aug 2004
Location: US
Distribution: Fedora, FBSD, Solaris
Posts: 46

Original Poster
Rep: Reputation: 15
Just as a test, I checked recording capabilities with audcity (a great recording/editing tool, yum install audacity if you dont have it). I got no signal there either... I'm willing to bet there's some sort of software mixing going on here, that sits bewteen d/ev/dsp and the actual hardware and is muting it. I'll poke around...
 
Old 09-01-2006, 05:29 PM   #7
MonkeeSage
LQ Newbie
 
Registered: Aug 2006
Distribution: Gentoo
Posts: 4

Rep: Reputation: 0
Yeah, it's very strange that the result of reading the device is always effectively 0. You'd think that at least some line noise would get picked up if it were reading the wrong channel on the mixer or something (with all channels unmuted and turned all the way up in alsamixer!). That's what made me wonder if the duplex was broken, with the read end hooked to /dev/null or something, heh. Software muting somewhere down the pipe would explain that I guess. I'm not running esd or arts or anything, though, but I suppose something kernel-level could be the culprit. Let me know if you figure it out!

BTW, I guess the read error would make sense if the sampling rate is wrong! Doh! Thanks for the explanation.
 
Old 09-25-2006, 09:08 PM   #8
MonkeeSage
LQ Newbie
 
Registered: Aug 2006
Distribution: Gentoo
Posts: 4

Rep: Reputation: 0
Bump, Bump!
 
  


Reply



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
no /dev/dsp nor /dev/mixer on 2.6.9 amuro_ray Slackware 9 08-03-2009 02:54 PM
devfs and devfsd don't create /dev/dsp or /dev/sound/dsp ? behmjose Linux - Hardware 2 10-02-2006 12:27 PM
/dev/dsp b123coder Linux - Hardware 3 04-08-2006 07:24 AM
/dev/dsp gone? onelung02 Slackware 7 07-22-2005 12:08 PM
No /dev/dsp /dev/mixer etc david.skinner Linux - Software 2 05-19-2005 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:03 PM.

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