Difference between revisions of "Linux Audio"

From S23Wiki
Jump to: navigation, search
(Quick intro in to Pulse Audio Output devices)
(No difference)

Revision as of 11:14, 27 May 2013

Linux Audio with Pulse Audio

Pulse Audio is a popular audio system for Linux.

Its basic command line app is "pacmd"

Terminology:

Sink: an audio output, typically an Analog audio output such as a sound card.

Source: an audio input, typically an Analog audio from a sound card such as a microphone. Can also can be a loop back / monitor of an audio output (Sink)

Output

List available sound outouts

# pacmd list-sinks 
Welcome to PulseAudio! Use "help" for usage information.
>>> 2 sink(s) available.
   index: 0
	name: <alsa_output.pci-0000_00_1b.0.analog-stereo> 
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
	state: RUNNING
...  
	* index: 14
	name: <alsa_output.usb-Behringer_BCD3000-00-BCD3000.analog-surround-40>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
	state: RUNNING
...

Change Default Output Device

# pacmd "set-default-sink ${Device Index}"

or

# pacmd "set-default-sink ${Device Name}"

E.G.

# pacmd "set-default-sink 14"
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> 
or
# pacmd set-default-sink alsa_output.usb-Behringer_BCD3000-00-BCD3000.analog-surround-40
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> 


List Apps using sound outputs

# pacmd list-sink-inputs
Welcome to PulseAudio! Use "help" for usage information.
>>> 2 sink input(s) available.
	index: 1994
		driver: <protocol-native.c>
		flags: 
		state: RUNNING
		sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
...
			application.process.id = "12170"
			application.process.binary = "java"
...
    index: 2106
		driver: <protocol-native.c>
		flags: START_CORKED 
		state: RUNNING
		sink: 14 <alsa_output.usb-Behringer_BCD3000-00-BCD3000.analog-surround-40>
...		
			application.process.id = "22083"
			application.icon_name = "media-player-banshee"
...


Move App to another output device

# pacmd "move-sink-input ${App Index}  ${Device Index}"

# pacmd "move-sink-input 1994 0"
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> 


Input

pacmd help

#pacmd help
Welcome to PulseAudio! Use "help" for usage information.
>>> Available commands:
   help                      Show this help
   list-modules              List loaded modules
   list-cards                List cards
   list-sinks                List loaded sinks
   list-sources              List loaded sources
   list-clients              List loaded clients
   list-sink-inputs          List sink inputs
   list-source-outputs       List source outputs
   stat                      Show memory block statistics
   info                      Show comprehensive status
   load-module               Load a module (args: name, arguments)
   unload-module             Unload a module (args: index)
   describe-module           Describe a module (arg: name)
   set-sink-volume           Set the volume of a sink (args: index|name, volume)
   set-source-volume         Set the volume of a source (args: index|name, volume)
   set-sink-mute             Set the mute switch of a sink (args: index|name, bool)
   set-source-mute           Set the mute switch of a source (args: index|name, bool)
   set-sink-input-volume     Set the volume of a sink input (args: index, volume)
   set-source-output-volume  Set the volume of a source output (args: index, volume)
   set-sink-input-mute       Set the mute switch of a sink input (args: index, bool)
   set-source-output-mute    Set the mute switch of a source output (args: index, bool)
   set-default-sink          Set the default sink (args: index|name)
   set-default-source        Set the default source (args: index|name)
   set-card-profile          Change the profile of a card (args: index|name, profile-name)
   set-sink-port             Change the port of a sink (args: index|name, port-name)
   set-source-port           Change the port of a source (args: index|name, port-name)
   suspend-sink              Suspend sink (args: index|name, bool)
   suspend-source            Suspend source (args: index|name, bool)
   suspend                   Suspend all sinks and all sources (args: bool)
   move-sink-input           Move sink input to another sink (args: index, sink)
   move-source-output        Move source output to another source (args: index, source)
   update-sink-proplist      Update the properties of a sink (args: index|name, properties)
   update-source-proplist    Update the properties of a source (args: index|name, properties)
   update-sink-input-proplist Update the properties of a sink input (args: index, properties)
   update-source-output-proplist Update the properties of a source output (args: index, properties)
   list-samples              List all entries in the sample cache
   play-sample               Play a sample from the sample cache (args: name, sink|index)
   remove-sample             Remove a sample from the sample cache (args: name)
   load-sample               Load a sound file into the sample cache (args: name, filename)
   load-sample-lazy          Lazily load a sound file into the sample cache (args: name, filename)
   load-sample-dir-lazy      Lazily load all files in a directory into the sample cache (args: pathname)
   kill-client               Kill a client (args: index)
   kill-sink-input           Kill a sink input (args: index)
   kill-source-output        Kill a source output (args: index)
   set-log-level             Change the log level (args: numeric level)
   set-log-meta              Show source code location in log messages (args: bool)
   set-log-time              Show timestamps in log messages (args: bool)
   set-log-backtrace         Show backtrace in log messages (args: frames)
   play-file                 Play a sound file (args: filename, sink|index)
   dump                      Dump daemon configuration
   dump-volumes              Debug: Show the state of all volumes
   shared                    Debug: Show shared properties
   exit                      Terminate the daemon