[alsa-devel] Major reworks on patch_via.c (TESTERS WANTED)

Takashi Iwai tiwai at suse.de
Fri Jul 15 08:03:19 CEST 2011

At Wed, 6 Jul 2011 02:58:09 +0200,
alex dot baldacchino dot alsasub at gmail dot com wrote:
> 2011/7/5 Takashi Iwai <tiwai at suse.de>:
> > At Mon, 4 Jul 2011 21:37:46 +0200,
> > Jan Binder wrote:
> >>
> >> Am Mittwoch, 22. Juni 2011, 16:28:36 schrieb Takashi Iwai:
> >> > At Mon, 20 Jun 2011 17:06:51 +0200,
> >> >
> >> > Takashi Iwai wrote:
> >> > > Hi,
> >> > >
> >> > > as there have many problems reported for VIA codecs, I started looking
> >> > > at the driver code, and decided to rework on it.
> >> > > [snip]
> >> * Independent HP worked, when I could turn it on in alsamixer and correctly
> >> produced sound with aplay -Dhw:0,2,0 . I could not always reliably enable
> >> Independent HP in alsamixer, sometimes it would not change status ans aplay
> >> claimed that hw:0,2,0 was busy.
> >
> > This is intentional.  The switching is racy, so it can't be changed
> > safely when the multi-channel PCM is opened/used.
> >
> Is it alway racy or only for those codecs sharing the same DAC between
> hp and side channel and/or requiring same stream as front to be set up
> for hp nid as well (e.g. not being connected to the front dac in any
> manner, if there is any such a via codec)?

Right, it's because of shared DAC.  If an individual DAC is available,
the driver won't block.

> In old implementation via_independent_hp_put() explicitly cleaned up
> any ongoing stream for hp dac and updated side mute status; in my case
> (vt2020) I didn't noticed errors or problems turning independent mode
> on/off several times while playing - I might have been just lucky and
> never met races, or just my codec isn't one of the above cases
> (indeed, there's no dac shared by hp and side, and my hp pin can be
> connected directly to front dac and gets also input by the stereo
> mixer being connected to front dac; actually, I haven't been able to
> find any info about via codecs with hp pin not being connected to
> front dac one way or another, so I don't follow why setting up same
> stream as front for hp dac, when in redirected mode).
> By the way, I can think of at least one use case where switching hp
> mode while playing could be useful/desirable: it might not be
> extremely frequent, but it might happen that somebody ask you to set a
> lower volume or to make no 'noise' at all, for a number of reasons,
> and one might choose to plug a headset in his/her case front audio
> panel, switch to redirected mode and turn off external speakers. With
> actual implementation, such would require to stop the playback
> completely (so that via_playback_multi_pcm_close() is called and
> spec->num_active_streams is decremented), to change mode, then to
> restart that playback: this could be annoying. Perhaps, such a
> scenario could be taken into account.

Yes, the dynamic DAC stream change is also in my TODO list.
I haven't implemented it yet because it needs some testing with real
machines.  But, judging from your experiences, it seems OK to do that.

Maybe I'll try to hack in the next week, but feel free to add by
yourself before me (and send a patch).



More information about the Alsa-devel mailing list