Difference between revisions of "Pulseaudio Setup"

From Ghpsdr3 SDR project
Jump to: navigation, search
m (Enable Pulseaudio Daemon to run in system wide mode)
 
(20 intermediate revisions by 6 users not shown)
Line 1: Line 1:
To run the softrock server use:
+
== Set audio levels with Pavucontrol ==
 +
To configure the softrock server with your soundcard for IQ processing use:
 
<pre>
 
<pre>
 
pavucontrol
 
pavucontrol
 
</pre>
 
</pre>
  
to choose the default pulse audio sources:
+
In order to install it, submit the following command:
  
For TX Audio
 
 
<pre>
 
<pre>
Softrock:IQ = shared ID for use with libusb Analog Stereo
+
sudo apt-get install pavucontrol
 
</pre>
 
</pre>
  
and for RX Audio:
+
Choose your Soundcard for IQ processing. If you are running the SDR-Widget your settings should look like in the following two pictures.
<pre>
+
=== TX audio levels on the softrock server ===
Softrock:IQ = shared ID for use with libusb Analog Stereo
+
</pre>
+
  
 +
 +
[[File:Playback.png]]
 +
=== RX audio levels on the softrock server ===
 +
 +
 +
[[File:Recording.png]]
 +
 +
'''Make sure not to set the RX Audio level in the Recording Tab of pavucontrol to 100%. Otherwise you could have audio feedthrough from RX to TX and a distorted TX Audio. A level from 22% - 80% would be ok, but may vary on each system.'''
 +
 +
== Enable network mode ==
 
You also need to run pulse in network mode. Use:
 
You also need to run pulse in network mode. Use:
 
<pre>
 
<pre>
Line 21: Line 29:
 
</pre>
 
</pre>
  
to set up network access by checking the various option boxes.
+
In order to install it, submit the following command:
 +
 
 +
=== Ubuntu ===
 +
<pre>
 +
sudo apt-get install paprefs
 +
</pre>
 +
 
 +
=== Fedora 16 ===
 +
<pre>
 +
sudo yum install pulseaudio-module-zeroconf
 +
sudo yum install paprefs
 +
pulseaudio -k ; pulseaudio -D --log-target=syslog
 +
</pre>
 +
 
 +
 
 +
 
 +
to set up network access by checking the various option boxes as follows:
 +
 
 +
[[File:PulseAudio_Preferences_036.png]]
 +
 
 +
<br>
 +
 
 +
[[File:PulseAudio_Preferences_037.png]]
 +
 
 +
If you are not able to change the network options you might be able to solve it with this workaround. See bug report for Ubuntu 11.10 [https://bugs.launchpad.net/ubuntu/+source/paprefs/+bug/829051].
 +
 
 +
<pre>
 +
sudo ln -s /usr/lib/pulse-1.0 /usr/lib/pulse-1.0.0
 +
</pre>
 +
 
 +
=== Pulseaudio Setup independant on a X-Server installation ===
 +
==== Add Username to /etc/group ====
 +
Make sure you add your username to the following system groups:
 +
<ul>
 +
<li>pulse
 +
<li>pulse-access
 +
<li>audio
 +
</ul>
 +
 
 +
Use the following commands: ($USER stands for current logged in user)<br>
 +
<pre>
 +
sudo adduser $USER pulse
 +
sudo adduser $USER pulse-access
 +
sudo adduser $USER audio
 +
</pre>
 +
 
 +
Example, for the user dl6kbg the grup file must contain:
 +
<pre>
 +
grep dl6kbg /etc/group
 +
...
 +
audio:x:29:pulse,dl6kbg
 +
pulse:x:119:dl6kbg
 +
pulse-access:x:120:dl6kbg
 +
...
 +
</pre>
 +
==== Enable Pulseaudio Daemon to run in system wide mode ====
 +
<pre>
 +
sudo nano /etc/default/pulseaudio
 +
</pre>
 +
 
 +
change settings to:
 +
 
 +
<pre>
 +
PULSEAUDIO_SYSTEM_START=1
 +
DISALLOW_MODULE_LOADING=0
 +
</pre>
 +
 
 +
Latest pulseaudio versions settings, /etc/default/pulseaudio is not used:-
 +
 
 +
"sudo nano /etc/pulse/daemon.conf" and uncomment the following line to read as follows:-
 +
 
 +
daemonize = yes
 +
 
 +
==== Enable network mode ====
 +
<pre>
 +
sudo nano /etc/pulse/system.pa
 +
</pre>
 +
 
 +
and add:
 +
 
 +
<pre>
 +
load-module module-native-protocol-tcp auth-anonymous=1
 +
</pre>
 +
 
 +
Restart pulseaudio:
 +
<pre>
 +
sudo /etc/init.d/pulseaudio restart
 +
</pre>
 +
 
 +
or restart the system and fire up the softrock server.
 +
Pulseaudio runs now in systemwide mode and your softrock server should be able to establish a connection
 +
to your following dspserver.
 +
 
 +
== Configure Pulseaudio Daemon ==
  
 
In order to use 96000 or 192000, you will need to configure pulse audio by editing:
 
In order to use 96000 or 192000, you will need to configure pulse audio by editing:
Line 28: Line 129:
 
</pre>
 
</pre>
  
or better, copy the file to:  
+
Uncomment these settings and change it for your needs.
 +
 
 +
Example:
 +
<pre>
 +
default-sample-format = s24le
 +
default-sample-rate = 192000
 +
</pre>
 +
 
 +
== Tweak System for realtime performance ==
 +
 
 +
For realtime audio add the following to:
 +
<pre>
 +
/etc/security/limits.conf
 +
</pre>
 +
 
 
<pre>
 
<pre>
~/.pulse/daemon.conf
+
@audio - rtprio 99
 +
@audio - memlock unlimited
 
</pre>
 
</pre>
and then edit the file there, if you run your pulseadio system in user mode.
+
and reboot and enjoy your system.

Latest revision as of 16:41, 5 May 2015

Set audio levels with Pavucontrol

To configure the softrock server with your soundcard for IQ processing use:

pavucontrol

In order to install it, submit the following command:

sudo apt-get install pavucontrol

Choose your Soundcard for IQ processing. If you are running the SDR-Widget your settings should look like in the following two pictures.

TX audio levels on the softrock server

Playback.png

RX audio levels on the softrock server

Recording.png

Make sure not to set the RX Audio level in the Recording Tab of pavucontrol to 100%. Otherwise you could have audio feedthrough from RX to TX and a distorted TX Audio. A level from 22% - 80% would be ok, but may vary on each system.

Enable network mode

You also need to run pulse in network mode. Use:

paprefs

In order to install it, submit the following command:

Ubuntu

sudo apt-get install paprefs

Fedora 16

sudo yum install pulseaudio-module-zeroconf
sudo yum install paprefs
pulseaudio -k ; pulseaudio -D --log-target=syslog


to set up network access by checking the various option boxes as follows:

PulseAudio Preferences 036.png


PulseAudio Preferences 037.png

If you are not able to change the network options you might be able to solve it with this workaround. See bug report for Ubuntu 11.10 [1].

sudo ln -s /usr/lib/pulse-1.0 /usr/lib/pulse-1.0.0

Pulseaudio Setup independant on a X-Server installation

Add Username to /etc/group

Make sure you add your username to the following system groups:

  • pulse
  • pulse-access
  • audio

Use the following commands: ($USER stands for current logged in user)

sudo adduser $USER pulse
sudo adduser $USER pulse-access
sudo adduser $USER audio

Example, for the user dl6kbg the grup file must contain:

grep dl6kbg /etc/group
...
audio:x:29:pulse,dl6kbg
pulse:x:119:dl6kbg
pulse-access:x:120:dl6kbg
...

Enable Pulseaudio Daemon to run in system wide mode

sudo nano /etc/default/pulseaudio

change settings to:

PULSEAUDIO_SYSTEM_START=1
DISALLOW_MODULE_LOADING=0

Latest pulseaudio versions settings, /etc/default/pulseaudio is not used:-

"sudo nano /etc/pulse/daemon.conf" and uncomment the following line to read as follows:-

daemonize = yes

Enable network mode

sudo nano /etc/pulse/system.pa

and add:

load-module module-native-protocol-tcp auth-anonymous=1

Restart pulseaudio:

sudo /etc/init.d/pulseaudio restart

or restart the system and fire up the softrock server. Pulseaudio runs now in systemwide mode and your softrock server should be able to establish a connection to your following dspserver.

Configure Pulseaudio Daemon

In order to use 96000 or 192000, you will need to configure pulse audio by editing:

/etc/pulse/daemon.conf

Uncomment these settings and change it for your needs.

Example:

default-sample-format = s24le
default-sample-rate = 192000

Tweak System for realtime performance

For realtime audio add the following to:

/etc/security/limits.conf
@audio - rtprio 99
@audio - memlock unlimited

and reboot and enjoy your system.