From nobody@FreeBSD.org  Wed Jun 23 02:00:48 2004
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 DF4F416A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 23 Jun 2004 02:00:48 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C115643D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 23 Jun 2004 02:00:48 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i5N20WSV028280
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 23 Jun 2004 02:00:32 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i5N20WAI028279;
	Wed, 23 Jun 2004 02:00:32 GMT
	(envelope-from nobody)
Message-Id: <200406230200.i5N20WAI028279@www.freebsd.org>
Date: Wed, 23 Jun 2004 02:00:32 GMT
From: Fabien Devaux <fab@gnux.info>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ACPI + snd_maestro3 problem
X-Send-Pr-Version: www-2.3

>Number:         68219
>Category:       i386
>Synopsis:       ACPI + snd_maestro3 problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-acpi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 23 02:10:18 GMT 2004
>Closed-Date:    Sat Jul 30 01:28:52 GMT 2005
>Last-Modified:  Sat Jul 30 01:28:52 GMT 2005
>Originator:     Fabien Devaux
>Release:        5.2.1-RELEASE
>Organization:
>Environment:
FreeBSD asus.localzone.fr 5.2.1-RELEASE-p8 FreeBSD 5.2.1-RELEASE-p8 #5: Tue Jun  8 20:05:09 CEST 2004     root@asus.localzone.fr:/usr/src/sys/i386/compile/MONKERN  i386
>Description:
      I own an ASUS 8400K laptop, the sound card is :
00:06.0 Multimedia audio controller: ESS Technology ES1988 Allegro-1 (rev 12)
        Subsystem: Asustek Computer, Inc.: Unknown device 1049
        Flags: bus master, medium devsel, latency 32, IRQ 10
        I/O ports at f800
        Capabilities: [c0] Power Management version 2

I load the snd_maestro3.ko module at boot time via /boot/loader.conf

The sound card works well but when I wake-up my laptop after a suspend mode (zzz) it often don't works anymore.
I've tried to put some lines in the rc.resume to fix the problem :
rc.resume:
/usr/local/bin/sudo /sbin/kldload snd_maestro3

rc.suspend:
/usr/local/bin/sudo /sbin/kldunload snd_maestro3
/usr/local/bin/sudo /sbin/kldunload snd_pcm

But sometimes it can't unload the module (it says it's busy) even If NO application is using it (even in runlevel 1).

Here is the dmesg output concerning the sound card, I see some error, maybe it can come from this:
wakeup from sleeping state (slept 99:02:22)
pcm0: <ESS Technology Allegro-1> port 0xf800-0xf8ff irq 10 at device 6.0 on pci0
pcm0: failed to enable memory mapping!
pcm0: <ESS Technology ES1988 AC97 Codec>

If I don't unload the module before sleeping I get this kind of error:
pcm0: m3_rdcd timed out.
pcm0: Codec reset retry
pcm0: m3_rdcd timed out.
pcm0: Codec reset retry
pcm0: m3_rdcd timed out.
pcm0: Codec reset retry
pcm0: m3_rdcd timed out.
pcm0: Codec reset failed
pcm0: ac97 codec init failed
wakeup from sleeping state (slept 00:00:18)
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.
pcm0: m3_wrcd timed out.

Every application works as it should be but no sound is played.
>How-To-Repeat:
load the sound module, work with many applications, close everything, try to unload the module...
If I don't unload the module before zzz'ing I get less or more the same problem too, I can use a mixer etc... everything works as if the soundcard worked but no sound can be heard.
>Fix:
      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-acpi 
Responsible-Changed-By: arved 
Responsible-Changed-When: Tue Aug 24 11:16:25 GMT 2004 
Responsible-Changed-Why:  
Over to ACPI maintainers. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68219 
State-Changed-From-To: open->feedback 
State-Changed-By: njl 
State-Changed-When: Tue Aug 24 19:31:07 GMT 2004 
State-Changed-Why:  
It's likely that the driver doesn't support suspend/resume well.  The 
power tree merge may have helped with this (i.e. BAR restoration) so 
please try 5.3.  The load/unload failure is the driver's responsibility. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68219 
State-Changed-From-To: feedback->closed 
State-Changed-By: kris 
State-Changed-When: Sat Jul 30 01:28:38 GMT 2005 
State-Changed-Why:  
Feedback timeout 

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