Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 3:11 pm

Hello, Ski552

I got one of those ( http://www.aliexpress.com/store/product ... o_detail_a ) today .I just connected it with my Raspi and rebooted the Raspi. You said it was plug and play, but I dont hear anything out of it. Do I have to change something in order to output the audio to the dac, and not anymore the HDMI or Line out ports?

chaosgenie
Posts: 5
Joined: Fri Dec 07, 2012 2:45 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 3:45 pm

Hi,
is this soundcard now working with beta 2 without any problems? Especially PnP?

Regards,

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 4:13 pm

Please read through the post...you most likely need to modify your alsa-base.conf file so that it picks up the USB card as the default card...right now it's probably registered as card 1 (onboard is card 0).

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 6:48 pm

Hello ski522,

I already edited the file alsa-base.conf to this: (I just added nrpacks=1)

options snd-usb-audio index=0 nrpacks=1

I then rebooted the device and dit an aplay -l. Results

Code: Select all

[email protected]:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: DAC [USB Audio DAC], device 0: USB Audio [USB Audio]
  Subdevices: 0/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 this is good i think? There is no HDMI cable connected, only ethernet, power, usb cable to dac , and in the dac a line out cable to the receiver. I also tested the button "mute" on the dac, but no respons... Can you help me in the good direction?

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 9:58 pm

That shows the card is now the default sound card. I don't think the buttons work which is driver related, but you should be able to control the sound card by running alsamixer at a shell prompt.

Are you connecting to your receiver with a digital connection (Coax or TOS) or are you using the analog jack? You can try playing some music with mplayer. First install mplayer "sudo apt-get install mplayer" then type

Code: Select all

mplayer -vo null -ao alsa  filename
mplayer will play just about any type of file. If you know some streaming mp3 music websites you can use mplayer like:

Code: Select all

mplayer -vo null -ao alsa -playlist http://website

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 10:33 pm

It is connected with the Line out connection. Just tried playing 1.mp3 with mplayer and this was the result:

Code: Select all

[email protected]:~# mplayer -vo null -ao alsa /var/1.mp3
Creating config file: /root/.mplayer/config
MPlayer svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /var/1.mp3.
libavformat version 53.21.0 (external)
Mismatching header version 53.19.0
Audio only file format detected.
Clip info:
 Title: Reunion
 Artist: The xx
 Album: Coexist
 Year: 2012
 Comment: reference libFLAC 1.2.1 2007
 Track: 5
 Genre: Blues
Load subtitles in /var/
==========================================================================
Requested audio codec family [mpg123] (afm=mpg123) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
AUDIO: 44100 Hz, 2 ch, floatle, 320.0 kbit/11.34% (ratio: 40000->352800)
Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
==========================================================================
[AO_ALSA] alsa-lib: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' fai                                                                                                                     led (-16): Device or resource busy
[AO_ALSA] Playback open error: Device or resource busy
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video


Exiting... (End of file)
So device or resource is busy?

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 10:53 pm

Argon wrote: So device or resource is busy?
Probably because you're running as root, although not sure why it wouldn't work as root, but I just had the same problem. "su pi" and try it again. If you run from a different user other then the default "pi" user you need to edit the permission group's file and add permission for that user to the audio group...gives that user permission to access audio resources.

"sudo nano /etc/group"
search for audio line and add the user, for example
audio:x:29:pi,mike
Probably wouldn't hurt to add the user to all the groups user pi is part of.
Last edited by ski522 on Fri Dec 07, 2012 11:15 pm, edited 1 time in total.

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Dec 07, 2012 11:14 pm

Actually, looking into that further, I got the error at root because I had MPD running and it was playing a song, so the device really was busy. You can see what might be accessing the card by running

Code: Select all

sudo fuser -u /dev/snd/pcmC0D0p 
Of course my result showed mpd accessing the card
/dev/snd/pcmC0D0p: 13755(mpd)

Mister Fab
Posts: 17
Joined: Mon Aug 06, 2012 7:20 am
Location: France - Toulouse

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Dec 09, 2012 2:37 pm

Hi all!

I finally received my usb soundcard from AliExpress yesterday and tried to make it work.

As I 'm not very experienced with linux command lines, I think I missed something.

The steps i followed:

-plugged the usb card
-installed a new copy of Raspbmc
-followed the steps 1, 2 and 3 of the stm labs topic (http://forum.stmlabs.com/showthread.php?tid=1052) to install pulse audio

And still no sound.

I tried to edit the /etc/modprobe.d/alsa-base.conf, but the file doesn't exist.

Can someone help me?

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Dec 09, 2012 4:22 pm

ski522 wrote:Actually, looking into that further, I got the error at root because I had MPD running and it was playing a song, so the device really was busy. You can see what might be accessing the card by running

Code: Select all

sudo fuser -u /dev/snd/pcmC0D0p 
Of course my result showed mpd accessing the card
/dev/snd/pcmC0D0p: 13755(mpd)
Hello,
I can see that the music plays at this moment but i don't hear anything. The Dac has 3 outputs (coax, tos and line out). Is it possible that the DAC sends out the music to the coax or Tos connection instead of the line out? Can I change this or not ?

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Dec 09, 2012 11:32 pm

Mister Fab wrote: I tried to edit the /etc/modprobe.d/alsa-base.conf, but the file doesn't exist.
Can someone help me?
That's odd, maybe you don't have alsa installed...try re-installing and then editing the alsa-base.conf

Code: Select all

audo apt-get install alsa-base 
If it says it's installed then try doing a reinstall

Code: Select all

apt-get install alsa-base --reinstall

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Dec 09, 2012 11:34 pm

Argon wrote:s it possible that the DAC sends out the music to the coax or Tos connection instead of the line out? Can I change this or not ?
I believe it sends out all 3 ports at the same time...if you plug in headphones do you hear anything? Also run alsamixer and press "M" to make sure the card is muted.

Also, make sure the /etc/asound.conf looks like:

Code: Select all

pcm.mmap0 {
    type mmap_emul;
    slave {
      pcm "hw:0,0";
    }
}

pcm.!default {
  type plug;
  slave {
    pcm mmap0;
  }
}

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Dec 10, 2012 5:50 am

If you like, you can watch my first tip for X-MAS here:

http://www.raspberrypi.org/phpBB3/viewt ... 01#p230501

Have fun!
truehl
http://www.squeezeplug.de

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Dec 10, 2012 7:28 am

Did someone got this device running with RPi? It looks pretty interesting!

http://www.aliexpress.com/store/product ... 58188.html
truehl
http://www.squeezeplug.de

User avatar
hannesie
Posts: 8
Joined: Mon Oct 15, 2012 10:40 am
Location: Netherlands Dordrecht

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Dec 10, 2012 9:33 am

I have tried it with the Tenor from the Minidsp, ministreamer Tenor 7022L 24/96, and the Raspberry freeze, no results until now.
I have also tried it with the USB streamer from Minidsp with the Xmos chip 24/192 asynchrone, buth it has not the results.
It is recognised by hardware but there are no drivers for now installed.
With a BB 27xx it is no problem.

Mister Fab
Posts: 17
Joined: Mon Aug 06, 2012 7:20 am
Location: France - Toulouse

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Dec 10, 2012 12:15 pm

ski522 wrote:
Mister Fab wrote: I tried to edit the /etc/modprobe.d/alsa-base.conf, but the file doesn't exist.
Can someone help me?
That's odd, maybe you don't have alsa installed...try re-installing and then editing the alsa-base.conf

Code: Select all

audo apt-get install alsa-base 
If it says it's installed then try doing a reinstall

Code: Select all

apt-get install alsa-base --reinstall
Ok, the installation worked, and I modified the alsa base to get the card as the default sound device, but still no sound through the optical...

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Dec 10, 2012 12:29 pm

Mister Fab wrote: Ok, the installation worked, and I modified the alsa base to get the card as the default sound device, but still no sound through the optical...
Post the results of aplay -l and aplay -L. Also you can try in your home directory a custom alsa config file that defaults to the digital ports, just "nano ~/.asoundrc" and add

Code: Select all

pcm.!default spdif

Mister Fab
Posts: 17
Joined: Mon Aug 06, 2012 7:20 am
Location: France - Toulouse

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Dec 10, 2012 9:27 pm

Here is the aplay -l

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 0: DAC [USB Audio DAC], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
and the aplay -L

Code: Select all

default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=DAC
    USB Audio DAC, USB Audio
    Default Audio Device
front:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    Front speakers
surround40:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
It seems the usb card is the correct default device, isn't it?

Mister Fab
Posts: 17
Joined: Mon Aug 06, 2012 7:20 am
Location: France - Toulouse

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Dec 10, 2012 10:14 pm

And I still can't select optical in XBMC's system menu. Only HDMI and analog are available.

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Tue Dec 11, 2012 12:48 am

Yes, the sound card is default. As for getting it active within XBMC, the standard versions of XBMC that available do not support external USB sound cards. You'll have to look into this post to run that http://forum.stmlabs.com/showthread.php?tid=1052. I can't help you with that as I don't use XBMC.

As for confirming the card is working it's best to test it from a shell prompt. Install mplayer then try

Code: Select all

mplayer -ao alsa:device=hw=0.0 somemp3file.mp3

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Tue Dec 11, 2012 12:25 pm

ski522 wrote:
Argon wrote:s it possible that the DAC sends out the music to the coax or Tos connection instead of the line out? Can I change this or not ?
I believe it sends out all 3 ports at the same time...if you plug in headphones do you hear anything? Also run alsamixer and press "M" to make sure the card is muted.

Also, make sure the /etc/asound.conf looks like:

Code: Select all

pcm.mmap0 {
    type mmap_emul;
    slave {
      pcm "hw:0,0";
    }
}

pcm.!default {
  type plug;
  slave {
    pcm mmap0;
  }
}

Still no succes here. Checked the "M" mute and this is ok. Checked asound.conf and it is just like yours. Plugged in a headphone ... no sound :-)

I don't understand it anymore. See below my aplay -l and aplay -L results:

aplay-l

Code: Select all

[email protected]:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: DAC [USB Audio DAC], 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
aplay -L

Code: Select all

[email protected]:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=DAC
    USB Audio DAC, USB Audio
    Default Audio Device
front:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    Front speakers
surround40:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=DAC,DEV=0
    USB Audio DAC, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
The last line here says: "sysdefault card=alsa" should that be DAC ? If so, how can i change this?

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Tue Dec 11, 2012 12:46 pm

Argon wrote:The last line here says: "sysdefault card=alsa" should that be DAC ? If so, how can i change this?
That's weird seems to indicate the onboard sound is still default. Install mplayer first and from a shell prompt see if you can get sound out of the card? This command will ensure the USB DAC is used

Code: Select all

mplayer -ao alsa:device=hw=0.0 somemp3file.mp3
Also, check if you have a ~/.asoundrc file in your home directory. If you do, change it's contents to:

Code: Select all

 pcm.!default {
    type hw
    card 0
}
If you don't have this file, then create it

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Tue Dec 11, 2012 4:45 pm

Hello,

Tried it with mplayer and I got sound from it!
But: still no sound from Squeezeplug :-(

I checked if I got a .asoundrc file in my /home/squeezeplug/ (I think this is correct?) directory. The file didn't exist. So i created the file and edit it with what you say. I rebooted the RasPi, but if I check aplay -L it still says on the last line that it's the onboard output that is default...

do I have to chmod the file to other permissions or users?

Eventual i can give you ssh access to my Pi so you can look at the settings?

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

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Tue Dec 11, 2012 5:24 pm

Okay, so the card is working for you, that's a good thing, just means some foo with a configuration somewhere..sometime alsa can be a pain.. You can actually replace what is in /etc/asound.conf with what I provided for the .asoundrc file. They are both the same thing, but asound.conf is supposed to be system wide. I don't use squeezeplug so can't offer much advice there, you might want to start a new topic asking for help with squeezeplug & usb sound cards or look for a forum that is dedicated to squeezeplug.

not_the_pi_guy
Posts: 2
Joined: Mon Dec 17, 2012 10:14 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Dec 19, 2012 11:21 am

2) Then I had to add the following to the /boot/cmdline.txt

Code: Select all

dwc_otg.speed=1
my usb card is a usb 2.0 device.. i followed your instructions (but left asound.conf as is) with no joy, audio is garbage from the usb soundcard, do you know if it can be done?

Return to “Graphics, sound and multimedia”