pulseaudio fails to start if ~/.pulse/default.pa exists

Bug #663019 reported by B Bobo
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Undecided
Unassigned

Bug Description

In Ubuntu 10.10 Maverick (Linux 2.6.35-22-generic, x86_64) plus ppa:ubuntu-audio-dev/ppa which provides pulseaudio-1:0.9.22~git20100719-0ubuntu1~ppa2

1. Pulseaudio was choosing incorrect default-sink, so I created a very simple file in ~/.pulse/default.pa. It had only two lines, and both lines were initially commented out (I was planning to uncomment them later):

# set-default-sink output 1
# set-default-source input 1

When this useless little file exists, pulseaudio fails to start, giving a fatal error:

  E: main.c: Daemon startup without any loaded modules, refusing to work.
  I: main.c: Daemon terminated.

Why?

The error message is really useless because it gives no clue as to the cause of the problem.
Maybe the error message could be changed to something more informative related to the cause.
It took me a long time to find out why pulseaudio was not starting.
Anyway, the answer is:

2. If I move the file out of ~/.pulse/, pulseaudio is able to start normally:

  $ mv ~/.pulse/default.pa ~/unused-default.pa

3. And if I move the file back again,

 $ mv ~/unused-default.pa ~/.pulse/default.pa

pulseaudio fails to start, giving a fatal error:

  E: main.c: Daemon startup without any loaded modules, refusing to work.
  I: main.c: Daemon terminated. :

Why?
Is it normal?
Is it a bug?

Thanks for any thoughts.

B Bobo (yout-bobo123)
affects: ubuntu → pulseaudio (Ubuntu)
B Bobo (yout-bobo123)
description: updated
summary: - pulseaudio fails to start if ~/default.pa exists
+ pulseaudio fails to start if ~/.pulse/default.pa exists
Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 663019] Re: pulseaudio fails to start if ~/default.pa exists

The version of pulseaudio in the ubuntu-audio-dev ppa for maverick is a snapshot of git master from a few months ago, and is not very well tested. Please reproduce this problem using the version of pulseaudio in maverick proper.

Revision history for this message
B Bobo (yout-bobo123) wrote :

I removed the ppa to get the maverick version and that has the same problem.

Revision history for this message
B Bobo (yout-bobo123) wrote :

No, I just removed the ppa from the list of repositories and then Reload, Mark Upgrades, Apply in succession in Synaptic, but that didn't provide the Maverick version - it still gave the ppa version.

So, I choose Package, Force Version and manually selected the Maverick version 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu21 (maverick) and hit Apply.
Then I got an error:

E: Unable to correct problems, you have held broken packages.

Why? I did a Reload and Mark All Upgrades in Synaptic and everything looks up to date and correct.
Where is the problem?
Is it related to still having other ppa:ubuntu-audio-dev packages installed?
I really don't want to remove those other packages' ppa versions because I need the ppa versions to get any sound working on this laptop. The standard Maverick audio-related packages do not provide a working sound system on this laptop.

I would prefer

Revision history for this message
B Bobo (yout-bobo123) wrote :

to install the Maverick version of pulseaudio only (and any additional dependencies it might have).
How can I do that?

Thanks.

Revision history for this message
David Henningsson (diwic) wrote :

This is intentional - if you intend to change default.pa, you should copy the entire default.pa from /etc/pulse, then only change what you need. There is nothing in ~/.pulse/default.pa that includes all the needed logic in /etc/pulse/default.pa.

Changed in pulseaudio (Ubuntu):
status: New → Invalid
Revision history for this message
B Bobo (yout-bobo123) wrote :

Ok, thank you for explaining that. It's a very unexpected way of operation. I'm sure it's going to catch out other people in the future. I wonder why doesn't the pulseaudio documentation say anything at all about it. Could you pass this upstream to ask that a few words of explanation be added in the pa docs?

Meanwhile, in my good faith attempt to answer the request for more information in this report, it somehow broke my package system as described in my previous two comments. If you can spare a moment and know the answer, could you suggest a way of fixing it please? If you are too busy, please say and I'll head over to answers.launchpad etc and ask for help there.

Revision history for this message
David Henningsson (diwic) wrote :

> Ok, thank you for explaining that. It's a very unexpected way of operation. I'm sure it's going to catch out other people in the future.

People think of it as a configuration file, but it is rather a script. I think that could be the "gotcha".

> I wonder why doesn't the pulseaudio documentation say anything at all about it. Could you pass this upstream to ask that a few words of explanation be added in the pa docs?

Ok, but could you then explain where you would look, and what the text would look like to give you that information? It would be good for me to know where users are looking for information.

> Meanwhile, in my good faith attempt to answer the request for more information in this report, it somehow broke my package system as described in my previous two comments.

Hmm, I'm not an expert in that area, but I think running "sudo apt-get" with the --fix-broken flag, e g "sudo apt-get dist-upgrade --fix-broken" might help. Or it might tell you what's wrong and what to do about it.

Revision history for this message
B Bobo (yout-bobo123) wrote :
Download full text (7.5 KiB)

> Ok, but could you then explain where you would look, and what the text would look like to give you that information? It would be good for me to know where users are looking for information.

I have made a few suggestions below.

> People think of it as a configuration file, but it is rather a script. I think that could be the "gotcha".

Hmmm, the issue I had was rather that it was not clear that the mere existence of ~/.pulse/default.pa effectively blocks the entire contents of /etc/pulse/default.pa from being used, instead of being that any configuration variable assignments in ~/.pulse/default.pa just override the corresponding variable assignments in /etc/pulse/default.pa.

Personally, I think it would be make more sense from a user-perspective, and thus generate fewer support issues in the future, if pulseaudio were always to read both /etc/pulse/default.pa and ~/.pulse/default.pa, taking the values of configuration variables from both of them, with the values in ~/.pulse/default.pa overriding the values in /etc/pulse/default.pa. Actually, I think it would be clearer and more consistent for the users to have it work in the same way for all of the files in /etc/pulse/, following the pattern of system-wide defaults in /etc/, but override-able on a per-variable basis in the configuration in the user's .pulse directory. Some of the files in /etc/pulse/ are configuration scripts and the others are configuration files, but for both types it should be straightforward to make any variable assignments in the ~/.pulse/ version able to override those in the /etc/pulse version.

I think the reason so many people recently seem to be getting confused and fed up with pulseaudio is that the documentation as a whole does have some issues. One of the issues is that it is often too terse in its explanations. If it were a bit less terse, I think there would be fewer users with support issues. Another issue with it is there is some inconsistency in how it refers to the same configuration-related entities in different places. I am going to mention a few here now; I wish I had the time to study it completely and identify all of the issues one by one.

==man page for default.pa==
This man page has a title line referring to default.pa as a "startup script", while the first paragraph refers to it as just "the file". This change in terminology is potentially confusing for users. A script is a type of file, but many other things are also files, so "file" is ambiguous. It really would help the users if the terminology were 100% consistent. Calling it a "file" is too general; ditto for "script"; "configuration script" is more specific if a bit long. Whatever term is used, it needs to be used consistently.
There is the same issue of less than 100% consistency for other terms used elsewhere in the pulseaudio documentation. If I had time, I would like to list them all here. It does need a careful review and some rewriting.

There is also a question about the name "default.pa". It is too general. It is potentially confusing for users. There surely has to be a better name for it, something more specific that would show immediately that it is actually a pulseaudio CL...

Read more...

Revision history for this message
David Henningsson (diwic) wrote :

Hi B Bobo and thanks for your engagement and time taken to write this down. I have relayed your comment to the pulseaudio mailing list, and it has already gotten two comments. If you like, you can join the pulseaudio-discuss mailinglist and answer them there:

Information about the list:
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss

Two answers for you:
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-October/008102.html
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-October/008103.html

Revision history for this message
cfi (cfi) wrote :

I've been bitten by this, too, and it cost me four hours to find the root cause - my own user specific config.

It's entirely my fault, because typing 'man pulseaudio', then scroll to the bottom, then type 'man default.pa' would have alerted me early of this problem. Instead I searched the internet high and low which one should always stop if there are hundreds of different by similar issues discussed for different versions of the sound stack.

However, maybe I'm not the only one, and maybe we have to help users a bit.

My proposal would be to

1. add mention to this fact (user's default.pa replacing the system wide one) in the man page of pulse-cli-syntax right in the first paragraph of the DESCRIPTION, and
2. if no modules are loaded, and debug level of printing is selected, specifically output a message along the lines of 'If no modules are loaded, check if a user specific config replaces the system wide default'. Potentially name the config files.

Cheers for an otherwise great sound system :)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers