Hi,


I noticed that the latest release of Raspbian will now include Pulse Audio. I'll be keen to try it out. I've spent many hours pottering around with Raspbian audio on a Raspberry Pi 1, with limited success.


The following is my understanding of ALSA and PulseAudio audio systems. It is based on my tinkering around with trying to get audio applications working on Raspbery Pi 1's / Raspbian. I may have got this completely wrong, so please feel free to correct me...


If you want "simple audio" on a linux system you use ALSA to accept a digital audio signal from an application, provide a volume control, and to output a pulse width modulated signal to a converter to produce an analog audio signal that can be amplified and then drive a loud speaker. Conversion from pulse width modulation to analog audio is not that complicated and can be done with passive devices (resistors, capacitors and inductors). Thus on a Raspberry Pi the pulse width modulated audio output from the ARM CPU chip goes to some passive components and then to the 3.5mm audio output socket.


My definition of "simple audio" is that only one application will send its digitalized audio stream at any one time to ALSA. If multiple applications want to simultaneously send digitized streams of audio to ALSA then this doesn't work. (Well I couldn't get it to work on Raspian / Raspberry Pi).

In theory you can install the "PulseAudio" application, which I understand inserts itself between the output of your audio applications and the input to ALSA. This means that ALSA only has one input source, which is the output of PulseAudio. However PulseAudio can have multiple audio sources, and a "PulseAudio Mixer" can be used to balance the volumes of the various audio sources. If the ALSA volume control is still used after PulseAudio has been inserted, then it is the "Master" volume control.

In inserting PulseAudio, then your applications have to be aware that PulseAudio has been inserted, and so they need to be told not to try sending their audio to ALSA but to send it to PulseAudio. (...Or maybe they do still go to ALSA and ALSA turns it around and sends it to PulseAudio which then sends it back to ALSA?)


Is that about how it works? ...Or did I go off the rails in one of my learning curves?

Previous versions of Raspbian only used ALSA. I tried installing PulseAudio, but was unsuccessful in getting audio from multiple sources to produce any output. Maybe someone has succeeded in doing this on a Raspberry Pi?

It seems that this latest version of Raspbian now includes PulseAudio as part of supporting Bluetooth audio. So maybe I can get PulseAudio working with my applications.


cheers,

Ian.


FYI: Below are some statements from the Raspbian update blog...

To connect an audio device, you pair it as described above � it will then be listed in the audio device menu, accessible by right-clicking the speaker icon on the taskbar.

Selecting a Bluetooth device from the audio device menu will cause it to be selected as the default audio output device � there will be a few seconds� pause while the connection is established. You can then use the volume control on the taskbar to control it, as for standard wired audio devices.

There is one issue with the support for Bluetooth audio, however. Due to the way the Bluetooth stack has been written, Bluetooth devices do not appear to the system as standard ALSA audio devices � they require the use of an intermediate audio layer called PulseAudio. The PulseAudio magic is all built into the UI � you don�t need to worry about setting it up � but the problem is that not all applications are able to send audio to the PulseAudio interface, and therefore cannot output audio over Bluetooth.

Most applications work just fine � videos and music work in the Epiphany and Iceweasel browsers, as does the command-line mplayer music player and the vlc media player. But at present neither Scratch nor Sonic Pi can output audio over Bluetooth � we are working with the authors of these programs to address this and are hopeful that both can be made compatible, so please bear with us!

The use of PulseAudio has one other effect that may cause issues for a small number of users � specifically, if you are already using PulseAudio for anything other than interfacing with Bluetooth devices. This plugin will automatically stop the PulseAudio service whenever a standard ALSA device is selected. If you are using PulseAudio for your own purposes, it would be best to remove the volumealsa plugin from the taskbar completely to avoid this � just right-click anywhere on the taskbar, choose �Add/Remove Panel Items�, and remove the �Volume Control (ALSA)� item from the list.

In the comments to the posting...


Bummer about audio requiring PulseAudio. I�m running jack over alsa and it would have been nice to have the option of outputting to a BT device. Having PulseAudio disabled won�t affect the ability to pair BT keyboard/mice will it?

PulseAudio is only started when you connect to a bluetooth audio device (and stopped afterwards). It�s not used or required otherwise, so keyboards and mice will work without problems.


________________________________________
From: wlug-bounces@list.waikato.ac.nz <wlug-bounces@list.waikato.ac.nz> on behalf of Peter Reutemann <fracpete@waikato.ac.nz>
Sent: Saturday, 14 May 2016 9:00 a.m.
To: wlug List
Subject: [wlug] Raspbian Linux OS Gets Major Update,    Adds Bluetooth Support to Pi 3

"The Raspberry Pi 3 was launched with built-in chip for Bluetooth and
Wi-Fi support, however, software support for Bluetooth was lacking
until now. The drivers were there, but today's update to the Raspbian
Linux distribution adds much-needed GUI tools to help you establish
Bluetooth connections. Another cool addition is a new backup tool.
There are other improvements as well including the mouse settings, and
the ability to empty the wastebasket through right-clicking as seen
below (yes, seriously). There is even a new shutdown dialog, something
even casual users should notice."

-- source: https://hardware.slashdot.org/story/16/05/13/1740218

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
wlug mailing list | wlug@list.waikato.ac.nz
Unsubscribe: https://list.waikato.ac.nz/mailman/listinfo/wlug