kern/98898: [PATCH] sys/dev/sound/pci/fm801.c

Johannes Weiner hnazfoo at googlemail.com
Tue Jun 13 09:50:13 UTC 2006


>Number:         98898
>Category:       kern
>Synopsis:       [PATCH] sys/dev/sound/pci/fm801.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 13 09:50:12 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Johannes Weiner
>Release:        RELENG_6
>Organization:
>Environment:
FreeBSD leiferikson.flosken.lan 6.1-STABLE FreeBSD 6.1-STABLE #0: Thu Jun  8 16:22:15 CEST 2006     root at leiferikson.flosken.lan:/usr/obj/usr/src/sys/DISCORD  i386
>Description:
Soundplayback was randomly broken. It always happened, when play_flip had the value 1 and therefore no new blocksize got set by fm801ch_setblocksize().

I don't know exactly what this play_flip is, but the blocksize has always to be set to the desired value. Otherwise speed and format get increased but the blocksize stays at bottom and is therefor wrong. Result was totally smashed sound.
>How-To-Repeat:
Play sound with Fortemedia FM801 XWave PCI soundcard.
>Fix:
--- sys/dev/sound/pci/fm801.c.orig      Tue Jun 13 11:32:49 2006
+++ sys/dev/sound/pci/fm801.c   Tue Jun 13 11:34:30 2006
@@ -32,8 +32,8 @@
 SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/fm801.c,v 1.27.2.1 2006/01/10 01:01:24 ariff Exp $");

 #define PCI_VENDOR_FORTEMEDIA  0x1319
-#define PCI_DEVICE_FORTEMEDIA1 0x08011319
-#define PCI_DEVICE_FORTEMEDIA2 0x08021319      /* ??? have no idea what's this... */
+#define PCI_DEVICE_FORTEMEDIA1 0x08011319      /* Audio controller */
+#define PCI_DEVICE_FORTEMEDIA2 0x08021319      /* Joystick controller */

 #define FM_PCM_VOLUME           0x00
 #define FM_FM_VOLUME            0x02
@@ -417,15 +417,13 @@
        struct fm801_chinfo *ch = data;
        struct fm801_info *fm801 = ch->parent;

-       if(ch->dir == PCMDIR_PLAY) {
-               if(fm801->play_flip) return fm801->play_blksize;
+       /* Don't mind for play_flip; set the blocksize to the desired
+        * values in any case - otherwise sound playback breaks here. */
+       if(ch->dir == PCMDIR_PLAY)
                fm801->play_blksize = blocksize;
-       }

-       if(ch->dir == PCMDIR_REC) {
-               if(fm801->rec_flip) return fm801->rec_blksize;
+       if(ch->dir == PCMDIR_REC)
                fm801->rec_blksize = blocksize;
-       }

        DPRINT("fm801ch_setblocksize %d (dir %d)\n",blocksize, ch->dir);
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list