Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-21 Thread Brynet
Thomas Pfaff wrote:
> What I wanted was a simpler way of controlling the basic features of the 
> device.

Yes, but what you failed to comprehend is that these devices are very
complex, it is not easy to "define" the basic features of the device
because there are many devices in different vendor-imposed
configurations (..which may or may not be easily detectable).

I think Jacob Meuser has done a good job at picking some sane
defaults, in the end there will be some devices where this is
inadequate.. fortunately you can manipulate mixerctl(1) to fit your
specialized needs and save your changes in /etc/mixerctl.conf.

He is more then willing to accept sane patches, but what they've been
trying to explain to you is.. "It's a helluva' lot simpler than other
free operating systems".

Take care.
-Bryan.



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-21 Thread Thomas Pfaff
On Fri, 20 Nov 2009 20:29:08 +0100
Thomas Pfaff  wrote:
>
> OK, I got the feedback I wanted.  Thanks all.  I'll continue
> hating mixerctl(1) and hope something more sane show up in
> the future ;-)
> 

That was a bit harsh.  I do actually like mixerctl(1) for simpler
devices, like my uaudio(4) headset;

$ mixerctl -f /dev/mixer2
outputs.spkr.mute=off
outputs.spkr=121,121
record.mic.mute=off
record.mic=255
inputs.mic.mute=on
inputs.mic=0

Simple enough.  azalia(4) however has over 88 knobs on my system,
and I have to do a bit of guesswork to get e.g. recording to work,
but I suppose there's no easier way to do this while keeping the
features of azalia(4) present and controllable.

I know a lot of work has been put into azalia(4) by Jacob and as
I initially said, I in no way want to undermine that work.  What
I wanted was a simpler way of controlling the basic features of
the device.



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-21 Thread Alexandre Ratchov
On Sat, Nov 21, 2009 at 05:54:21AM +, Jacob Meuser wrote:
> On Sat, Nov 21, 2009 at 12:28:38AM -0500, Ted Unangst wrote:
> > On Fri, Nov 20, 2009 at 3:19 PM, Jacob Meuser 
> > wrote:
> > >> If you don't like mixerctl, there's at least a half dozen mixers in
> > >> ports.
> > >
> > > those don't help at all.  cmixer is the only one with a chance of
> > > ever being really helpful, imo.  it's the only one that doesn't use
> > > libossaudio (where the real mixer names are matched to OSS names,
> > > ick).
> > 
> > I used aumix with some success, back when I was scared of the command
> > line (and using an ISA soundblaster).  I'm not sure what it would do
> > with a current azalia set of mixers, but in olden times it managed to
> > pop up a useful set of sliders.
> 
> because our mixer interface design only ever had simple old timey SB
> type devices as it's target.  same with OSS.
> 
> 
> frankly, I get rather perturbed at people complaining about azalia's
> mixer interface, because that's what's driven all the other "free"
> HDA drivers to try to shoehorn HDA mixers into a simple SB-like
> mixer interface.  just doesn't work without taking away a lot of
> the capabilities.  not only do they take away a lot of capablilty,
> they get it wrong, because it's not easy, with no way but patching
> the driver (or maybe NetBSD's hdaudioctl, or FreeBSD's HDA sysctls,
> or Linux's boot parameters, all of which require some understanding
> of the *HDA specification* to use effectively) to fix it.  yeah,
> azalia mixers may have a lot of controls, but there all right there
> to be configured as you wish.
> 
> 

I'm glad HDA devices have "complicated" mixers, because
it showed that SB-like approach to the mixer is plain wrong.

I fully agree with Jacob here, we can't make azalia(4) look
like a soundblaster to "simplify it". The way to go is to
have a structured mixer to allow apps to behave
intelligently: searching for knobs, grouping knobs
together... somewhat as the azalia(4) driver builds its
outputs.master now.

The last week, I've seen for the first time a real azalia(4)
device, I mean not just a dump of mixerctl output sent by
someone by e-mail.

mixerctl displayed a lot of controls but their names were
structured enough to find very quickly all controls I
needed. IMHO azalia(4) mixer is structured and could almost
be used pragmatically. Thanks for all the recent
developments.

-- Alexandre



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Jacob Meuser
On Sat, Nov 21, 2009 at 12:28:38AM -0500, Ted Unangst wrote:
> On Fri, Nov 20, 2009 at 3:19 PM, Jacob Meuser 
> wrote:
> >> If you don't like mixerctl, there's at least a half dozen mixers in
> >> ports.
> >
> > those don't help at all.  cmixer is the only one with a chance of
> > ever being really helpful, imo.  it's the only one that doesn't use
> > libossaudio (where the real mixer names are matched to OSS names,
> > ick).
> 
> I used aumix with some success, back when I was scared of the command
> line (and using an ISA soundblaster).  I'm not sure what it would do
> with a current azalia set of mixers, but in olden times it managed to
> pop up a useful set of sliders.

because our mixer interface design only ever had simple old timey SB
type devices as it's target.  same with OSS.


frankly, I get rather perturbed at people complaining about azalia's
mixer interface, because that's what's driven all the other "free"
HDA drivers to try to shoehorn HDA mixers into a simple SB-like
mixer interface.  just doesn't work without taking away a lot of
the capabilities.  not only do they take away a lot of capablilty,
they get it wrong, because it's not easy, with no way but patching
the driver (or maybe NetBSD's hdaudioctl, or FreeBSD's HDA sysctls,
or Linux's boot parameters, all of which require some understanding
of the *HDA specification* to use effectively) to fix it.  yeah,
azalia mixers may have a lot of controls, but there all right there
to be configured as you wish.


-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Ted Unangst
On Fri, Nov 20, 2009 at 3:19 PM, Jacob Meuser 
wrote:
>> If you don't like mixerctl, there's at least a half dozen mixers in
>> ports.
>
> those don't help at all.  cmixer is the only one with a chance of
> ever being really helpful, imo.  it's the only one that doesn't use
> libossaudio (where the real mixer names are matched to OSS names,
> ick).

I used aumix with some success, back when I was scared of the command
line (and using an ISA soundblaster).  I'm not sure what it would do
with a current azalia set of mixers, but in olden times it managed to
pop up a useful set of sliders.



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Jacob Meuser
On Fri, Nov 20, 2009 at 05:47:19PM +0100, Thomas Pfaff wrote:
> On Fri, 20 Nov 2009 08:28:34 -0800
> Ted Unangst  wrote:
> 
> > On Nov 20, 2009, at 8:03 AM, Thomas Pfaff  wrote:
> > 
> > > On Fri, 20 Nov 2009 15:45:31 +0100
> > > Peter Hessler  wrote:
> > >
> > >> mixerctl inputs.master=[0,255]
> > >> mixerctl outputs.master=[0,255]
> > >
> > > Still, is a simpler sysctl interface something people want?  mixerctl
> > > can be reserved for people wanting to screw around with the gazillion
> > > of options available.
> > 
> > Mixerctl and sysctl already have the same interface. And saying  
> > mixerctl has too many options is silly considering how many options  
> > sysctl has.
> 
> Sure, but sysctl snd.* won't have that many options.  Do you really
> like the mixerctl interface?

outputs.master and record.volume are intentionally near the end of
the control list, so no matter how many controls there are, when
you do 'mixerctl', they are on the display, and you can ignore the
rest ...

> > If you don't like mixerctl, there's at least a half dozen mixers in  
> > ports.
> 
> I don't want some band aid solution.
> 
> Anyway, thanks for the feedback.

mixerctl is not intended to be user friendly.  think about it, it just
dumps all the mixer controls and their current values.

someone who feels mixerctl is lacking needs to write an intelligent mixer
program.  I am comfortable with mixerctl.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Jacob Meuser
On Fri, Nov 20, 2009 at 08:28:34AM -0800, Ted Unangst wrote:
> On Nov 20, 2009, at 8:03 AM, Thomas Pfaff  wrote:
> 
> >On Fri, 20 Nov 2009 15:45:31 +0100
> >Peter Hessler  wrote:
> >
> >>mixerctl inputs.master=[0,255]
> >>mixerctl outputs.master=[0,255]
> >
> >Still, is a simpler sysctl interface something people want?  mixerctl
> >can be reserved for people wanting to screw around with the gazillion
> >of options available.

I have been considering making 'outputs.master' and 'record.volume'
standard on all devices.  the way it's done in azalia(4) could be
done for any driver.  uaudio(4) would be the only difficult one,
the rest would be easy.

but that would mean things are a lot more consistent (same "basic"
controls on all audio devices), and would even simplify some code
in audio(4).

I just haven't decided what would be the best way to do that yet.
probably some of the code could be reused, but where to put that
code is the question.  i.e. a driver just needs to make lists
of device indexes, but the mixer code has to be part of the
hardware driver, not audio(4) ...

> Mixerctl and sysctl already have the same interface. And saying  
> mixerctl has too many options is silly considering how many options  
> sysctl has.
> 
> If you don't like mixerctl, there's at least a half dozen mixers in  
> ports.

those don't help at all.  cmixer is the only one with a chance of
ever being really helpful, imo.  it's the only one that doesn't use
libossaudio (where the real mixer names are matched to OSS names,
ick).

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Jacob Meuser
On Fri, Nov 20, 2009 at 08:16:40PM +0100, Atle Kristensen wrote:

> what about audioctl, I think that the defaults could be more sane on USB 
> audio's?
> (OpenBSD 4.6
> 
> play.rate=32000
> play.channels=1
> play.precision=8

this was recently changed in -current to try to set 44.1 kHz stereo 16-bit
slinear by default, but of course it depends whether or not the device
supports those parameters.  it will get as close as possible.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Jacob Meuser
On Fri, Nov 20, 2009 at 04:10:26PM +0100, Thomas Pfaff wrote:
> On Fri, 20 Nov 2009 15:45:31 +0100
> Peter Hessler  wrote:
> 
> > mixerctl inputs.master=[0,255]
> > mixerctl outputs.master=[0,255]
> > 
> > 
> > those two should do what you want.  the rest are there for people that
> > like to poke at their audio bits. 
> > 
> 
> Well, inputs could be a line or a mic so I think we need to be a bit
> more specific, or maybe that's the job of mixerctl *shrugs*

yes, exactly.

also note that azalia has the notion of "jack retasking", so you can
input through what would normaly be an output, or output through what
would normally be an input.  the outputs.*_dir controls control the
direction of retaskable ports.

for example on my laptop, I have 3 jacks: 1 hp, 1 mic and 1 line-in.
normally, the mic and line-in jacks are for input, but I can make
all the jacks output and play 5.1 surround.  fwiw, that isn't
possible on linux, netbsd or freebsd.  at least not with my laptop.

I've been meaning to write up an article for undeadly about jack
retasking with azalia (and multichannel/multistream with aucat)
but I've been more interested in understanding/fixing uauadio(4)
lately.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Jacob Meuser
On Fri, Nov 20, 2009 at 03:45:31PM +0100, Peter Hessler wrote:
> mixerctl inputs.master=[0,255]

record.volume, actually.  historical/consistency reasons.

> mixerctl outputs.master=[0,255]
> 
> those two should do what you want.  the rest are there for people that
> like to poke at their audio bits. 

yes.  note that on azalia, those two (record.volume and outputs.master)
are special.  their behaviour and configurability is explained in
azalia(4) (as of some weeks in -current, anyway).

recording is a little different though, as you should really be able
to choose the source.  usually the control to select the recording
source on azalia is record.adc-0:1_source.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Thomas Pfaff
On Fri, 20 Nov 2009 18:01:24 +0100
Alexandre Ratchov  wrote:
>
> > I'm not trying to undermine the work put into this; it has been greatly
> > improved over the last 6 months or so, but all I really want to do is
> > simply adjust the input and output volume (and a few other things);
> > 
> >sysctl snd.outputN.volume=[0,255]
> >sysctl snd.inputN.volume[0,255]
> 
> Switching from ioctl to sysctl won't change the number of
> knobs, neither it will simplify their names.
> 
> Additionnaly in the longer term, mixer knobs should use
> read(2) and write(2), so they can be polled, instead of a
> ioctl(2)-like interface. So sepending time on this wouldn't
> be very paying.
> 

OK, I got the feedback I wanted.  Thanks all.  I'll continue
hating mixerctl(1) and hope something more sane show up in
the future ;-)

Cheers,
Thomas.



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Ted Unangst

On Nov 20, 2009, at 8:47 AM, Thomas Pfaff  wrote:


On Fri, 20 Nov 2009 08:28:34 -0800
Ted Unangst  wrote:


On Nov 20, 2009, at 8:03 AM, Thomas Pfaff  wrote:


On Fri, 20 Nov 2009 15:45:31 +0100
Peter Hessler  wrote:


mixerctl inputs.master=[0,255]
mixerctl outputs.master=[0,255]


Still, is a simpler sysctl interface something people want?   
mixerctl
can be reserved for people wanting to screw around with the  
gazillion

of options available.


Mixerctl and sysctl already have the same interface. And saying
mixerctl has too many options is silly considering how many options
sysctl has.


Sure, but sysctl snd.* won't have that many options.  Do you really
like the mixerctl interface?




"only look at the options you care about" works equally well for  
mixerctl as sysctl. :). You know you're looking for snd but that's  
only because you just invented it. Typical users will be no better off.


What do I do? I find a volume I like and I put it in /etc/ 
mixerctl.conf. The interface is just fine for that. I guess I have  
trouble imagining a situation where:

A: you want to type commands into a terminal to adjust the volume
B: you adjust the volume frequently enough you want to optimize this
C: you adjust the volume infrequently enough you don't remember which  
knob to turn.


By analogy, there are a shit ton of programs in /usr/bin but that  
doesn't mean I run ls to find the one I want. I memorized the  
important ones and ignore the rest.


I don't think ease if use is a bad thing, I just think your suggestion  
doesn't change anything. 



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Alexandre Ratchov
On Fri, Nov 20, 2009 at 03:39:55PM +0100, Thomas Pfaff wrote:
> Hi.
> 
> I've been thinking a bit about how to simplify the audio interface in
> OpenBSD and I thought about sysctl.  Personally I find the mixerctl
> interface horrible.  88 entries on my system, and I honestly do not
> understand what half of it is for ;-)
> 
> I'm not trying to undermine the work put into this; it has been greatly
> improved over the last 6 months or so, but all I really want to do is
> simply adjust the input and output volume (and a few other things);
> 
>sysctl snd.outputN.volume=[0,255]
>sysctl snd.inputN.volume[0,255]
> 

Switching from ioctl to sysctl won't change the number of
knobs, neither it will simplify their names.

Additionnaly in the longer term, mixer knobs should use
read(2) and write(2), so they can be polled, instead of a
ioctl(2)-like interface. So sepending time on this wouldn't
be very paying.

-- Alexandre



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Atle Kristensen
On Fri, 20 Nov 2009 16:10:26 +0100
Thomas Pfaff  wrote:

> On Fri, 20 Nov 2009 15:45:31 +0100
> Peter Hessler  wrote:
> 
> > mixerctl inputs.master=[0,255]
> > mixerctl outputs.master=[0,255]
> > 
> > 
> > those two should do what you want.  the rest are there for people that
> > like to poke at their audio bits. 
> > 
> 
> Well, inputs could be a line or a mic so I think we need to be a bit
> more specific, or maybe that's the job of mixerctl *shrugs*
> 



what about audioctl, I think that the defaults could be more sane on USB 
audio's?
(OpenBSD 4.6

play.rate=32000
play.channels=1
play.precision=8

uaudio0 at uhub0 port 2 configuration 1 interface 0 "Burr-Brown from TI USB 
Audio CODEC" rev 1.10/1.00 addr 2
uaudio0: audio rev 1.00, 2 mixer controls
audio1 at uaudio0
$ audioctl -f /dev/audio1 -a 
name=USB audio
version=
config=uaudio
encodings=ulinear:8,mulaw:8*,alaw:8*,slinear:8,slinear_le:16,ulinear_le:16*,slinear_be:16*,ulinear_be:16*
properties=full_duplex,independent
full_duplex=0
fullduplex=0
blocksize=1984
hiwat=16
lowat=12
output_muted=0
monitor_gain=0
mode=play
play.rate=32000
play.channels=1
play.precision=8
play.encoding=mulaw
play.gain=127
play.balance=32
play.port=0x0
play.avail_ports=0x0
play.seek=0
play.samples=0
play.eof=0
play.pause=0
play.error=0
play.waiting=0
play.open=1
play.active=0
play.buffer_size=32768
play.block_size=1984
play.errors=0
record.rate=160


Internal audio:
$ audioctl -f /dev/audio0 -a 
name=VIA VT82C686A
version=
config=auvia

play.rate=48000
play.channels=2
play.precision=16

$ head /var/run/dmesg.boot  
 
OpenBSD 4.5-current (GENERIC) #14: Thu May 28 20:42:55 MDT 2009
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: VIA Nehemiah ("CentaurHauls" 686-class) 534 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,CX8,SEP,MTRR,PGE,CMOV,PAT,MMX,FXSR,SSE
real mem  = 125399040 (119MB)
avail mem = 112758784 (107MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 11/14/02, BIOS32 rev. 0 @ 0xfb370, SMBIOS 
rev. 2.2 @ 0xf0800 (29 entries)
bios0: vendor Award Software International, Inc. version "6.00 PG" date 
11/14/2002
bios0: VIA TECHNOLOGIES, INC. EPIA


(a BIG THANK YOU to all who made the usbaudio work!) :)

-- 
# Atle Kristensen
Sono stati 50 anni di intensa attivita e di successi... 
Non si e mai finito di imparare e creare per dar corpo ai sogni.
 -- Ernesto Colnago



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Thomas Pfaff
On Fri, 20 Nov 2009 08:28:34 -0800
Ted Unangst  wrote:

> On Nov 20, 2009, at 8:03 AM, Thomas Pfaff  wrote:
> 
> > On Fri, 20 Nov 2009 15:45:31 +0100
> > Peter Hessler  wrote:
> >
> >> mixerctl inputs.master=[0,255]
> >> mixerctl outputs.master=[0,255]
> >
> > Still, is a simpler sysctl interface something people want?  mixerctl
> > can be reserved for people wanting to screw around with the gazillion
> > of options available.
> 
> Mixerctl and sysctl already have the same interface. And saying  
> mixerctl has too many options is silly considering how many options  
> sysctl has.

Sure, but sysctl snd.* won't have that many options.  Do you really
like the mixerctl interface?

> If you don't like mixerctl, there's at least a half dozen mixers in  
> ports.

I don't want some band aid solution.

Anyway, thanks for the feedback.



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Ted Unangst

On Nov 20, 2009, at 8:03 AM, Thomas Pfaff  wrote:


On Fri, 20 Nov 2009 15:45:31 +0100
Peter Hessler  wrote:


mixerctl inputs.master=[0,255]
mixerctl outputs.master=[0,255]


Still, is a simpler sysctl interface something people want?  mixerctl
can be reserved for people wanting to screw around with the gazillion
of options available.


Mixerctl and sysctl already have the same interface. And saying  
mixerctl has too many options is silly considering how many options  
sysctl has.


If you don't like mixerctl, there's at least a half dozen mixers in  
ports.




Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Thomas Pfaff
On Fri, 20 Nov 2009 15:45:31 +0100
Peter Hessler  wrote:

> mixerctl inputs.master=[0,255]
> mixerctl outputs.master=[0,255]
> 
> 
> those two should do what you want.  the rest are there for people that
> like to poke at their audio bits. 
> 

Sorry, I misread what you said.

Still, is a simpler sysctl interface something people want?  mixerctl
can be reserved for people wanting to screw around with the gazillion
of options available.



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Thomas Pfaff
On Fri, 20 Nov 2009 15:45:31 +0100
Peter Hessler  wrote:

> mixerctl inputs.master=[0,255]
> mixerctl outputs.master=[0,255]
> 
> 
> those two should do what you want.  the rest are there for people that
> like to poke at their audio bits. 
> 

Well, inputs could be a line or a mic so I think we need to be a bit
more specific, or maybe that's the job of mixerctl *shrugs*



Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Peter Hessler
mixerctl inputs.master=[0,255]
mixerctl outputs.master=[0,255]


those two should do what you want.  the rest are there for people that
like to poke at their audio bits. 


On 2009 Nov 20 (Fri) at 15:39:55 +0100 (+0100), Thomas Pfaff wrote:
:Hi.
:
:I've been thinking a bit about how to simplify the audio interface in
:OpenBSD and I thought about sysctl.  Personally I find the mixerctl
:interface horrible.  88 entries on my system, and I honestly do not
:understand what half of it is for ;-)
:
:I'm not trying to undermine the work put into this; it has been greatly
:improved over the last 6 months or so, but all I really want to do is
:simply adjust the input and output volume (and a few other things);
:
:   sysctl snd.outputN.volume=[0,255]
:   sysctl snd.inputN.volume[0,255]
:
:or something like that.  Is this anything to pursue or should I just
:leave it alone?
:
:Cheers,
:Thomas
:

-- 
"I'd love to go out with you, but I'm staying home to work on my
cottage cheese sculpture."



mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Thomas Pfaff
Hi.

I've been thinking a bit about how to simplify the audio interface in
OpenBSD and I thought about sysctl.  Personally I find the mixerctl
interface horrible.  88 entries on my system, and I honestly do not
understand what half of it is for ;-)

I'm not trying to undermine the work put into this; it has been greatly
improved over the last 6 months or so, but all I really want to do is
simply adjust the input and output volume (and a few other things);

   sysctl snd.outputN.volume=[0,255]
   sysctl snd.inputN.volume[0,255]

or something like that.  Is this anything to pursue or should I just
leave it alone?

Cheers,
Thomas