From: Doug Ledford <dledford@redhat.com>
To: Doug Ledford <dledford@redhat.com>
Cc: Nathan Bryant <nbryant@optonline.net>,
Andris Pavenis <pavenis@lanet.lv>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i810_audio fix for version 0.11
Date: Fri, 07 Dec 2001 13:36:51 -0500 [thread overview]
Message-ID: <3C110C43.4000801@redhat.com> (raw)
In-Reply-To: <3C10E85F.7040009@lanet.lv> <3C10F9E0.7010906@optonline.net> <3C110287.8070205@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]
Doug Ledford wrote:
> Well, unfortunately, neither of the patches you guys sent do what I
> was looking for ;-) My goal with that code was to enable a specific
> certain behaviour, and because of the deadlock I have to make a few
> changes elsewhere for it to work properly. The workaround patches are
> fine for now, but later today I'll make a 0.12 that fixes it the way
> I'm looking for. (Hint: it's legal for a program to call SETTRIGGER
> to disable PCM output, then call the write() routine to fill the
> buffer, then call SETTRIGGER again to start output, otherwise known as
> pre buffering, and I want to support that without forcing the DAC to
> be started on update_lvi())
>
> The real answer is multipart:
>
> 1) during i810_open go back to the old behaviour of setting
> dmabuf->trigger to PCM_ENABLE_INPUT and/or OUTPUT based on file mode.
>
> 2) make sure that i810_mmap clears dmabuf->trigger
>
> 3) make sure that in both i810_write and i810_read, we force the
> trigger setting when we can't output/input any data because count <= 0
>
> 4) in update_lvi make the check something like:
>
> if (!dmabuf->enable && dmabuf->trigger) {
> ....
> }
>
> That should solve the problem, I just haven't written it up yet.
>
>
>
OK, the attached patch should do what is mentioned above.
Doug Ledford
[-- Attachment #2: patch-12 --]
[-- Type: text/plain, Size: 1577 bytes --]
--- i810_audio.c.11 Thu Dec 6 16:53:41 2001
+++ i810_audio.c.12 Fri Dec 7 13:32:38 2001
@@ -198,7 +198,7 @@
#define INT_MASK (INT_SEC|INT_PRI|INT_MC|INT_PO|INT_PI|INT_MO|INT_NI|INT_GPI)
-#define DRIVER_VERSION "0.11"
+#define DRIVER_VERSION "0.12"
/* magic numbers to protect our data structures */
#define I810_CARD_MAGIC 0x5072696E /* "Prin" */
@@ -952,7 +952,7 @@
* the CIV value to the next sg segment to be played so that when
* we call start_{dac,adc}, things will operate properly
*/
- if (!dmabuf->enable) {
+ if (!dmabuf->enable && dmabuf->trigger) {
outb((inb(port+OFF_CIV)+1)&31, port+OFF_LVI);
if(rec) {
__start_adc(state);
@@ -1111,8 +1111,11 @@
/*
* This will make sure that our LVI is correct, that our
- * pointer is updated, and that the DAC is running
+ * pointer is updated, and that the DAC is running. We
+ * have to force the setting of dmabuf->trigger to avoid
+ * any possible deadlocks.
*/
+ dmabuf->trigger = PCM_ENABLE_OUTPUT;
i810_update_lvi(state,0);
if (signal_pending(current))
@@ -2280,6 +2283,7 @@
card->states[i] = NULL;;
return -EBUSY;
}
+ dmabuf->trigger |= PCM_ENABLE_INPUT;
i810_set_adc_rate(state, 8000);
}
if(file->f_mode & FMODE_WRITE) {
@@ -2291,6 +2295,7 @@
/* Initialize to 8kHz? What if we don't support 8kHz? */
/* Let's change this to check for S/PDIF stuff */
+ dmabuf->trigger |= PCM_ENABLE_OUTPUT;
if ( spdif_locked ) {
i810_set_dac_rate(state, spdif_locked);
i810_set_spdif_output(state, AC97_EA_SPSA_3_4, spdif_locked);
next prev parent reply other threads:[~2001-12-07 18:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-07 16:03 [PATCH] i810_audio fix for version 0.11 Andris Pavenis
2001-12-07 17:18 ` Nathan Bryant
2001-12-07 17:37 ` Andris Pavenis
2001-12-07 17:55 ` Doug Ledford
2001-12-07 18:36 ` Doug Ledford [this message]
2001-12-08 8:39 ` Andris Pavenis
2001-12-08 9:25 ` Andris Pavenis
2001-12-08 9:36 ` Doug Ledford
2001-12-08 9:45 ` Andris Pavenis
2001-12-11 0:42 ` Doug Ledford
2001-12-11 6:59 ` Andris Pavenis
2001-12-27 11:10 ` i810_audio driver version 0.13 still broken Andris Pavenis
2001-12-27 21:44 ` Nathan Bryant
2001-12-28 7:16 ` Andris Pavenis
2001-12-28 20:14 ` Nathan Bryant
2002-01-05 12:29 ` Andris Pavenis
2001-12-31 4:06 ` Nick Papadonis
-- strict thread matches above, loose matches on Subject: below --
2001-12-07 2:44 [PATCH] i810_audio fix for version 0.11 Nathan Bryant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C110C43.4000801@redhat.com \
--to=dledford@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nbryant@optonline.net \
--cc=pavenis@lanet.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox