[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Setting default sound device (was Re: New Dell Inspiron 15 3000 Series 3511 sound problem on Debian 11 Stable)



On Mon 13 Feb 2023 at 17:49:19 (-0800), Charlie Gibbs wrote:
> On Mon Feb 13 09:36:01 2023 David Wright wrote:
> 
> > I think the section "Wrong card used by default" in:
> >
> >  https://wiki.debian.org/ALSA
> >
> > should help. There's more detail at:
> >
> >  https://alsa.opensrc.org/MultipleCards
> >
> > and I think both these are pure ALSA and PA-free.
> 
> Thanks for the links.  I worked through them, but as usual,
> found it tough sledding.  I did come across another page
> that pointed out that alsa.conf has moved from /etc/modprobe.d/
> to /usr/share/alsa/, for what it's worth.

It would be interesting to see how that statement was actually
expressed. AIUI the two files are completely different in both
their contents and how they work.

/etc/modprobe.d/sound.conf (I think the wiki forgets that the filename
needs the .conf; the actual filename can be anything reasonable)
contains options for loading a /kernel module/, like the example:

  options snd_hda_intel index=1,0

I just added that exact line to my Lenovo laptop. Before I added it,
alsamixer would come up with the HDMI card and a row of S/PDIF
controls. The F6 menu would read:

       Sound Card
  - (default)
  0 HDA Intel HDMI
  1 HDA Intel PCH
    enter device name...

After adding it and rebooting, alsamixer comes up with the
slider controls instead, and the F6 menu reads:

       Sound Card
  - (default)
  0 HDA Intel PCH
  1 HDA Intel HDMI
    enter device name...

This behaviour is documented at:

  https://www.kernel.org/doc/html/v5.10/sound/index.htmlhttps://www.kernel.org/doc/html/v5.10/sound/alsa-configuration.html#module-parameters

  Common parameters for top sound card modules

  Each of top level sound card module takes the following options.

  index
      index (slot #) of sound card; Values: 0 through 31 or negative;
      If nonnegative, assign that index number; if negative, interpret
      as a bitmask of permissible indices; the first free permitted
      index is assigned; Default: -1

The files in /usr/share/alsa/ are AFAIK for user-space software. They
have a quite a complicated syntax, and I wouldn't say I'm comfortable
writing them: I just tend to cut and paste from examples.

You can probably achieve the same ends, with the correct incantation,
as with the modprobe option. You might even be able to get the two
methods to fight each other. (IOW it's important to clear out one
method before trying the other.)

> > > When I bring up alsamixer and hit F6, I get the following choices:
> > >   0  HDA Intel
> > >   1  HDA NVidia
> > >   2  IVTV-0
> > >   3  IVTV-1
> > > There's no mention of which is the default or how to set a default.

I don't know what IVTVs are. Using the first (kernel) method, I would
write:

  options snd_hda_intel index=1,0,2,3

making 1 into the default.

Note: IIRC hyphens and underscores are interchangeable.
      snd_hda_intel is a guess. Most modern sound is,
      I believe, Intel DHA, but you never know. There's
      a list of top-level card modules in the 2nd URL,
      and of course its name must appear somewhere in
      your lsmod output.

Cheers,
David.

Reply to: