NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52781: audioctl can't set output gain



The following reply was made to PR kern/52781; it has been noted by GNATS.

From: Tetsuya Isaki <isaki%pastel-flower.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost,
	gnats-admin%netbsd.org@localhost,
	netbsd-bugs%netbsd.org@localhost
Cc: bouyer%antioche.eu.org@localhost
Subject: Re: kern/52781: audioctl can't set output gain
Date: Thu, 03 May 2018 16:11:57 +0900

 nat@,
 
 > It would be an unwanted side effect if the change was reverted to have
 > setting 
 > the gain on a particular channel influence other open channel's volume.
 
 Please don't use the word 'unwanted' or 'side effect',
 before defining/sharing the specification.
 
 > I will update the documentation regarding how the gain fields work if the 
 > current behavior is desired.
 
 > The attached patch should fix the problem and return the relative gain for
 > the 
 > channel when the audioctl -p 1 play.gain is issued.
 >
 > To increase the overall master volume mixerctl -w outputs.master will have to 
 > be used though.
  
 - What is the difference between "audioctl -p N play.gain" and
   "mixerctl -w vchan.dacN"?
   o (I don't know well about history between audioctl and mixerctl)
   o Although, mixerctl vchan has another problem.
 
 - How do I know about this N for audioctl -p?
 
 - How do you think about PR/52627 ?
   It allows unprivileged users to control privileged processes.
 
 - How does "audioctl {,-w} play.gain" (without -p) behave?
 
 - Assuming that the gain is controlled by software,
   why is the balance controlled by the mixer?  It means:
    "audioctl -p N -w play.gain" affects N-th VC's volume.
    "audioctl      -w play.gain" affects nothing? (as described in this PR)
    "audioctl -p N -w play.balance" affects HW balance.
    "audioctl      -w play.balance" affects HW balance.
   I don't think it's a good specification.
 
 - (and I also wonder inefficient implementation which reallocates
   mixer state arrays on every audio open/close.)
 
 > --- audio.c	6 Feb 2018 04:39:18 -0000	1.452
 > +++ audio.c	28 Apr 2018 21:44:39 -0000
 > @@ -4903,6 +4903,9 @@ audiogetinfo(struct audio_softc *sc, str
 >  
 >  		au_get_gain(sc, &sc->sc_inports, &r->gain, &r->balance);
 >  		au_get_gain(sc, &sc->sc_outports, &p->gain, &p->balance);
 > +
 > +		p->gain = vc->sc_swvol;
 > +		r->gain = vc->sc_recswvol;
 >  	}
 >  
 >  	if (sc->sc_monitor_port != -1 && buf_only_mode == 0) {
 
 I think it's not enough.
 - Many specifications are not fixed as above.
 - Again, What does "audioctl play.gain" (without -p) display in this
   case?
 - Assuming that the gain does not link the HW mixer, it should be also
   obtained with AUDIO_GETBUFINFO.
 
 Anyway, please propose and explain your desired specification first
 on public list.
 ---
 Tetsuya Isaki <isaki%pastel-flower.jp@localhost / isaki%NetBSD.org@localhost>
 


Home | Main Index | Thread Index | Old Index