* Help with AD1816 driver please...
@ 2006-02-03 3:34 Ken Arromdee
2006-02-03 3:58 ` Lee Revell
0 siblings, 1 reply; 6+ messages in thread
From: Ken Arromdee @ 2006-02-03 3:34 UTC (permalink / raw)
To: alsa-devel
I'm probably the only person who uses this driver (four years ago it wasn't
working at all and wasn't fixed until I reported the problem).
At any rate, I just tried using my card (Shark Predator ISA) for capture, which
I never did before. It didn't work--it gave a weird repeating sound and
eventually the following error:
arecord: pcm_read:1196: read error: Input/output error
I highly suspect the driver is causing the problem. It's obviously never been
tested, and capture works fine in Windows 98. Also, I know the weird sound
was a driver problem, because I was able to fix it (the version I patched is
the one in Mandrake 10.1). I still get the pcm_read I/O error, however.
Here's the patch. Is there anyone willing to officially make this change in
CVS, and/or help me fix the I/O error?
*** ad1816a_lib.c.orig 2006-02-02 21:25:00.869143712 -0500
--- ad1816a_lib.c 2006-02-02 21:29:13.142792288 -0500
***************
*** 179,185 ****
static int snd_ad1816a_trigger(ad1816a_t *chip, unsigned char what,
! int channel, int cmd)
{
int error = 0;
--- 179,185 ----
static int snd_ad1816a_trigger(ad1816a_t *chip, unsigned char what,
! int channel, int cmd, int iscapture)
{
int error = 0;
***************
*** 188,197 ****
case SNDRV_PCM_TRIGGER_STOP:
spin_lock(&chip->lock);
cmd = (cmd == SNDRV_PCM_TRIGGER_START) ? 0xff: 0x00;
! if (what & AD1816A_PLAYBACK_ENABLE)
snd_ad1816a_out_mask(chip, AD1816A_PLAYBACK_CONFIG,
AD1816A_PLAYBACK_ENABLE, cmd);
! if (what & AD1816A_CAPTURE_ENABLE)
snd_ad1816a_out_mask(chip, AD1816A_CAPTURE_CONFIG,
AD1816A_CAPTURE_ENABLE, cmd);
spin_unlock(&chip->lock);
--- 188,201 ----
case SNDRV_PCM_TRIGGER_STOP:
spin_lock(&chip->lock);
cmd = (cmd == SNDRV_PCM_TRIGGER_START) ? 0xff: 0x00;
! /* if (what & AD1816A_PLAYBACK_ENABLE) */
! /* That is not valid, because playback and capture enable
! * are the same bit pattern, just to different addresses
! */
! if (!iscapture)
snd_ad1816a_out_mask(chip, AD1816A_PLAYBACK_CONFIG,
AD1816A_PLAYBACK_ENABLE, cmd);
! if (iscapture)
snd_ad1816a_out_mask(chip, AD1816A_CAPTURE_CONFIG,
AD1816A_CAPTURE_ENABLE, cmd);
spin_unlock(&chip->lock);
***************
*** 208,221 ****
{
ad1816a_t *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_PLAYBACK_ENABLE,
! SNDRV_PCM_STREAM_PLAYBACK, cmd);
}
static int snd_ad1816a_capture_trigger(snd_pcm_substream_t *substream, int cmd)
{
ad1816a_t *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_CAPTURE_ENABLE,
! SNDRV_PCM_STREAM_CAPTURE, cmd);
}
static int snd_ad1816a_hw_params(snd_pcm_substream_t * substream,
--- 212,225 ----
{
ad1816a_t *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_PLAYBACK_ENABLE,
! SNDRV_PCM_STREAM_PLAYBACK, cmd, 0);
}
static int snd_ad1816a_capture_trigger(snd_pcm_substream_t *substream, int cmd)
{
ad1816a_t *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_CAPTURE_ENABLE,
! SNDRV_PCM_STREAM_CAPTURE, cmd, 1);
}
static int snd_ad1816a_hw_params(snd_pcm_substream_t * substream,
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Help with AD1816 driver please...
2006-02-03 3:34 Help with AD1816 driver please Ken Arromdee
@ 2006-02-03 3:58 ` Lee Revell
2006-02-03 4:50 ` Ken Arromdee
0 siblings, 1 reply; 6+ messages in thread
From: Lee Revell @ 2006-02-03 3:58 UTC (permalink / raw)
To: Ken Arromdee; +Cc: alsa-devel
On Thu, 2006-02-02 at 19:34 -0800, Ken Arromdee wrote:
>
> Here's the patch. Is there anyone willing to officially make this
> change in
> CVS, and/or help me fix the I/O error?
>
Can you regenerate with patch -Nru?
Lee
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help with AD1816 driver please...
2006-02-03 3:58 ` Lee Revell
@ 2006-02-03 4:50 ` Ken Arromdee
2006-02-03 5:39 ` Lee Revell
0 siblings, 1 reply; 6+ messages in thread
From: Ken Arromdee @ 2006-02-03 4:50 UTC (permalink / raw)
To: alsa-devel
On Thu, 2 Feb 2006, Lee Revell wrote:
> > Here's the patch. Is there anyone willing to officially make this
> > change in
> > CVS, and/or help me fix the I/O error?
> Can you regenerate with patch -Nru?
I'm not sure what you're asking. If you're asking if the patch I mailed out
works against current source code using patch -Nru, no it doesn't (variable
names and whitespace have changed).
If you want a patch against current source code, here it is. Disclaimer: I
haven't tried to compile this, so hope I made no stupid typoes.
*** ad1816a_lib.c.orig 2006-02-02 23:32:50.691921760 -0500
--- ad1816a_lib.c 2006-02-02 23:38:54.755575672 -0500
***************
*** 174,180 ****
static int snd_ad1816a_trigger(struct snd_ad1816a *chip, unsigned char what,
! int channel, int cmd)
{
int error = 0;
--- 174,180 ----
static int snd_ad1816a_trigger(struct snd_ad1816a *chip, unsigned char what,
! int channel, int cmd, int iscapture)
{
int error = 0;
***************
*** 183,192 ****
case SNDRV_PCM_TRIGGER_STOP:
spin_lock(&chip->lock);
cmd = (cmd == SNDRV_PCM_TRIGGER_START) ? 0xff: 0x00;
! if (what & AD1816A_PLAYBACK_ENABLE)
snd_ad1816a_out_mask(chip, AD1816A_PLAYBACK_CONFIG,
AD1816A_PLAYBACK_ENABLE, cmd);
! if (what & AD1816A_CAPTURE_ENABLE)
snd_ad1816a_out_mask(chip, AD1816A_CAPTURE_CONFIG,
AD1816A_CAPTURE_ENABLE, cmd);
spin_unlock(&chip->lock);
--- 183,196 ----
case SNDRV_PCM_TRIGGER_STOP:
spin_lock(&chip->lock);
cmd = (cmd == SNDRV_PCM_TRIGGER_START) ? 0xff: 0x00;
! /* if (what & AD1816A_PLAYBACK_ENABLE) */
! /* That is not valid, because playback and capture enable
! * are the same bit pattern, just to different addresses
! */
! if (!iscapture)
snd_ad1816a_out_mask(chip, AD1816A_PLAYBACK_CONFIG,
AD1816A_PLAYBACK_ENABLE, cmd);
! if (iscapture)
snd_ad1816a_out_mask(chip, AD1816A_CAPTURE_CONFIG,
AD1816A_CAPTURE_ENABLE, cmd);
spin_unlock(&chip->lock);
***************
*** 203,216 ****
{
struct snd_ad1816a *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_PLAYBACK_ENABLE,
! SNDRV_PCM_STREAM_PLAYBACK, cmd);
}
static int snd_ad1816a_capture_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_ad1816a *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_CAPTURE_ENABLE,
! SNDRV_PCM_STREAM_CAPTURE, cmd);
}
static int snd_ad1816a_hw_params(struct snd_pcm_substream *substream,
--- 207,220 ----
{
struct snd_ad1816a *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_PLAYBACK_ENABLE,
! SNDRV_PCM_STREAM_PLAYBACK, cmd, 0);
}
static int snd_ad1816a_capture_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_ad1816a *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_CAPTURE_ENABLE,
! SNDRV_PCM_STREAM_CAPTURE, cmd, 1);
}
static int snd_ad1816a_hw_params(struct snd_pcm_substream *substream,
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Help with AD1816 driver please...
2006-02-03 4:50 ` Ken Arromdee
@ 2006-02-03 5:39 ` Lee Revell
2006-02-03 17:52 ` Ken Arromdee
0 siblings, 1 reply; 6+ messages in thread
From: Lee Revell @ 2006-02-03 5:39 UTC (permalink / raw)
To: Ken Arromdee; +Cc: alsa-devel
On Thu, 2006-02-02 at 20:50 -0800, Ken Arromdee wrote:
> On Thu, 2 Feb 2006, Lee Revell wrote:
> > > Here's the patch. Is there anyone willing to officially make this
> > > change in
> > > CVS, and/or help me fix the I/O error?
> > Can you regenerate with patch -Nru?
>
> I'm not sure what you're asking. If you're asking if the patch I mailed out
> works against current source code using patch -Nru, no it doesn't (variable
> names and whitespace have changed).
>
> If you want a patch against current source code, here it is. Disclaimer: I
> haven't tried to compile this, so hope I made no stupid typoes.
Sorry, I meant, diff -Nru (unified diff format)
Lee
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help with AD1816 driver please...
2006-02-03 5:39 ` Lee Revell
@ 2006-02-03 17:52 ` Ken Arromdee
2006-02-09 13:51 ` Takashi Iwai
0 siblings, 1 reply; 6+ messages in thread
From: Ken Arromdee @ 2006-02-03 17:52 UTC (permalink / raw)
To: alsa-devel
Here's the diff.
Note that this only fixes half of the problem. I haven't been able to
figure out the other half.
--- ad1816a_lib.c.orig 2006-02-02 23:32:50.000000000 -0500
+++ ad1816a_lib.c 2006-02-02 23:38:54.000000000 -0500
@@ -174,7 +174,7 @@
static int snd_ad1816a_trigger(struct snd_ad1816a *chip, unsigned char what,
- int channel, int cmd)
+ int channel, int cmd, int iscapture)
{
int error = 0;
@@ -183,10 +183,14 @@
case SNDRV_PCM_TRIGGER_STOP:
spin_lock(&chip->lock);
cmd = (cmd == SNDRV_PCM_TRIGGER_START) ? 0xff: 0x00;
- if (what & AD1816A_PLAYBACK_ENABLE)
+ /* if (what & AD1816A_PLAYBACK_ENABLE) */
+ /* That is not valid, because playback and capture enable
+ * are the same bit pattern, just to different addresses
+ */
+ if (!iscapture)
snd_ad1816a_out_mask(chip, AD1816A_PLAYBACK_CONFIG,
AD1816A_PLAYBACK_ENABLE, cmd);
- if (what & AD1816A_CAPTURE_ENABLE)
+ if (iscapture)
snd_ad1816a_out_mask(chip, AD1816A_CAPTURE_CONFIG,
AD1816A_CAPTURE_ENABLE, cmd);
spin_unlock(&chip->lock);
@@ -203,14 +207,14 @@
{
struct snd_ad1816a *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_PLAYBACK_ENABLE,
- SNDRV_PCM_STREAM_PLAYBACK, cmd);
+ SNDRV_PCM_STREAM_PLAYBACK, cmd, 0);
}
static int snd_ad1816a_capture_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_ad1816a *chip = snd_pcm_substream_chip(substream);
return snd_ad1816a_trigger(chip, AD1816A_CAPTURE_ENABLE,
- SNDRV_PCM_STREAM_CAPTURE, cmd);
+ SNDRV_PCM_STREAM_CAPTURE, cmd, 1);
}
static int snd_ad1816a_hw_params(struct snd_pcm_substream *substream,
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-02-09 13:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-03 3:34 Help with AD1816 driver please Ken Arromdee
2006-02-03 3:58 ` Lee Revell
2006-02-03 4:50 ` Ken Arromdee
2006-02-03 5:39 ` Lee Revell
2006-02-03 17:52 ` Ken Arromdee
2006-02-09 13:51 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.