zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Audio Out Through USB

Tue Apr 09, 2013 9:59 pm

I'm trying to get my Pi to output sound through my Focusrite Scarlett 2i2 (http://wiki.linuxaudio.org/wiki/current_audio_gear says it should work out of the box w/ ALSA) but having no luck. The Pi recognizes that it's there, but I can't seem to pipe any sound to it. I tried what was detailed here http://www.raspberrypi.org/phpBB3/viewtopic.php?t=20866 and got nothin'. Is there a good source for how to do this anywhere? I've been searching Google and everything I've found hasn't worked.

I'd be more than happy to supply any info y'all need. Setup is currently:

Pi Model B
USB Slot 1: Plugable USB 2.0 7 Port Hub (which it is also powered by)
USB Slot 2: Airlink 101 WiFi Dongle

7 Port Hub
USB Slot 1: RPi
USB Slot 2: Focusrite Scarlett 2i2
USB Slots 3 - 7: Empty

Focusrite Scarlett 2i2 is running out through a 1/4" - 1/8" adapter and then to my speakers. Quite sure the adapter isn't the issue (tested it with another one I had lying around and didn't fix anything).

I'm running it headless and messing with it via VNC and SSH on my Windows machine.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Audio Out Through USB

Tue Apr 09, 2013 11:09 pm

First thing to do is post what "aplay -l" shows.from a shell prompt.

zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Re: Audio Out Through USB

Sat Jun 08, 2013 3:51 pm

Very sorry I didn't see your comment, ski522. Didn't get any "New reply" notification. I'll check that as soon as I can.

zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Re: Audio Out Through USB

Sun Jun 09, 2013 7:25 pm

I think I know what the issue is.

I've been playing around with speaker-test's parameters, and discovered that this works:

Code: Select all

speaker-test -Dplug:front


As opposed to plain 'ol speaker-test. Looks like I've goofed up somewhere along the line when I tried making my Focusrite 2i2 the default sound device for Alsa. I'll have to check over those files again to see if I can fix it.

zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Re: Audio Out Through USB

Sun Jun 09, 2013 7:53 pm

In case anyone is interested, here's the output from aplay -L

Code: Select all

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=USB
    Scarlett 2i2 USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    Scarlett 2i2 USB, USB Audio
    Front speakers
surround40:CARD=USB,DEV=0
    Scarlett 2i2 USB, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
    Scarlett 2i2 USB, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
    Scarlett 2i2 USB, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
    Scarlett 2i2 USB, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
    Scarlett 2i2 USB, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=USB,DEV=0
    Scarlett 2i2 USB, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
It looks like I have two sysdefault entries. Is that normal? I'd think that having two defaults would make the machine freak out and not know what to do.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4998
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Audio Out Through USB

Sun Jun 09, 2013 9:25 pm

FWIW I made some notes (can be found at http://www.cpmspectrepi.webspace.virgin ... apter.html ) when I was experimenting with a different USB sound adapter to yours. Hopefully they may be of some help or, at least, provide a "clue or two".
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Audio Out Through USB

Sun Jun 09, 2013 9:52 pm

aplay -l (lowercase L) would be more helpful. I'm guessing the onboard sound card is defaulting to index 0 while your usb card is defaulting to index 2.

zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Re: Audio Out Through USB

Sun Jun 09, 2013 11:20 pm

aplay -l gives me this:

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 0: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: 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
So yeah I'm not sure that helps, but if that gives anyone else a clue let me know!

zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Re: Audio Out Through USB

Sun Jun 09, 2013 11:28 pm

FTrevorGowen wrote:FWIW I made some notes (can be found at http://www.cpmspectrepi.webspace.virgin ... apter.html ) when I was experimenting with a different USB sound adapter to yours. Hopefully they may be of some help or, at least, provide a "clue or two".
Trev.
I've tried what's detailed on that page, and as long as I tell it to use the sysdefault device every time, I can get sound. Not sure if that's how it ought to work or not... theoretically I should just be able to tell it "speaker-test" or "aplay blah/blah/blah Front_Center.wav" and it *should* play, right?

Last I had heard people were having a really hard time getting Audacity to work on the Pi! Has that changed recently? I'd love to get that on my Pi.

EDIT: Well I've installed Audacity and ran it through the GUI and all that and everything seems to work just fine! I'm getting audio input and output through my USB device. "speaker-test" without any device param still doesn't work properly, but at this point I think that's a minor issue. Thanks for all of your help! I'd be happy to sit here and troubleshoot the speaker-test issue as well if anyone wants to participate in that, but right now I've got everything I need working.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Audio Out Through USB

Mon Jun 10, 2013 4:06 pm

You can run speaker test with

Code: Select all

speaker-test -D sysdefault:CARD=USB
But wouldn't worry about at this point if you're finding Audacity to be working.

zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Re: Audio Out Through USB

Mon Jun 10, 2013 4:29 pm

ski522 wrote:You can run speaker test with

Code: Select all

speaker-test -D sysdefault:CARD=USB
But wouldn't worry about at this point if you're finding Audacity to be working.
That works just fine, but it kind of bothers me that "speaker-test" on its own won't work.

I'm not too worried at this point since, yeah, sound seems to be working the way I want it too.

zomgdavidbowie
Posts: 24
Joined: Wed Apr 03, 2013 12:43 am

Re: Audio Out Through USB

Wed Jun 12, 2013 1:09 pm

Okay so not everything is honky-dory over here. I can't seem to get sound out of Csound via the command line. I'm going to have to dive back into the default settings and see what's going on. I've tried flagging the command to run through my USB device, and it says it goes through, but I don't hear anything and my device doesn't show any amount of sound coming through it.

If anyone has any experience with Csound through the command line (or even QuteCsound, I can't get audio out of that either) let me know! I'll be posting over in the Csound forum as well. I *think* it'll probably be the same fix for that and getting "speaker-test" to run without any flags.

Return to “Troubleshooting”