Sound


 * Проигрывание звука
 * Перенаправление звука
 * Audio
 * Настройка записи звука
 * Настройка проигрывания звука
 * Запись звука

http://wiki.freebsd.org/Sound

In Audacity, set the drop down box for recording source to vol. With the mixer set the rec vol to a low number so you don't clip the signal until you see how things work. Something like: Code: mixer rec 8
 * audacity

You may have to adjust the IGain, mine is at 53. Press the record button on Audcity. This works for me, FreeBSD 8. The likely problem is that Audacity is not configured for your sound card. If you were to click through the menus (Edit > Preferences) to the "Audio I/O" tab will reveal what Audacity thinks your sound card is. On mine, for example, the entry was /dev/dsp which was wrong. To solve the problem:

[AudioIO] PlaybackDevice=/dev/pcm0 RecordingDevice=/dev/pcm0
 * Find the hidden audacity configuration "dot file" (.audacity) in your home directory.
 * Copy it to .audacity.old so you can have it as a back up.
 * Open .audacity in a text editor.
 * Find the section labeled [AudioIO] and change the /dev/whatever to the name of your sound device. For my Intel/AC'97 snd_ich, it was /dev/pcm0. See the Code box below.
 * Save the file and restart Audacity.
 * Select "Vol" in the pick-box as the sound source.

Настройка звука
Если драйвер неизвестен, то грузить sound.ko - он загрузит все или несколько модулей и звук заработает, скорее всего.

asus p5k-v

dmesg pci0:  at device 27.0 (no driver attached)

pciconf -lv none0@pci0:0:27:0:     class=0x040300 card=0x829f1043 chip=0x293e8086 rev=0x02 hdr=0x00 vendor    = 'Intel Corporation' device    = '82801IB/IR/IH (ICH9 Family) HD Audio Controller' class     = multimedia subclass  = HDA

Сначала пытался по ошибке воспользоваться snd_ich.ko kldload /boot/kernel/snd_hda.ko kldstat Id Refs Address           Size     Name 1   7 0xffffffff80100000 c9fe20   kernel 3   2 0xffffffff80e22000 39570    sound.ko 4    1 0xffffffff80e5c000 141b6    snd_hda.ko

cat /dev/sndstat FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64) Installed devices: pcm0:  (play/rec) default pcm1:  (play/rec) pcm2:  (play)

dmesg hdac0:  mem 0xf7ff8000-0xf7ffbfff irq 22 at device 27.0 on pci0 hdac0: HDA Driver Revision: 20100226_0142 hdac0: [ITHREAD] hdac0: HDA Codec #0: Realtek ALC883 pcm0:  at cad 0 nid 1 on hdac0 pcm1:  at cad 0 nid 1 on hdac0 pcm2:  at cad 0 nid 1 on hdac0

pciconf -lv hdac0@pci0:0:27:0:     class=0x040300 card=0x829f1043 chip=0x293e8086 rev=0x02 hdr=0x00 vendor    = 'Intel Corporation' device    = '82801IB/IR/IH (ICH9 Family) HD Audio Controller' class     = multimedia subclass  = HDA

Устройства /dev/dsp и /dev/pcm не появляются, хотя музыка в FF4 HTML5 играет (с рывками)

Похоже, dsp создается после запуска команды mixer

The device nodes /dev/dsp* will be created automatically when needed. If they are not used, they do not exist and will not appear in the output of ls(1).

dsp0.0 dsp1.0 dsp2.0

играет cat install-notes.txt > /dev/dsp0.0

 You should be able to bring up the microphone volume in the mixer and hear it in your speakers or headphones:

% mixer mic 100 Setting the mixer mic to 100:100. %

For recording from the microphone, I normally select the recording source with mixer and set the record level with the rec device:

% mixer =rec mic mic 100 Setting the mixer mic to 100:100. Recording source: mic %

As a test you can copy from /dev/audio to a file and vice-versa for playback:

% cp /dev/audio test.au   ^C [after several seconds of recording] % cp test.au /dev/audio %



По номеру PCM можно указывать sysctl hw.snd.default_unit=n

/etc/sysctl.conf hw.snd.default_unit=4

snd_hda_load="YES" в /boot/loader.conf

mixer -f /dev/mixer0 Mixer vol     is currently set to  75:75 Mixer pcm     is currently set to  75:75 Mixer speaker is currently set to  75:75 Mixer line    is currently set to  75:75 Mixer mic     is currently set to   0:0 Mixer mix     is currently set to   0:0 Mixer rec     is currently set to  75:75 Mixer igain   is currently set to   0:0 Recording source: mic Mixer vol     is currently set to  75:75 Mixer pcm     is currently set to  75:75 Mixer speaker is currently set to  75:75 Mixer mix     is currently set to   0:0 Mixer rec     is currently set to  75:75 Mixer igain   is currently set to   0:0 Mixer monitor is currently set to  75:75 Recording source: monitor Mixer vol     is currently set to  75:75 Mixer pcm     is currently set to  75:75
 * 1) mixer -f /dev/mixer1
 * 1) mixer -f /dev/mixer2

а микрофон работает только при подключении к задней панели. куда копать?

mixer =rec mix

p5q-em
После обновления с 7 до 8 перестало выводится в порт на передней панели, который подключен косичкой. На задней панели с 6 jack-ами, выводят все 4 одновременно кроме микрофона и Line-In.

Контроллер на материнской плате P5Q-EM none0@pci0:0:27:0:     class=0x040300 card=0x82fe1043 chip=0x3a3e8086 rev=0x00 hdr=0x00 vendor    = 'Intel Corporation' device    = 'HD Audio Controller' class     = multimedia subclass  = HDA

cat /dev/sndstat  FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386) Installed devices: pcm0:  at ? kld snd_uaudio [MPSAFE] (1p:1v/0r:0v channels simplex default) 

mixer Mixer vol     is currently set to  75:75 Mixer pcm     is currently set to  27:27

sysctl -aeh | egrep "snd|pcm"  hw.snd.feeder_rate_quality=1 hw.snd.feeder_rate_round=25 hw.snd.feeder_rate_max=2016000 hw.snd.feeder_rate_min=1 hw.snd.feeder_rate_polyphase_max=183040 hw.snd.feeder_rate_presets=100:8:0.85 100:36:0.92 100:164:0.97 hw.snd.feeder_eq_exact_rate=0 hw.snd.feeder_eq_presets=PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000 hw.snd.vpc_reset=0 hw.snd.vpc_0db=45 hw.snd.vpc_autoreset=1 hw.snd.latency_profile=1 hw.snd.latency=5 hw.snd.report_soft_matrix=1 hw.snd.report_soft_formats=1 hw.snd.compat_linux_mmap=0 hw.snd.vpc_mixer_bypass=1 hw.snd.verbose=1 hw.snd.maxautovchans=16 hw.snd.default_unit=0 hw.snd.version=2009061500/i386 hw.snd.default_auto=0 dev.pcm.0.%desc=USB audio dev.pcm.0.%driver=pcm dev.pcm.0.%parent=uaudio0 dev.pcm.0.play.vchans=1 dev.pcm.0.play.vchanmode=fixed dev.pcm.0.play.vchanrate=48000 dev.pcm.0.play.vchanformat=s16le:2.0 dev.pcm.0.buffersize=0 dev.pcm.0.bitperfect=0 dev.pcm.1.%desc=HDA Realtek ALC888 PCM #0 Analog dev.pcm.1.%driver=pcm dev.pcm.1.%parent=hdac0 dev.pcm.1.play.vchans=1 dev.pcm.1.play.vchanmode=fixed dev.pcm.1.play.vchanrate=48000 dev.pcm.1.play.vchanformat=s16le:2.0 dev.pcm.1.rec.vchans=1 dev.pcm.1.rec.vchanmode=fixed dev.pcm.1.rec.vchanrate=48000 dev.pcm.1.rec.vchanformat=s16le:2.0 dev.pcm.1.buffersize=16384 dev.pcm.1.bitperfect=0 dev.pcm.2.%desc=HDA Realtek ALC888 PCM #1 Analog dev.pcm.2.%driver=pcm dev.pcm.2.%parent=hdac0 dev.pcm.2.play.vchans=1 dev.pcm.2.play.vchanmode=fixed dev.pcm.2.play.vchanrate=48000 dev.pcm.2.play.vchanformat=s16le:2.0 dev.pcm.2.rec.vchans=1 dev.pcm.2.rec.vchanmode=fixed dev.pcm.2.rec.vchanrate=48000 dev.pcm.2.rec.vchanformat=s16le:2.0 dev.pcm.2.buffersize=16384 dev.pcm.2.bitperfect=0 dev.pcm.3.%desc=HDA Realtek ALC888 PCM #2 Digital dev.pcm.3.%driver=pcm dev.pcm.3.%parent=hdac0 dev.pcm.3.play.vchans=1 dev.pcm.3.play.vchanmode=passthrough dev.pcm.3.play.vchanrate=48000 dev.pcm.3.play.vchanformat=s16le:2.0 dev.pcm.3.buffersize=16384 dev.pcm.3.bitperfect=0 dev.pcm.4.%desc=HDA Realtek ALC888 PCM #3 Digital dev.pcm.4.%driver=pcm dev.pcm.4.%parent=hdac0 dev.pcm.4.play.vchans=1 dev.pcm.4.play.vchanmode=passthrough dev.pcm.4.play.vchanrate=48000 dev.pcm.4.play.vchanformat=s16le:2.0 dev.pcm.4.buffersize=16384 dev.pcm.4.bitperfect=0 dev.pcm.5.%desc=HDA Intel G45 HDMI PCM #0 Digital dev.pcm.5.%driver=pcm dev.pcm.5.%parent=hdac0 dev.pcm.5.play.vchans=1 dev.pcm.5.play.vchanmode=passthrough dev.pcm.5.play.vchanrate=48000 dev.pcm.5.play.vchanformat=s16le:2.0 dev.pcm.5.buffersize=16384 dev.pcm.5.bitperfect=0 

Создаем файл автозагрузки для настройки микшера (Если кто знает способ лучше пишите) ls -la /usr/local/etc/rc.d/000.mixer.sh -rwxr--r-- 1 root  wheel  174 Apr 24 10:08 /usr/local/etc/rc.d/000.mixer.sh Содержаение  #!/bin/sh su root -c '/usr/sbin/mixer rec 75 1>/dev/null 2>&1' su root -c '/usr/sbin/mixer igain 75 1>/dev/null 2>&1' su root -c '/usr/sbin/mixer =rec line 1>/dev/null 2>&1' # если нужен еще одно устройство записи то добавляем строчку: cat /usr/local/etc/rc.d/000.mixer.s > /dev/dsp0.1 # и так далее, почему то sysctl hw.snd.pcm0.vchans=4 не работает, видимо в 7 фряхе # как то по другому, если знаете поправьте </PRE>

Лог OSS /var/log/soundon.log


 * handbook
 * http://rrv.nsk.ru/wiki/index.php/%D0%97%D0%B0%D0%BF%D0%B8%D1%81%D1%8C_%D1%81_%D0%BB%D0%B8%D0%BD%D0%B5%D0%B9%D0%BD%D0%BE%D0%B3%D0%BE_%D0%B2%D1%85%D0%BE%D0%B4%D0%B0