From nobody@FreeBSD.org  Tue Jun 13 09:45:47 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 96A4916A41A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Jun 2006 09:45:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4CA6143D48
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Jun 2006 09:45:47 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k5D9jlBN044987
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Jun 2006 09:45:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k5D9jlXW044986;
	Tue, 13 Jun 2006 09:45:47 GMT
	(envelope-from nobody)
Message-Id: <200606130945.k5D9jlXW044986@www.freebsd.org>
Date: Tue, 13 Jun 2006 09:45:47 GMT
From: Johannes Weiner <hnazfoo@googlemail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] sys/dev/sound/pci/fm801.c
X-Send-Pr-Version: www-2.3

>Number:         98898
>Category:       kern
>Synopsis:       [pci] [patch] fix random sound problems in fm801
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 13 09:50:12 GMT 2006
>Closed-Date:    Sat May 19 13:20:42 GMT 2007
>Last-Modified:  Sat May 19 13:30:04 GMT 2007
>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@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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-multimedia 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun May 13 04:37:14 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98898 
State-Changed-From-To: open->closed 
State-Changed-By: joel 
State-Changed-When: Sat May 19 13:19:53 UTC 2007 
State-Changed-Why:  
Committed with minor modifications, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98898 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/98898: commit references a PR
Date: Sat, 19 May 2007 13:19:39 +0000 (UTC)

 joel        2007-05-19 13:19:32 UTC
 
   FreeBSD src repository (doc committer)
 
   Modified files:
     sys/dev/sound/pci    fm801.c 
   Log:
   Fix randomly broken playback with Fortemedia FM801 XWave PCI soundcard.
   
   PR:             kern/98898
   Submitted by:   Johannes Weiner <hnazfoo@googlemail.com>
   Approved by:    ariff
   
   Revision  Changes    Path
   1.31      +9 -8      src/sys/dev/sound/pci/fm801.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
