[clug] Sound Preferences Hardware Output

Scott Ferguson scott.ferguson.clug at gmail.com
Sun Mar 4 23:51:18 MST 2012


On 05/03/12 16:46, Hal Ashburner wrote:
> Thanks Scott
> 
> The quest to make 7.1 output stick between reboots continues. It's
> good to have your axe. ;)
> 
> Check for S50alsa-utils:- find /etc/rc* | grep alsa
> 
> --I got nothing from this. alsa-utils is installed but nothing in
> /etc/rc*

When, if at all, is alsa-utils loaded?

NOTE: I don't run Ubuntu (I've just had to, um, fix it on occasion).

Debian Squeeze:-
scott at work:~$ mlocate alsa-utils
/etc/init.d/alsa-utils
/etc/rc0.d/K01alsa-utils
/etc/rc1.d/K01alsa-utils
/etc/rc6.d/K01alsa-utils
/etc/rcS.d/S20alsa-utils

> manually firing /etc/init.d/alsa-restore doesn't change things from 
> stereo to 7.1 output.

It won't - unless the state is saved in the first place.

scott at work:~$ ls /etc/init.d/alsa*
/etc/init.d/alsa-utils



> 
> sudo alsa force-reload fired from crontab doesn't work :-(

See above
> 
> 
> /var/lib/pulse/${magic_number}-default-source is being changed when
> the user changes output to 7.1 in sound settings.

That sounds correct

> So another config file found that it isn't.

I send a correction to the pastebin link, and some other suggestions
with it, just a little while ago.

I'll wait till you deal with those before making other suggestions.

> 
> 
> /etc/pulse/system.pa <http://system.pa> contains: ### Automatically
> restore the default sink/source when changed by the user ### during
> runtime ### NOTE: This should be loaded as early as possible so that
> subsequent modules ### that look up the default sink/source get the
> right value #load-module module-default-device-restore I've tried
> commenting that out because I have failed to find where on earth it
> is getting the "what's my default device" from. This hasn't worked
> either.

udev?

> 
> ps aux | grep pulse� pulse � � 1531 �0.3 �0.1 103204 �5464 ? � � �
> �S<l �16:09 � 0:02 /usr/bin/pulseaudio --system --daemonize
> --high-priority --log-target=syslog --disallow-module-loading=0
> 
> So we're in "system" mode, apparently. Which apparently makes 
> /etc/pulse/system.pa <http://system.pa> a relevant file. 
> /etc/pulse/default.pa <http://default.pa> is perhaps not so well
> named since this is used if pulse is in per-user mode. per-user.pa 
> <http://per-user.pa> ?�

PA should always be in user mode (not session mode)

See the previous link to upstream PA for more detail

> 
> 
> I've tried� default-sink = 
> alsa_output.usb-0d8c_PnP_Audio_Device-00-Device.analog-surround-71 in
> /etc/pulse/client.conf� This looked really really promising, the
> manpage says it overrides the setting in the daemon. But whatever
> that does it�hasn't worked. /etc/pulse/daemon.conf has no setting for
> default-sink

per user....

> 
> my best guess is that pulse is using alsa and udev to ask "what have
> you got" the driver for this onboard usb cmedia card is a bit buggy
> so it gets back stuff early that is wrong and uses it until you
> change it with the correct values that it doesn't know about until
> later.

it's a problematic card. Pulse talks to ALSA, ALSA talks to your card
(cause udev told it to)

> 
> Maybe it will only ever work on being slapped and can't be told in
> any one of its many, many, many configuration files...
> 
> I still don't know why my sound server is complaining about not
> being able to open my X display. So very many levels of ...

One of the many undocumented features of Ubuntu?

In Debian proper you need to enable anything beyond very basic sound
setups. X forwarding of sound is not enabled out of the box.

<snipped>

> sudo alsactl store
> 
> No. Should have mentioned this was one of many, many things I've
> tried. Worth checking it's plugged in, sure. On this occasion it is.

I'll get back to that when I read your response to this and the other
email (correction) I sent.

<snipped>

> 
> Let me know what your setting in paman are.
> 
> 
> heads up, paman is deprecated,

(because Ubuntu is going to replace it, one day)

apparently.

I've had to install it onto Ubuntu just so I could figure out what the
actual setting were.

> paman shows me that the default sink is stereo output. When I change 
> output in sound settings to 7.1 it shows me 7.1 is the default
> output. Nothing remotely suggesting where it's getting this from.

Should be getting it from ALSA.


> 
> 
> Also grabbed the recommended paprefs and had a look. 4 tabs
> 
> 1, network access 2. network server 3. Multicast/RTP 4. Simutaneous
> ouput (on all of my one soundcard on my one box)

Yes - (virtual). In your case you should/would have all four option
disabled.

I only have one sound card on this box - but it serves sound to three
currently running VB machines, streams Amarok to other machines, and
allows me to run other sound tasks (Ardour, Soundgarden, two Skype
instances).


> 
> I can see why paprefs is not shipped by at least this distro, not 
> exactly common uses are they?

It's nice as an add-on, but I don't know how many people want it. Many
people have trouble with bluetooth, burning CDs etc, manoeuvring around
furniture... ;-p

Depends how many music players you want in your house - I want one in my
office - but I like to hear sound throughout the house, ditto Skype
calls. I also like to watch videos on a low end (old) laptop outside,
and like my music, I want all my media stored in one place, - pulse
audio allow me to X forward with sound from a more powerful box.

<snipped>

> 
> $ ls -l ~/.pulse http://pastebin.com/0qi2tLsB
> 
> Dead link

See the correction I sent
>> 
>> (where aside, I give thanks for shell globbing and tab completion
> for that
>> horror and wonder how hard it would have been to put the magic
> number after
>> the human readable identifier rather than prepend all files with
> it - it's
>> the little things that attract to you to contributing to a project
> ... )
> 
> 
> To prevent DoSing by other users PA daemon like ESDs daemon was 
> susceptible to?
> 
> 
> Huh? Ok let's accept it's a problem at all on our single user
> desktop, laptop & media boxes, which I absolutely don't. Then file
> permissions is the answer. chmod 700 on the dir and only the user can
> access the files in the directory. As far as making the filenames
> thoroughly inconvenient, well that's just not a solution to DoS.

:-)
Thin clients... NFS shares, multiple sessions??

> 
>> 
> 
> All runtime data is kept separate keyed on the individual machine's 
> unique identifier (this is typically the dbus machine-id 
> (/var/lib/dbus/machine-id or /etc/machine-id) but if that is not 
> present, we use the machines hostname) This is why all the files
> inside ~/.pulse have the weird prefix that is clearly an md5 hash.
> 
> 
> So you can't keep machine information inside the config file
> because..? I'm guessing that 99% is a really conservative estimate
> for the users who are using this on one machine to play sound on that
> same machine by programs running on the machine. You've described a
> generalisation to N machines. Great, I get it.

Desktop, one user per machine - is not 99% of cases. Pulse audio is
increasingly common on portable devices (I have it on a phone).

> Having said that you can't honestly think those file names look
> good, pretty, or usable.

As I don't touch those generated files, I don't care. Doesn't mean you
can't be offended by the naming policy though.

> That is (part of) the cost of this generalisation. You don't have to
> agree but you see the point, yeah?

I can see your point - in your frinstance. It's not a directory I've
ever had a reason to look in before. You can delete it if you want - it
just gets recreated next time - so I don't understand the fuss.

<snipped>

>> 
>> this c2a9c3aebe602c2197a290b00000007-runtime ->
>> /tmp/pulse-1aeL5jtfh2fq is a symlink to nothing...
> 
> I believe that's a symlink to "something"...
> 
> Well ok, let's get metaphysical, �but if I'm telling you 
> �/tmp/pulse-1aeL5jtfh2fq is not any kind of file in /tmp will you 
> believe me?


I need to get back to what I was doing while there's still light, we can
get back to that later if necessary (I suspect it's just a pointer)

<snipped>

> 
> I'm guessing (as you don't provide much information) that GNOME is
> your desktop environment...??
> 
> 
> Gnome is my desktop environment. �
> 
> What, if any, sound packages have you installed? (eg, JACK, Ardour, 
> Rosegarden, etc) What, if any changes, have you made to your sound
> system files?
> 
> 
> As little as humanly possible. Was really hoping someone would say.
> "Oh you need 7.1 output and that output *works*, the file you need to
> change so it sticks is hidden /here/at/this/path Spent a lot of time
> googling, reading docs, man pages, blog entries and grepping for conf
> files, examining gconf etc etc

Sorry - that only works when "everyone" has the same problem. Consider
yourself "special" ;-p

> 
> 
>> 
>> Are we paying for this kind generalisation or did we get it free?
> 
> You paid for Ubuntu? :-) But seriously - "generalisation"?
> 
> 
> It's a sound server, generalising it to be network transparent? Meh. 
> Make a client that connects to your sound server and also to a
> network socket if you need to allow network control of, and
> input/output by your sound server. Keep networking complexity out of
> the sound server. Make the configuration simple. So, you know, you
> don't make your users pay with hours of time trying to find a damn
> piece of configuration to make 7.1 output, that works and can be
> heard, stick between reboots. � �

You'd need to do work to make it network (paprefs) - that unenabled
functionality has no bearing on the minimum use case. Those capabilities
can seem a little daunting when your "just looking to make sound work"
(assuming that "making sound work" is the same for everyone). eg.
yesterday it was someone "wanting sound to work" on GNOME for WOW and
Skype (debian-user lists)

> 
>> Is it possible that this kind of abstraction belongs somewhere
>> else, like, perhaps not at all on the overwhelming majority of
>> pulseaudio users' machines?

I'm not sure I like a painting by numbers sound system approach - that's
why there has been so many *nix sound systems - each is/was too limited
in scope.

> 
> I'm one of many happy PA users - though it's true we don't make as
> much noise as the vocal conservatives.
> 
> 
> I'm genuinely thrilled you're happy. At one time I really, honestly 
> believed linux and gnome in particular would sweep the world. I
> still want to be happy. I still don't know where to configure 7.1
> output...
> 
>> 
> 
>> Those that do could, you know install something that opens a
>> network socket and sends
> packets to
>> the soundcard if they have that use?
> 
> Huh? I'm not sure I understand what you're trying to say there
> Hal... Are you implying that the ability to treat a network device as
> a sound source/sink *if* you choose, is forced on you by PA - then
> you misunderstand "opt-in" (or Ubuntu is more broken than I'd first 
> supposed).
> 
> 
> How do I opt-out of this insane configuration fight? I don't want
> this fight, I just want 7.1 output.

Understandable - and should be achievable. Starting with getting alsa to
save settings. (check with paman to ensure you're not trying to use
duplex on a card that doesn't support it in 7.1 mode).

<snipped>

>> knows what's on board. Not quite true for audio though, given its
> use in
>> recording studios and so on...
> 
> OSX get's used in which major recording studios?
> 
> 
> No clue and don't care, sorry. Also I have no reason to doubt that it
> is...

I don't know any major studios that use either *nix or Mac (sadly). And
backstage I've only ever seen Windoof in use.
<snipped>

Kind regards




More information about the linux mailing list