On Wed, Oct 7, 2009 at 3:03 PM, Takashi Iwai <tiwai@xxxxxxx> wrote: > At Wed, 7 Oct 2009 13:56:35 +0800, > Li Bo wrote: >> >> On Tue, Oct 6, 2009 at 11:34 PM, Takashi Iwai <tiwai@xxxxxxx> wrote: >> > At Tue, 6 Oct 2009 23:27:35 +0800, >> > Li Bo wrote: >> >> >> >> On Tue, Oct 6, 2009 at 8:38 PM, Takashi Iwai <tiwai@xxxxxxx> wrote: >> >> > At Tue, 6 Oct 2009 14:17:40 +0200, >> >> > Harald Welte wrote: >> >> >> >> >> >> Hi all, >> >> >> >> >> >> On Tue, Oct 06, 2009 at 08:01:40AM +0200, Takashi Iwai wrote: >> >> >> >> >> >> > > As you describe, we implement it with self-reschedule workqueue, acting >> >> >> > > like a timer. >> >> >> > > Is there some advice to implement timer-like task, I tested with timer and >> >> >> > > it will crash the driver. >> >> >> > >> >> >> > Right, you can't call it in a softirq. >> >> >> > >> >> >> > A few problems, however: >> >> >> > - present variable should be in struct via_spec, instead of a static >> >> >> > variable in update_hp_jack_state(). >> >> >> >> >> >> I agree >> >> >> > - This mechanism is unconditionally invoked on VT1708 although, in >> >> >> > theory, you can have a hardware that doesn't need HP jack detection >> >> >> >> >> >> Yes, Logan/Li/Lydia: If we generate this kind of workaround with a timer, >> >> >> it should only be used on those particular chips that absolutely need it. >> >> > >> >> > As far as I see, the code is only for VT1708, so it's already specific >> >> > to the codec chip. But, even with this chip, you might have a pin >> >> > configuration that doesn't need the HP jack detection. >> >> > >> >> >> >> Yes, it's only for VT1708, and HP exists on most cases, and so HP jack detection >> >> are needed. >> >> And present will put into via_spec. >> > >> > If it's restricted only during the opened (better running) PCM stream, >> > it's not too bad. But, it'd be even better to check the availability >> > of HP jack. >> > >> Sorry about analog loopback is not considered, I think analog loopback >> mute/unmute >> callback should also be added, is that OK? > > Honestly, I think we can remove the analog-loopback part completely > for VT1708 + HP-jack. If the loopback is inevitably needed, you can add > a check of codec "hint" interface to determine whether to build the > HP-jack detection or not at probing. > About hints, look at snd_hda_get_bool_hint() and HD-Audio.txt. > > > thanks, > > Takashi > OK, I add hp detect to prepare/cleanup, and check hint "analog_loopback_hp_detect" before adding it to analog mute/unmute. Following will be the update patch _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx http://mailman.alsa-project.org/mailman/listinfo/alsa-devel