From owner-freebsd-multimedia Thu Apr 11 21: 5:26 2002 Delivered-To: freebsd-multimedia@freebsd.org Received: from purple.nge.isi.edu (dial169.east.isi.edu [65.114.169.169]) by hub.freebsd.org (Postfix) with ESMTP id B675137B400 for ; Thu, 11 Apr 2002 21:05:22 -0700 (PDT) Received: from purple.nge.isi.edu (localhost.nge.isi.edu [127.0.0.1]) by purple.nge.isi.edu (8.12.2/8.12.2) with ESMTP id g3C45L59000480 for ; Fri, 12 Apr 2002 00:05:21 -0400 (EDT) (envelope-from csp@purple.nge.isi.edu) Message-Id: <200204120405.g3C45L59000480@purple.nge.isi.edu> To: freebsd-multimedia@FreeBSD.ORG Subject: Sound on ThinkPad X22 Date: Fri, 12 Apr 2002 00:05:21 -0400 From: Colin Perkins Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I've been fighting to get audio working on my ThinkPad X22, running 4.5-STABLE. Seems I finally have success, and I wanted to share the information with the list for the record. Stock 4.5-STABLE detects the soundcard, but can't map the IO port space. The dmesg shows: pcm0: irq 5 at device 31.5 on pci0 pcm0: unable to map IO port space device_probe_and_attach: pcm0 attach returned 6 Applying the patches from PR kern/36716 and i386/36972 and recompiling with the PCI_ENABLE_IO_MODES option in the kernel config results in: pcm0: port 0x18c0-0x18ff,0x1c00-0x1cff irq 5 at device 31.5 on pci0 pcm0: ac97 codec reports dac not ready pcm0: measured ac97 link rate at 44201 Hz and non-functional sound. However, this can be fixed by increasing the delay in sys/dev/sound/pcm/ac97.c as follows: *** ac97.c.orig Thu Apr 11 14:29:49 2002 --- ac97.c Thu Apr 11 23:30:54 2002 *************** *** 367,373 **** wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); wrcd(codec, AC97_REG_RESET, 0); ! DELAY(100000); wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); i = rdcd(codec, AC97_REG_RESET); --- 367,373 ---- wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); wrcd(codec, AC97_REG_RESET, 0); ! DELAY(400000); wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); i = rdcd(codec, AC97_REG_RESET); *************** *** 462,468 **** wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); wrcd(codec, AC97_REG_RESET, 0); ! DELAY(100000); wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); i = rdcd(codec, AC97_REG_RESET); --- 462,468 ---- wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); wrcd(codec, AC97_REG_RESET, 0); ! DELAY(400000); wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); i = rdcd(codec, AC97_REG_RESET); and dmesg now shows: pcm0: port 0x18c0-0x18ff,0x1c00-0x1cff irq 5 at device 31.5 on pci0 Question for the list: is this increase in the delay parameter likely to cause problems with other devices? If not, can someone consider committing the necessary changes? Cheers, Colin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message