MavEtJu's Distorted View of the World - 2004-03

Sound hickups during disk access
Multiple applications accessing /dev/dsp under FreeBSD

Back to index

Sound hickups during disk access

Posted on 2004-03-23 13:52:12, modified on 2006-01-09 16:29:21
Tags: Computers, FreeBSD

Recently I changed two things on my computer. 1. I upgraded to FreeBSD 5.2.1 and 2. I installed a bigger harddisk.

When using the soundcard (playing MP3s, listening to the radio, watching movies), the sound got bargled (hickupped, prrrrrtzed, whatever you call it) for a split second, after which it continued as normal.

Annoying, specially if you are singing along. Guido van Rooij (former collegue, fellow FreeBSD user etc) told me to change the buffersize on the sound card to 16Kb:

[~] edwin@k7>sysctl hw.snd.pcm0.buffersize
hw.snd.pcm0.buffersize: 16384

To do this, requires a change in /boot/device.hints:

[~] edwin@k7>grep pcm /boot/device.hints
hint.pcm.0.buffersize=16384

and a reboot. Since this change my MP3s play smoothly.


Show 2 comments | Share on Facebook | Share on Twitter

Multiple applications accessing /dev/dsp under FreeBSD

Posted on 2004-03-06 15:23:22, modified on 2006-01-09 16:29:21
Tags: Computers, FreeBSD

[~] root@k7>sysctl hw.snd.pcm0.vchans
hw.snd.pcm0.vchans: 0

If you set this to a higher number (I have four), multiple applications can access the /dev/dsp device at the same time:

[~] edwin@k7>lsof -n | grep dsp
mplayer   16352 edwin    9w    VCHR  30,131075 0t40194048      218 /dev/dsp0.2
xmms      99819 edwin   10w    VCHR       30,3 0t22636544       34 /dev/dsp0.0

Finally I can play games and listening to the radio at the same time!


No comments | Share on Facebook | Share on Twitter