Jump to content
IGNORED

Audio out through USB in Ubuntu - how does it work?


norfolknog
 Share

Recommended Posts

Hi, I'm new to this great site - wish I'd found it a few weeks ago, before I started building my Linux music server! Looking at the spec for Chris' CAPS, I think I've made some good choices.

 

I also went for the Intel D945GSEJT motherboard, which I put in a fanless Mini-box M350 case (not too pretty!), with a regular hard drive - SSD too expensive for me at the moment. The operating system is a minimal Ubuntu 9.10 server build, to which I've added alsa and MPD for playback (which is being controlled by the Theremin client on my Macbook). Music has been ripped from my CDs by abcde, as FLACs.

 

It's early days for this system; and I don't know too much about audio with Linux yet. I'm currently just using the built-in stereo jack socket on the motherboard into my amp, though it was sort of trial-and-error with alsamixer etc; I don't really understand what's going on to be honest. But, it is working. Obviously I could get better sound (hopefully!) using an external DAC, which I'm considering, and this is where my questions start - sorry for the long preamble!

 

1) What do I need to do to get the digital audio out from the system to the USB sockets, and then to a USB DAC? Is audio just automatically "present" via USB? Or, what needs to happen to make it so? Configuration of linux, MPD, alsa... ?

 

2) The mobo has an S/PDIF header on it, but there is no cable or socket. Are there "standard" cables that just plug into the header, at the other end of which is a digital socket that can then go into a DAC? Would there be any difference between S/PDIF and USB in such a system?

 

I'll be grateful for any help. It's all very exciting, and I'm really glad to have found this site - it's a great resource, thanks!

 

Link to comment
Share on other sites

Hi norfolknog

 

 

"1) What do I need to do to get the digital audio out from the system to the USB sockets, and then to a USB DAC? Is audio just automatically "present" via USB? Or, what needs to happen to make it so? Configuration of linux, MPD, alsa... ?"

 

Have you configured mpd.conf yet?

 

"2) The mobo has an S/PDIF header on it, but there is no cable or socket. Are there "standard" cables that just plug into the header, at the other end of which is a digital socket that can then go into a DAC? Would there be any difference between S/PDIF and USB in such a system?"

 

You can build a cable or have one built for you. Here is what I used. I did not like the sound coming from the S/PDIF output compared to USB.

 

(Photo 1) (Photo 2)

 

Founder of Audiophile Style

Announcing The Audiophile Style Podcast

Link to comment
Share on other sites

1)Download mpd mpc and [gmpc or ario]

sudo apt-get install mpd mpc gmpc

 

2)aplay -l to find sound card

example: You would enter 0,1 for this device in step 4b.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

card 0: NVidia [HDA NVidia], device 1: Conexant Digital [Conexant Digital]

Subdevices: 1/1

Subdevice #0: subdevice #0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

3)change file, remove a comment

sudo gedit /etc/default/mpd

example: This last line had a # mark, just remove and save [was #MPDCONF...]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

## The configuration file location for mpd:

MPDCONF=/etc/mpd.conf

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

4)change file, add music path, add playlist path, add soundcard

sudo gedit /etc/mpd.conf

 

in new terminal

cd to your music directory then type pwd to find path.

Next, cd to playlist directory then type pwd to find path

 

4a.

In the REQUIRED PATHS section of the mpd.conf file replace the information for music directory with your information [path] and playlist.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

music_directory "/media/FreeAgent/Music"

playlist_directory "/home/dynobot/.mpd/playlist"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

4b.

Scroll down to AUDIO OUTPUT section of mpd.conf file, uncomment this section [remove #]. Modify the line for device with plug and the soundcard numbers

add "plug" before "hw" in the device line and the two numbers for your sound card instead of the zeros

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#

audio_output {

type "alsa"

name "My ALSA Device"

device "plughw:1,0"

format "44100:24:2"

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

 

5)create 2 new directories

mkdir ~/.mpd

mkdir ~/.mpd/playlist

 

6)create file for internet radio

I can email you a sample file, just gedit the file and replace the http:station with your http:station

Then move the file to your playlist directory

sudo mv *.m3u ~/.mpd/playlist

 

7)update database with music

In terminal type:

killall mpd

then type,

sudo /usr/bin/mpd --create-db /etc/mpd.conf

then type

mpc update

then type

mpd

 

done!

 

Link to comment
Share on other sites

type

 

alsamixer

 

then make sure nothing has a 'MM' under it....if it does then its muted, toggle it with the m key. Press tab or esc I forget which to make sure you have everything listed.

 

This is un-mute your SPDIF

 

Then type iecset -c 1 audio on

 

This will turn on the SPDIF

 

Do a aplay -L to find the spdif

 

Link to comment
Share on other sites

I have just build a Ubuntu music server (see other post). Yes it does all work :-)

 

Minimal Ubuntu 9.10

sshd

alsa

mpd

mpc

 

The built in sound card will make noise but not produce Hi-Fi quality sound. An external USB DAC is one option but be careful as some of these require special drivers that are not available for Linux. Alternatively a USB -> SPDIF dongle will work. I got one from http://stores.ebay.co.uk/Vintage-Audio-Lab and it works just fine. I have run the on board and external optical SPDIF to my external DAC and can not tell the difference between them. General opinion appears to be that optical is better as it provides greater electrical isolation and reduces noise.

 

For bit perfect digital out my mpd.conf looks like:

 

audio_output {

type "alsa"

name "Onboard SPDIF"

device "iec958:CARD=NVidia,DEV=0"

}

 

If you have an iPod Touch or iPhone look in the app store for the free app MPoD it is a remote control for MPD.

 

Regards,[br]Steve W[br]http://www.steveww.org/[br]Linux MPD (silent PC) -> MF V-Link II -> Benchmark HDR -> Hypex UcD400 x 2 (mono) -> Heybrook Sextet

Link to comment
Share on other sites

Wow this is an active forum!

 

@Chris - 1) yes I have configured mpd.conf, and the audio_output section is this:

 

audio_output {

type "alsa"

name "My ALSA Device"

device "hw:0,0" # optional

# format "44100:16:2" # optional

# mixer_device "default" # optional

# mixer_control "PCM" # optional

# mixer_index "0" # optional

}

 

As I say I am getting sound OK from the line out jack with this config. What I really want to know is what I have to do, if anything, to get digital audio out of the USB and/or S/PDIF sockets.

 

@Chris 2) that is interesting if you preferred the USB rather than S/PDIF on this mobo.

 

@Dynobot - thanks for all the info. In the screenshot of my alsamixer (attached), are the two devices IEC958 and IEC958 D the S/PDIF devices? Why is there two and what's the difference?

 

Might try Mint Linux for something else but this is what I believe is called a headless server - it won't have a kbd, monitor or mouse. I'm just ssh-ing to it from my Macbook.

 

@Steve - I think I just want a USB DAC that works with Linux "out of the box" then, with no drivers. I'm not convinced I can justify getting a USB to S/PDIF converter plus a DAC. I am doing this on a budget to be honest - I was thinking of maybe the Pro-Ject USB DAC, or possibly the King-Rex UD-01 or something similar; does anyone know if they will 'just work'?

 

Thanks again!

 

Link to comment
Share on other sites

Hi norfolknog - If you haven't already you'll want to download the Alsa Tools & Alsa Utils. They will give you the tools to list your playback devices. From there you can specify in mpd.conf where to send the audio. The easiest thing is probably to disable the onboard analog and digital output. Then the USB DAC will be the only device capable to receiving audio. Once you have a USB DAC you can run a couple commands and post them here if things don't work and we'll get you to where you need to be. One command is aplay -L to list devices.

 

I believe you have two IEC958 and IEC958 D devices listed because one is digital and one is analog. Does that sound correct?

 

Founder of Audiophile Style

Announcing The Audiophile Style Podcast

Link to comment
Share on other sites

I have just been researching all of this. Here is what I found out:

 

The TerraLink-X USB -> SPDIF dongle is £38 and works with Linux just by plugging it in. SPDIF gives you a wider choice of DACs to choose from.

 

USB based DACs will work if they are based around the CMI108 or Burr Brown 270x series of chips.

 

www.maplin.co.uk do an entry level USB -> SPDIF dongle product number A56AK for £20. I tried this an it works a treat.

 

As long as you have installed ALSA for your distro then aplay -L lists all the available playback devices. You can then use one of those names in the device clause of the mpd.conf file.

 

Simples :-)

 

Regards,[br]Steve W[br]http://www.steveww.org/[br]Linux MPD (silent PC) -> MF V-Link II -> Benchmark HDR -> Hypex UcD400 x 2 (mono) -> Heybrook Sextet

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share



×
×
  • Create New...