[raspberry-vi] Re: USB Sound Device, how to configure for all users

  • From: "Glenn" <glennervin@xxxxxxxxxxxx>
  • To: <raspberry-vi@xxxxxxxxxxxxx>
  • Date: Wed, 27 Jul 2016 09:31:06 -0500

Thanks Mike.
I have only one USB audio card, but as they are so cheap, I may order 
several to have around.
I guess these are like the new hardware synth.

Glenn
----- Original Message ----- 
From: "Mike Ray" <mike@xxxxxxxxxxxxxxx>
To: <raspberry-vi@xxxxxxxxxxxxx>
Sent: Wednesday, July 27, 2016 9:19 AM
Subject: [raspberry-vi] USB Sound Device, how to configure for all users


Hello folks,

I finally spent some time working out how to configure a USB sound
dongle for all users from boot time.

I can confirm that this stops speakup from stuttering and will also
presumably do so for Orca via speech-dispatcher.

This is quite hard to find, because over the last six months or so,
configuration of the kernel and the Pi, at least on Raspbian has changed.

With the introduction of "device tree blocks", I think that's what DTB
is for (not Digital Talking Book in this case), there have been many
changes not only to /boot/config.txt but to the configuration of other
stuff connected with kernel and driver configuration.

This has made this stuff hard to find, since Googling turns up posts
from several years ago as well as very recent.

Couple this with the fact that ALSA configuration is harder to
understand than the Rosetta Stone, it had me tearing my hair out nearly
all last night.

It used to be a matter of editing /etc/asound/alsa.conf, which no longer
exists.

You will also see posts about editing .asoundrc, but that route will
presumably only configure the dongle for your user, causing the lightdm
greeter in LXDE to be silent until you log in, unless of course you also
plug a speaker into the audio jack on the Pi.  But thinking about it, as
the USB dongle will now be the default, even that might not work.

So, here is how to configure the USB sound dongle system-wide:

Changing to USB Audio on Raspberry Pi (Raspbian Jessie)

If you don't need analog audio then prevent the module from loading and
set the USB headset as the default device.

1. Disable analog audio:

* Open /boot/config.txt and comment out the line:

dtparam=audio=on

with a hash character.

2. Set the USB audio device to be the default:

* Open /lib/modprobe.d/aliases.conf and comment out the line:

options snd-usb-audio index=-2

again with a hash character.

3. Reboot

Note it is the editing of the /lib/modprobe.d/aliases.conf which ensures
the change to make the USB dongle the default audio device is system-wide.

You can leave out step one if you still want analog audio from the BCM
sound driver for some reason.  But you will have to specifically name
the device if you use 'aplay' for example.

Again I confirm that speakup does not stutter with my Daffodil USB sound
dongle, and presumably Orca will not either.

One down side of the USB dongle is that is fatter and deeper than a
usual USB plug, so it fouls USB sockets adjacent to it, and either above
or below.  So, in effect plugging one in makes the other three USB
sockets unusable.  But a USB hub will solve this.

One note about the Daffodil USB dongle in particular, I spent ages
trying to get it to make a sound only to discover that the headphone
jack was not all the way in, it takes a very firm push to make that
final click.

Mike


-- 
Michael A. Ray
Analyst/Programmer
Witley, Surrey, South-east UK

Eyes-free Linux:
http://eyesfreelinux.ninja/

Raspberry VI:
http://www.raspberryvi.org/

===========================================================
The raspberry-vi mailing list
Archives: //www.freelists.org/archives/raspberry-vi
Administrative contact: <mike.ray@xxxxxxxxxxxxxx>
-----------------------------------------------------------
Raspberry Pi and the Raspberry Pi logo are trademarks of the Raspberry Pi 
Foundation.

This list is not affiliated to the Raspberry Pi Foundation and the views and 
attitudes expressed by the subscribers to this list do not reflect those of 
the Foundation.

Mike Ray, list creator, January 2013

=========================================================== 
The raspberry-vi mailing list 
Archives: //www.freelists.org/archives/raspberry-vi
Administrative contact: <mike.ray@xxxxxxxxxxxxxx>
-----------------------------------------------------------
Raspberry Pi and the Raspberry Pi logo are trademarks of the Raspberry Pi 
Foundation.

This list is not affiliated to the Raspberry Pi Foundation and the views and 
attitudes expressed by the subscribers to this list do not reflect those of the 
Foundation.

Mike Ray, list creator, January 2013

Other related posts: