All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Pavel Hofman <pavel.hofman@ivitera.com>, alsa-devel@alsa-project.org
Subject: Re: Order of device overrides in config files
Date: Mon, 11 Jun 2018 15:34:39 +0200	[thread overview]
Message-ID: <8163424e-9373-aeae-23e6-9ebfcc757c3b@perex.cz> (raw)
In-Reply-To: <ee2da76e-ed55-f7a1-b08a-99744cda8593@ivitera.com>

Dne 11.6.2018 v 15:18 Pavel Hofman napsal(a):
> Dne 11.6.2018 v 14:20 Jaroslav Kysela napsal(a):
>>
>> It means operation mode 'override':
>>
>> http://www.alsa-project.org/alsa-doc/alsa-lib/conf.html
>>
>> By default, the operation mode is 'merge+create'.
> 
> Hi Jaroslav,
> 
> Thank you for the information and the link.
> 
> In alsa.conf I see the order of config files which is same as my strace 
> output reveals:
> 
> @hooks [
>          {
>                  func load
>                  files [
>                          {
>                                  @func concat
>                                  strings [
>                                          { @func datadir }
>                                          "/alsa.conf.d/"
>                                  ]
>                          }
>                          "/etc/asound.conf"
>                          "~/.asoundrc"
>                  ]
>                  errors false
>          }
> ]
> 
> 
> The default device is overriden in pulse-alsa.conf which is called by 
> hook_func.pulse_load_if_running defined in alsa.conf.d/pulse.conf read 
> BEFORE processing my .asoundrc . Strace shows that reading 
> pulse-alsa.conf occurs AFTER reading .asoundrc . It works as specified :-)

I cannot confirm that - the order specified in the configuration file
(files compound/array) is retained on my system (as it should):

open("/usr/share/alsa/alsa.conf", O_RDONLY) = 3
open("/usr/share/alsa/alsa.conf.d/",
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
open("/usr/share/alsa/alsa.conf.d//50-pulseaudio.conf", O_RDONLY) = 3
open("/usr/share/alsa/alsa.conf.d//99-pulseaudio-default.conf",
O_RDONLY) = 3
open("/etc/asound.conf", O_RDONLY)      = 3
open("/home/perex/.asoundrc", O_RDONLY) = 3

The snd_config_hook_load() in src/conf.c function handles that.

> Please would it make sense to call .asoundrc (somehow...) after all the 
> config hooks were processed so that redefining the default device in the 
> user's config actually works? Many users get confused by this behavior 
> as it is not really obvious. No matter what they list in their .asoundrc 
> (correctly following alsa documentation), the default device always ends 
> up to be the pulse plugin.

It seems that there's something different in your system, so the
~/.asoundrc file is not parsed as last.

						Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

  reply	other threads:[~2018-06-11 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 11:33 Order of device overrides in config files Pavel Hofman
2018-06-11 12:20 ` Jaroslav Kysela
2018-06-11 13:18   ` Pavel Hofman
2018-06-11 13:34     ` Jaroslav Kysela [this message]
2018-06-11 13:45       ` Pavel Hofman
2018-06-11 15:19         ` Jaroslav Kysela
2018-06-11 15:30           ` Pavel Hofman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8163424e-9373-aeae-23e6-9ebfcc757c3b@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=pavel.hofman@ivitera.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.