4

This may sound like a duplicate question, but the answers to similar questions are not solving my problem. I have plugged the USB cable from my Logitech S-150 digital speakers into a powered USB hub connected to my Pi 3. The speakers show that they're on - "DIGITAL" appears on the one with the controls and cable. My aplay -l output is

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: AUDIO [USB  AUDIO], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I used sudo nano /usr/share/alsa/alsa.conf to change the defaults.ctl.card 0 defaults.pcm.card 0 values to 1 as I read in an answer to a similar problem. I don't know if the speakers are working or the Pi is not recognizing them. I have used the GUI Audio Device Settings (under Preferences) to set the Control to PCM for both bcm2835 ALSA (Alsa mixer)(Default) and USB AUDIO (Alsa mixer). Is there a way I can test the speakers' output without finding & using an MP3 file with aplay?

I issued wget goo.gl/XJuOUW -O example.mp3 --no-check-certificate and got -

-2016-04-21 14:55:57--  http://goo.gl/XJuOUW
Resolving goo.gl (goo.gl)... 2607:f8b0:4002:c05::66, 216.58.217.238
Connecting to goo.gl (goo.gl)|2607:f8b0:4002:c05::66|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/raspberrypilearning/burping-jelly-baby/master/sounds/la.mp3 [following]
--2016-04-21 14:55:58--  https://raw.githubusercontent.com/raspberrypilearning/burping-jelly-baby/master/sounds/la.mp3
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 23.235.44.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|23.235.44.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17260 (17K) [audio/mpeg]
Saving to: ‘example.mp3’

example.mp3         100%[=====================>]  16.86K  --.-KB/s   in 0.001s 

2016-04-21 14:55:59 (27.5 MB/s) - ‘example.mp3’ saved [17260/17260]

I then issued omxplayer example.mp3 and got

Audio codec mp3 channels 1 samplerate 11025 bitspersample 16
Subtitle count: 0, state: off, index: 1, delay: 0
have a nice day ;)

Through my Pi 3's GUI Preferences, I've set both bcm2835 ALSA (Alsa mixer) (Default) and USB AUDIO (Alsa Mixer).

  • You can test with wget goo.gl/XJuOUW -O example.mp3 --no-check-certificate and omxplayer example.mp3 – Steve Robillard Apr 20 '16 at 19:43
  • I heard no sound. I issued aplay example.mp3 and got Playing raw data 'example.mp3' : Unsigned 8 bit, Rate 8000 Hz, Mono. – GeorgeInNC Apr 20 '16 at 23:46
  • After much more searching for answers and trying a whole bunch of things, my speakers are now working as expected! – GeorgeInNC Jun 2 '16 at 15:05
  • 4
    So why not answer your own question and help others. – Steve Robillard Jun 2 '16 at 15:07
2

Just had a similar issue and solved it like this (found in this tutorial):

Find your playback devices:

Locate your speaker in the list of playback hardware devices. Write down the card number and device number.

aplay -l

Create a new file named .asoundrc in the home directory (/home/pi). Make sure it has the right slave definitions speaker; use the configuration below but replace <card number> and <device number> with the numbers you wrote down in the previous step. Do this for pcm.speaker.

pcm.!default {
  type asym
  playback.pcm "speaker"
}

pcm.speaker {
  type plug
  slave {
    pcm "hw:<card number>,<device number>"
  }
}
  • The link in the above answer (i.e. shown as "this" tutorial) does not link to the relevant tutorial. – John Rose Apr 12 '18 at 8:20
1

This solved my problem:

All we have to do is tell Raspbian to look at "card #1" for the default audio. Card #0 is the built in audio, so this is fairly straightforward.

Tun sudo nano /usr/share/alsa/alsa.conf and look for the following two lines:

defaults.ctl.card 0

defaults.pcm.card 0

Change both “0” to “1” and then save the file. That’s it!

https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/updating-alsa-config

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.