From dan.naumov@ofw.fi  Mon Mar 24 08:08:47 2003
Return-Path: <dan.naumov@ofw.fi>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7E8C137B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Mar 2003 08:08:47 -0800 (PST)
Received: from MAILSERVER.ofw.fi (ns.ofw.fi [194.111.144.200])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 44D8143F85
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Mar 2003 08:08:46 -0800 (PST)
	(envelope-from dan.naumov@ofw.fi)
Received: from [172.16.161.81] by MAILSERVER.ofw.fi (NTMail 7.00.0022/NT1439.00.90501b21) with ESMTP id hcwbjaaa for FreeBSD-gnats-submit@freebsd.org; Mon, 24 Mar 2003 18:07:57 +0200
Message-Id: <1048522327.43790.28.camel@localhost>
Date: 24 Mar 2003 18:12:07 +0200
From: Dan Naumov <dan.naumov@ofw.fi>
To: FreeBSD-gnats-submit@freebsd.org
Subject: sound mixing issues with ENSONIQ AudioPCI ES1371 and

>Number:         50253
>Category:       kern
>Synopsis:       sound mixing issues with ENSONIQ AudioPCI ES1371 and
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 24 08:10:16 PST 2003
>Closed-Date:    Sun Apr 06 09:36:27 PDT 2003
>Last-Modified:  Sun Apr 06 09:36:27 PDT 2003
>Originator:     Dan Naumov
>Release:        5.0-RELEASE-p4
>Organization:
none, home user
>Environment:
FreeBSD localhost.localdomain 5.0-RELEASE-p4 FreeBSD 5.0-RELEASE-p4 #0:
Sat Mar  8 06:48:20 EET 2003
root@localhost.localdomain:/usr/obj/usr/src/sys/JAGO  i386

pcm0: <Creative CT5880-C> port 0xe400-0xe43f irq 11 at device 14.0 on
pci0

>Description:
I've recently noticed a very strange issue when I was watching
high-quality DiVX movies using multimedia/mplayer. Namely, the sound
would make really annoying "cracking" noises, somewhat resambling a bad
radio. At first I thought it was a codec or player issue, but it turned
out to not be the case. A cry for help on mplayer-users resulted in this
reply:

"it is a FreeBSD related problem. For the 4.X branch it was a problem
with the kernel software mixing which runs to 44100 Hz and most of
movies are encoded to 48000 Hz, so the nasty sound appears."

Apparently, this problem is also present in 5.0

>How-To-Repeat:
install mplayer
attempt to play a video with sound encoded at 48000 Khz

>Fix:
There is no real fix so far, but the workaround is to pass "-srate
44100" to mplayer or gmplayer when starting them. Yes, I know it's very
ugly, but it's better than having nothing until the real fix arrives.

>Release-Note:
>Audit-Trail:

From: Dan Naumov <dan.naumov@ofw.fi>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: RE: kern/50253: sound mixing issues with ENSONIQ AudioPCI ES1371
 and
Date: Mon, 31 Mar 2003 23:28:28 +0300

 Apparently, MPlayer is NOT the only program to suffer from the sound
 mixing issues. I've just discovered that multimedia/linux-realplayer
 suffers from the exact same problem. The problem however, still doesn't
 occur in XMMS or games (QuakeForge, Quake3, ZSNES) I've played so far.
 
 Sincerely,
 -- 
 Dan Naumov <dan.naumov@ofw.fi>
State-Changed-From-To: open->closed 
State-Changed-By: orion 
State-Changed-When: Sun Apr 6 09:22:32 PDT 2003 
State-Changed-Why:  
This problem was fixed at the end of January/beginning of February 
2003.  The code responsible for software resampling has been 
re-written.  The code exists in both the HEAD cvs branch and the 
STABLE branch.  It is in 4.8R, STABLE, CURRENT, but not in 
5.0-RELEASE. 

Fix 1 (short to type, long to perform) 
-------------------------------------- 

Install a FreeBSD version appropriate OS version. 

Fix 2 (long to type, short to perform) 
-------------------------------------- 

Copy over the offending file: 

${FBSDSRC}/sys/dev/sound/pcm/feeder_rate.c  

with the the appropriate fixed version from CVS and recompile the 
kernel (or just pcm module if loading from kernel modules).  There are 
relatively few dependencies in this file and you shouldn't hit any 
compilation problems. 

The appropriate fetch for 5.x would be: 
fetch -o feeder_rate.c 'http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/sound/pcm/feeder_rate.c?rev=1.9&content-type=text/plain' 

The appropriate fetch for 4.x would be: 
fetch -o feeder_rate.c 'http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/sound/pcm/feeder_rate.c?rev=1.9&content-type=text/plain' 


http://www.freebsd.org/cgi/query-pr.cgi?pr=50253 
>Unformatted:
 "device pcm"
