All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+alsa@arm.linux.org.uk>
To: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@suse.cz>, Roc Wu <cooloney@yahoo.com.cn>,
	Clemens Ladisch <clemens@ladisch.de>,
	Alsa-devel@lists.sourceforge.net
Subject: Re: An driver error when I using aplay!
Date: Mon, 7 Jun 2004 14:51:13 +0100	[thread overview]
Message-ID: <20040607145113.B28526@flint.arm.linux.org.uk> (raw)
In-Reply-To: <s5hbrjv4hbs.wl@alsa2.suse.de>; from tiwai@suse.de on Mon, Jun 07, 2004 at 03:40:23PM +0200

On Mon, Jun 07, 2004 at 03:40:23PM +0200, Takashi Iwai wrote:
> At Mon, 7 Jun 2004 14:08:17 +0100,
> Russell King wrote:
> > 
> > On Mon, Jun 07, 2004 at 02:45:20PM +0200, Takashi Iwai wrote:
> > > i guess so, too.  as you can see in the original post, the error
> > > returned from hw_params callback (sample not available), thus it
> > > doesn't call trigger(START) callback yet at all.
> > 
> > If we never got past hw_params() then we didn't enable the IO,
> > and it must be that something else in the system fiddled with
> > the chip and set it incorrectly.
> > 
> > > unfurtunately i can't tell any more unless i read the driver code.
> > > where can i find the code?
> > 
> > I never officially released the driver, though it was part of the
> > old -rmk patches back in the 2.6.0-test era.  Where Roc has got
> > the source from, and what modifications have been made is anyones
> > guess.
> 
> Roc sent me the code now :)
> 
> after a quick look, it seems that txcr isn't initialized in the open
> callback but only in hw_params callback (which was never called in
> this case).

Why should it be explicitly initialised?  Take a moment to consider
what guarantees snd_card_new() gives for the allocated memory.  Yep,
that's right - it's initialised to zero.  So, chan->txcr is already
initialised to zero.

So, let's step back and consider.

At init time.
	chan->txcr is zeroed.
open
	no change.
hw_parms
	chan->txcr may be set to the required format if successful,
	but isn't.
close
	chan->txcr should still be zero.

Even if hw_params did succeed, then chan->txcr will be set to something
which doesn't have TXCR_TXEN set, until the trigger is called with
SNDRV_PCM_TRIGGER_START.

So I still assert that the problem is in ALSA core or in modifications
to the code.

> if my guess is correct, adding the following to
> aacpi_playback_open() should fix this problem:
> 
> 	chan->txcr = 0;

So respectfully I think the above is crap.

But unfortunately I don't have the driver code myself to be able to
comment, so its probably been fscked.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504

  reply	other threads:[~2004-06-07 13:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-04  9:13 An driver error when I using aplay! Roc Wu
2004-06-07  3:04 ` Roc Wu
2004-06-07  7:24   ` Clemens Ladisch
2004-06-07  9:25     ` Roc Wu
2004-06-07 10:17       ` Russell King
2004-06-07 10:43         ` Jaroslav Kysela
2004-06-07 12:45           ` Takashi Iwai
2004-06-07 13:08             ` Russell King
2004-06-07 13:40               ` Takashi Iwai
2004-06-07 13:51                 ` Russell King [this message]
2004-06-07 14:18                   ` Takashi Iwai
2004-06-07 15:04                     ` Russell King
2004-06-07 15:13                       ` Takashi Iwai
2004-06-07 15:18                         ` Russell King
2004-06-07 15:32                           ` Takashi Iwai
2004-06-07 15:44                             ` Russell King
2004-06-07 16:25                               ` Takashi Iwai
2004-06-07 18:04                                 ` Russell King
2004-06-08 15:48                                   ` Takashi Iwai
2004-06-08 16:40                                     ` Russell King
2004-06-08 16:48                                       ` Takashi Iwai
2004-06-07 14:24                   ` James Courtier-Dutton
2004-06-07 15:08                     ` Russell King
2004-06-08  4:01               ` Roc Wu
2004-06-07 10:44       ` Developer docs missing from ALSA web server - was:Re: [Alsa-devel] " James Courtier-Dutton

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=20040607145113.B28526@flint.arm.linux.org.uk \
    --to=rmk+alsa@arm.linux.org.uk \
    --cc=Alsa-devel@lists.sourceforge.net \
    --cc=clemens@ladisch.de \
    --cc=cooloney@yahoo.com.cn \
    --cc=perex@suse.cz \
    --cc=tiwai@suse.de \
    /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 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.