Re: [pulseaudio-discuss] [PATCH] ALSA: hda/hdmi: Add Intel silent stream support

2020-06-25 Thread Pierre-Louis Bossart



On 6/25/20 10:30 AM, Jaroslav Kysela wrote:

Dne 25. 06. 20 v 16:46 Pierre-Louis Bossart napsal(a):





So, rather the question is how we should provide the setup of such
parameter.  It's supposed to be a part of power management stuff 
that
should be touched by either a smart PM tool or a manual override 
such

as runtime PM setup?  Or can it be seen as a more casual tuning?


I am not aware of such tools. The only thing I know is that some of
the HDaudio power settings are already controlled by kernel
parameters, e.g.

/etc/modprobe.d/audio_powersave.conf
options snd_hda_intel power_save=1


Yes, it's been the primary knob for years to turn on/off the runtime
PM for HD-audio and other legacy drivers.  This was used by powertop
or some other power-aware daemons and tools, to be toggled dynamically
per the power cable state or such.

And, how the silent stream feature should be seen?
Should it be a system-wide root-only setup or adjustable per user?
Would it be changed often?  Such questions and answers will lead us to
the right direction, I hope.


For audio, would UCM not be the appropriate point for a system 
integrator to decide how the audio device should be set up?


This would allow for a choice based on the situation in which the 
device is actually being deployed without users having to muck 
around with module parameters -- maybe someone wants want this 
enabled for an HTPC setup, but not on a desktop connected to a monitor.


Right, that's my concern.  Many users with HDMI monitor that is
capable of audio don't use HDMI audio because they don't need it
and/or the output sucks.  For them, this feature is superfluous and
harmful from the runtime PM POV. >
If it were provided via UCM, would it be yet another UCM profile like
HDMI+silentstream?  This can be confusing, too, I'm afraid.


Unless I am mistaken, this silent stream would be applicable to the
legacy HDaudio driver, as well as SOF.

UCM is not used for the legacy HDaudio case, so that would close the
door on UCM-based configurations, no?


UCM can be used for legacy HDA, too (and it is used for some legacy HDA 
models - dual codecs). It seems that it's better to describe the 
"abstract" device layout for users on the one place.


Did you mean represent the form-factor in UCM?

Currently we use e.g. the same bytcr-rt5640 UCM file for tablets, 
notebooks and headless devices (mini desktops). UCM would need to get 
the information from somewhere else, I don't think it'd be practical to 
hard-code form-factors in UCM proper.


My plan is to migrate to UCM completely at some day when the major 
issues are resolved. It may be a bit challenge for the legacy HDA driver 
and USB devices but doable.


For USB I don't know how this would work. USB report descriptors, if you 
wanted to represent all possible cases with UCM you'd need to build the 
union of all possible cases and make parts conditional.

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] ALSA: hda/hdmi: Add Intel silent stream support

2020-06-25 Thread Jaroslav Kysela

Dne 25. 06. 20 v 16:46 Pierre-Louis Bossart napsal(a):





So, rather the question is how we should provide the setup of such
parameter.  It's supposed to be a part of power management stuff that
should be touched by either a smart PM tool or a manual override such
as runtime PM setup?  Or can it be seen as a more casual tuning?


I am not aware of such tools. The only thing I know is that some of
the HDaudio power settings are already controlled by kernel
parameters, e.g.

/etc/modprobe.d/audio_powersave.conf
options snd_hda_intel power_save=1


Yes, it's been the primary knob for years to turn on/off the runtime
PM for HD-audio and other legacy drivers.  This was used by powertop
or some other power-aware daemons and tools, to be toggled dynamically
per the power cable state or such.

And, how the silent stream feature should be seen?
Should it be a system-wide root-only setup or adjustable per user?
Would it be changed often?  Such questions and answers will lead us to
the right direction, I hope.


For audio, would UCM not be the appropriate point for a system integrator to 
decide how the audio device should be set up?

This would allow for a choice based on the situation in which the device is 
actually being deployed without users having to muck around with module 
parameters -- maybe someone wants want this enabled for an HTPC setup, but not 
on a desktop connected to a monitor.


Right, that's my concern.  Many users with HDMI monitor that is
capable of audio don't use HDMI audio because they don't need it
and/or the output sucks.  For them, this feature is superfluous and
harmful from the runtime PM POV. >
If it were provided via UCM, would it be yet another UCM profile like
HDMI+silentstream?  This can be confusing, too, I'm afraid.


Unless I am mistaken, this silent stream would be applicable to the
legacy HDaudio driver, as well as SOF.

UCM is not used for the legacy HDaudio case, so that would close the
door on UCM-based configurations, no?


UCM can be used for legacy HDA, too (and it is used for some legacy HDA models 
- dual codecs). It seems that it's better to describe the "abstract" device 
layout for users on the one place.


My plan is to migrate to UCM completely at some day when the major issues are 
resolved. It may be a bit challenge for the legacy HDA driver and USB devices 
but doable.


Jaroslav

--
Jaroslav Kysela 
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] ALSA: hda/hdmi: Add Intel silent stream support

2020-06-25 Thread Pierre-Louis Bossart






So, rather the question is how we should provide the setup of such
parameter.  It's supposed to be a part of power management stuff that
should be touched by either a smart PM tool or a manual override such
as runtime PM setup?  Or can it be seen as a more casual tuning?


I am not aware of such tools. The only thing I know is that some of
the HDaudio power settings are already controlled by kernel
parameters, e.g.

/etc/modprobe.d/audio_powersave.conf
options snd_hda_intel power_save=1


Yes, it's been the primary knob for years to turn on/off the runtime
PM for HD-audio and other legacy drivers.  This was used by powertop
or some other power-aware daemons and tools, to be toggled dynamically
per the power cable state or such.

And, how the silent stream feature should be seen?
Should it be a system-wide root-only setup or adjustable per user?
Would it be changed often?  Such questions and answers will lead us to
the right direction, I hope.


For audio, would UCM not be the appropriate point for a system integrator to 
decide how the audio device should be set up?

This would allow for a choice based on the situation in which the device is 
actually being deployed without users having to muck around with module 
parameters -- maybe someone wants want this enabled for an HTPC setup, but not 
on a desktop connected to a monitor.


Right, that's my concern.  Many users with HDMI monitor that is
capable of audio don't use HDMI audio because they don't need it
and/or the output sucks.  For them, this feature is superfluous and
harmful from the runtime PM POV. >
If it were provided via UCM, would it be yet another UCM profile like
HDMI+silentstream?  This can be confusing, too, I'm afraid.


Unless I am mistaken, this silent stream would be applicable to the 
legacy HDaudio driver, as well as SOF.


UCM is not used for the legacy HDaudio case, so that would close the 
door on UCM-based configurations, no?



  From the interface POV, as Kai suggested in another mail, the
analogy to power_save option makes sense.  OTOH, power_save is the
knob that is better to be enabled (as long as it works), silent stream
is the feature that is needed only when required.  So it comes to the
question which interface is easier to manage.


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] ALSA: hda/hdmi: Add Intel silent stream support

2020-06-25 Thread Tanu Kaskinen
On Thu, 2020-06-25 at 09:03 +0200, Takashi Iwai wrote:
> On Thu, 25 Jun 2020 02:18:58 +0200,
> Arun Raghavan wrote:
> > +pulseaudio-discuss for information
> > 
> > On Wed, 24 Jun 2020, at 1:33 PM, Takashi Iwai wrote:
> > > On Wed, 24 Jun 2020 19:05:14 +0200,
> > > Pierre-Louis Bossart wrote:
> > > > 
> > > > 
> > > > On 6/24/20 11:43 AM, Takashi Iwai wrote:
> > > > > On Wed, 24 Jun 2020 17:33:45 +0200,
> > > > > Pierre-Louis Bossart wrote:
> > > > > > It also doesn't have a UCM representation
> > > > > > so would force the use of amixer and manual configs, or the UCM file
> > > > > > would always set the mode.
> > > > > 
> > > > > But people usually use the distro kernels, so the situation is more or
> > > > > less equivalent; you'd have to adjust a module option manually if you
> > > > > want a different one from the default, and you'd have to be root to
> > > > > change it.
> > > > > 
> > > > > So, rather the question is how we should provide the setup of such
> > > > > parameter.  It's supposed to be a part of power management stuff that
> > > > > should be touched by either a smart PM tool or a manual override such
> > > > > as runtime PM setup?  Or can it be seen as a more casual tuning?
> > > > 
> > > > I am not aware of such tools. The only thing I know is that some of
> > > > the HDaudio power settings are already controlled by kernel
> > > > parameters, e.g.
> > > > 
> > > > /etc/modprobe.d/audio_powersave.conf
> > > > options snd_hda_intel power_save=1
> > > 
> > > Yes, it's been the primary knob for years to turn on/off the runtime
> > > PM for HD-audio and other legacy drivers.  This was used by powertop
> > > or some other power-aware daemons and tools, to be toggled dynamically
> > > per the power cable state or such.
> > > 
> > > And, how the silent stream feature should be seen?
> > > Should it be a system-wide root-only setup or adjustable per user?
> > > Would it be changed often?  Such questions and answers will lead us to
> > > the right direction, I hope.
> > 
> > For audio, would UCM not be the appropriate point for a system
> > integrator to decide how the audio device should be set up?
> > 
> > This would allow for a choice based on the situation in which the
> > device is actually being deployed without users having to muck
> > around with module parameters -- maybe someone wants want this
> > enabled for an HTPC setup, but not on a desktop connected to a
> > monitor.

Is UCM really an appropriate place for deciding the setting? The
default should be to disable the feature, and if that is done in UCM,
how is the user expected to enable it when needed? I'm not aware of an
easy way to tweak the UCM configuration (modifying distro-provided
files is not good).

I don't really get the talk about system integrators. This seems like
an end-user setting to me.

> Right, that's my concern.  Many users with HDMI monitor that is
> capable of audio don't use HDMI audio because they don't need it
> and/or the output sucks.  For them, this feature is superfluous and
> harmful from the runtime PM POV.
> 
> If it were provided via UCM, would it be yet another UCM profile like
> HDMI+silentstream?  This can be confusing, too, I'm afraid.
> 
>  From the interface POV, as Kai suggested in another mail, the
> analogy to power_save option makes sense.  OTOH, power_save is the
> knob that is better to be enabled (as long as it works), silent stream
> is the feature that is needed only when required.  So it comes to the
> question which interface is easier to manage.

Having a separate UCM "profile" (do you mean a verb or a device?) seems
overkill. I think there could be a device-specific variable, like
SilentStreamControl, which would indicate that the device supports the
silent stream feature. The variable would also point to the mixer
control for enabling it.

That said, I don't see much need for involving UCM at all. UCM becomes
more relevant if we want PulseAudio to provide an API for controlling
this feature, but until that happens, just having a mixer control that
users can toggle seems sufficient to me. (I'm assuming that ALSA
remembers mixer settings between boots. I'm not sure if that's the
case, but I have the impression that the alsa-state thingy is
universally enabled and implements this.)

-- 
Tanu

https://www.patreon.com/tanuk
https://liberapay.com/tanuk

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] ALSA: hda/hdmi: Add Intel silent stream support

2020-06-25 Thread Takashi Iwai
On Thu, 25 Jun 2020 02:18:58 +0200,
Arun Raghavan wrote:
> 
> +pulseaudio-discuss for information
> 
> On Wed, 24 Jun 2020, at 1:33 PM, Takashi Iwai wrote:
> > On Wed, 24 Jun 2020 19:05:14 +0200,
> > Pierre-Louis Bossart wrote:
> > > 
> > > 
> > > 
> > > On 6/24/20 11:43 AM, Takashi Iwai wrote:
> > > > On Wed, 24 Jun 2020 17:33:45 +0200,
> > > > Pierre-Louis Bossart wrote:
> > > >>
> > > >>
> > > > The silent stream is enabled with a Kconfig option, as well as a 
> > > > kernel
> > > > parameter should there be a need to override the build time default.
> > > 
> > >  I'm not sure whether the module option is the best interface.
> > >  An alternative is a mixer element that controls dynamically.  Then
> > >  it'll be per card unlike the module option.
> > > >>>
> > > >>> +1, kcontrol seems the appropriate way to control this.
> > > >>
> > > >> It was my suggestion to use Kconfig+kernel parameter for
> > > >> simplicity/overrides.
> > > >>
> > > >> The kcontrol is a nice idea, but in practice we typically only have
> > > >> one card dealing with HDMI.
> > > >
> > > > Not really.  There are systems with two HDMI outputs from both
> > > > integrated and discrete GPUs.  Most modern systems are only with
> > > > hybrid graphics, though.
> > > 
> > > Ok, maybe I am mistaken, in most of the HDMI issues we've seen only
> > > one HDMI source.
> > > 
> > > But it's a good point that this is only supposed to be used for Intel
> > > whether it's a kernel parameter or a kcontrol shouldn't this be
> > > dependent on a PCI ID being detected and a SKYLAKE flag being set?
> > > it's my understanding that this applies from Skylake to TigerLake, not
> > > before.
> > 
> > I guess we can check it from the codec ID?  Change the probe function
> > for Skylake+ codecs to patch_i915_skl_hdmi and co, and set the flag
> > there.
> > 
> > > >> It also doesn't have a UCM representation
> > > >> so would force the use of amixer and manual configs, or the UCM file
> > > >> would always set the mode.
> > > >
> > > > But people usually use the distro kernels, so the situation is more or
> > > > less equivalent; you'd have to adjust a module option manually if you
> > > > want a different one from the default, and you'd have to be root to
> > > > change it.
> > > >
> > > > So, rather the question is how we should provide the setup of such
> > > > parameter.  It's supposed to be a part of power management stuff that
> > > > should be touched by either a smart PM tool or a manual override such
> > > > as runtime PM setup?  Or can it be seen as a more casual tuning?
> > > 
> > > I am not aware of such tools. The only thing I know is that some of
> > > the HDaudio power settings are already controlled by kernel
> > > parameters, e.g.
> > > 
> > > /etc/modprobe.d/audio_powersave.conf
> > > options snd_hda_intel power_save=1
> > 
> > Yes, it's been the primary knob for years to turn on/off the runtime
> > PM for HD-audio and other legacy drivers.  This was used by powertop
> > or some other power-aware daemons and tools, to be toggled dynamically
> > per the power cable state or such.
> > 
> > And, how the silent stream feature should be seen?
> > Should it be a system-wide root-only setup or adjustable per user?
> > Would it be changed often?  Such questions and answers will lead us to
> > the right direction, I hope.
> 
> For audio, would UCM not be the appropriate point for a system integrator to 
> decide how the audio device should be set up?
> 
> This would allow for a choice based on the situation in which the device is 
> actually being deployed without users having to muck around with module 
> parameters -- maybe someone wants want this enabled for an HTPC setup, but 
> not on a desktop connected to a monitor.

Right, that's my concern.  Many users with HDMI monitor that is
capable of audio don't use HDMI audio because they don't need it
and/or the output sucks.  For them, this feature is superfluous and
harmful from the runtime PM POV.

If it were provided via UCM, would it be yet another UCM profile like
HDMI+silentstream?  This can be confusing, too, I'm afraid.

 From the interface POV, as Kai suggested in another mail, the
analogy to power_save option makes sense.  OTOH, power_save is the
knob that is better to be enabled (as long as it works), silent stream
is the feature that is needed only when required.  So it comes to the
question which interface is easier to manage.


thanks,

Takashi
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] ALSA: hda/hdmi: Add Intel silent stream support

2020-06-24 Thread Arun Raghavan
+pulseaudio-discuss for information

On Wed, 24 Jun 2020, at 1:33 PM, Takashi Iwai wrote:
> On Wed, 24 Jun 2020 19:05:14 +0200,
> Pierre-Louis Bossart wrote:
> > 
> > 
> > 
> > On 6/24/20 11:43 AM, Takashi Iwai wrote:
> > > On Wed, 24 Jun 2020 17:33:45 +0200,
> > > Pierre-Louis Bossart wrote:
> > >>
> > >>
> > > The silent stream is enabled with a Kconfig option, as well as a 
> > > kernel
> > > parameter should there be a need to override the build time default.
> > 
> >  I'm not sure whether the module option is the best interface.
> >  An alternative is a mixer element that controls dynamically.  Then
> >  it'll be per card unlike the module option.
> > >>>
> > >>> +1, kcontrol seems the appropriate way to control this.
> > >>
> > >> It was my suggestion to use Kconfig+kernel parameter for
> > >> simplicity/overrides.
> > >>
> > >> The kcontrol is a nice idea, but in practice we typically only have
> > >> one card dealing with HDMI.
> > >
> > > Not really.  There are systems with two HDMI outputs from both
> > > integrated and discrete GPUs.  Most modern systems are only with
> > > hybrid graphics, though.
> > 
> > Ok, maybe I am mistaken, in most of the HDMI issues we've seen only
> > one HDMI source.
> > 
> > But it's a good point that this is only supposed to be used for Intel
> > whether it's a kernel parameter or a kcontrol shouldn't this be
> > dependent on a PCI ID being detected and a SKYLAKE flag being set?
> > it's my understanding that this applies from Skylake to TigerLake, not
> > before.
> 
> I guess we can check it from the codec ID?  Change the probe function
> for Skylake+ codecs to patch_i915_skl_hdmi and co, and set the flag
> there.
> 
> > >> It also doesn't have a UCM representation
> > >> so would force the use of amixer and manual configs, or the UCM file
> > >> would always set the mode.
> > >
> > > But people usually use the distro kernels, so the situation is more or
> > > less equivalent; you'd have to adjust a module option manually if you
> > > want a different one from the default, and you'd have to be root to
> > > change it.
> > >
> > > So, rather the question is how we should provide the setup of such
> > > parameter.  It's supposed to be a part of power management stuff that
> > > should be touched by either a smart PM tool or a manual override such
> > > as runtime PM setup?  Or can it be seen as a more casual tuning?
> > 
> > I am not aware of such tools. The only thing I know is that some of
> > the HDaudio power settings are already controlled by kernel
> > parameters, e.g.
> > 
> > /etc/modprobe.d/audio_powersave.conf
> > options snd_hda_intel power_save=1
> 
> Yes, it's been the primary knob for years to turn on/off the runtime
> PM for HD-audio and other legacy drivers.  This was used by powertop
> or some other power-aware daemons and tools, to be toggled dynamically
> per the power cable state or such.
> 
> And, how the silent stream feature should be seen?
> Should it be a system-wide root-only setup or adjustable per user?
> Would it be changed often?  Such questions and answers will lead us to
> the right direction, I hope.

For audio, would UCM not be the appropriate point for a system integrator to 
decide how the audio device should be set up?

This would allow for a choice based on the situation in which the device is 
actually being deployed without users having to muck around with module 
parameters -- maybe someone wants want this enabled for an HTPC setup, but not 
on a desktop connected to a monitor.

-- Arun
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss