Some bugs and patches
Hans Petter Selasky
hselasky at c2i.net
Tue Apr 19 10:35:10 PDT 2005
Hi,
Do I have to post a PR or can I just post patches like this to get it
committed?
1) I have some problems with an old soundblaster-8 (original)
*** sys/dev/sound/isa/sb8.c.ref Wed Oct 20 22:10:18 2004
--- sys/dev/sound/isa/sb8.c Wed Oct 20 22:20:09 2004
***************
*** 565,571 ****
if (sb->bd_flags & BD_F_HISPEED)
sb_reset_dsp(sb);
else
! sb_cmd(sb, DSP_CMD_DMAEXIT_8);
if (play)
sb_cmd(sb, DSP_CMD_SPKOFF); /* speaker off */
--- 565,578 ----
if (sb->bd_flags & BD_F_HISPEED)
sb_reset_dsp(sb);
else
! {
! /* sb_cmd(sb, DSP_CMD_DMAEXIT_8);
! * NOTE: DSP_CMD_DMAEXIT_8
! * does not work with old
! * soundblaster
! */
! sb_reset_dsp(sb);
! }
if (play)
sb_cmd(sb, DSP_CMD_SPKOFF); /* speaker off */
2) there is panic with the vibra16x when trying to record:
*** sys/dev/sound/isa/sb16.c.ref Wed Oct 20 22:10:18 2004
--- sys/dev/sound/isa/sb16.c Mon Nov 22 17:56:05 2004
***************
*** 478,484 ****
sb_intr(void *arg)
{
struct sb_info *sb = (struct sb_info *)arg;
! int reason = 3, c;
/*
* The Vibra16X has separate flags for 8 and 16 bit transfers, but
--- 478,484 ----
sb_intr(void *arg)
{
struct sb_info *sb = (struct sb_info *)arg;
! int reason, c;
/*
* The Vibra16X has separate flags for 8 and 16 bit transfers, but
***************
*** 554,561 ****
sb_reset_dsp(sb);
if (sb->bd_flags & BD_F_SB16X) {
pprio = sb->pch.run? 1 : 0;
! sndbuf_dmasetup(sb->pch.buffer, pprio? sb->drq1 : NULL);
sb->pch.dch = pprio? 1 : 0;
sndbuf_dmasetup(sb->rch.buffer, pprio? sb->drq2 : sb->drq1);
sb->rch.dch = pprio? 2 : 1;
--- 554,562 ----
sb_reset_dsp(sb);
if (sb->bd_flags & BD_F_SB16X) {
+ /* full-duplex doesn't work! */
pprio = sb->pch.run? 1 : 0;
! sndbuf_dmasetup(sb->pch.buffer, pprio? sb->drq1 : sb->drq2);
sb->pch.dch = pprio? 1 : 0;
sndbuf_dmasetup(sb->rch.buffer, pprio? sb->drq2 : sb->drq1);
sb->rch.dch = pprio? 2 : 1;
The vibra16X supports full duplex. I traced the Windows driver, and what is
does is that it programs one DMA channel 8-bit, and the other 16-bit. There
might be some kind of auto detection logic here, because it always uses 8-bit
for playback, even if I play 16-bit sound ...
3) Missing PCI-ID:
*** sbc.orig Wed Dec 25 21:34:52 2002
--- sbc.c Wed Dec 25 18:53:21 2002
***************
*** 251,256 ****
--- 251,257 ----
{0x81167316, "ESS ES1681"}, /* ESS1681 */
{0x02017316, "ESS ES1688"}, /* ESS1688 */
+ {0x68097316, "ESS ES1688"}, /* ESS1688 */
{0x68187316, "ESS ES1868"}, /* ESS1868 */
{0x03007316, "ESS ES1869"}, /* ESS1869 */
{0x69187316, "ESS ES1869"}, /* ESS1869 */
4) There is a bug regarding the setting of the SIMPLEX flag (which is
currently not working!)
Several device drivers call "pcm_setflags" before "pcm_register". The problem
is that "pcm_register" clears these flags. Maybe the device drivers should be
changed, or maybe "pcm_register" should be changed.
Here is my solution: In the file "pcm/sound.c" in the function
"pcm_register()" "d->flags = 0;" should be changed into:
/* d->flags = 0; should be cleared by allocator of softc;
* cannot clear this field here, because several devices set
* this flag before calling pcm_register()
*/
For example see sb8.c:
pcm_setflags(dev, pcm_getflags(dev) | SD_F_SIMPLEX);
5) I have a problem with one of my soundcards. When I try to
"cat /dev/dsp0.0", the samplerate is always 48000Hz instead of 8000Hz. Is
this a bug in the driver? How can I fix it?
pcm0: <Intel ICH4 (82801DB)> port 0x1c00-0x1cff,0x18c0-0x18ff mem
0xe0100c00-0xe0100dff,0xe0100800-0xe01008ff irq 10 at device 31.5 on pci0
pcm0: [GIANT-LOCKED]
pcm0: <Unknown AC97 Codec (id = 0x43585430)>
6) I have modified the sound driver so that it can be opened from within the
kernel. This enables me to make a sound-bridge that moves data from an
ISDN/telephony device to a sound device (full duplex). This works very well
and the delay is very little. Are there any plans to make such support
generic or what do you think?
Yours
HPS
More information about the freebsd-multimedia
mailing list