[gentoo-user] Re: alsamixer and pulseaudio - which is at fault?

2016-12-31 Thread Nikos Chantziaras

On 12/30/2016 03:44 PM, Mick wrote:

On Friday 30 Dec 2016 12:12:17 Nikos Chantziaras wrote:

On 12/30/2016 12:04 PM, Nikos Chantziaras wrote:

On 12/29/2016 03:21 PM, Mick wrote:

Hi All,

My sound has been behaving erratically for a while now, probably since
pulseaudio started being shipped with various desktop applications.


I had many similar issues years ago. I solved them by doing the following:
[...]


Oh, forgot to mention that I also deleted the ALSA custom configuration
files:

   rm ~/.asoundrc
   rm /etc/asound.conf

It's recommended to not have them, unless you actually need them.


Thank you Nikos, I followed your advice above but the darn thing is still not
working as it should.  The interaction of pa with alsa is anything but aligned
with the way my brain works and with how alsa used to work.


Another thing I did was put this in the USE flags in make.conf:

  pulseaudio -alsa

and then do a:

  emerge -auDN --with-bdeps=y @world

That is, globally disable ALSA and enable PA. This makes sure that 
programs will use PulseAudio instead of ALSA. This prevents the issue 
where PA changes your ALSA mixer settings as the same time as an ALSA 
program tries to do the same, resulting in things getting FUBARed.


Unfortunately, portage is missing a feature where you can disable one 
USE flag only if another is available. So it's not possible to disable 
"alsa" only if the package also has a "pulseaudio" flag. That means if 
you have packages that only support ALSA, you need to enable the "alsa" 
USE flag for that package in package.use. This includes 
media-sound/pulseaudio itself! So package.use needs at least:


  media-sound/pulseaudio alsa

There's other packages where this is needed. My list in package.use:

  media-sound/audacity alsa
  media-libs/libcanberra alsa
  dev-java/oracle-jdk-bin alsa
  media-sound/audacity alsa

In general, if a package doesn't support PA and "alsa" is needed to make 
it support sound output, then it needs an entry in package.use.





Re: [gentoo-user] Re: alsamixer and pulseaudio - which is at fault?

2016-12-30 Thread Mick
On Friday 30 Dec 2016 15:11:29 Corbin Bird wrote:
> On 12/30/2016 07:44 AM, Mick wrote:
> > On Friday 30 Dec 2016 12:12:17 Nikos Chantziaras wrote:
> >> On 12/30/2016 12:04 PM, Nikos Chantziaras wrote:
> >>> On 12/29/2016 03:21 PM, Mick wrote:
>  Hi All,
>  
>  My sound has been behaving erratically for a while now, probably since
>  pulseaudio started being shipped with various desktop applications.
> >>> 
> >>> I had many similar issues years ago. I solved them by doing the
> >>> following:
> >>> [...]
> >> 
> >> Oh, forgot to mention that I also deleted the ALSA custom configuration
> >> 
> >> files:
> >>rm ~/.asoundrc
> >>rm /etc/asound.conf
> >> 
> >> It's recommended to not have them, unless you actually need them.
> > 
> > Thank you Nikos, I followed your advice above but the darn thing is still
> > not working as it should.  The interaction of pa with alsa is anything
> > but aligned with the way my brain works and with how alsa used to work.
> > 
> > I've commented out the pa entries to stop it trying to restore settings as
> > you suggested.  Alsamixer settings now stick between reboots, except for
> > the first headphone which for some reason is always muted and changing it
> > won't stick for a couple of years now.  All looks great  until I get
> > a desktop pop up warning.  Then I notice both Speaker and PCM are pegged
> > at 100% again.  :-/
> > 
> > This also happens if I tweak any of the pa settings using a GUI. 
> > Adjusting
> > the application settings using e.g.
> > systemsettings5/hardware/Multimedia/Audio Volume/Applications,
> > immediately resets alsamixer's Speaker and PCM bars both to 100.  I am
> > guessing when a warning pops up on the desktop it is also plugging into
> > pa and no matter what Speaker or PCM have been set at, they will be
> > pegged at 100 once more.
> 
> You do need to install "media-sound/pavucontrol" and uninstall ( if
> possible ) whatever desktop GUI based mixer you are currently using ( if
> .. if .. it is based on the alsamixer and not on PulseAudio ).
> 
> Changing settings in the wrong mixer just doesn't work.

Thanks Corbin, I did install pavucontrol but did not persevere with it.  When 
I first started it up it muted the master volume control, which I had to unmute 
to get my sound back.  I'll try reinstalling it tomorrow and test it more 
thoroughly.

The audio mixer I used is based on pa anyway.

-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: alsamixer and pulseaudio - which is at fault?

2016-12-30 Thread Corbin Bird

On 12/30/2016 07:44 AM, Mick wrote:
> On Friday 30 Dec 2016 12:12:17 Nikos Chantziaras wrote:
>> On 12/30/2016 12:04 PM, Nikos Chantziaras wrote:
>>> On 12/29/2016 03:21 PM, Mick wrote:
 Hi All,

 My sound has been behaving erratically for a while now, probably since
 pulseaudio started being shipped with various desktop applications.
>>> I had many similar issues years ago. I solved them by doing the following:
>>> [...]
>> Oh, forgot to mention that I also deleted the ALSA custom configuration
>> files:
>>
>>rm ~/.asoundrc
>>rm /etc/asound.conf
>>
>> It's recommended to not have them, unless you actually need them.
> Thank you Nikos, I followed your advice above but the darn thing is still not 
> working as it should.  The interaction of pa with alsa is anything but 
> aligned 
> with the way my brain works and with how alsa used to work.
>
> I've commented out the pa entries to stop it trying to restore settings as 
> you 
> suggested.  Alsamixer settings now stick between reboots, except for the 
> first 
> headphone which for some reason is always muted and changing it won't stick 
> for a couple of years now.  All looks great  until I get a desktop pop up 
> warning.  Then I notice both Speaker and PCM are pegged at 100% again.  :-/
>
> This also happens if I tweak any of the pa settings using a GUI.  Adjusting 
> the application settings using e.g. systemsettings5/hardware/Multimedia/Audio 
> Volume/Applications, immediately resets alsamixer's Speaker and PCM bars both 
> to 100.  I am guessing when a warning pops up on the desktop it is also 
> plugging into pa and no matter what Speaker or PCM have been set at, they 
> will 
> be pegged at 100 once more.
>

You do need to install "media-sound/pavucontrol" and uninstall ( if
possible ) whatever desktop GUI based mixer you are currently using ( if
.. if .. it is based on the alsamixer and not on PulseAudio ).

Changing settings in the wrong mixer just doesn't work.




Re: [gentoo-user] Re: alsamixer and pulseaudio - which is at fault?

2016-12-30 Thread Mick
On Friday 30 Dec 2016 12:12:17 Nikos Chantziaras wrote:
> On 12/30/2016 12:04 PM, Nikos Chantziaras wrote:
> > On 12/29/2016 03:21 PM, Mick wrote:
> >> Hi All,
> >> 
> >> My sound has been behaving erratically for a while now, probably since
> >> pulseaudio started being shipped with various desktop applications.
> > 
> > I had many similar issues years ago. I solved them by doing the following:
> > [...]
> 
> Oh, forgot to mention that I also deleted the ALSA custom configuration
> files:
> 
>rm ~/.asoundrc
>rm /etc/asound.conf
> 
> It's recommended to not have them, unless you actually need them.

Thank you Nikos, I followed your advice above but the darn thing is still not 
working as it should.  The interaction of pa with alsa is anything but aligned 
with the way my brain works and with how alsa used to work.

I've commented out the pa entries to stop it trying to restore settings as you 
suggested.  Alsamixer settings now stick between reboots, except for the first 
headphone which for some reason is always muted and changing it won't stick 
for a couple of years now.  All looks great  until I get a desktop pop up 
warning.  Then I notice both Speaker and PCM are pegged at 100% again.  :-/

This also happens if I tweak any of the pa settings using a GUI.  Adjusting 
the application settings using e.g. systemsettings5/hardware/Multimedia/Audio 
Volume/Applications, immediately resets alsamixer's Speaker and PCM bars both 
to 100.  I am guessing when a warning pops up on the desktop it is also 
plugging into pa and no matter what Speaker or PCM have been set at, they will 
be pegged at 100 once more.

-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


[gentoo-user] Re: alsamixer and pulseaudio - which is at fault?

2016-12-30 Thread Nikos Chantziaras

On 12/30/2016 12:04 PM, Nikos Chantziaras wrote:

On 12/29/2016 03:21 PM, Mick wrote:

Hi All,

My sound has been behaving erratically for a while now, probably since
pulseaudio started being shipped with various desktop applications.


I had many similar issues years ago. I solved them by doing the following:
[...]


Oh, forgot to mention that I also deleted the ALSA custom configuration 
files:


  rm ~/.asoundrc
  rm /etc/asound.conf

It's recommended to not have them, unless you actually need them.




[gentoo-user] Re: alsamixer and pulseaudio - which is at fault?

2016-12-30 Thread Nikos Chantziaras

On 12/29/2016 03:21 PM, Mick wrote:

Hi All,

My sound has been behaving erratically for a while now, probably since
pulseaudio started being shipped with various desktop applications.


I had many similar issues years ago. I solved them by doing the following:

In /etc/pulse/daemon.conf, I've set:

  flat-volumes = no

In /etc/pulse/default.pa, comment-out these entries:

  #load-module module-device-restore
  #load-module module-stream-restore
  #load-module module-card-restore

Add the "alsasound" service to "boot" runlevel:

  rc-config add alsasound boot

In /etc/conf.d/alsasound, set:

  RESTORE_ON_START="yes"
  SAVE_ON_STOP="yes"

Stop the alsasound service:

  /etc/init.d/alsasound stop

Delete the currently saved mixer settings:

  rm /var/lib/alsa/asound.state

Use alsamixer to configure your sound card to your liking (hit F6 first 
and select the real device.)


Start the alsasound service:

  /etc/init.d/alsasound start

Stop it again to save the current mixer settings:

  /etc/init.d/alsasound stop

Change /etc/conf.d/alsasound to:

  SAVE_ON_STOP="no"

You're done. Reboot to check if everything is working as intended.

What the above does is make PA not restore its own settings on boot, 
make ALSA restore your preferred settings on boot but not save 
alterations on shutdown (next reboot will restore your initial 
settings.) It also disables the "flat volumes" feature of PA, which for 
me at least resulted in many "RIP my ears" moments, and also makes the 
volume mixer (KMix and pavucontrol in my case) behave very weirdly (it 
seems I need to get a PhD from MIT first to figure out what the volume 
settings do when "flat volumes" is on.)


Note that the above is only done once. Do it, and reboot. After that it 
should work forever. When upgrading PA or ALSA, make sure to not 
overwrite your custom /etc/ settings when running "dispatch-conf" or 
"etc-update" (or whatever you're using.)


Hope this helps.