This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: /dev/dsp not making sounds


On Mon, 7 Jun 2004, Buchbinder, Barry (NIH/NIAID) wrote:

> /dev/dsp is not working for me currently.  It gives an error message on
> the console and no sound from the speakers, which echo '^G' shows are
> working. /dev/null is working as expected.
>
> I reinstalled cygwin -- no improvement.
>
> I played a bit with it to see if the error messages might give a hint.  No
> such luck for me but maybe it will say something to one of the cygwizards.
>
> /c/WINDOWS/Media> cat TADA.WAV > /dev/dsp
> cat: write error: Permission denied
> /c/WINDOWS/Media> cat tada.wav > /dev/null
> /c/WINDOWS/Media> cmd /c type tada.wav > /dev/dsp
> The handle is invalid.
> /c/WINDOWS/Media> cat tada.wav | tr 'x' 'x' > /dev/dsp
> tr: write error: Permission denied
> tr: write error
> /c/WINDOWS/Media> cat tada.wav | tr 'x' 'x' > /dev/null

I can confirm the above errors on Win2k, same Cygwin version.

> /c/WINDOWS/Media> cat tada.wav | tr 'x' 'x' | /dev/dsp
> bash: /dev/dsp: No such file or directory
>
> - Barry

Umm, this last one is weird...

Here are a couple of other datapoints:

$ echo $BASH_VERSION
2.05b.0(1)-release
$ pwd
/cygdrive/c/WINNT/Media
$ cp tada.wav /dev/dsp			# <A SOUND IS HEARD>
$ echo "`cat tada.wav`" > /dev/dsp	# <NO SOUND IS HEARD, NO ERROR>
$ sh -c "cat tada.wav > /dev/dsp"	# <NO SOUND IS HEARD, NO ERROR>
$ sh -c "cat tada.wav" > /dev/dsp
cat: write error: Permission denied
$

Strace of the erring command seems to show that it's a dup() call gone
wrong, here's the relevant snippet:

243644  690710 [main] bash 2924 fhandler_dev_dsp::Audio_out::query: freq=8000 bits=8 channels=1 OK
  268  690978 [main] bash 2924 fhandler_dev_dsp::open: ACCMODE=0x00000001 audio_in=00000000 audio_out=0A056FC0, rc=1
  143  691121 [main] bash 2924 open: 3 = open (/dev/dsp, 0x601)
  238  691359 [main] bash 2924 dtable::dup2: dup2 (3, 1)
  119  691478 [main] bash 2924 fhandler_dev_dsp::fhandler_dev_dsp: 0x616D1650
  116  691594 [main] bash 2924 build_fh_pc: fh 0x616D1650
  115  691709 [main] bash 2924 fhandler_dev_dsp::dup:
  108  691817 [main] bash 2924 fhandler_base::set_flags: flags 0x10601, supplied_bin 0x0
  113  691930 [main] bash 2924 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
  124  692054 [main] bash 2924 fhandler_base::set_flags: filemode set to binary
  109  692163 [main] bash 2924 dtable::dup_worker: duped '/dev/dsp' old 0x0, new 0x0
                                                                        ^^^      ^^^
  111  692274 [main] bash 2924 dtable::dup2: newfh->io_handle 0x0, oldfh->io_handle 0x0
  130  692404 [main] bash 2924 close: close (1)

The first line shows that /dev/dsp actually works.  I can provide more
info on request if anyone's interested.  I'll also try to investigate as
time permits.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]