Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Already in use is probably pulseaudio. Depending on your distro.
$ grep -i autospawn /etc/pulse/client.conf
If you change that to "autospawn = no", you can stop pulseaudio.
$ pulseaudio --kill
And with a pulse over jack setup you can restart it $(pulseaudio --start), after starting jackd. Without the autospawn=no, the init system will by default restart pulseaudio. Various other routes with snd-aloop plus other tricks.
I ran your grep command. autospawn was set to yes, so I loaded the file in vim and set autospawn = no. Then I issued 'pulseaudio --kill, which didn't work. So I checked ps and found the pulseaudio process and sent it a kill -9. After that jack started, and pulseaudio CLAIMS to start, but I have no sound in either mpg123 or pianobar.
Code:
root@caitlyn:~# grep -i autospawn /etc/pulse/client.conf
autospawn = yes
allow-autospawn-for-root = yes
root@caitlyn:~# vim /etc/pulse/client.conf
root@caitlyn:~# pulseaudio --kill
E: [pulseaudio] main.c: Failed to kill daemon: No such process
root@caitlyn:~# ps ax | grep pulseaudio
1455 ? Sl 0:01 /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 5 14680097 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
1609 ? Sl 4:55 /usr/bin/pulseaudio --start --log-target=syslog
10101 pts/0 S+ 0:00 grep pulseaudio
root@caitlyn:~# kill -9 1609
root@caitlyn:~# ps ax | grep pulseaudio
1455 ? Sl 0:01 /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 5 14680097 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
10103 pts/0 S+ 0:00 grep pulseaudio
root@caitlyn:~# jackd -d alsa -d hw:0 -r 48000 -n 3 -p 512
jackd 0.124.1
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
apparent rate = 48000
creating alsa driver ... hw:0|hw:0|512|3|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 512 frames (10.7 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 3 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 3 periods for playback
^Z
[2]+ Stopped jackd -d alsa -d hw:0 -r 48000 -n 3 -p 512
root@caitlyn:~# bg
[2]+ jackd -d alsa -d hw:0 -r 48000 -n 3 -p 512 &
**** alsa_pcm: xrun of at least -773626593.280 msecs
root@caitlyn:~# ls /etc/rc.d
init.d/ rc.cpufreq* rc.lxc rc.syslog*
rc.0@ rc.cups rc.mcelog* rc.sysstat
rc.4* rc.cups-browsed rc.messagebus* rc.sysvinit*
rc.6* rc.cups.orig rc.modules* rc.timidity
rc.K* rc.dnsmasq rc.modules.local* rc.tor*
rc.M* rc.font rc.modules.local.orig* rc.udev*
rc.S* rc.fuse* rc.modules.local~* rc.ulogd*
rc.S.orig* rc.gpm* rc.mysqld* rc.vboxautostart-service*
rc.acpid* rc.httpd rc.networkmanager* rc.vboxballoonctrl-service*
rc.alsa* rc.inet1* rc.nfsd rc.vboxdrv*
rc.alsa-oss rc.inet1.conf rc.ntpd* rc.wireless*
rc.atalk rc.inet1.conf.new rc.ntpd.orig* rc.wireless.conf
rc.autofs rc.inet1.orig* rc.pcmcia rc.yp
rc.bind rc.inet2* rc.php-fpm rc0.d/
rc.bluetooth* rc.inetd* rc.pulseaudio rc1.d/
rc.cgconfig rc.ip_forward rc.rpc rc2.d/
rc.cgconfig.orig rc.local* rc.samba rc3.d/
rc.cgmanager* rc.local.orig* rc.saslauthd rc4.d/
rc.cgproxy* rc.local_shutdown* rc.sendmail* rc5.d/
rc.cgred rc.local_shutdown~* rc.serial rc6.d/
rc.cgred.orig rc.local~* rc.snmpd
rc.consolekit* rc.loop* rc.sshd*
root@caitlyn:~# chmod +x /etc/rc.d/rc.pulseaudio
root@caitlyn:~# /etc/rc.d/rc.pulseaudio start
Starting system PulseAudio daemon: /usr/bin/pulseaudio --system --disallow-module-loading &
root@caitlyn:~# /etc/rc.d/rc.pulseaudio restart
Stopping PulseAudio: /bin/killall pulseaudio
Starting system PulseAudio daemon: /usr/bin/pulseaudio --system --disallow-module-loading &
root@caitlyn:~#
I think I'm going to have to change autospawn back to yes, and then reboot the computer to get back to the state I was in before. Do you have any other ideas? I'm sorry I'm being so whiney.
This allows sharing over tcp/ip with "other" users on the same machine on localhost, and over the network on a subnet. Kind of nice to not have to buy two high end interfaces and two sets of speakers. Plus it offloads a bit of processing from the main machine. The last two allow jack so I can run things like a 30 band EQ with calf plugins.
Once it's all started up I use qjackctl to ensure that pulseaudio is listed, which means it's good to go. If it doesn't show up I stop/start pulseaudio again.
$ pulseaudio --kill
$ pulseaudio --start
While pulse is NOT running is when you start jackd. You don't need pulseaudio or jackd though as timidity++ can run against alsa natively, it's been a while but "-iA -Os" as the flags for timidity to use alsa. Although it has to be compiled in a certain way, which is debians default options NOW, but older versions didn't and I had to custom compile that one. And double check those options. Once it's functional it should show up with aconnect (like qjackctl, more like jack_connect, but for alsa).
$ timidity++ -iA -Os &
$ aconnect -ol
Otherwise the pulse over jackd method covers all the bases. Option number 3 from below is what my setup is based off of and relative to debian jessie at the moment.
Also check the logs as to WHY pulseaudio didn't start.
$ sudo less /var/log/syslog
or
$ sudo journalctl -a
for systemd-ish ways. with "/" and "pulse", then ENTER to search. Or press END if it's the very last thing you tried. Same hotkeys as less / man / ... aka whatever pager is default for your distro (probably less).
Also note that in client.conf if it starts with ;, then that is a comment. Distros often comment options when the value listed is the assumed default value.
FILE: /etc/pulse/client.conf
Code:
; autospawn = yes
autospawn = no
The NO is actually used, and not because it was listed last, but because it wasn't a comment.
Yes and no, with a pulse over jack setup, you start jack, THEN you start pulse and it "should" work. But you cannot start jack when pulse is already running. Plus it likely doesn't work out of the box at boot time, and needs manual intervention after every boot cycle. Sadly if you skype or modern browser, you kind of have to put up with pulse these days. If you're just doing local media creation, you can pretty much uninstall it and be golden. Or option 4 from the previous link of suspend PA.
As far as configurations for local users, ~/.pulse is OLD, the more recent (past 5+ years or more) use ~/.config/pulse/ for those things. In fact having ~/.pulse or /.pulse (if root oops) REALLY gets in the way of the proper functioning of pulse. I tend to delete all of the above if it's awkward and then start pulse again. Just be sure to use pavucontrol after you start it to manage levels and devices. With the short answer being to disable all the devices under Configuration in pavucontrol, except the one you actually want to use. Most anything beyond that with pulse over jack will be done with qjackctl or the jack_* options for fancy routing like the calf plugin for a 30 band EQ. Depending on how much RAM, CPU, and latency that you find acceptable.
Once it all works you should be able to get by with stop, start, and qjackctl to route. No need to delete anything unless you Oopsies by trying to stop or start pulse as root.
The networking stuff I showed earlier is supplemental if you ONLY use ONE user and otherwise don't network your audio. I tend to use multiple users, one per task, browser, game, youtube, and such. Plus multiple machines so nice to use one good sound card and one good set of speakers. Also nice to have hardware options like a headphone preamp to have some arms reach analog knobs and a mute button.
This allows sharing over tcp/ip with "other" users on the same machine on localhost, and over the network on a subnet. Kind of nice to not have to buy two high end interfaces and two sets of speakers. Plus it offloads a bit of processing from the main machine. The last two allow jack so I can run things like a 30 band EQ with calf plugins.
Once it's all started up I use qjackctl to ensure that pulseaudio is listed, which means it's good to go. If it doesn't show up I stop/start pulseaudio again.
$ pulseaudio --kill
$ pulseaudio --start
While pulse is NOT running is when you start jackd. You don't need pulseaudio or jackd though as timidity++ can run against alsa natively, it's been a while but "-iA -Os" as the flags for timidity to use alsa. Although it has to be compiled in a certain way, which is debians default options NOW, but older versions didn't and I had to custom compile that one. And double check those options. Once it's functional it should show up with aconnect (like qjackctl, more like jack_connect, but for alsa).
$ timidity++ -iA -Os &
$ aconnect -ol
Otherwise the pulse over jackd method covers all the bases. Option number 3 from below is what my setup is based off of and relative to debian jessie at the moment.
I've made all the suggested changes to the appropriate files. I have issued the following commands as my personal account user:
Code:
michael@caitlyn michael $ timidity -iA -Os &
[1] 30146
michael@caitlyn michael $ Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 33868, period size 3760 bytes
TiMidity starting in ALSA server mode
Opening sequencer port: 128:0 128:1 128:2 128:3
michael@caitlyn michael $ aconnect -ol
client 128: 'TiMidity' [type=user]
0 'TiMidity port 0 '
1 'TiMidity port 1 '
2 'TiMidity port 2 '
3 'TiMidity port 3 '
client 129: 'rosegarden' [type=user]
0 'record in '
Connected From: 0:1
2 'external controller'
michael@caitlyn michael $ ps ax | grep pulseaudio
28474 ? Sl 0:01 /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 5 14680097 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
30168 pts/3 S+ 0:00 grep pulseaudio
michael@caitlyn michael $ pulseaudio --start
N: [pulseaudio] main.c: User-configured server at 127.0.0.1, refusing to start/autospawn.
michael@caitlyn michael $ pulseaudio --start
At this moment, not only do I have no midi in rosegarden, I also have no sound anywhere in Linux, and my stupid pulseaudio applet keeps popping up to tell me that pulseaudio is not working. Pulseaudio will not start.
Code:
root@caitlyn:~# journalctl -a
-su: journalctl: command not found
root@caitlyn:~# grep pulseaudio /var/log/syslog
Jun 1 16:56:37 caitlyn pulseaudio[1424]: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
Jun 1 16:56:37 caitlyn pulseaudio[1443]: [pulseaudio] pid.c: Daemon already running.
And I don't know why pulseaudio will not restart. The only thing /var/log/messages tells me about it is that it will not start.
You do NOT need the $HOME/.config/pulse/client.conf for the USER who STARTS pulseaudio. Alsa shares the sound card by default, pulse locks it down to the user who starts it. The networking half is to enable "sharing" by network or pseudo network (localhost). The user which starts pulseaudio is NOT sharing, it's the owner / bossman / head haunch.
You do NOT need the $HOME/.config/pulse/client.conf for the USER who STARTS pulseaudio. Alsa shares the sound card by default, pulse locks it down to the user who starts it. The networking half is to enable "sharing" by network or pseudo network (localhost). The user which starts pulseaudio is NOT sharing, it's the owner / bossman / head haunch.
Code:
michael@caitlyn michael $ cat .config/pulse/client.conf
default-server = 127.0.0.1
That's probably why it does not work for you. No "USER" has the permissions of root. In debian the polkitd (package policykit-1) and rtkit-daemon (package rtkit) handle the root side of the equation and pulseaudio runs as the user. Generally the same user who starts / logs into X11. Where the RT in rtkit stands for realtime, not root. All of which are deps of pulseaudio in debian. Having /.pulse or /root/.pulse and friends (like /root/.config/pulse/), which you'll have if you run pulseaudio as root, effectively breaks things.
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 1048576
Period size range from 32 to 349526
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
0 - Front Left
1 - Front Right
Time per period = 10.938314
Also, qjackctl did not start. Message window said:
Code:
michael@caitlyn michael $ speaker-test -c 2 -l 1
speaker-test 1.1.1
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 1048576
Period size range from 32 to 349526
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
0 - Front Left
1 - Front Right
Time per period = 10.938314
And even though the output from speaker test looked good to me, I have no sound. At all. Hopefully it will come back after I reboot the computer, but I'd have to undo some of the stuff you suggested before that would happen. My Pulseaudio applet says "HDMI/Displayport (unplugged), but I have not manually unplugged anything. Thank you for being patient with me.
Last edited by maschelsea; 06-04-2017 at 03:59 PM.
If you're needing HDMI audio, you probably need to append the speaker-test with that device. Or override it with a .asoundrc.
$ speaker-test -c 2 -l 1 -D hw:0,3
or
$ speaker-test -c 2 -l 1 -D pulse
Although -D pulse would be the assumed default if pulseaudio was running. Perhaps omit -l 1 and run pavucontrol while it runs to configure things. Sometimes you have to disable / re-enable a card for pulseaudio to become sentient again. It's like a loopy X-girlfriend, constantly forgetting that the nature of your relationship has changed.
michael@caitlyn michael $ speaker-test -c 2 -l 1 -D pulse
speaker-test 1.1.1
Playback device is pulse
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 1048576
Period size range from 32 to 349526
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
0 - Front Left
1 - Front Right
Time per period = 10.938541
My ~/.asoundrc file says:
Code:
michael@caitlyn michael $ cat .asoundrc
ctl.pulse { type pulse fallback sysdefault }
pcm.pulse { type pulse fallback sysdefault }
ctl.!default { type pulse fallback sysdefault }
pcm.!default { type pulse fallback sysdefault }
And still no sound. Just for kicks and giggles, I tried your other line.
Code:
michael@caitlyn michael $ speaker-test -c 2 -l 1 -D hw:0,3
speaker-test 1.1.1
Playback device is hw:0,3
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Playback open error: -2,No such file or directory
Does this reveal anything helpful?
Last edited by maschelsea; 06-04-2017 at 05:00 PM.
So -D hw:0,3 on my system, but -D hw:Generic,3 would work too. But if pulse is in play and working, you can use pavucontrol to mouse click the output you desire. Ignore the jack stuff previously mentioned, on a good day, system defaults should work. YMMV depending on distro. I'm not a fan of ubuntu, but they tend to get pulse right out of the box. So on a bad day you could just cut and paste their configs to almost any distro.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.