Ubuntu Servers :: Using Pulseaudio From A Script In 10.10
Jul 7, 2011
I'm working on a server who's job is to record audio on a scheduled basis. I'm trying to get this working under Ubuntu Server 10.10 and am having difficulty with pulseaudio.
I've added the user account to groups audio and pulse* and have installed the pulseaudio and associated library packages.
Here's the problem:
If I have a user session logged in, everything works just fine but when I start my program from rc.local (su'ed to a regular user, not root), pulseaudio doesn't start correctly.
My startup script attempts to start pulseaudio with: /usr/bin/pulseaudio --start --log-level=3
but syslog shows this:
pulseaudio[1045]: main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.Spawn.ExecFailed: /bin/dbus-launch terminated abnormally without any error message
/bin/dbus-launch does not exist on this system, but dbus is there
and running.
I run ps ax > /tmp/psout from the startup script and dbus appears to be running before I log into the user account: grep dbus /tmp/psout 551 ? Ss 0:00 dbus-daemon --system --fork
My system works just fine if I leave a user logged in, but it doesn't work after a reboot with no user logged in.
I've had nothing but trouble with Pulseaudio in Fedora 14. I had managed to get rid of it in Fedora 10 with the command: su -c "yum remove alsa-plugins-pulseaudio pulseaudio" I just don't want to have to deal with Pulseaudio anymore. It does not like my sound card and gets in the way. Is there a Linux distribution that does not use Pulseaudio ?
I followed these commands to disable pulseaudio in ubuntu 9.10 and now it seems I've broken gnome-volume-control. How can I go about undoing these changes???
after struggling for a couple days with Pulse not working in Natty, I found a solution, and it's easy: Delete the ~/.pulse folder in your home folder. I keep a separate home partition, and apparently some of the old settings conflicted with the new setup.
I'm running xubuntu 11.04 and pulseaudio is giving me some problems with wine and dosbox. I want to romove it and have alsa as default, since it always worked fine for me on this computer
How should I remove it without breaking anything? I've found ways to do it on older releases, but not for 11.04
I'm using XFCE with pulseaudio. I don't have a keyboard with dedicated multimedia keys. Getting to alsa to work with f1 f2 and f3 (mute, volume down, volume up) was easy. I want to use pulseaudio instead of alsa. What do I use for mute, volume up and down?
This tutorial is meant for Ubuntu 9.10 Karmic Koala, but it might work in earlier or later versions as well. I wrote this tutorial mostly because it took me a full day of work using lots of help from people on #mpd and #pulseaudio from the FreeNode IRC server.The goal is to get the MPD daemon working using PulseAudio, but without it being dependent on the X server or a session. To do that we must configure PulseAudio to run in system-wide daemon mode (which is not recommended by the developers, but in this case we do not have a choice). This means it will be using the /etc/pulse/system.pa config file instead of the usual /etc/pulse/default.pa. We must also make sure the appropriate user/group permissions are set, or PulseAudio will be rejecting the connections.The result will be an interrupt-less music environment, not dependent on the X server. Meaning we can for example log out and log in without the music having to stop for even a second. Switching TTYs (Ctrl+Alt+Fx) will also keep the music playing (not possible by default). All that and PulseAudio will still be able to detect and configure all your devices automatically.
Instructions: Make sure you add your username to the following system groups: pulse, pulse-access and audio.Do that by going to System --> Administration --> Users and Groups.Click the unlock button (the one with a picture of some keys), then click Manage Groups. In the list of groups that pops up, for each of the previously mentioned groups click "Properties" and select all the users that you want to have this functionality.
AlsaMixer by default selects "Mic" as the microphone input for my Toshiba Satellite T115D-S1125 see pic below:
[IMG][/IMG]
I need to select "Mic 1" but as soon as I do the mic is muted in Sound Preferences see below:
[IMG][/IMG]
For a brief moment I can see activity from the input level display and then nothing...I have tried removing PulseAudio and that has worked but I prefer to correct this with PulseAudio installed as it seems to be a simple fix...
I would really like to get digital (5.1) surround in Ubuntu 10.04 with pulseaudio. However, when I go to the preferences->sound->hardware setting, I can only select analog surround outputs. The only digital outputs shown are stereo.
After i tried a lot of mpd.conf tricks, I followed the tips on [url], namely, adding the mpd user to groups pulse and pulse-access. Now, which makes me really happy, MPD can have audio output. Downside: no other program can make sound, I can't make my beats again with lmms etc. The volume icon in the top right is always on mute, when i click preferences, the hardware tab didn't even show a device. Now it does, but nothing comes out except mpd out - and pressing the volume keys will display a notification but the main icon in the bar stays on "---" mute. Can i make mpd just an application on the pulseaudio outputs list, so that it can play nicely with the other guys?
I am using 8.04, Pulseaudio, Microsoft Lifechat USB headset and Skype on a Compaq 210. Pulse works fine for everything else. One day, it just stopped working for no apparent reason (only on the Skype mic) so I uninstalled and went back to ALSA (for a few reasons) but couldn't get that working either so now back to square one. When I boot Skype, all goes well, can place a test call, no errors. But on playback of the message it's pure fuzz, basically white noise, no sign of my voice. I've twiddled with just about every volume control and toggle I can find and then some, but nothing. Another interesting thing; Pulse is now NOT working unless I input 'pulseaudio -D' in a terminal after boot. Then it seems to be okay, 'cept the mic.
Strange as the mic works perfectly and crystal clear in Sound Recorder. No probs. So:
1/ How do I replace the recorded white noise in a Skype test call with my own mellifluous tones and;
2/ Where do I put 'pulseaudio -D' (what file) so it will be read and turn pulse on at boot?
Using Skype 2.1.0.47 (I know there is a newer version, .87 I think, but that was even more problematic). Another strange thing; the newer version (.87?) worked flawlessly for months before the mic just one day died (ONLY in Skype). As explained on my last thread; wife's uni/entertainment machine and me being the house computer dude, one of the reasons we use Linux is so I am not fixing Windows problems constantly. I only go near this machine when something goes pear-shaped so that is rarely. My wife doesn't tweak with her computer AT ALL.
Sound issues on this machine have been pretty much constant and I am really sick of it. I have two desktops running ALSA and Skype flawlessly with any USB headset AND they can ring incoming calls through the external speakers and you can take the call through the headset, something that is seemingly impossible for some reason in Pulse. Despite its bells and whistles, this is a serious oversight by Pulse developers in my opinion. (Unless I'm missing something and I've have searched for hours trying to fix THAT little mystery).
I seem to be having a problem with my sound. Every time I start my computer, I hear the sound played at the login screen and the sound played when I login. Right then, every time, the sound cracks up and stops before it finishes. Running "ubuntu-bug audio" shows that ALSA works fine but pulseaudio does not. For reference, "pacmd list" says that there are 0 sinks, 0 sources and 0 caches.
Edit: Solved by a really stupid mistake: loose 3.5mm audio cable. Don't do that. your sound and you're on a desktop computer, go, right now, and check to make sure that you haven't made the same mistake as me.
Jan 3 23:52:38 Sai kernel: [ 3914.806177] __ratelimit: 3 callbacks suppressed Jan 3 23:52:38 Sai kernel: [ 3914.806183] compiz.real[1908]: segfault at 11 ip 08055c2d sp bfccbb70 error 4 in compiz.real[8048000+34000] Jan 3 23:52:38 Sai kernel: [ 3914.866575] operapluginwrap[2169]: segfault at b66a5030 ip 003cbd1d sp bff5e5d4 error 4 in libpthread-2.10.1.so[3c4000+15000]
[Code]....
It seems starting up gives a ton of errors I can't really isolate. The above boot errors are in no order. I just pasted them all together.
What happens is randomly when Im browsing through videos on ....., it crashes back to the login screen. Im guessing this has something to do with Opera's plugin/Sound/Pulse Audio.
Using the Pulse Audio manager does anyone know if it is possible to specify a particular sink or source to be used by a named program? I am assuming it will not be the same as the default.
I'm on 9.10 and I use huludesktop often to watch my Hulu queue. Every once in a while (and more so lately) the video freeze and the sound stutters. I then find that pulseaudio is taking 100% of a CPU (I have a quad core AMD 64bit machine). Killing pulseaudio causes huludesktop to continue without sound and a new pulseaudio starts up. I have to kill huludesktop and resume playback and then everything's OK, until it happens again.
From time to time I have to close Opera in order to regain the ability to use Totem or VLC (perhaps others). I'll explain. Normally everything is fine, but from time to time I will open Movie Player (Totem) and it will attempt to load whatever I have sent to it and it will vanish (crash). I can attempt to send anything to it and the same problem occurs (audio or video; mp3, flac, avi, &c). I can test the same problem with VLC and the same results occur (vanish/crash).
If I close Opera (and optionally restart it), I again can use Totem and VLC. I have tried merely killing Opera's plugin wrapper (thinking it was perhaps related to a plugin seizing PA), but this does nothing for the matter. (Of course killing Opera does as this is more or less the same as closing Opera.)
I'm using Mangler and WoW under Wine. Mangler is quiet, WoW is not. I would like to write a script to adjust the volume of my Wine application (set it to say 50%) and then launch Mangler. The CLI page on the PulseAudio wiki offers
Code: set-sink-volume/set-source-volume But I am apparently missing the part of how to apply that to an application. Update: Solved with update to 1.1.2010227
I've noticed in my karmic Koala pulseaudio has many options to make my sound discoverable via upnp/dlna server. I've got a ps3 and a Pinnacle Soundbridge, suitable for this protocol and working fine with mt-daapd or ushare. But I would like to use mplayer and making the sound available to my devices. I've activated the options in Pulseaudio (paprefs) but can't play music in my client device and I can't see the server in the lan.
This is my config: sound Preferences > output > DLNA/upnp Streaming (stereo) paprefs
-Tab Network access click on "make discoverable Pulseaudio network sound devices available locally" & same for "[...] Apple Airtunes" -Tab Network server All options clicked on -Tab Multicast RTP Enabled "receiver", enabled "sender" and selected "send audio from local speakers" -Tab simultaneous output Not enabled
Padevchooser - Default server: my pc - Default sink: DLNA/upnp Streaming - Default source: internal analog Stereo Can't see any upnp server.
I installed "Theocracy" on my 9.10 Karmic system. The installer asks for a sound device, dev/dsp is the default and I didn't change it. When I now try to start the game, I get the following error: Unable to open sound device: Device or resource busy Aborted Execution of /usr/games/theocracy_base/theocracy.real failed! What is the sound device when using PulseAudio on Karmic?
I broke PulseAudio accidentally, when I was trying to fix something else. I'm not sure what I did, but PulseAudio no longer starts automatically when I log in. That means I get no sound. I can start the PulseAudio daemon manually by running:
Code:
pulseaudio -D
at the command line, but I also have to go into sound preferences and select the correct hardware (Audigy 2 ZS card) instead of my motherboard's sound device (which is not connected to my speakers) to get sound back. How do I make all that happen automatically?
I need to upgrade Pulseaudio to a version better than 0.9.14 (i.e. at least 0.9.15) in order to get the Pulseaudio plugin in Blueman to work, but despite following these instructions to add the PPA it will not be upgraded!
I've been using a Freetalk USB Headset for a while on my Sony Vaio. It worked fine. Did a bit of travelling and used a different USB headset. Returned home, plugged in the Freetalk headset and find that Pulseaudio only sees the microphone part and not the speaker part. Using PAV Volume Control Configuration, against the Freetalk headset I only get the profile options of "Analog Mono Input" or "Off". When I first set it up, ages ago, I remember getting a load of options here and set the one for input and output. How to I get more options to set up the headset properly?
1) Many of us use JACK for low-latency audio work, but it's annoying to have to turn it on or off to have to allow regular Ubuntu applications to work. It's even more annoying that both can't normally work together -- either JACK or PulseAudio must take control of the sound control. This method allow JACK to do, and PulseAudio just routes to JACK.
2) JACK is kinda super awesome. By routing PulseAudio through it, your regular Ubuntu sound application suddenly get super powers. Pretty easy to do! (Well, we count our blessings in Linux...)
1. DYNAMICALLY You need the PulseAudio utilities and JACK sink:
Code: sudo aptitude install pulseaudio-utils pulseaudio-module-jack And then run this to get PulseAudio connected to JACK: Code:pactl load-module module-jack-sink pactl load-module module-jack-source Now, go to Ubuntu's sound preferences, and you'll see "Jack sink" in the output tab. If you use JACK Control, you can create a script for the above and have it set up in "Execute script after Startup". Then, PulseAudio will automatically load the JACK sink when you start JACK.
2. BY DEFAULT Edit /etc/pulse/default.pa, and add these lines:
Code:load-module module-jack-source load-module module-jack-sink You can test it without rebooting by restarting PulseAudio. In Ubuntu, PulseAudio is started in the user session, not as a system daemon. To restart it:
To satisfy my sound stream control needs, I installed PulseAudio in Kubuntu 10.04 amd64. It's working perfectly, but the (Gnome?) PulseAudio applet's icon is missing, i.e., in the systray and in the program menu (for the PulseAudio device chooser) the 'white page with blue question mark' icon is used. Which package do I need to install to get the right icon, or, how can I find out which icon exactly is missing, or, how can I set an alternative icon?
So, the only way to have bass is to use PulseAudio and edit daemon.conf to enable-lfe-remixing? Well, damn, but alright. how do I fine-tune low frequency reproduction (since my satellites can't handle anything below 150Hz)?
So there's just one DVD (Narnia) that won't play on my Ubuntu machine using Totem: other DVDs play (I've installed libdvdread4 and libdvdcss2 like a good boy) and non-pulseaudio players like VLC play it properly. If I completely remove and kill pulseaudio, it plays in totem fine. It gets to the language selection screen and I select English, but as soon as any sound is involved it doesn't play. Clicking Go --> DVD menu causes Totem to hang. I don't want to be uninstalling pulseaudio, and VLC player is a bit complex for the mother.
The output of totem: Code: marcus@margit-laptop:~$ totem libdvdread: Using libdvdcss version 1.2.10 for DVD access libdvdnav: Using dvdnav version 4.1.3 libdvdread: Using libdvdcss version 1.2.10 for DVD access libdvdnav: DVD Title: libdvdnav: DVD Serial Number: 43D1F9FE (GEAR): libdvdnav: DVD Title (Alternative): libdvdnav: Unable to find map file '/home/marcus/.dvdnav/.map' ..... marcus@margit-laptop:~$
Note that before the last line, Totem does absolutely nothing. It just sits their. Like it's trying to devour my soul or something.
How do you set PulseAudio to auto-start during boot? Just upgraded ALSA versions, but pulse audio does not appear to be starting at boot time and I have no sound. RT-Kernel-33
Just upgraded to Lucid (32bit), pulse generally seems to work ok: I get sound out, I can see various apps connecting via the Sound Preferences dialog (audacious, flash via alsa interface, etc.), and my mic seems to work fine too.
However, when starting skype (v2.1.0.81 which defaults to pulseaudio if it's running), it isn't able to output any sound and I never see a connection appear in Sound Preferences. Don't really want to force it to use Alsa or anything like that; I'd be fine with pulse if it would just work.
I've tried installing the .deb from the skype site as well as the official ubuntu package, with the same result. Any idea why pulse seems to be working, but skype can't seem to use it properly?
I am using Maverick I had this problem on Lucid as well. With an old version of alsa my headphones mute my laptops speakers when I plug them in. This seems to be the correct behavior.
With a newer alsa, plugging in headphones enables sound in both laptop speakers and headphones. Sometimes plugging in the headphones mutes everything, when I unmute it has the same behavior of playing sound out of both outputs. Changing to Analog Headphones enables playback with only the speaker but is always muted by default, requiring me to go into alsamixer. Removing pulse gets the correct behavior with just alsa, so pulse seems to be the culprit.
Here is my result of the alsa info script. I tried an option suggested in an alsa wikipage to do "snd-hda-intel: enable_msi=1". It did not help.