Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

liamw9534/mopidy-pulseaudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mopidy-PulseAudio

Latest PyPI version Number of PyPI downloads Travis CI build status Test coverage

Mopidy extension for PulseAudio server management.

Installation

Install by running:

pip install Mopidy-PulseAudio

Or, if available, install the Debian/Ubuntu package from apt.mopidy.com.

Configuration

PulseAudio

There are several configuration files used by PulseAudio normally located under /etc/pulse. The following settings should be present:

daemon.conf:

daemonize = yes
allow-exit = no
exit-idle-time = -1
; This must be set for embedded hardware like Raspberry Pi
resample-method = trivial
default-sample-rate = 44100

For bluetooth support ensure the module module-bluetooth-discover is also loaded as part of default.pa file.

Extension

Add the following section to your Mopidy configuration file following installation:

[audio]
output = pulsesink device=mopidy

[pulseaudio]
enabled = true
name = mopidy
auto_sources = default
auto_sinks = default
attach_audio_sink = false

If attach_audio_sink is true then this extension will use the (presently on a branch) dynamic audio configuration feature for adding a pulsesink to the audio output tee. Otherwise, it is assumed that the user has configured their output - in this instance, output should be configured for pulsesink with the device property set to the same value as configured under name for pulseaudio.

Note that this extension creates a "null" sink within pulseaudio for mopidy to use during start-up.

The auto_sources and auto_sinks settings allows all named sources to be connected to all named sinks automatically without user intervention. This also handles sources or sinks that are connected dynamically, such as bluetooth audio devices. The configuration parameters are a list of source/sink names, with some special values also permitted:

  • default: the source/sink selected is the pulseaudio default source/sink
    • note: default source is always the sink monitor connected to mopidy.
  • all: all sources/sinks are selected
    • note: monitor sources/sinks are filtered out
  • none: no source/sink is selected
    • note: manual selection is necessary at all times

HTTP API

  • To obtain a list of sources, use mopidy.pulseaudio.getSources()
  • To obtain a list of sinks, use mopidy.pulseaudio.getSinks()
  • To establish a new connection between a source and sink, use mopidy.pulseaudio.connect()
    • A unique connection identifier string is returned
  • To remove a connection between a source and sink, use mopidy.pulseaudio.disconnect()
    • A valid connection identifier string should be provided
  • To list all established connections, use mopidy.pulseaudio.getConnections()
  • Extension properties may be get/set dynamically using getProperty() and setProperty()

respectively.

Project resources

Changelog

v0.2.0 (NOT IMPLEMENTED)

  • Create networked audio sinks e.g., RTP, TCP (initial investigation suggests that that jitter buffer support is not very good).
  • Connect to networked audio sinks

v0.1.0 (PENDING RELEASE)

Supports the following features:

  • Connect/disconnect mopidy to/from audio sinks via HTTP API
  • Connect any arbitrary audio source to an audio sink via HTTP API
  • Detect new bluetooth audio sources/sinks (A2DP)
  • Auto-connect feature for discovered sources and sinks
  • Zeroconf publish and discovery

About

Mopidy extension for PulseAudio server management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages