LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-09-2017, 01:04 PM   #1
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 306

Rep: Reputation: 63
Unhappy Another Slackware user with PulseAudio problems


Already looked at some similar PulseAudio threads, but probably have not found everything yet.

My observations:
PulseAudio tries to totally take over all sound (by indirection the ConsoleKit is taking over all sound). It has many interfaces for intercepting sound meant for other drivers. It does not seem to have any provision for cooperating nicely with other drivers.
These are the conclusions that I have come to after fighting with it for several weeks.

I have no interest at all in how some other users may have such a limited usage of sound that PulseAudio is perfectly fine for them. Those people should go away right now.

I want to use Jack.

I need to use SDL, as I am developing SDL software.
PulseAudio is blocking my SDL output. If I kill the pulseaudio task the SDL sound gets through.

Question 1: PulseAudio wants the audio group all to itself. Any evidence that this is necessary.

Question 2: I am getting two pulseaudio tasks. The PulseAudio docs seem to claim that starting extra pulseaudio, like one per user, is a good thing.
What I see is that the first pulseaudio uses up the CPU time, but produces no sound. How many pulseaudio is normal, how many is workable.

Question 3: My pulseaudio volume control only shows the dummy output. I have no idea which pulseaudio task it is referencing, or why pulseaudio is having trouble.

Question 4: I can use a TiMidity executable from my Linux 2.6, that works perfectly fine, even when PulseAudio is blocking all the other sound. It goes directly to ALSA port. But the TiMidity compiled on Linux 4.4.14 sounds like it is synthesizing at 4KHz. Is the latest TiMidity output going through
PulseAudio even when I tell it an ALSA port?

Question 5: Does PulseAudio corrupt sound, like resampling it at 4Kz, when it feels like it.
When playing TiMidity using aplaymidi, I get the sound going bad (sounds lik 4KHz), then good again, two or three times during the song (over 4 minutes).

Question 6: The bluetooth driver only interfaces with PulseAudio. Other programs will select the output sound device.

Question 7: I am going to put a sound device selection mechanism in my programs. How do I bypass PulseAudio and send sound directly to ALSA, from a program, and especially from a SDL program?
Without the user having to reconfigure anything?

Question 8: The PulseAudio volume control is dumbed down, inadequate, incomplete. Any alternatives, like using ALSA-mixer.
 
Old 03-09-2017, 01:27 PM   #2
bassmadrigal
Senior Member
 
Registered: Nov 2003
Location: Newport News, VA
Distribution: Slackware
Posts: 3,885

Rep: Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902Reputation: 1902
I'm one of those that has limited usage of sound. So, I don't have a whole lot of experience with configuring pulseaudio. On my HTPC and my desktop, sound just worked without any configuration out of the box. I haven't found any programs that don't work that way, although, I've never dug into them enough to know if I have SDL-based audio output (I imagine I do, since I have built SDL2_mixer for something).

However, the first question to ask is have you gotten rid of your previous audio configuration files like /etc/asound.conf and ~/.asoundrc (or at least moved them so they aren't being referenced)? They were likely designed with alsa in mind and generally don't work with pulseaudio (at least not without heavy modification). A good chunk of pulseaudio issues we see in the forum is due to these configuration files wreaking havoc. I just wanted to get that question out of the way...

The next question is to make sure you do not have /etc/rc.d/rc.pulseaudio as executable. For the majority of users, there's no reason to have that executable.

As to your questions, unfortunately, I can't answer most of your "questions" (they aren't all questions). But, I think the answer to "question" #6 is the whole reason we have pulseaudio in the first place. BlueZ removed alsa support in v5, and that is what prompted Pat to switch to pulseaudio. The below is from the 14.2 changelog:

Code:
After upgrading to BlueZ 5 recently, everything seemed to be working great,
but then it was pointed out that Bluetooth audio was no longer working.
The reason was that the newer BlueZ branch had dropped ALSA support and now
required PulseAudio. So with some trepidation, we began investigating adding
PulseAudio to Slackware. Going back to BlueZ 4 wasn't an option with various
dependent projects either having dropped support for it, or considering doing
so. After several iterations here refining the foundation packages and
recompiling and tweaking other packages to use PulseAudio, it's working well
and you'll likely not notice much of a change. But if you're using Bluetooth
audio, or needing to direct audio through HDMI, you'll probably find it a lot
easier to accomplish that.
This is likely the reason you're not able to choose alsa for bluetooth audio... because BlueZ no longer supports it.

Last edited by bassmadrigal; 03-09-2017 at 01:28 PM.
 
1 members found this post helpful.
Old 03-09-2017, 01:53 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,331

Rep: Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359
Insure that /etc/rc.d/{rc.alsa,rc.alsa-oss,rc.pulseaudio} be all 0644. And yes, a pulseaudio daemon is started when you log in as regular user. At least that's what most of us do and are happy with, maybe with simpler or easier to deal with use cases though.

Other than that, If you find something weird or wrong with pulseaudio, I suggest that you file an issue or several issues upstream, to get a chance they be worked on.

Last edited by Didier Spaier; 03-09-2017 at 01:58 PM.
 
1 members found this post helpful.
Old 03-09-2017, 02:05 PM   #4
notKlaatu
Member
 
Registered: Sep 2010
Location: Wellington, New Zealand
Distribution: Slackware, Fedora
Posts: 998

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by selfprogrammed View Post
Question 1: PulseAudio wants the audio group all to itself. Any evidence that this is necessary.
There's no evidence that this is true. If you set an application to send sound directly to ALSA, it bypasses Pulse and plays. So Pulse does not "own" the audio group. Also, I'm not clear on how Pulse "wants" the audio group all to itself? that's not how UNIX groups work.


Quote:
Originally Posted by selfprogrammed View Post
Question 2
I have no useful data for you, so I'll skip this one.

Quote:
Originally Posted by selfprogrammed View Post
Question 3: My pulseaudio volume control only shows the dummy output. I have no idea which pulseaudio task it is referencing, or why pulseaudio is having trouble.
In which tab? Configuration? Input? Output? or all of them?

Quote:
Originally Posted by selfprogrammed View Post
Question 4: [...] Is the latest TiMidity output going through PulseAudio even when I tell it an ALSA port?
It shouldn't be, although Pulse may be aware of it via the Pulse ALSA-plugin. That shouldn't affect it though.

How did you install TiMidity? A configuration option can define what system it supports, and when I last checked, Pulse wasn't listed as an option.

Bottom line: as far as I know, TiMidity should be unaffected by Pulse. The fact that it appears to be is odd. Maybe kill PulseAudio and test.


Quote:
Originally Posted by selfprogrammed View Post
Question 5: Does PulseAudio corrupt sound, like resampling it at 4Kz, when it feels like it.
When playing TiMidity using aplaymidi, I get the sound going bad (sounds lik 4KHz), then good again, two or three times during the song (over 4 minutes).
Does this happen even if you kill Pulse?

Quote:
Originally Posted by selfprogrammed View Post
Question 6: The bluetooth driver [...]
As others have pointed out, Bluez doesn't do ALSA any more.

Quote:
Originally Posted by selfprogrammed View Post
Question 7: I am going to put a sound device selection mechanism in my programs. How do I bypass PulseAudio and send sound directly to ALSA, from a program, and especially from a SDL program?
Without the user having to reconfigure anything?
Just don't code for Pulse. You don't *have* to hook into Pulse. XMMS doesn't have Pulse output, for example. Audacity and VLC have Pulse options, but retains hooks directly into ALSA. Pulse can still manage it, because there's an ALSA plugin for Pulse. Of course, if SDL was compiled with Pulse support, then you may need to distribute / bundle your own SDL builds along with the rest of your code, but ultimately it's down to the libraries you include and the code you write. If you're leaning on SDL to handle all that low-level stuff for you, then you'll get what they give you.

Quote:
Originally Posted by selfprogrammed View Post
Question 8: The PulseAudio volume control is dumbed down, inadequate, incomplete. Any alternatives, like using ALSA-mixer.
[/QUOTE]

Well, there's alsamixer and, I guess, JACK.
 
Old 03-09-2017, 02:26 PM   #5
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,954

Rep: Reputation: 685Reputation: 685Reputation: 685Reputation: 685Reputation: 685Reputation: 685
How use PulseAudio and JACK?
 
Old 03-09-2017, 11:35 PM   #6
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 2,559

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
Quote:
Originally Posted by selfprogrammed View Post
I have no interest at all in how some other users may have such a limited usage of sound that PulseAudio is perfectly fine for them. Those people should go away right now.
That really should have been your first paragraph.
 
4 members found this post helpful.
Old 03-10-2017, 02:54 AM   #7
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 349

Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
The pulseaudio build configuration has an enable/disable-jack option (seems to be enabled by default). Presumably jack would need to be installed for this to be effective but since jack would not be installed when Pat builds pulseaudio, the stock pulseaudio would not support jack. Therefore you will likely need to rebuild pulseaudio yourself with jack already installed.

When that's done, google "pulseaudio jack" - there are heaps of reasonable looking howto's out there.

chris
 
Old 03-10-2017, 03:20 AM   #8
dederon
Member
 
Registered: Oct 2013
Posts: 74

Rep: Reputation: 38
Quote:
Originally Posted by selfprogrammed View Post
Question 6: The bluetooth driver only interfaces with PulseAudio. Other programs will select the output sound device.
firefox 52 requires pulseaudio. i'm so fed up. i wish pat would rebuild firefox with alsa support, this is still possible.
 
1 members found this post helpful.
Old 03-10-2017, 03:33 AM   #9
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,581

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Pat has just pushed an update on -current that contains a rebuilt Firefox with ALSA support
 
2 members found this post helpful.
Old 03-10-2017, 03:35 AM   #10
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,331

Rep: Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359Reputation: 2359
Quote:
Originally Posted by dederon View Post
firefox 52 requires pulseaudio. i'm so fed up. i wish pat would rebuild firefox with alsa support, this is still possible.
Done:
Code:
Fri Mar 10 05:41:05 UTC 2017
a/coreutils-8.27-x86_64-1.txz:  Upgraded.
ap/mc-4.8.19-x86_64-1.txz:  Upgraded.
l/harfbuzz-1.4.4-x86_64-1.txz:  Upgraded.
x/libepoxy-1.4.1-x86_64-1.txz:  Upgraded.
x/libinput-1.6.3-x86_64-1.txz:  Upgraded.
x/mesa-17.0.1-x86_64-1.txz:  Upgraded.
x/motif-2.3.6-x86_64-1.txz:  Upgraded.
xap/gimp-2.8.20-x86_64-1.txz:  Upgraded.
xap/mozilla-firefox-52.0-x86_64-2.txz:  Rebuilt.
  Recompiled with --enable-alsa option.  Without this, there is no fallback
  support for ALSA if PulseAudio is not present.  Thanks to Ivan Kalvatchev.
xap/network-manager-applet-1.4.6-x86_64-1.txz:  Upgraded.

Last edited by Didier Spaier; 03-10-2017 at 03:36 AM.
 
2 members found this post helpful.
Old 03-11-2017, 04:21 PM   #11
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 306

Original Poster
Rep: Reputation: 63
Thank you. I did find the upgrade slack packages and have already installed them.
It sounds like anyone doing any music or audio work has to take an axe to PulseAudio, without actually removing the libraries. That is what I needed to know first, as every configure is going to see that the PulseAudio libraries are present. If they needed to be removed it has to be before compiling any packages. Removing them latter will cause all kinds of new problems.
I have about 100 packages I have downloaded (library trip, they have a fast internet connection).

Slackware 14.2 was installed on wiped bare directories, so there should be no left over configuration files. When through that hell with that on Linux 2.4 installation.
Will look for the /etc/asound.conf file though, thank you.

The Slack howto file I found on how to tame PulseAudio seems helpful, but I also need to know the current situation, and the other users perspective. After two weeks of fighting with it I found there are far too many variations of setups to do random testing.

I do not know what got compiled into that new TiMidity, that is the problem.
Comparing their sources with a diff just resulted in a huge file with lots of changes.

I am having the similar problems with compiling plib, it compiles with warnings and then fatal errors due to type conversion.
 
Old 03-16-2017, 09:24 AM   #12
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,390
Blog Entries: 15

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
Too bad pulse can't be tied strictly to bluez and only loaded strictly by bluez usage in the rc script. That way it lives and dies with bluez only.
 
4 members found this post helpful.
Old 03-16-2017, 01:40 PM   #13
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 306

Original Poster
Rep: Reputation: 63
I have a VIA southbridge with AC97 as a sound device.
ALSA is listing it as a device properly.

But, using fuser, I can see that one of the pulseaudio (and it does not say which one) has the /dev/snd ports.

Pulseaudio does not list it as a card
> pacmd list-cards
says there are 0 cards

The syslog has this in it:
<code>
Mar 16 12:27:00 MySys pulseaudio[825]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="1" card_name="alsa_card.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Mar 16 12:27:00 MySys pulseaudio[1171]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Mar 16 12:27:00 MySys pulseaudio[1171]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="1" card_name="alsa_card.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Mar 16 12:27:05 MySys pulseaudio[2037]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Mar 16 12:27:05 MySys pulseaudio[2037]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="1" card_name="alsa_card.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Mar 16 12:27:05 MySys pulseaudio[2037]: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
Mar 16 12:47:11 MySys pulseaudio[825]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Mar 16 12:47:11 MySys pulseaudio[825]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="1" card_name="alsa_card.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Mar 16 12:47:11 MySys pulseaudio[2037]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Mar 16 12:47:11 MySys pulseaudio[2037]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="1" card_name="alsa_card.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
</code>

As far as I can tell the /usr/share/pulse files are there.
This was installed directly from Slackware 14.2 CDROM.

I have managed to disable bluetooth, to eliminate one error message.
I do not have any bluetooth hardware.

I have commented out the pulseaudio in the /etc/asound.conf file, so next time I boot
I should have normal ALSA sound, maybe. But that will still leave the pulseaudio only programs stuck, and alot of error messages piling up in my syslog.
I still need to find out what is wrong with pulseaudio.

I have been thinking of starting it in system mode so as limit it to one task.
The ArchLinux PulseAudio troubleshooting say that is possible, but it will defeat some
features of PulseAudio. So what features will it defeat, and do they matter that much ??

I have many consoles running for the same user. I suspect that pulseaudio
screws up during console switches. There are hints that it mutes or blocks sound of the first user, which is exactly not what I want to happen. It seems that they think that who ever has the console is supposed to OWN the sound device. To change this kind of behavior you are expected to learn the pulseaudio programming language they use in their files (I really cannot call them config files).


PulseAudio FAQ says that PulseAudio expects to have the audio group to itself.
I found this in the PulseAudio FAQ where it said to make sure to remove all users from the audio group, and that PulseAudio should be the only member of the audio group. Failure to do this will result in slow switches of some kind. Its on their website.


<Just don't code for Pulse.>
If my program sends sounds to ALSA and the usual /etc/asound.conf that PulseAudio installs is present, then it will redirect my sounds to pulseaudio.
It has been posted elsewhere (ArchLinux) that two lines in the /etc/asound.conf
have be commented out to get ALSA working again. My program cannot change a users /etc config files, and requiring that those lines be changed would certainly be a massive alteration of all of a users sound setup.

I suspect that is happening to TiMidity, but I do not know what each of these cryptic config settings actually does.

I am a little surprised that no one could tell me how many pulseaudio should be running.
To count them try:
> ps -A | grep pulse
Also it would be helpful to know which is accumulating run time. On my system the first one accumulates the run time, and the second one (started by XFCE) has 0 run time.

Last edited by selfprogrammed; 03-16-2017 at 02:29 PM.
 
Old 03-16-2017, 08:12 PM   #14
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 2,559

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
Did you read /etc/pulse/default.pa to see what you can can comment out?
 
Old 03-17-2017, 10:17 AM   #15
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 306

Original Poster
Rep: Reputation: 63
I have disabled the ALSA redirect to pulseaudio by commenting out the two lines in the /etc/asound.conf.

The alsamixer controls actively do useful things again.

I have been into the /etc/pulse files and disabled bluetooth. I read them all but there is not much else that is clear.

I have disabled the first pulseaudio by removing exec priv from /etc/rc.d/rc.pulseaudio.
The file said that it starts a system pulseaudio daemon.

XFCE is starting a pulseaudio, so there is one available, but it is not working.
Throws error messages about not being able to find ALSA profile, whatever that is.
I have checked that the /usr/share/pulse files are there.
Being that there was some sound previous (bad, but present), it must have been able to
find the files before. It may be the first pulseaudio was actually handling some sound
and the second started by XFCE cannot find the profile files.
I may be that Slackware is setup only for the system pulseaudio that is started by rc.d/rc.slackware, as Slackware installed that file as executable. The pulseaudio started by XFCE may be a rogue.

I wish someone with Slackware would tell me which pulseaudio they have running and which of these setups is supposed to work.


As of now, I can play midi using the latest TiMidity, without the noise problems it had before.
Part of that may have been priority issue, as it was set to a priority much higher than pulseaudio. If ALSA then redirected the output through pulseaudio, then the driver would be fighting for CPU with TiMidity. With only ALSA handling sound this does not happen.
Setting priority of TiMidity using the TiMidity start command line will always do this as it adds your number to a real-time priority that is much higher than anything else.
To set a lower priority in the rc.d/rc.local you must discover the TiMidity PID and then use system tools to set it directly. I set it to be close to the pulseaudio daemaon priority.

I can also use audacious, as it has an output selection that can select ALSA. Now that it does not redirect through pulseaudio it works and sounds great.

MPlayer sounds horrible and scratchy (same CD and songs as tested on Audacious). It also does not read the CDROM until the buffer is empty, and so the music stops every 10 sec to read more of the CDROM. Cannot find a setting to fix that or reason why there should be one.
KPlayer is a front for MPlayer and behaves exactly the same.

Amarok has gone amok. It was working last week, it would play its default music. Now it just flickers alot, with this little box that goes on and off about 3 to 4 times a second.
The little box has pause and cancel buttons, but you cannot hit them. Also Amarok is not responding so to even close it you must go through the "Program not responding" messages.

Still do not have sound for the Pairs program (which did have sound a couple weeks ago).

SDL sound still does not seem to work. This is in spite of it having worked after killing the pulseaudio daemon during a previous test.
I would be surprised if they managed to route it through pulseaudio, but not too surprised considering what a mess pulseaudio has caused.

I would not be too surprised if it turned out that some programs were using the system pulseaudio and some were using the XFCE pulseaudio. Then the two pulseaudio daemons were fighting to grab the sound devices, so only some programs would work depending on who had grabbed it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bypass pulseaudio problems and crashes when you don't have pulseaudio. Rinndalir Linux - Software 1 08-31-2016 01:00 PM


All times are GMT -5. The time now is 12:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration