[lug] Forcing a Sound Device

Ralf Mattes rm at seid-online.de
Mon Nov 13 02:10:57 MST 2017

Just a few remarks from a long-time lurker:

On Sun, Nov 12, 2017 at 07:33:08PM -0700, Davide Del Vento wrote:

> I have no clues about the issue at hand, but you can relatively easily
> find out which file a program alters using strace: run the program
> with it, redirecting the stdout/err to a file, and do the "thing" that
> triggers the change you want to find out. Try to minimize everything
> else you do, because the output is huge.

For such tasks I prefer to use fatrace which only reports file
operations without having to juggle with strace '-e' filters. This tool
is especially useful if you don't know which process is altering files.

Also, I often find the info from ltrace better for tracing than only
looking at system calls with strace.

But ...

> On Sun, Nov 12, 2017 at 11:46 AM,  <stimits at comcast.net> wrote:
> ...
> > analog audio...the device setting works for one song, then reverts. Wish I
> > knew what file pavucontrol alters...I'd use SElinux and make it immutable to
> > everything. Or if I knew what it is that tells pavucontrol to change, I'd
> > bzip2 the binary so it can't be used (at this point I don't care if it
> > brings down the system...I just want to know debugging information).

Most likely pavucontrol won't alter any files. That tool only
remote-controls the pulseaudio server process and it's doing this by
means of shared memory access.

(Side note: I'm one of those pro-audio users that hates pulse audio, so
the followin might be slightly biased).
My current setup: all my audio input and output is handled by a jack
server that gets started at login (as a systemd user service). I use
jack2 gives me the possibility to control the server over dbus.

This control interface I use to run Cadence
(http://kxstudio.linuxaudio.org/Applications:Cadence). In that tool I
activate both the pulseaudio bridge as well as the alsa bridge.
That gives me a running pulseaudio server that provides pulseaudio for
programs that only work with pa (firefox and skype et al.) as well as a
default virtual alsa device. Both bridges route all audio data to jack.

If this sounds too complex (it really isn't): the usual way to change
alsa's default device is to re-order the card by means of kernel module
parameters. Edit (or create) '/etc/modprobe.d/alsa-base.conf' and add
entries like:

 options snd-hda-intel index=-2
 options snd-usb-audio index=0

That way, the USB interface will be loaded first and show up as alsa's
default interface.

HTH, Ralf Mattes

More information about the LUG mailing list