All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Gupta, Suresh" <Suresh.Gupta@lsi.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: LSI HDA Modem is not working on HP new Laptop which has IDT 7605 HDA codec and REDHAT installed on it with ALSA ver 1.0.24.
Date: Thu, 29 Sep 2011 09:57:47 +0200	[thread overview]
Message-ID: <s5h62kbbx1g.wl%tiwai@suse.de> (raw)
In-Reply-To: <s5h8vp7by4m.wl%tiwai@suse.de>

At Thu, 29 Sep 2011 09:34:17 +0200,
Takashi Iwai wrote:
> 
> At Thu, 29 Sep 2011 12:42:41 +0530,
> Gupta, Suresh wrote:
> > 
> > LSI Modem always checks the "opened" bit of "azx_dev" before opening the stream. Modem sets "opened" bit and 
> > use stream if and only if that "opened" bit was not set otherwise move to next stream "azx_dev".
> > 
> > I found that the ALSA unset this "opened" bit on close but do not reset  AC_VERB_SET_CHANNEL_STREAMID of IDC codec. 
> > Due to which IDC Codec always get active and always sending data to stream 0. Now when LSI modem check the "opened" 
> > bit of stream 0, it found it is not set and open the stream 0 and start reading data from stream 0. As IDC codec 
> > still sending data on stream 0 the LSI Modem get this unexpected data and stop working.
> >   
> > I believe the Code (below) which checks "no_sticky_stream" is the culprit due to which "really_cleanup_stream" 
> > function is not called. I found the Analog devices codec set "no_sticky_stream" while probing their codec. 
> > This is the reason, our modem works on HP laptop with Analog device codec.
> >  
> > According to me the IDC codec should stop sending data after closing the stream or otherwise they should always acquire the stream which is not right. 
> > 
> > I don't know why "no_sticky_stream" come into new code and what's it significance. Why only Analog devices use this "no_sticky_stream".  
> 
> The problem is that your driver steals the stream silently.
> The stream is still assigned to the IDT codec driver even after the
> PCM is closed.  It's just not used.  When the PCM is opened, the very
> same stream is used again without reassigning the stream tag.
> 
> Now the modem driver grabs the stream and use the stream tag.  Of
> course, the data will be fed.  
> 
> The stream must be allocated via azx_assign_device().  If you don't,
> it's not guaranteed what happens.

Looking back at the code, I think my previous analysis was incorrect.
The problem is likely that your driver doesn't set up the stream via
snd_hda_codec_setup_stream() or snd_hda_codec_prepare() isn't called
properly by any reason.

The logic is:
- the inactive old streams conflicting with the newly prepared stream
  are marked as dirty in snd_hda_codec_setup_stream(); this is
  supposed to be called from the codec driver's prepare callback,
- then the codecs with dirty streams are cleaned up in
  purity_inactive_streams() called from snd_hda_codec_prepare().


Takashi

  reply	other threads:[~2011-09-29  7:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29  5:21 LSI HDA Modem is not working on HP new Laptop which has IDT 7605 HDA codec and REDHAT installed on it with ALSA ver 1.0.24 Gupta, Suresh
2011-09-29  6:20 ` Takashi Iwai
2011-09-29  7:12   ` Gupta, Suresh
2011-09-29  7:34     ` Takashi Iwai
2011-09-29  7:57       ` Takashi Iwai [this message]
2011-09-29  8:31         ` suresh gupta
2011-09-29  8:46           ` Takashi Iwai
2011-09-29  8:51             ` suresh gupta
2011-10-01  2:56             ` Raymond Yau
2011-10-01  6:24               ` Takashi Iwai
2011-10-03  1:35                 ` Raymond Yau
2011-10-06  8:15                   ` Takashi Iwai
2011-10-06  8:24             ` Takashi Iwai
2011-10-11  9:19               ` suresh gupta
2011-10-11  9:36                 ` Takashi Iwai
2011-09-29  7:18   ` suresh gupta

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=s5h62kbbx1g.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Suresh.Gupta@lsi.com \
    --cc=alsa-devel@alsa-project.org \
    /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.