[PC-BSD Dev] pcm-oss.conf

N V VaNs9 at yandex.ru
Tue Aug 21 07:36:32 PDT 2012


Hi.

Where is //compat/linux/etc/alsa/pcm/pcm-oss.conf file for the linux apps.
It has deafult device configured. I've got usb webcam with intergrated microphone (which appears as hda device).
If I run skype, it doesn't know anything about it, because there is no entry in /compat/linux/etc/alsa/pcm/pcm-oss.conf but only default device. So I've got sound, but buddy on the other side doesn't hear me. If I make microphone hda device (pcm6 here) default one, I've got no sound in Skype of course, but buddy on the other side hears me. :)

Well, imho, there is some ways to fix this:
- pregenerate anough devices in pcm-oss.conf;
- generate device list each time I change sound configuration;
- generate pcm-oss.conf each time sound device configuration changes (using devd, for example).

The last variant seems to be most user friendly and Plug'n'Play-like, but it introduces some kind of automagical staff which (personally) I don't like. But you may find it ok. Here is rough-and-ready prototype for this variant, it may be called by devfs attach/detach events, it may be like webcamd script:
[code]
#!/bin/sh

PCM=`egrep -o 'pcm[0-9]+' /dev/sndstat | egrep -o '[0-9]+'`
cat > /tmp/pcm-oss.conf <<EOF
# pcm-oss plugin configuration

pcm.oss {
        type oss
        device /dev/dsp
        hint {
                description "Open Sound System"
        }
}

ctl.oss {
        type oss
        device /dev/mixer
        hint {
                description "Open Sound System"
        }
}

EOF

for NUM in $PCM; do
  cat >> /tmp/pcm-oss.conf <<EOF
pcm.oss${NUM} {
	type oss
	device /dev/dsp${NUM}
	hint {
		description "Open Sound System Unit ${NUM}"
	}
}

ctl.oss${NUM} {
	type oss
	device /dev/mixer${NUM}
	hint {
		description "Open Sound System Unit ${NUM}"
	}
}

EOF

done

mv /tmp/pcm-oss.conf /compat/linux/etc/alsa/pcm/pcm-oss.conf

[/code]

May be, it is not the time to integrate anything for the /compat/linux/etc/alsa/pcm/pcm-oss.conf, may be it's for the next release.

Regards,
Vans.


More information about the Dev mailing list