any port use /dev/dsp directly?

Gary Kline kline at
Thu Jan 14 02:42:46 UTC 2010

On Wed, Jan 13, 2010 at 08:37:46PM -0500, Glen Barber wrote:
> Gary Kline wrote: 
> > 
> > 	I have a couple short programs where I mess with /dev/dsp.  I'll open
> > 	check to be sure the speed is right, open in mono or stereo, &c.  is 
> > 	there anything is ports that uses this dev by opening, doing ioctls and 
> > 	so forth?
> > 
> > 	I think I may need to flush my data before closing the FILE *FP. Not
> > 	sure; just guessing.
> > 
> I don't know if this directly answers your question, but from sound(4):
> hw.snd.default_unit
> 	Default sound card for systems with multiple sound cards.  When
> 	using devfs(5), the default device for /dev/dsp.  Equivalent to a
> 	symlink from /dev/dsp to /dev/dsp${hw.snd.default_unit}.
> FWIW, www/linux-f10-flashplugin10 is using /dev/dsp0.0 on my system at the
> moment.
> Regards,

	Thanks, but I already read the sound man page.  I am trying to emulate 

	/bin/cat WAVEFILE > /dev/dsp

	which works well by opening /dev/dsp, making sure everything is set,
	the writing the bytes of the WAVEFILE thru/into the device with a 
	write() call.  It works, the sound echoes, but at the end is an ugly 
	HISSing or FIZZZZ sound.  

	Anybody seen anything like this?  Doesn't hurt to ask, given the
	brainpower on this list.  But this may be something I have got to
	figure out.

	(There doesn't seem to be any way of getting rid of that annoying 
	HISS.  ... .)

	thanks, Glen and everybody else,


> -- 
> Glen Barber

 Gary Kline  kline at  Public Service Unix
    The 7.79a release of Jottings:

More information about the freebsd-questions mailing list