Date: Mon, 16 Feb 1998 04:50:25 -0800 From: Mike Smith <mike@smith.net.au> To: Luigi Rizzo <luigi@labinfo.iet.unipi.it> Cc: mike@smith.net.au (Mike Smith), grafe@lab12.ie.pitt.edu, freebsd-mobile@FreeBSD.ORG, multimedia@FreeBSD.ORG Subject: Re: Q: Audio from ATAPI CDROM following resume? Message-ID: <199802161250.EAA06420@dingo.cdrom.com> In-Reply-To: Your message of "Mon, 16 Feb 1998 12:09:10 %2B0100." <199802161109.MAA27817@labinfo.iet.unipi.it>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > However, following a resume from a suspend, by way of "/usr/sbin/zzz", > > > audio output does not appear at the notebook's speakers, > .... > > I am observing exactly the same symptoms on the same unit under > > -current (no PAO). The mixer appears to be correctly set following > > resume as well. > > > > Multimedia people; is there anything in the Yamaha OPL-SAX that is > > likely to need reinitialising after power-on to restore operation? > > the opl-sax has an independent master volume register, which we > currently set only in the attach routine to max level. maybe that register > is cleared at power up. if this is the case (can be easily tested by > looking at the attach code and trying to set it playing with /dev/io) > one could try to support that with the mixer. Ok, I'll try that. > the fact that mixer values are preserved is not significant since > the state of the mixer is cached in the io descriptor and reads do not > go to the chip. Ah. Let me guess; the chip is write-only? > i have no idea, though, what is the correct way to properly resume > operation. is there some specific "resume" interface for a device > driver which can be called ? You do it with APM hooks. Include "apm.h", so that NAPM is defined, and apm_bios.h to get the prototypes and defines. Then, conditionalised on NAPM > 0, do: struct apmhook ap; ap.ah_fun = func; ap.ah_arg = (void *)something_useful; ap.ah_name = "pcm resume handler"; ap.ah_order = APM_MID_ORDER; apm_hook_establish(APM_HOOK_RESUME, &ap) ... int func(void *arg) { ... resume stuff ... } and then func() will be called on APM resume. You might actually want to hook suspend as well, to stop any current play operation and save the state so you can restart it on a resume. At the moment, if I suspend while sound is playing, I can count on wedging the sound driver. I realise this adds some wrinkles. Sorry about that. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802161250.EAA06420>