andrewn / neue-radio

Neue Radio: Prototype connected object using web technologies
10 stars 6 forks source link

Makes Pulse Audio the default audio system #22

Closed andrewn closed 6 years ago

andrewn commented 6 years ago

Pulse Audio seems to be better at working out-of-the-box.

To test this, I disabled the Pi's on-board sound and enabled the Phat DAC in /boot/config.txt:

#dtparam=audio=on
dtoverlay=hifiberry-dac

I also plugged in a USB microphone.

PulseAudio correctly outputs sound over the DAC and Chromium gets sound from the microphone with no further config necessary. \o/

Default volume is very loud, and you should be able to use alsamixer to control this but it doesn't work for me.

pixelblend commented 6 years ago

Do we want to make this optional? ALSA works fine with the stock sound device and the sound mixer works properly.

pixelblend commented 6 years ago

You can set the volume using pulseaudio-utils package: http://terokarvinen.com/2015/volume-control-with-pulseaudio-command-line-tools

andrewn commented 6 years ago

@pixelblend My instinct is to settle on one audio system so that we can get proficient using it (including figuring out how to turn the volume down 🤦‍♂️ ).

If we want our prototypes to have better audio quality then we're immediately standardising on a DAC so this becomes necessary as a default? Not sure though.

Not sure what @libbymiller thinks?

andrewn commented 6 years ago

You can set the volume using pulseaudio-utils package: http://terokarvinen.com/2015/volume-control-with-pulseaudio-command-line-tools

pulseaudio-utils is installed by pulseaudio so that's good but the volume commands don't seem to have any effect.

pi@raspberrypi:~ $ apt-cache show pulseaudio
Package: pulseaudio
Version: 10.0-1+deb9u1
Architecture: armhf
Maintainer: Pulseaudio maintenance team <pkg-pulseaudio-devel@lists.alioth.debian.org>
Installed-Size: 5535
Depends: libasound2 (>= 1.0.24.1), libc6 (>= 2.15), libcap2 (>= 1:2.10), libdbus-1-3 (>= 1.9.14), libgcc1 (>= 1:3.5), libice6 (>= 1:1.0.0), libltdl7 (>= 2.4.6), liborc-0.4-0 (>= 1:0.4.25), libpulse0 (= 10.0-1+deb9u1), libsm6, libsndfile1 (>= 1.0.20), libsoxr0 (>= 0.1.0), libspeexdsp1 (>= 1.2~beta3.2-1), libstdc++6 (>= 4.3.0), libsystemd0, libtdb1 (>= 1.2.7+git20101214), libudev1 (>= 183), libwebrtc-audio-processing1, libx11-6, libx11-xcb1, libxcb1, libxtst6, adduser, lsb-base (>= 3.2-13), libasound2-plugins, pulseaudio-utils
libbymiller commented 6 years ago

The default sound system isn't ever going to be acceptable as an actual thing people want to listen to. Asking around, pulseaudio is more modern and therefore maybe a better choice?

pixelblend commented 6 years ago

I don't have an issue with using Pulseaudio as a default, so long as we're not merging in a buggy implementation. It feels like we're not there yet.

Are we happy with merging fixes into this branch and then merging to master when it's ready?

andrewn commented 6 years ago

We're now using PulseAudio in "system" mode and it seems to be working well for us. It's being installed as a side-effect of speech-dispatcher but we should install it explicitly.