From nobody@FreeBSD.ORG  Sat Oct 28 00:38:50 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id DFF3337B479; Sat, 28 Oct 2000 00:38:50 -0700 (PDT)
Message-Id: <20001028073850.DFF3337B479@hub.freebsd.org>
Date: Sat, 28 Oct 2000 00:38:50 -0700 (PDT)
From: aizu@jaist.ac.jp
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] resume from suspend breaks sound mixer volume. (with ESS18XX)
X-Send-Pr-Version: www-1.0

>Number:         22372
>Category:       kern
>Synopsis:       [PATCH] resume from suspend breaks sound mixer volume. (with ESS18XX)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    cg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 28 00:40:01 PDT 2000
>Closed-Date:    Sun Apr 8 16:02:24 PDT 2001
>Last-Modified:  Sun Apr 08 16:02:39 PDT 2001
>Originator:     Hiroyuki Aizu
>Release:        FreeBSD 4.1-RELEASE & ||4.1.1-STABLE
>Organization:
JAIST
>Environment:
Sony VAIO 505SX w/128MB RAM

4.1.1-STABLE FreeBSD 4.1.1-STABLE #2: Sat Oct 28 16:01:52 JST 2000

pcm0: <ESS 18xx DSP> on sbc0
>Description:
After resuming from suspend, Mixer volume of pcm will be shift.
So, it needs re-initialize the mixer.

And because it makes just noise after resume,
call reset_dsp() at resume.

>How-To-Repeat:
suspend + resume and play sounds.

>Fix:
Patch against dev/sound/isa/ess.c of 4.1.1-STABLE.
(It will works -CURRENT, I think)

diff -u ess.c.orig ess.c
--- ess.c.orig  Thu Oct  5 14:07:49 2000
+++ ess.c       Sat Oct 28 16:01:32 2000
@@ -888,11 +888,33 @@
        return ess_doattach(dev, sc);
 }
 
+static int
+ess_resume(device_t dev)
+{
+       struct ess_info *sc;
+
+       sc = pcm_getdevinfo(dev);
+       if (ess_reset_dsp(sc)) {
+               device_printf(dev, "unable reset the DSP at resume\n");
+               return ENXIO;
+       } else {
+               device_printf(dev, "reset at resume\n");
+       }
+
+       if (mixer_reinit(dev)) {
+               device_printf(dev, "unable to reinitialize the mixer at resume\n
");
+               return ENXIO;
+       }
+
+       return 0;
+}
+
 static device_method_t ess_methods[] = {
        /* Device interface */
        DEVMETHOD(device_probe,         ess_probe),
        DEVMETHOD(device_attach,        ess_attach),
        DEVMETHOD(device_detach,        ess_detach),
+       DEVMETHOD(device_resume,        ess_resume),
 
        { 0, 0 }
 };


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cg 
Responsible-Changed-By: johan 
Responsible-Changed-When: Fri Nov 3 14:24:09 PST 2000 
Responsible-Changed-Why:  
Over to pcm(4) maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22372 
State-Changed-From-To: open->closed 
State-Changed-By: greid 
State-Changed-When: Sun Apr 8 16:02:24 PDT 2001 
State-Changed-Why:  
Patch committed, thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22372 
>Unformatted:
