Unix administration - The value of tracing: Enabling sound in Fedora 8

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > December 2007 > The value of tracing: Enabling sound in Fedora 8





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author The value of tracing: Enabling sound in Fedora 8
Wayne

2007-12-18, 1:33 pm

Like some other folk sound didn't work for me out of the box.
First thing to try was to unmute (F8 has "alsaunmute" command!)
but that didn't do it.

Some Google work showed you can fix this problem with
"yum remove alsa-plugins-pulseaudio". This didn't do it.
Using the sound card configuration utility
("system-config-soundcard") I fiddled with the settings, changing
the default PCM and another setting from the default for AC'97
to one that included another parameter, iec### I think it was.
That worked but for root but didn't work for non-root.

I guessed (after checking with Google) to change the owner
of some files in /dev, by configuring PAM's console permissions
file ("/etc/security/console.perms.d/50-default.perms").
That didn't help. So, how does one find out which files
need to be readable (or read/write) by others for sound to
work for everyone?

I came up with strace. Checking the man page allowed me to
limit the output to open system calls, which list the pathname
of the file being opened. Unfortunately it seems the "play"
command I traced also "stat"s some files first, and doesn't
attempt to open them if it would fail. (More skill with
various tracing tools would no doubt have lead to a
simpler solution. :-)

In the end I created a list of files opened by "play", by root
and by a non-root user, and then I compared the two lists.

The one file different was /etc/asound.conf, which was mode 600.
changing that to 644 fixed the sound for all users!

The strace command I used (one in a root xterm, one in a non-root
xterm) was:

strace -fFqe trace=open play /usr/share/sounds/phone.wav 2>&1 \
|awk -F'"' '{print $2}' |sort |xargs /bin/ls -ld 2>/dev/null

The output of strace is processed by awk, which extracts just
the pathname of the file being opened. Sorting the list makes
comparisons between windows easy (could have used diff or comm too).
the /dev/null is used to eliminate the errors of attempts to
open non-existent files, which "play" does a lot.

I think this general technique will work for finding permission
problems for most stuff, when stuff works for root only.

-Wayne
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com