boxee :: forums  

Go Back   boxee :: forums > boxee community > boxee for linux help

Reply
 
Thread Tools Display Modes
  #1  
Old May 24th, 2009, 08:40 PM
lordbinky lordbinky is offline
Junior Member
 
Join Date: May 2009
Posts: 13
Default [SOLVED] Alsa Digital Out

I spent a few days getting Alsa working through digital out and found a good way of getting sound to work all around for all of the media in Boxee. Using the digital out check box in sound did not work for me. Finally, I was able to get sound working in Internet streams, my media library, and movie collection. My movie collection was able to get Dolby, DTS, etc working without any readjusting or changing any settings per file. Basically, everything worked without any additional tweaking.

Here are my findings of what worked for me using a Gigabyte E7AUM-DS2H with an ALC883 sound device. This configuration should work with other sound devices as I have tried it with the Zotac Geforce 9300 Mini-ITX board and a few other boards. I am using a Mythbuntu 9.04 install with Boxee replacing mythtv as a frontend (although the backend isn't doing much at the moment as I am still testing). This should work with a standard Ubuntu deviation or any Linux install with Alsa.

I used the code below and saved it as ~/.asoundrc (/home/user/.asoundrc or /etc/asound.conf). Then changed Boxee audio to digital, and changed the 'default audio device' from iec958 to default, leaving all other settings such as pass-through checked. This has the added benefit of getting all sound to work through the SPDIF (aka iec958).

I found this here:
Mythtv Alsa Setup
Note, that there are special options near the bottom of the link. You can have all audio output to all devices, although I have never tried or tested this.

From the link above all I modified was commenting (#):
Code:
#slave.pcm "dmix-analog"
and uncommenting:
Code:
slave.pcm "dmix-digital"
This was essential and made a huge difference in getting everything working. I originally tried it with digital-hw being used but none of the Internet streams would work (Shoutcast, Hulu, Joost) as well as local media such as my flac library.

Here is a copy of the code I am using with all modifications.

Code:
# ~/.asoundrc or /etc/asound.conf
# ALSA configuration file

##### USAGE #####
# Save this file as "~/.asoundrc" (for user-specific sound configuration) or
# "/etc/asound.conf" (for system-wide sound configuration) and specify ALSA
# device names ad described in the next section.


##### DEVICE NAMES #####
# This configuration file defines four devices for use by the user.  Those
# devices are "analog", "mixed-analog", "digital", and "mixed-digital".  The
# user may also re-define "default" to be identical to one of the above-named
# devices (i.e. to send all sound output to the digital output unless otherwise
# specified).  Use the device names as described below:
#  - "analog" outputs to the analog output directly and (at least on software
#  sound cards) blocks other audio output.  After playback completes, "queued"
#  sounds are output in sequence.
#  - "mixed-analog" mixes audio output from multiple programs into the analog
#  output (so you can hear beeps, alerts, and other noises while playing back
#  an audio stream).
#  - "digital" outputs to the digital output directly.  Since most (all?)
#  digital outputs expect 48kHz PCM audio, this may not work for some playback
#  (i.e. CD's--which are 44.1kHz PCM audio--or 32kHz audio streams from TV
#  recordings, etc.).
#  - "mixed-digital"

# All other devices created within this file are used only by the configuration
# file itself and should /not/ be used directly.  In other words, do not use
# the devices "analog-hw", "dmix-analog", "digital-hw", or "dmix-digital".


##### IMPORTANT #####
# To make this ALSA configuration file work with your sound card, you will need
# to define the appropriate card and device information for the "analog-hw" and
# "digital-hw" devices below.  You can find the card and device information
# using "aplay -l".


##### Configuration File #####

# Override the default output used by ALSA.  If you do not override the
# default, your default device is identical to the (unmixed) "analog" device
# shown below.  If you prefer mixed and/or digital output, uncomment the
# appropriate four lines below (only one slave.pcm line).
#
# Note, also, that as of ALSA 1.0.9, "software" sound cards have been modified
# such that their default "default" device is identical to the "mixed-analog"
# device.  Whether using an ALSA version before or after 1.0.9, it does no harm
# and has no affect on performance to redefine the device (even if the
# redefinition does not change anything).  Also, by using this ALSA
# configuration file, you once again have access to unmixed analog output using
# the "analog" device.
pcm.!default {
  type plug
## Uncomment the following to use (unmixed) "analog" by default
#  slave.pcm "analog-hw"
## Uncomment the following to use "mixed-analog" by default
#  slave.pcm "dmix-analog"
## Uncomment the following to use (unmixed) "digital" by default
#  slave.pcm "digital-hw"
## Uncomment the following to use "mixed-digital" by default
  slave.pcm "dmix-digital"  
}

# Control device (mixer, etc.) for the card
ctl.!default {
  type hw
  card 0
}

# Alias for (converted) analog output on the card
# - This is identical to the device named "default"--which always exists and
# refers to hw:0,0 (unless overridden)
# - Therefore, we can specify "hw:0,0", "default", or "analog" to access analog
# output on the card
# - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
# "default" to do mixing, meaning this device is different from "default" and
# allows playback while blocking other sound sources (until playback
# completes).
pcm.analog {
  type plug
  slave.pcm "analog-hw"
}

# Control device (mixer, etc.) for the card
ctl.analog {
  type hw
  card 0
}

# Alias for (converted) mixed analog output on the card
# - This will accept audio input--regardless of rate--and convert to the rate
# required for the dmix plugin (in this case 48000Hz)
# - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
# "default" to do mixing, meaning this device is identical to "default" for
# "software" sound cards.
pcm.mixed-analog {
  type plug
  slave.pcm "dmix-analog"
}

# Control device (mixer, etc.) for the card
ctl.mixed-analog {
  type hw
  card 0
}

# Alias for (converted) digital (S/PDIF) output on the card
# - This will accept audio input--regardless of rate--and convert to the rate
# required for the S/PDIF hardware (in this case 48000Hz)
pcm.digital {
  type plug
  slave.pcm "digital-hw"
}

# Control device (mixer, etc.) for the card
ctl.digital {
  type hw
  card 0
}

# Alias for mixed (converted) digital (S/PDIF) output on the card
#  - This will accept audio input--regardless of rate--and convert to the rate
#  required for the S/PDIF hardware (in this case 48000Hz)
pcm.mixed-digital {
  type plug
  slave.pcm "dmix-digital"
}

# Control device (mixer, etc.) for the card
ctl.mixed-digital {
  type hw
  card 0
}

# The following devices are not useful by themselves.  They require specific
# rates, channels, and formats.  Therefore, you probably do not want to use
# them directly.  Instead use of of the devices defined above.

# Alias for analog output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.analog-hw {
  type hw
  card 0
  # The default value for device is 0, so no need to specify
#  - Uncomment one of the below or create a new "device N" line as appropriate
#    for your sound card or 
#  device 1
#  device 4
}

# Control device (mixer, etc.) for the card
ctl.analog-hw {
  type hw
  card 0
}

# Alias for digital (S/PDIF) output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.digital-hw {
  type hw
  card 0
  device 1
#  - Comment out "device 1" above and uncomment one of the below or create a
#    new "device N" line as appropriate for your sound card or 
#  device 2
#  device 4
}

# Control device (mixer, etc.) for the card
ctl.digital-hw {
  type hw
  card 0
}

# Direct software mixing plugin for analog output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-analog {
  type dmix
  ipc_key 1234
  slave {
    pcm "analog-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  } 
}

# Control device (mixer, etc.) for the card
ctl.dmix-analog {
  type hw
  card 0
}

# Direct software mixing plugin for digital (S/PDIF) output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-digital {
  type dmix
  ipc_key 1235
  slave {
    pcm "digital-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  } 
}

# Control device (mixer, etc.) for the card
ctl.dmix-digital {
  type hw
  card 0
}
What this configuration does is make your audio default be exactly the device that you specify. So that all applications which use 'default' as a setting will output sound to the device that you need it to. In my case it was device 1 with mixed digital audio. If this configuration does not work for you, you can acquire some useful information from 'aplay -l'. That should provide you with the correct device and card number you need to use and apply it to the configuration.

I apologize if this is over informative and overwhelming. But I do hope that this helps others.

Last edited by lordbinky; May 24th, 2009 at 09:13 PM.
Reply With Quote
  #2  
Old May 24th, 2009, 08:59 PM
ShoppingA1 ShoppingA1 is offline
Junior Member
 
Join Date: May 2009
Location: Unites States
Posts: 1
Default [SOLVED] Alsa Digital Out

[SOLVED] Multiple Sound Solution (ALSA w Pulseaudio)
[SOLVED] Multiple Sound Solution (ALSA w Pulseaudio)
The 10,000 Page Guide to Sound Troubleshooting and Configuration for Hardy Heron 8.04 and Intrepid 8.10 and Jaunty 9.04

You should check back here often, the guide is being updated on a continuous basis.

Pulseaudio is the sound server for Ubuntu Hardy and Intrepid and the new Jaunty. It will continue to be so for the foreseeable future. This guide is geared towards first getting your sound hardware working and then getting Pulseaudio set up properly. If you are using KDE4/Kubuntu Intrepid Phonon is replacing aRts as the sound server. Since Phonon is so new some functionality has not yet been implemented. There is a link below for using Pulseaudio to fill the gaps.

If you are using Intrepid you must read this before continuing
The sound scheme in Intrepid 8.10 is fundamentally the same as that in Hardy 8.04 with few exceptions. ALSA 1.0.17 is now installed with Intrepid so more hardware works out of the box. The PulseAudio Volume Control now has a Recording tab. The link for the Multimedia overhaul has been updated for Intrepid and works, use it to get the dvd decoders and other restricted codecs from the medibuntu repository, it will also update some packages you got with the ubuntu-restricted-extras package. Flash 10 is now included in the ubuntu-restricted-extras package for both 32 and 64 bit users. Many of the other links have also been updated for Intrepid. If you know of some other helpful links, please let me know and I will include them here. It has been reported that Skype now works out of the box with Intrepid so if you are having problems it is either with your Skype setup or something more fundamental.
__________________
All In One
Reply With Quote
  #3  
Old May 25th, 2009, 03:08 PM
lordbinky lordbinky is offline
Junior Member
 
Join Date: May 2009
Posts: 13
Default

I suppose you are referring to this:
http://ubuntuforums.org/showthread.php?t=843012

I am not sure what happened there. But that could be a little confusing.

In any event, Pulseaudio is a good consideration. I decided against it as I have had trouble with it in the past.

I also should point out that I had to recompile Alsa as the HD Intel drivers have caused some sound to be very quiet. To test this; if you don't have sound try turning up the volume. You should hear whatever video or music you are trying to play. (some decent instructions: https://help.ubuntu.com/community/HdaIntelSoundHowto)

Last edited by lordbinky; May 26th, 2009 at 10:50 AM.
Reply With Quote
  #4  
Old July 6th, 2009, 02:43 PM
mattsimis mattsimis is offline
Junior Member
 
Join Date: Jun 2009
Posts: 2
Default

Just like to say this also fixed my issue on the latest Boxee build on two Ubuntu 9.04 systems:

PC One with Sound over HDMI (Digital)
PC Two with Sound over SPDIF (Digital)

On both systems Boxee sound would die on most videos or only be in the menu (or vice versa, I couldnt get it 100%), but now all sounds in all apps on the PCs. Big thanks!
Pity neither Ubuntu or Boxee devs can get sounds working as it does on Windows.
Reply With Quote
  #5  
Old July 20th, 2009, 04:00 PM
bcohen5055 bcohen5055 is offline
Junior Member
 
Join Date: Jul 2009
Posts: 13
Default

I'm having a bit of trouble getting this to work correctly, I have a pci soundcard with s/pdif when I run aplay -l this is what I get

**** List of PLAYBACK Hardware Devices ****
card 0: ICE1724 [ICEnsemble ICE1724], device 0: ICE1724 [ICE1724]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICE1724 [ICEnsemble ICE1724], device 1: IEC1724 IEC958 [IEC1724 IEC958]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: V8237 [VIA 8237], device 0: VIA 8237 [VIA 8237]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 1: V8237 [VIA 8237], device 1: VIA 8237 [VIA 8237]
Subdevices: 1/1
Subdevice #0: subdevice #0


So it looks like s/pdif port is 0,1 this is just like in the config file above so I just copied/pasted the file

Boxee will play sound for everything when set to analog, but I get the "check audio configuration" when I switch to digital

On the audio settings in boxee i have default as the main interface and have tried many different settings for the passthrough but none have worked
Reply With Quote
  #6  
Old February 26th, 2010, 03:35 AM
Emmett1 Emmett1 is offline
Junior Member
 
Join Date: Feb 2010
Posts: 1
Default

sounds good to me
__________________
shoes and sunglasses outlet and more about furniture
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:25 AM.


skin based on greenzero from vBSkins.com

 
Powered by vBulletin® Version 3.7.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.