Re: volume keys not working on thinkpad x201

2014-03-30 Thread Remi Locherer
On Sun, Mar 23, 2014 at 07:06:51PM +0100, Alexandre Ratchov wrote:
> On Sun, Mar 23, 2014 at 11:38:11AM -0600, Theo de Raadt wrote:
> > > >>> So we should take all our hardware mixers, and crank them to full
> > > >>> volume right at boot time.
> > > >>>
> > > >> IMO, this is the best option.
> > > Do you have a stereo system connected to your PC? I would not
> > > made this the default. Start low and if "you" want a loud default
> > > setting, use mixerctl.conf
> > 
> > So that is the reason why my car stereo has two sets of volume control
> > knobs. with the second set located inside the engine compartment,
> > so I have to stop at the side of the road, pop open the hood, and
> > reach down along the hot engine to near where the oil filter is.
> > 
> > It is ridiculous to have two layers of volume control.
> > 
> > It is unfriendly.
> 
> 100% agreed. We should have one mixer only.
> 

I installed the snapshot from March 29 and the volume keys now work as
before (changing outputs.master). Thank you!



Re: volume keys not working on thinkpad x201

2014-03-24 Thread Kent R. Spillner
If you're trying to "surf the web" one handed in the basement after your family 
goes to sleep you want the hardware muted by default.



Re: volume keys not working on thinkpad x201

2014-03-24 Thread Jean-Philippe Ouellet
On 3/24/14 7:01 AM, Alexandre Ratchov wrote:
> I was talking about raising initial hardware volume and lowering
> the initial software volume (current defaults are the opposite). I
> agree that it doesn't make sense to have everything cranked.

Not that my opinion is worth anything, but I strongly believe a
lower hardware volume seems like a much more sane default. If you
want to be /that guy/ who turns on their fire alarm^W^W laptop in
the meeting, then by all means do so, but I don't think it makes
sense to subject everyone else to it by default.

> This would allow more use-cases to be handled in software only, but
> may force those of us with noisy devices and alike (see tedu@ mail
> for more examples) to change the defaults by hand.

Sure, that's nice, but at what cost? Perhaps an FAQ entry is in order
to tell people how to raise it, but like tedu I'd rather be annoyed
than angry, and being quiet by default doesn't even really annoy me.



Re: volume keys not working on thinkpad x201

2014-03-24 Thread Theo de Raadt
> previously on this list Alexandre Ratchov contributed:
> 
> > I was talking about raising initial hardware volume and lowering
> > the initial software volume (current defaults are the opposite)
> 
> My dads a bit of an audio junkie having built his first record player
> when he was 14 and he tells me setting PCM below maximum (75% - 90%)
> often gives a better quality or lower noise output or avoids clipping
> (ignoring clipping by idiot production crews these days competing for
> their song to be as loud as the amplified radio adverts).
> 
> Whether it becomes a potentially overlooked limiter compared to
> master may need consideration. Does anyone need absolute max volume, say
> on a netbook?

Alexandre Ratchov is an audio junkie, too.

But he's commited a "softwave volume control" design which is completely
disconnected from the hardware volume control.

Take that for what it is.



Re: volume keys not working on thinkpad x201

2014-03-24 Thread Kevin Chadwick
previously on this list Alexandre Ratchov contributed:

> I was talking about raising initial hardware volume and lowering
> the initial software volume (current defaults are the opposite)

My dads a bit of an audio junkie having built his first record player
when he was 14 and he tells me setting PCM below maximum (75% - 90%)
often gives a better quality or lower noise output or avoids clipping
(ignoring clipping by idiot production crews these days competing for
their song to be as loud as the amplified radio adverts).

Whether it becomes a potentially overlooked limiter compared to
master may need consideration. Does anyone need absolute max volume, say
on a netbook?

-- 
___

'Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface'

(Doug McIlroy)

In Other Words - Don't design like polkit or systemd
___



Re: volume keys not working on thinkpad x201

2014-03-24 Thread Alexandre Ratchov
On Sun, Mar 23, 2014 at 05:33:11PM +0100, Benjamin Baier wrote:
> >>>So we should take all our hardware mixers, and crank them to full
> >>>volume right at boot time.
> >>>
> >>IMO, this is the best option.
> Do you have a stereo system connected to your PC? 

sure, one with a 250W amp

> I would not
> made this the default. Start low and if "you" want a loud default
> setting, use mixerctl.conf
> 

I was talking about raising initial hardware volume and lowering
the initial software volume (current defaults are the opposite). I
agree that it doesn't make sense to have everything cranked.

This would allow more use-cases to be handled in software only, but
may force those of us with noisy devices and alike (see tedu@ mail
for more examples) to change the defaults by hand.

Anyway there's no plan for this, and we must fix the volume keys
(pckbd driver) before attempting to change the mixer and/or the
defauts.

> >
> >I think there is a major disconnect here.  The software level should
> >control the hardware level.
> >
> >Or, this entire software layer should be removed.  While the new mechanims
> >is fancy, the old one worked right.
> >
> Sound volume controll is higly user specific, and it troubles me with
> every OS I use. Especially if there is more than one sound
> card attached (e.g. USB Headset on a Laptop). And then different
> sound inputs (mostly software, firefox, media player, system sounds)
> all coming in with different line levels (volumes)...

in my experience systems with lots of sources and devices are
better handled in software with all hardware levels set to 0dB.
Single point of control, all sound cards look the same, etc...

> 
> I would also like the up/down/mute keys actuating the hardware outputs.

that makes sense in most cases.

-- Alexandre



Re: volume keys not working on thinkpad x201

2014-03-24 Thread Kevin Chadwick
previously on this list Ted Unangst contributed:

> All true. Since we're talking about thinkpads, I will note that
> outputs.master does control the volume of the beeper because in this
> particular case it is wired up that way on most models I'm familiar
> with.
> 
> I don't expect or ask that mixerctl work with the beeper, just
> pointing out that we cannot assume the opposite, that the audio mixer
> won't affect the beeper.

In light of some laptops having software controlled cpu fans
(especially nvidia gpu fans controlled by closed drivers). I have to say
I was impressed by the Thinkpad T42 remembering my hardware mute option
between boots even after the battery and power is removed and applying
that to the low battery beeps too. Much better than the HP and other
laptops that are always enabled on boot, meaning you would have to
catch any login sound if in a presentation audience for example.

-- 
___

'Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface'

(Doug McIlroy)

In Other Words - Don't design like polkit or systemd
___



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Remi Locherer
On Sun, Mar 23, 2014 at 02:27:57PM +0100, Alexandre Ratchov wrote:
> On Sun, Mar 23, 2014 at 10:50:21AM +0100, Remi Locherer wrote:
> > On Sat, Mar 22, 2014 at 04:31:22PM -0600, Theo de Raadt wrote:
> > > > > Date: Sat, 22 Mar 2014 21:49:19 +0100 (CET)
> > > > > From: remi.loche...@relo.ch
> > > > > 
> > > > >   With the snapshot from March 22 the volume keys on my ThinkPad
> > > > >   x201 do not work anymore. mixerctl still works. Before I was
> > > > >   running the snapshot from Feb 3 with which the volume keys
> > > > >   worked.
> > > > 
> > > > The volume keys still work.  What changed is that the volume keys no
> > > > longer control the hardware mixer directly anymore when you're running
> > > > X.  Instead the volume key events are passed to whatever X application
> > > > is running.  If you're running mplayer, you'll see that the volume
> > > > keys still control the volume and give you feedback on the screen.  If
> > > > you run gnome, you'll see something similar.
> > > > 
> > > > The problem you might experience is that the x201 boots up with the
> > > > hardware mixer set to a fairly low level.  And the software volume
> > > > control in most X applications won't change it so you won't be able to
> > > > go any higher by just pressing the volume keys.
> >  
> > When several X applications are running which one should get the event?
> > 
> > I cranked outputs.master to 200 and tested with smplayer and aqualung
> > both playing something. The volume keys had no audible nor visual effect.
> 
> Do volume keys work when smplayer and aqualung have the keyboard
> focus ?

No, it does not work with smplayer and aqualung. But it works with
mplayer when it has the focus.

> > > So we should take all our hardware mixers, and crank them to full
> > > volume right at boot time.
> > > 
> > > Except that would be bad.  So this indicates that the new mixer layer
> > > has a problem.
> > 
> > The old behaviour where the volume keys manipulated outputs.master was
> > more intuitive to me. 
> 
> yes but it doesn't work in all cases :(



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Mark Kettenis
> Date: Sun, 23 Mar 2014 14:51:24 -0400
> From: Ted Unangst 
> 
> On Sun, Mar 23, 2014 at 18:24, Miod Vallat wrote:
> >> Slamming outputs.master=255 would be way worse than the current
> >> situation. There are sounds, like the beep made when suspending and
> >> resuming, that do not go through sndiod. Maxing out the hardware volume
> >> is not a viable option.
> > 
> > suspend/resume and text console beeps usually run through pcppi(4),
> > which volume is not necessarily controlled by the audio device
> > (especially on systems without onboard audio devices).
> > 
> > There is no easy way to have the volume settings shown by mixerctl apply
> > to this. And, to the best of my knowledge, the kernel has no way to know
> > whether the pcppi wave generator goes through the audio device, or
> > directly reaches the speaker.
> 
> All true. Since we're talking about thinkpads, I will note that
> outputs.master does control the volume of the beeper because in this
> particular case it is wired up that way on most models I'm familiar
> with.
> 
> I don't expect or ask that mixerctl work with the beeper, just
> pointing out that we cannot assume the opposite, that the audio mixer
> won't affect the beeper.

Note that on some machines where the beeper goes through the hardware
mixer, there is an inputs.beep that controls its (relative) volume.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Ted Unangst
On Sun, Mar 23, 2014 at 18:24, Miod Vallat wrote:
>> Slamming outputs.master=255 would be way worse than the current
>> situation. There are sounds, like the beep made when suspending and
>> resuming, that do not go through sndiod. Maxing out the hardware volume
>> is not a viable option.
> 
> suspend/resume and text console beeps usually run through pcppi(4),
> which volume is not necessarily controlled by the audio device
> (especially on systems without onboard audio devices).
> 
> There is no easy way to have the volume settings shown by mixerctl apply
> to this. And, to the best of my knowledge, the kernel has no way to know
> whether the pcppi wave generator goes through the audio device, or
> directly reaches the speaker.

All true. Since we're talking about thinkpads, I will note that
outputs.master does control the volume of the beeper because in this
particular case it is wired up that way on most models I'm familiar
with.

I don't expect or ask that mixerctl work with the beeper, just
pointing out that we cannot assume the opposite, that the audio mixer
won't affect the beeper.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Miod Vallat
> Slamming outputs.master=255 would be way worse than the current
> situation. There are sounds, like the beep made when suspending and
> resuming, that do not go through sndiod. Maxing out the hardware volume
> is not a viable option.

suspend/resume and text console beeps usually run through pcppi(4),
which volume is not necessarily controlled by the audio device
(especially on systems without onboard audio devices).

There is no easy way to have the volume settings shown by mixerctl apply
to this. And, to the best of my knowledge, the kernel has no way to know
whether the pcppi wave generator goes through the audio device, or
directly reaches the speaker.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Ted Unangst
On Sun, Mar 23, 2014 at 18:53, Alexandre Ratchov wrote:
> On Sun, Mar 23, 2014 at 11:52:49AM -0400, Ted Unangst wrote:
>> On Sun, Mar 23, 2014 at 14:22, Alexandre Ratchov wrote:
>> >> So we should take all our hardware mixers, and crank them to full
>> >> volume right at boot time.
>> >> 
>> > 
>> > IMO, this is the best option.
>> 
>> Strongest possible disagree.
> 
> so, diff to fix pckbd(4) is welcome.

The current situation isn't perfect, but at least I can live with it,
or have figured out how to cope.

Slamming outputs.master=255 would be way worse than the current
situation. There are sounds, like the beep made when suspending and
resuming, that do not go through sndiod. Maxing out the hardware volume
is not a viable option.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Alexandre Ratchov
On Sun, Mar 23, 2014 at 11:38:11AM -0600, Theo de Raadt wrote:
> > >>> So we should take all our hardware mixers, and crank them to full
> > >>> volume right at boot time.
> > >>>
> > >> IMO, this is the best option.
> > Do you have a stereo system connected to your PC? I would not
> > made this the default. Start low and if "you" want a loud default
> > setting, use mixerctl.conf
> 
> So that is the reason why my car stereo has two sets of volume control
> knobs. with the second set located inside the engine compartment,
> so I have to stop at the side of the road, pop open the hood, and
> reach down along the hot engine to near where the oil filter is.
> 
> It is ridiculous to have two layers of volume control.
> 
> It is unfriendly.

100% agreed. We should have one mixer only.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Alexandre Ratchov
On Sun, Mar 23, 2014 at 11:56:44AM -0600, Theo de Raadt wrote:
> > On Sun, Mar 23, 2014 at 11:52:49AM -0400, Ted Unangst wrote:
> > > On Sun, Mar 23, 2014 at 14:22, Alexandre Ratchov wrote:
> > > >> So we should take all our hardware mixers, and crank them to full
> > > >> volume right at boot time.
> > > >> 
> > > > 
> > > > IMO, this is the best option.
> > > 
> > > Strongest possible disagree.
> > 
> > so, diff to fix pckbd(4) is welcome.
> 
> The problem is not with the keyboard controllers.
> 
> The issue is that libsndiod does not watch & manipulate the
> hardware mixer.

libsndio never made use of the hardware mixer. The old mixer is
still there. It hasn't changed. Just rebuild your kernel, and keep
using it.

> It ignores a critical piece of the machine, which worked fine before.

the mixer didn't change since 2008



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Theo de Raadt
> On Sun, Mar 23, 2014 at 11:52:49AM -0400, Ted Unangst wrote:
> > On Sun, Mar 23, 2014 at 14:22, Alexandre Ratchov wrote:
> > >> So we should take all our hardware mixers, and crank them to full
> > >> volume right at boot time.
> > >> 
> > > 
> > > IMO, this is the best option.
> > 
> > Strongest possible disagree.
> 
> so, diff to fix pckbd(4) is welcome.

The problem is not with the keyboard controllers.

The issue is that libsndiod does not watch & manipulate the
hardware mixer.

It ignores a critical piece of the machine, which worked fine before.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Alexandre Ratchov
On Sun, Mar 23, 2014 at 11:52:49AM -0400, Ted Unangst wrote:
> On Sun, Mar 23, 2014 at 14:22, Alexandre Ratchov wrote:
> >> So we should take all our hardware mixers, and crank them to full
> >> volume right at boot time.
> >> 
> > 
> > IMO, this is the best option.
> 
> Strongest possible disagree.

so, diff to fix pckbd(4) is welcome.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Theo de Raadt
> >>> So we should take all our hardware mixers, and crank them to full
> >>> volume right at boot time.
> >>>
> >> IMO, this is the best option.
> Do you have a stereo system connected to your PC? I would not
> made this the default. Start low and if "you" want a loud default
> setting, use mixerctl.conf

So that is the reason why my car stereo has two sets of volume control
knobs. with the second set located inside the engine compartment,
so I have to stop at the side of the road, pop open the hood, and
reach down along the hot engine to near where the oil filter is.

It is ridiculous to have two layers of volume control.

It is unfriendly.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Benjamin Baier

So we should take all our hardware mixers, and crank them to full
volume right at boot time.


IMO, this is the best option.

Do you have a stereo system connected to your PC? I would not
made this the default. Start low and if "you" want a loud default
setting, use mixerctl.conf



If hardware mixer is too loud, we can attenuate the sound in
software. The opposite in not possible, we can't increase the
volume in software if the hardware is too quiet.


Except that would be bad.  So this indicates that the new mixer layer
has a problem.

Hardware defaults are too quiet, they have always been too quiet.


I think there is a major disconnect here.  The software level should
control the hardware level.

Or, this entire software layer should be removed.  While the new mechanims
is fancy, the old one worked right.


Sound volume controll is higly user specific, and it troubles me with
every OS I use. Especially if there is more than one sound
card attached (e.g. USB Headset on a Laptop). And then different
sound inputs (mostly software, firefox, media player, system sounds)
all coming in with different line levels (volumes)...

I would also like the up/down/mute keys actuating the hardware outputs.

 - Ben



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Theo de Raadt
> On Sun, Mar 23, 2014 at 14:22, Alexandre Ratchov wrote:
> >> So we should take all our hardware mixers, and crank them to full
> >> volume right at boot time.
> >> 
> > 
> > IMO, this is the best option.
> 
> Strongest possible disagree. The keyboard beep on my thinkpads at full
> volume is mind shattering. Among other noises. I do not want to be in
> the situation where I'm hoping that sndiod will then soft lower the
> volume to an acceptable level. The fact that there is a mixer that
> mplayer is not aware of could be considered a feature.
> 
> Across a variety of machines, running a variety of operating
> systems and software, I am constantly adjusting the volume up or down
> depending on the sitatuation because there is no one level that's
> perfect. I make the following observation about my emotional state when
> doing so:
> 
> When I have to raise the volume, I am annoyed.
> When I have to lower the volume, I am *angry*.
> 
> > Hardware defaults are too quiet, they have always been too quiet.
> 
> I think that's fine. Quiet is secure by default. :)
> 
> We ship a default /etc/mixerctl.conf with a commented entry that raises
> the volume. If people want loud, it's an easy change to make.

The "two mixers" model is broken.   There should only be one mixer.

The software mixer should notice when hardware mixer changes happen
behind the scene.

The software mixer should also tune the hardware mixer itself into a
high or low range.

Basically, somewhere along the way writing this code Alexandre started
to think that users could cope with a multi-control mixer board.  That
is not realistic.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Ted Unangst
On Sun, Mar 23, 2014 at 14:22, Alexandre Ratchov wrote:
>> So we should take all our hardware mixers, and crank them to full
>> volume right at boot time.
>> 
> 
> IMO, this is the best option.

Strongest possible disagree. The keyboard beep on my thinkpads at full
volume is mind shattering. Among other noises. I do not want to be in
the situation where I'm hoping that sndiod will then soft lower the
volume to an acceptable level. The fact that there is a mixer that
mplayer is not aware of could be considered a feature.

Across a variety of machines, running a variety of operating
systems and software, I am constantly adjusting the volume up or down
depending on the sitatuation because there is no one level that's
perfect. I make the following observation about my emotional state when
doing so:

When I have to raise the volume, I am annoyed.
When I have to lower the volume, I am *angry*.

> Hardware defaults are too quiet, they have always been too quiet.

I think that's fine. Quiet is secure by default. :)

We ship a default /etc/mixerctl.conf with a commented entry that raises
the volume. If people want loud, it's an easy change to make.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Theo de Raadt
> > So we should take all our hardware mixers, and crank them to full
> > volume right at boot time.
> > 
> 
> IMO, this is the best option.

When I do that, the audio circuits pick up noise from the hard
drive.  So there is backgorund noise all the time, even when I am
not doing audio.

> If hardware mixer is too loud, we can attenuate the sound in
> software. The opposite in not possible, we can't increase the
> volume in software if the hardware is too quiet.
> 
> > Except that would be bad.  So this indicates that the new mixer layer
> > has a problem.
> 
> Hardware defaults are too quiet, they have always been too quiet.


I think there is a major disconnect here.  The software level should
control the hardware level.

Or, this entire software layer should be removed.  While the new mechanims
is fancy, the old one worked right.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Alexandre Ratchov
On Sun, Mar 23, 2014 at 10:50:21AM +0100, Remi Locherer wrote:
> On Sat, Mar 22, 2014 at 04:31:22PM -0600, Theo de Raadt wrote:
> > > > Date: Sat, 22 Mar 2014 21:49:19 +0100 (CET)
> > > > From: remi.loche...@relo.ch
> > > > 
> > > > With the snapshot from March 22 the volume keys on my ThinkPad
> > > > x201 do not work anymore. mixerctl still works. Before I was
> > > > running the snapshot from Feb 3 with which the volume keys
> > > > worked.
> > > 
> > > The volume keys still work.  What changed is that the volume keys no
> > > longer control the hardware mixer directly anymore when you're running
> > > X.  Instead the volume key events are passed to whatever X application
> > > is running.  If you're running mplayer, you'll see that the volume
> > > keys still control the volume and give you feedback on the screen.  If
> > > you run gnome, you'll see something similar.
> > > 
> > > The problem you might experience is that the x201 boots up with the
> > > hardware mixer set to a fairly low level.  And the software volume
> > > control in most X applications won't change it so you won't be able to
> > > go any higher by just pressing the volume keys.
>  
> When several X applications are running which one should get the event?
> 
> I cranked outputs.master to 200 and tested with smplayer and aqualung
> both playing something. The volume keys had no audible nor visual effect.

Do volume keys work when smplayer and aqualung have the keyboard
focus ?

> > So we should take all our hardware mixers, and crank them to full
> > volume right at boot time.
> > 
> > Except that would be bad.  So this indicates that the new mixer layer
> > has a problem.
> 
> The old behaviour where the volume keys manipulated outputs.master was
> more intuitive to me. 

yes but it doesn't work in all cases :(



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Alexandre Ratchov
On Sat, Mar 22, 2014 at 04:31:22PM -0600, Theo de Raadt wrote:
> > > Date: Sat, 22 Mar 2014 21:49:19 +0100 (CET)
> > > From: remi.loche...@relo.ch
> > > 
> > >   With the snapshot from March 22 the volume keys on my ThinkPad
> > >   x201 do not work anymore. mixerctl still works. Before I was
> > >   running the snapshot from Feb 3 with which the volume keys
> > >   worked.
> > 
> > The volume keys still work.  What changed is that the volume keys no
> > longer control the hardware mixer directly anymore when you're running
> > X.  Instead the volume key events are passed to whatever X application
> > is running.  If you're running mplayer, you'll see that the volume
> > keys still control the volume and give you feedback on the screen.  If
> > you run gnome, you'll see something similar.
> > 
> > The problem you might experience is that the x201 boots up with the
> > hardware mixer set to a fairly low level.  And the software volume
> > control in most X applications won't change it so you won't be able to
> > go any higher by just pressing the volume keys.
> 
> So we should take all our hardware mixers, and crank them to full
> volume right at boot time.
> 

IMO, this is the best option.

If hardware mixer is too loud, we can attenuate the sound in
software. The opposite in not possible, we can't increase the
volume in software if the hardware is too quiet.

> Except that would be bad.  So this indicates that the new mixer layer
> has a problem.

Hardware defaults are too quiet, they have always been too quiet.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Mark Kettenis
> Date: Sun, 23 Mar 2014 10:50:21 +0100
> From: Remi Locherer 
> 
> On Sat, Mar 22, 2014 at 04:31:22PM -0600, Theo de Raadt wrote:
> > > > Date: Sat, 22 Mar 2014 21:49:19 +0100 (CET)
> > > > From: remi.loche...@relo.ch
> > > > 
> > > > With the snapshot from March 22 the volume keys on my ThinkPad
> > > > x201 do not work anymore. mixerctl still works. Before I was
> > > > running the snapshot from Feb 3 with which the volume keys
> > > > worked.
> > > 
> > > The volume keys still work.  What changed is that the volume keys no
> > > longer control the hardware mixer directly anymore when you're running
> > > X.  Instead the volume key events are passed to whatever X application
> > > is running.  If you're running mplayer, you'll see that the volume
> > > keys still control the volume and give you feedback on the screen.  If
> > > you run gnome, you'll see something similar.
> > > 
> > > The problem you might experience is that the x201 boots up with the
> > > hardware mixer set to a fairly low level.  And the software volume
> > > control in most X applications won't change it so you won't be able to
> > > go any higher by just pressing the volume keys.
>  
> When several X applications are running which one should get the event?

Good question.  Typically the application that has focus gets the
events, but other applications (window manager?) can steal them.

> I cranked outputs.master to 200 and tested with smplayer and aqualung
> both playing something. The volume keys had no audible nor visual effect.

Try xev(1).  The audio keys should show up as XF86AudioMute,
XF86AudioLowerVolume and XF86AudioRaiseVolume.

> I'm using cwm. Does this make a difference?

Possibly.

> The mute key works as expected tough mixerctl said outputs.master.mute=off
> while the speaker was muted.

The mute key on the Thinkpads seems to be special in that it mutes in
hardware behind the back of the OS.  Possibly acpithinkpad(4) is
responsible for this.

> > So we should take all our hardware mixers, and crank them to full
> > volume right at boot time.
> > 
> > Except that would be bad.  So this indicates that the new mixer layer
> > has a problem.
> 
> The old behaviour where the volume keys manipulated outputs.master was
> more intuitive to me. 

Except that in the old model X would also see the events and also muck
around with the volume settings.



Re: volume keys not working on thinkpad x201

2014-03-23 Thread Remi Locherer
On Sat, Mar 22, 2014 at 04:31:22PM -0600, Theo de Raadt wrote:
> > > Date: Sat, 22 Mar 2014 21:49:19 +0100 (CET)
> > > From: remi.loche...@relo.ch
> > > 
> > >   With the snapshot from March 22 the volume keys on my ThinkPad
> > >   x201 do not work anymore. mixerctl still works. Before I was
> > >   running the snapshot from Feb 3 with which the volume keys
> > >   worked.
> > 
> > The volume keys still work.  What changed is that the volume keys no
> > longer control the hardware mixer directly anymore when you're running
> > X.  Instead the volume key events are passed to whatever X application
> > is running.  If you're running mplayer, you'll see that the volume
> > keys still control the volume and give you feedback on the screen.  If
> > you run gnome, you'll see something similar.
> > 
> > The problem you might experience is that the x201 boots up with the
> > hardware mixer set to a fairly low level.  And the software volume
> > control in most X applications won't change it so you won't be able to
> > go any higher by just pressing the volume keys.
 
When several X applications are running which one should get the event?

I cranked outputs.master to 200 and tested with smplayer and aqualung
both playing something. The volume keys had no audible nor visual effect.

I'm using cwm. Does this make a difference?

The mute key works as expected tough mixerctl said outputs.master.mute=off
while the speaker was muted.

> So we should take all our hardware mixers, and crank them to full
> volume right at boot time.
> 
> Except that would be bad.  So this indicates that the new mixer layer
> has a problem.

The old behaviour where the volume keys manipulated outputs.master was
more intuitive to me. 



Re: volume keys not working on thinkpad x201

2014-03-22 Thread Theo de Raadt
> > Date: Sat, 22 Mar 2014 21:49:19 +0100 (CET)
> > From: remi.loche...@relo.ch
> > 
> > With the snapshot from March 22 the volume keys on my ThinkPad
> > x201 do not work anymore. mixerctl still works. Before I was
> > running the snapshot from Feb 3 with which the volume keys
> > worked.
> 
> The volume keys still work.  What changed is that the volume keys no
> longer control the hardware mixer directly anymore when you're running
> X.  Instead the volume key events are passed to whatever X application
> is running.  If you're running mplayer, you'll see that the volume
> keys still control the volume and give you feedback on the screen.  If
> you run gnome, you'll see something similar.
> 
> The problem you might experience is that the x201 boots up with the
> hardware mixer set to a fairly low level.  And the software volume
> control in most X applications won't change it so you won't be able to
> go any higher by just pressing the volume keys.

So we should take all our hardware mixers, and crank them to full
volume right at boot time.

Except that would be bad.  So this indicates that the new mixer layer
has a problem.



Re: volume keys not working on thinkpad x201

2014-03-22 Thread Mark Kettenis
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=relo.ch; 
> s=relo.ch-dec2013; t=1395521365; 
> bh=KDZL4Qy+ccBjd0+xefXm0iLbwWEZHI4Iu3fQGzrl1iA=; 
> h=Date:Message-Id:To:Subject:From:Cc:Reply-To; 
> b=NKOibw5wzjqXx1J8o4fy1FLpQ6+FfabL0zr7kgluhyyV/jBfAeNDqqQpTZr5lmniW 
> NAvlaE2xKhxMYenj8BYRGzES8CuQpxh+reyn21jT39vrQJMRSRVCUcnN3E9BxN9zCC 
> Wa576rtfPkhvnlhVmIpXEn2gep88dpTwk3F0558o=
> Date: Sat, 22 Mar 2014 21:49:19 +0100 (CET)
> From: remi.loche...@relo.ch
> 
>   With the snapshot from March 22 the volume keys on my ThinkPad
>   x201 do not work anymore. mixerctl still works. Before I was
>   running the snapshot from Feb 3 with which the volume keys
>   worked.

The volume keys still work.  What changed is that the volume keys no
longer control the hardware mixer directly anymore when you're running
X.  Instead the volume key events are passed to whatever X application
is running.  If you're running mplayer, you'll see that the volume
keys still control the volume and give you feedback on the screen.  If
you run gnome, you'll see something similar.

The problem you might experience is that the x201 boots up with the
hardware mixer set to a fairly low level.  And the software volume
control in most X applications won't change it so you won't be able to
go any higher by just pressing the volume keys.



volume keys not working on thinkpad x201

2014-03-22 Thread remi . locherer
>Synopsis:      volume keys not working on thinkpad x201 
>Category:  kernel
>Environment:
System  : OpenBSD 5.5
Details : OpenBSD 5.5-current (GENERIC.MP) #16: Sat Mar 22 01:04:40 
MDT 2014
 
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

Architecture: OpenBSD.amd64
Machine : amd64
>Description:
With the snapshot from March 22 the volume keys on my ThinkPad x201 do
not work anymore. mixerctl still works. Before I was running the 
snapshot
from Feb 3 with which the volume keys worked.

I tried to revert sys/dev/acpi/dsdt.c to revision 1.205 but that did not
help (the commit message noted that it might break brightness keys)

>How-To-Repeat:
Install the snapshot from Mar 22 on a ThinkPad x201 and try to use the
volume buttons.



dmesg:
OpenBSD 5.5-current (GENERIC.MP) #16: Sat Mar 22 01:04:40 MDT 2014
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8357658624 (7970MB)
avail mem = 8126451712 (7749MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xe0010 (78 entries)
bios0: vendor LENOVO version "6QET61WW (1.31 )" date 10/26/2010
bios0: LENOVO 3626GN8
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT APIC MCFG HPET ASF! BOOT SSDT TCPA DMAR SSDT 
SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) IGBE(S4) EXP1(S4) EXP2(S4) EXP3(S4) 
EXP4(S4) EXP5(S4) EHC1(S3) EHC2(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz, 1197.20 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF,PERF,ITSC
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 132MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1.0, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz, 1197.00 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF,PERF,ITSC
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz, 1197.00 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF,PERF,ITSC
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 5 (application processor)
cpu3: Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz, 1197.00 MHz
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF,PERF,ITSC
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 2, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG_)
acpiprt2 at acpi0: bus 13 (EXP1)
acpiprt3 at acpi0: bus -1 (EXP2)
acpiprt4 at acpi0: bus -1 (EXP3)
acpiprt5 at acpi0: bus 5 (EXP4)
acpiprt6 at acpi0: bus 2 (EXP5)
acpicpu0 at acpi0: C3, C1, PSS
acpicpu1 at acpi0: C3, C1, PSS
acpicpu2 at acpi0: C3, C1, PSS
acpicpu3 at acpi0: C3, C1, PSS
acpipwrres0 at acpi0: PUBS, resource for EHC1, EHC2
acpitz0 at acpi0: critical temperature is 100 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model "42T4694" serial  1523 type LION oem "SANYO"
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit offline
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
cpu0: Enhanced SpeedStep 1197 MHz: speeds: 2667, 2666, 2533, 2399, 2266, 2133, 
1999, 1866, 1733, 1599, 1466, 1333, 1199 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core Host" rev 0x02
vga1 at pci0 dev 2 function 0 "Intel HD Graphics" rev 0x02
intagp0 at vga1
agp0 at intagp0: aperture at 0xd000, size 0x1000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1280x800
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 3400 MEI" rev 0x06 at pci0 de