davclark
Posts: 4
Joined: Wed Nov 30, 2016 4:32 pm

Getting audio working in the GUI

Thu Dec 01, 2016 4:36 pm

to be clear - ALSA on the command line works fine (after I delete/modify .asoundrc after it's auto-broken by PIXEL). I'm using a Mackie Blackjack Onyx (a reasonably nice stereo DAC) on a Raspberry Pi 3.

The most seemingly contemporary answer I've found on modern Raspbian ALSA config was here:

http://raspberrypi.stackexchange.com/qu ... 0832#40832

I have no idea where @Housni read about the slots option being needed for recent versions of Raspbian, though.

It seems that ALSA on Raspberry Pi is a bit funny and I don't see any official docs that are relevant to non-standard audio anywhere (just directions on HDMI or the PWM outputs). I have looked at MANY websites, including raspi forums, this SE site, Adafruit, and the ALSA docs.

My situation:
  • I can set my USB device to default for alsa, as either device 0 or 1, except...
    .asoundrc gets regenerated each login to LXDE/PIXEL. Somehow it knows where the built-in device is and selects that card. Doesn't matter if a good .asoundrc was there vs. no such file.

    So, by default, I get the built-in sound on the command line after login, but I can edit/delete .asoundrc and everything's fine on the CLI.

    The GUI (e.g., pimixer aka "Audio Device Manager") ONLY seems to see the built-in audio. The USB card is visible via e.g., aplay -l, but not in the pimixer drop-down.
Based on the pimixer README, it seems PIXEL (aka sorta LXDE) is using Gstreamer for GUI stuff.

As far as I can tell, this issue could reside in

- LXDE,
- PIXEL LXDE mods,
- Gstreamer,
- the XFCE4 mixer settings (pimixer related stuff).

I trashed my .config directory, disabled internal audio, and set the global asound.conf in both /etc and also /usr/share/alsa. None of this gets the USB audio in the GUI. If I disable internal audio, pimixer says "No ALSA audio devices were detected." (aplay -l still shows my USB device - a Blackjack Onyx.)

I've verified that there's no problem with Ubuntu MATE (which uses PulseAudio), but their version of Chromium doesn't play audio!

So, what is generating that .asoundrc?
What sound framework is Chromium talking to?

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 446
Joined: Fri Dec 26, 2014 11:02 am

Re: Getting audio working in the GUI

Thu Dec 01, 2016 4:53 pm

Insert your USB audio device
Boot PIXEL
Right-click the speaker icon on the taskbar
Select your audio device
Reboot PIXEL

The device you selected should still be the default if you do it like this. The volumealsa plugin to the taskbar takes control of the audio settings, as something has to integrate onboard audio, USB devices and Bluetooth audio, and that something needs to be running all the time.

(This would be much easier if the writers of the BlueZ Bluetooth stack hadn't removed the support for Bluetooth devices appearing as ALSA devices in the version in Jessie. As it is, PulseAudio has to run for Bluetooth devices, and not run for ALSA devices, and this is all controlled by the plugin.)

If you want to manually control audio devices, remove the volumealsa plugin from the taskbar - right-click the taskbar, choose "Add/Remove Panel Items", find "Volume Control (ALSA)" and click remove. You're then on your own - you will lose any support for Bluetooth audio, but it sounds as if that isn't a problem for you.

davclark
Posts: 4
Joined: Wed Nov 30, 2016 4:32 pm

Re: Getting audio working in the GUI

Fri Dec 02, 2016 2:54 pm

Awesome - I think you answered my question, though your solution doesn't work directly.

My device does not show up as an option in the drop down. This is curious to me, as it shows up in the ALSA list. I even tried disabling built-in audio, at which point the PIXEL apps say there is no ALSA devices (even though command line shows my USB sound card, and I can use it via command line).

But it seems I can probably just disable the volumealsa plugin and maybe use something like pulseaudio directly (e.g., pavumeter). I'll try that and report back.

If anyone has any ideas why the volumealsa plugin isn't seeing my USB audio (Onyx Blackjack), I'm all ears.

I also have more info at this stackexchange site - trying to keep both updated:

http://raspberrypi.stackexchange.com/qu ... 8413#58413

spl23
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 446
Joined: Fri Dec 26, 2014 11:02 am

Re: Getting audio working in the GUI

Sat Dec 03, 2016 4:31 pm

I can make an educated guess as to why your device doesn't appear in the plugin.

One of the most irritating features of ALSA is that the channels on a device aren't numbered, they are named with arbitrary text strings, and we have to guess which channel is the default output on a device. There is therefore a list in the plugin of the names which default channels are usually given - one or another of the entries in this list works on 95% of devices, but it looks as if your device doesn't offer any of the names we recognise, so we don't show it in the list as we don't know how to talk to it. (This tends to be the case on semi-pro gear where the manufacturers have actually thought about things like names, as opposed to just using an off-the-shelf chipset which uses default names.)

When I get a chance, I'll dig out the magic incantations which report the channel names to the command line - we can then work out what I need to add to the plugin in order for it to recognise your device.

Return to “Raspberry Pi OS”