LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2214|回复: 10

(已独创解决,请求加精中)tp600e 在freebsd 5.4下声卡的安装?

[复制链接]
发表于 2005-8-25 17:13:33 | 显示全部楼层 |阅读模式
见了N多贴子,都是FREEBSD 5.21以前版本在600E上安装的。我安的是新版5.4。硬件支持的哪个美啊,比DEBIAN还强。现在中文化了,也用上了FF。不过声卡和以前不一样了。
老版用的是snd_pcm.ko这一个驱动,5.4版 用的是sound.ko,说明见:
http://www.freebsd.org/cgi/man.c ... FreeBSD+5.4-RELEASE
(下面我贴上来吧)
我试了很多次,也参照了老版(5.4以前)的贴子,包括精华贴。总是不行,用kldstat,cat /dev/sndstat,kldload,kldunload.好像设不上IRQ什么的,不过不知道在哪设啊?
照说明写了,没用,和没写一样。dmesg显示irq,什么的都为0.
我用kldstat看,没有sound模块。更不用说snd_driver.ko了。

下面的贴子的最后一页有些相关的,可供参考(freebsd 5.2.1)
解决 IBM Thinkpad600e 声卡问题的一个办法
http://www.linuxsir.cn/bbs/showt ... mp;page=1&pp=15

thankyouverymuch。
 楼主| 发表于 2005-8-25 17:19:11 | 显示全部楼层

新驱动sound.ko主要的说明:

备注:
这个驱动代替了以前的snd_pcm.ko

SOUND(4)               FreeBSD Kernel Interfaces Manual               SOUND(4)

NAME
     sound, pcm, snd -- FreeBSD PCM audio device infrastructure

SYNOPSIS
     For a card with bridge driver support, and a PnP card:
     device sound

     For a card without bridge driver support, and a non-PnP card, the follow-
     ing lines may be required in /boot/device.hints: 注:已实践
     hint.pcm.0.at="isa"
     hint.pcm.0.irq="5"
     hint.pcm.0.drq="1"
     hint.pcm.0.flags="0x0"  注:还试过0x10  ,还加过hint.pcm.0.port="0x52C" 抄的。

DESCRIPTION
     Note: There exists some ambiguity in the naming at the moment (sound,
     pcm, snd).  It will be resolved soon by renaming device sound to device
     snd, and doing associated changes.

     The sound driver provides support for PCM audio play and capture.        This
     driver also supports various PCI, WSS/MSS compatible, ISA sound cards,
     and AC97 mixer.  Once the sound driver attaches, supported devices pro-
     vide audio record and playback channels.  The FreeBSD sound system pro-
     vides dynamic mixing ``VCHAN'' and rate conversion ``soft formats''.
     True full duplex operation is available on most cards.

     If the sound card is supported by a bridge driver, the sound driver works
     in conjunction with the bridge driver.

     Apart from the usual parameters, the flags field is used to specify the
     secondary DMA channel (generally used for capture in full duplex cards).
     Flags are set to 0 for cards not using a secondary DMA channel, or to
     0x10 + C to specify channel C.

     The driver works best with WSS/MSS cards, which have a very clean archi-
     tecture and an orthogonal set of features.  They also happen to be among
     the cheapest audio cards on the market.

     The driver does its best to recognize the installed hardware and drive it
     correctly so the user is not required to add several lines in
     /boot/device.hints.  For PCI and ISA PnP cards this is actually easy
     since they identify themselves.  For legacy ISA cards, the driver looks
     for MSS cards at addresses 0x530 and 0x604 (unless overridden in
     /boot/device.hints).

Supported Cards
     Below we include a list of supported codecs/cards.  If your sound card is
     not listed here, it may be supported by a bridge driver.

     CS4237, CS4236, CS4232, CS4231 (ISA)
         All these cards work perfectly in full duplex using the MSS mode.
         This chipset is used, among others, on the A/Open AW35 and AW32, on
         some Intel motherboards, and (the CS4231) on some non-PnP cards.

         The CS4232 is reported as buggy in the Voxware documentation but I am
         not sure if this is true.  On one of my Intel motherboards, capture
         does not work simply because the capture DMA channel is not wired to
         the ISA DMA controller.

     Yamaha OPL-SAx (ISA)
         Works perfectly in all modes.        This chip is used in several PnP
         cards, but also (in non-PnP mode) on motherboards and laptops (e.g.,
         the Toshiba Libretto).

     OPTi931 (ISA)
         The chip is buggy, but the driver has many workarounds to make it
         work in full duplex because for some time these were the only full
         duplex cards I could find.  U-law format uses U8 format internally
         because of a bug in the chip.

     Trident 4DWave DX/NX (PCI)

     ENSONIQ AudioPCI ES1370/1371 (PCI)
         Creative Labs SoundBlaster PCI is supported as well.

     ESS Solo-1/1E (PCI)

     NeoMagic 256AV/ZX (PCI)

补充一下:
hint.driver.unit.keyword=value
driver 是设备驱动程序名,unit 是设备驱动程序单位名,keyword 是 hint 关键字。关键字可以由以下选项组成:
at:指明设备所绑定的总线
port:指明所使用 I/O 的起始地址。
irq:指明所使用的中断请求号。
drq:指明 DMA channel 号。
maddr:指明设备占用的物理内存地址。
flags:给设备设置各种标志位。
disabled:如果设成 1,设备被禁用。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-25 20:03:29 | 显示全部楼层
大家别烦@,我又总结出两条:

1要在/boot/device.hints里加上
hint.pcm.0.at="isa"
hint.pcm.0.irq="5"
hint.pcm.0.drq="1"
hint.pcm.0.flags="0x0"
这四行,是让sound.ko读取配置的。

2要在/boot/loader.conf加上一行
sound_load="YES"
表明要系统加载sound.ko

结果:
#cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
#kldstat
Id Refs Address    Size     Name
1    8 0xc0400000 5dde24   kernel
2    1 0xc09de000 1d4fc    sound.ko
3   14 0xc09fc000 56270    acpi.ko
4    1 0xc178e000 17000    linux.ko
可以看出第二步有作用了。可是还是没有pcm0?why???????
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-25 20:59:22 | 显示全部楼层
有网真好,请看:
configuringy your thinkpad 600E for FreeBSD 5.4
http://www.ece.umr.edu/~taknnc/600E.html
解决这一问题。
老外牛啊。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 01:30:19 | 显示全部楼层
dmesg出现了以下:
pcm0: <CS4236> at port 0xf8c-0xf94,0xe0e,0x52c-0x533 drq 1 flags 0x10 on isa0
device_attach: pcm0 attach returned 6

什么意思?mixer服务还是不能用!!!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 02:29:02 | 显示全部楼层

最好的礼物

终于解决了。主要是参考老外的,见上面。不过它用的法子是编译内核,这可不用。
在上面第二贴中是官方的说明,让我走了许多弯路。其实只要知道一点,没有它(sound.ko)是驱动不了的,但加载它又是错误的。在我这儿只加载了snd_mss.ko就解决了,但snd_mss.ko又会需要sound.ko.系统会自动加载它。

老外的解决方法到现在也不全懂,它解决了些问题,如去掉ACPI,加上APM。但它用的是snd_mss.ko,我就拿来用了。编译核心现在不想。除了没编译核心我都照着做了,就是不行。这时有点恢心了,毕竟做了十小时了。

照第二贴的说明:
hints.pcm.0.at 之类的变量应该放在/boot/device.hints文件里,不过老外放在了/boot/loader.conf里,看样也行。是让?.ko来读取的。理解了这点,我把所有的这类都在了loader.conf里。下面是loader.conf的老外的COPY:
hw.cbb.start_memory="0x20000000"
hw.pci.allow_unsupported_io_range="1"
hint.acpi.0.disabled="1"
hint.pcm.0.flags="0x10"
snd_mss_load="YES"
具体的如hw_这样的查loader.conf的资料能找到含义。不过我关心的是与声卡有关的:hint.pcm.0.flags="0x10"  snd_mss_load="YES"
用ls /boot/kernel/snd_mss.ko一看有这个文件。放心了一半,没有它还得编译。接着老外又修改了/boot/device.hints和/etc/rc.conf文件,不过与声卡无关。就不写了。hint.pcm.0.?这样的在第二贴的官方文件里说了必须得加四行(见上面的贴子),不过老外没加就行,我没事了去加?
第一次我没加这四句:
     hint.pcm.0.at="isa"
     hint.pcm.0.irq="5"
     hint.pcm.0.drq="1"
     hint.pcm.0.flags="0x0"
不行。
第二次我加上了,还是不行。用dmesg和cat /dev/sndstat/kldstat杳看结果。把错误copy到googel上去搜。结果不多也有几个。不过没一个完全适合自己的。有两个好人,因为我不知道 是谁,他们把dmesg中有关这个声卡的pcm0贴出来了。反正他们成功了,我就照这个设。上面四行再加一行:
hint.pcm.0.port="0x52c"    #老外没这个
hint.pcm.0.flags="0x10"     #原来老外用的是0x0
这几项有几个组合,反正我重启了几回。一直改成:
hw.cbb.start_memory="0x20000000"
hw.pci.allow_unsupported_io_range="1"
hint.acpi.0.disabled="1"
hint.pcm.0.at="isa"
hint.pcm.0.port="0x52c"
hint.pcm.0.drq="1"
hint.pcm.0.irq="5"
hint.pcm.0.flags="0x10"
snd_mss_load="YES"
重启,用esd命令试试,HAHAAHHAHAHAHAHA.-----------------------

如果出现下面结果就成了:
# cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <CS4236> at io 0x52c irq 5 drq 1:0 bufsz 4096 (1p/1r/0v channels duplex default)
# dmesg | grep pcm
pcm0: <CS4236> at port 0xf8c-0xf94,0xe0e,0x52c-0x533 irq 5 drq 1 flags 0x10 on isa0
pcm1: <CS423x-PCI> on isa0
device_attach: pcm1 attach returned 6

放放东郭先生吧:
#mpg123 dgxs2.mp3
Playing MPEG stream from dgxs2.mp3 ...
Junk at the beginning 00000000
MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo

过程写得无趣,不过是从这儿过来的,@
回复 支持 反对

使用道具 举报

发表于 2005-8-26 08:59:10 | 显示全部楼层
支持加精!

如果谁碰巧用这个型号的机器,这个帖子的价值就出来了。

不过,实际上此类问题在FreeBSD上还是很多的,FreeBSD支持的硬件比Linux少,
前段时间,我的NEC vesapro 声卡也不认,最后的解决比你这个还要复杂,是通过修改
源代码解决的。如果谁在这个型号机器上安装不上声卡,我无偿提供修改的源代码。

实际上很多声卡要想在FreeBSD下使用都必须修改源代码,上网搜一下,可以找到很多。
比如:同是支持AC97的声卡,FreeBSD源码中仅定义了一小部分,如果你的声卡支持AC97,
又有问题,只要在源代码上作些修改,加入一些你那个型号的信息就会OK了。

所以,一旦FreeBSD不支持你的硬件,千万不要放弃,解决这样的问题正是一个锻炼熟悉
FreeBSD的好机会。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 10:40:42 | 显示全部楼层
谢谢大鱼兄的支持!
我顶下。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-28 16:11:08 | 显示全部楼层
我晕,发这么长的贴子,怎不加精?
几天了还是这几个贴子,人少?
不管怎么说,SIR是俺的益友,冷清了俺不好受啊。
回复 支持 反对

使用道具 举报

发表于 2005-8-30 22:54:23 | 显示全部楼层
Post by heiyou
终于解决了。主要是参考老外的,见上面。不过它用的法子是编译内核,这可不用。
在上面第二贴中是官方的说明,让我走了许多弯路。其实只要知道一点,没有它(sound.ko)是驱动不了的,但加载它又是错误的。在我这儿只加载了snd_mss.ko就解决了,但snd_mss.ko又会需要sound.ko.系统会自动加载它。

老外的解决方法到现在也不全懂,它解决了些问题,如去掉ACPI,加上APM。但它用的是snd_mss.ko,我就拿来用了。编译核心现在不想。除了没编译核心我都照着做了,就是不行。这时有点恢心了,毕竟做了十小时了。

照第二贴的说明:
hints.pcm.0.at 之类的变量应该放在/boot/device.hints文件里,不过老外放在了/boot/loader.conf里,看样也行。是让?.ko来读取的。理解了这点,我把所有的这类都在了loader.conf里。下面是loader.conf的老外的COPY:
hw.cbb.start_memory="0x20000000"
hw.pci.allow_unsupported_io_range="1"
hint.acpi.0.disabled="1"
hint.pcm.0.flags="0x10"
snd_mss_load="YES"
具体的如hw_这样的查loader.conf的资料能找到含义。不过我关心的是与声卡有关的:hint.pcm.0.flags="0x10"  snd_mss_load="YES"
用ls /boot/kernel/snd_mss.ko一看有这个文件。放心了一半,没有它还得编译。接着老外又修改了/boot/device.hints和/etc/rc.conf文件,不过与声卡无关。就不写了。hint.pcm.0.?这样的在第二贴的官方文件里说了必须得加四行(见上面的贴子),不过老外没加就行,我没事了去加?
第一次我没加这四句:
     hint.pcm.0.at="isa"
     hint.pcm.0.irq="5"
     hint.pcm.0.drq="1"
     hint.pcm.0.flags="0x0"
不行。
第二次我加上了,还是不行。用dmesg和cat /dev/sndstat/kldstat杳看结果。把错误copy到googel上去搜。结果不多也有几个。不过没一个完全适合自己的。有两个好人,因为我不知道 是谁,他们把dmesg中有关这个声卡的pcm0贴出来了。反正他们成功了,我就照这个设。上面四行再加一行:
hint.pcm.0.port="0x52c"    #老外没这个
hint.pcm.0.flags="0x10"     #原来老外用的是0x0
这几项有几个组合,反正我重启了几回。一直改成:
hw.cbb.start_memory="0x20000000"
hw.pci.allow_unsupported_io_range="1"
hint.acpi.0.disabled="1"
hint.pcm.0.at="isa"
hint.pcm.0.port="0x52c"
hint.pcm.0.drq="1"
hint.pcm.0.irq="5"
hint.pcm.0.flags="0x10"
snd_mss_load="YES"
重启,用esd命令试试,HAHAAHHAHAHAHAHA.-----------------------

如果出现下面结果就成了:
# cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <CS4236> at io 0x52c irq 5 drq 1:0 bufsz 4096 (1p/1r/0v channels duplex default)
# dmesg | grep pcm
pcm0: <CS4236> at port 0xf8c-0xf94,0xe0e,0x52c-0x533 irq 5 drq 1 flags 0x10 on isa0
pcm1: <CS423x-PCI> on isa0
device_attach: pcm1 attach returned 6

放放东郭先生吧:
#mpg123 dgxs2.mp3
Playing MPEG stream from dgxs2.mp3 ...
Junk at the beginning 00000000
MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo

过程写得无趣,不过是从这儿过来的,@





能再具体地,完整地,整理一下吗,渴望!!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表