[LINUX] ALSA audio, HDMI and analog, on Acer Revo 3610
#31
Analog will only give you stereo. There is no 5.1 on Analog, only digital (spidf / HMDI).
Reply
#32
alda Wrote:no I need 5.1 analog output.

wow. Don't know where to point you.

good luck.
Reply
#33
Hi Guys,
Firstly thanks Liam for the original post it has been super helpful.
I have it up and running to a point that it is pretty close to sorted out.
I might give you a run down on what I am doing (who knows who it may be helpful too..
So I have my Acer Revo 3610 which runs in to my onkyo tx sr 578 which is a 7.1 amp through HDMI.
Everything was happy until I started to set up my zone 2 speakers outside.
Unfortunately they will only run off a analog input.
So I followed the instructions and I have 2 channel audio running through both (via the alsa:xbmc) and have the passthrough as hdmi.
This should work fine 99% of the time as I really only want to play music outside anyway and will set it uo as a seperate input on the amp.
I guess the reason for my post (other than to say thanks) is this.
In the code for the asound.conf file I found this.

pcm.multi {
type multi
slaves.a.pcm "analog-hw"
slaves.a.channels 2
slaves.b.pcm "digital-hw"
slaves.b.channels 2
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave a
bindings.1.channel 1
bindings.2.slave b
bindings.2.channel 0
bindings.3.slave b
bindings.3.channel 1
}

Just wondering what affect this may have? I would happen if this were set to 5.1 or 6 etc?
I'm the first to admit that i know a little less than nothing about linux.

Cheers
Justin
Reply
#34
rcrh Wrote:wow. Don't know where to point you.

good luck.


sorry, maybe it's misunderstanding. I will try explain my problem deeper :
I have XBMC live installed.
When I have audio output set :
- analog - default -no downmix to stereo - I have 6ch output on my board ( 3 jacks ) ( nvidia ion based pegatron board ).
When I have audio output set :
- analog - hdmi + downmix to stereo - I have stereo signal in my TV via HDMI.

What I want :
Keep XBMC setup on - analog - custom ( plug:xbmc ) - no downmix
and configure asound.conf to send not downmixed signal from xbmc to analog and downmix signal from xbmc and send him to HDMI.

Alda
Reply
#35
liamf Wrote:ah. yes.

well that would be an issue with that config alright.

I'm afraid I don't have a 5.1 setup to play with to see if there is a way to have both ...



Hey Liam

Your custom sound config is a elixir. It has cured another of my problems. A film with several soundtracks refused to play the interesting one, until (by chance) I tried it while under the influence of your alsa:xbmc custom device. Magic!
Here's the thread:
http://forum.xbmc.org/showthread.php?p=5...post588010
Reply
#36
ABSO-FREAKIN-LUTELY ROCKS!

Thanks so much for this.

I'm running Camelot 9.11 and I've got all of my audio working.

I don't plan on touching anything until Darma is complete.
Reply
#37
EDIT: I had been putting this asound.conf in my /etc/asound.conf location. should I have been placing this file here /usr/share/xbmc/system/asound.conf because they are both totally different looking
here is what /usr/share/xbmc/system/asound.conf looks like
Code:
xbmc@XBMCLive:~$ cat /usr/share/xbmc/system/asound.conf
# downmixing to 2 channels
pcm.xbmc_71to2 {
  @args.0 SLAVE
  @args.SLAVE {
    type string
    default "default"
  }
  type plug
  slave.pcm $SLAVE
  slave.channels 2
  route_policy duplicate
  ttable.0.0 1          # front left speaker
  ttable.1.1 1          # front right speaker
  ttable.2.0 0.7        # rear left speaker
  ttable.3.1 0.7        # rear right speaker
  ttable.4.0 0.7        # center to left mapping
  ttable.4.1 0.7        # center to right mapping
  ttable.5.0 0.5        # LFE (base) to left mapping
  ttable.5.1 0.5        # LFE to right mapping
  ttable.6.0 0.6        # SL to left mapping
  ttable.7.0 0.6        # SR to right mapping
}

# downmixing to 2 channels
pcm.xbmc_51to2 {
  @args.0 SLAVE
  @args.SLAVE {
    type string
    default "default"
  }
  type plug
  slave.pcm $SLAVE
  slave.channels 2
  route_policy duplicate
  ttable.0.0 1          # front left speaker
  ttable.1.1 1          # front right speaker
  ttable.2.0 0.7        # rear left speaker
  ttable.3.1 0.7        # rear right speaker
  ttable.4.0 0.7        # center to left mapping
  ttable.4.1 0.7        # center to right mapping
  ttable.5.0 0.5        # LFE (base) to left mapping
  ttable.5.1 0.5        # LFE to right mapping
}

# downmixing to 2 channels
pcm.xbmc_50to2 {
  @args.0 SLAVE
  @args.SLAVE {
    type string
    default "default"
  }
  type plug
  slave.pcm $SLAVE
  slave.channels 2
  route_policy duplicate
  ttable.0.0 1          # front left speaker
  ttable.1.1 1          # front right speaker
  ttable.2.0 0.7        # rear left speaker
  ttable.3.1 0.7        # rear right speaker
  ttable.4.0 0.7        # center to left mapping
  ttable.4.1 0.7        # center to right mapping
}
EDIT: just dawned on me I might need to get into my bios and check one last setting see this post here
http://www.zotacusa.com/forum/topic/2314...#entry4817

HALP.....

I copied the asound.conf made by Liamf to my asound.conf

I set my audio output to alsa:xbmc and my passthrough to alsa:xbmc (lowercase letters)

I have my main sound set to HDMI and 5.1 speaker system.

I get zero analog audio from my head phone jack.

I turned my amp to analog input and turned xbmc from hdmi to analog input and got nothing.

if I leave my amp to auto and xbmc to HDMI with the alsa:xbmc ouputs I do get didgital audio. DTS, DOLBY, AAC....

this is the last piece to my puzzle see my sig for my hardware

-=Jason=-
Reply
#38
well in my bios I have internal and external selected but I can't get it to output sound from the headphone jack no matter what I do.

-=Jason=-
Reply
#39
Ok, I have a new problem which may be partly shared with Flomaster.
When I have the Custom audio selected i.e alsa:xbmc I can't get AAC 5.1 through HDMI. All that plays through is the back ground music.
I went back into settings and changed the audio output back to HDMI and it worked fine, but now my Zone 2 Speakers won't work because the analog output is turned off.
Any suggestions on what I need to change?

I think i need a version of what Flomaster has posted.
But I only want PCM to downmix to 2.1 through Analog. I still need it to passthrough 5.1aac via hdmi.

Any help is most appreciated.
Reply
#40
Big Grin 
Many thanks liamf for the info here. I used the posted asound.conf and used alsa:xbmc in XBMC settings. (HDMI as device, alsa:xbmc, alsa:xbmc).

Didn't work initially because gnome seemed to be blocking the output. Solved by selecting an unused device under gnome sound settings, in this case the optical out.

The combination of the revo and tv in the bedroom, a bedside speaker with audio in from the headphone jack when the tv's off and a ipad running xbmc remote, really awesome!! Cheers.
Reply
#41
Ok I so there has been no reply so I will throw a new post up.
I will be clear that I know little about Linux and Alsa. I have been trying to find solutions but have not come across one.
Now I am currently running the code as posted by Liam. This works to a point.
My analog out put is fine. It is only 2 channel anyway so no problems.
Where the problem starts is with HDMI and multichannel audio. As the code is written for 2 channel I only get sound out of 2 speakers.


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".

# 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"
  hint {
    show on
    description "Analog Output - Use analog outputs, converting samples, format, and rate as necessary."
  }
}

# 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"
  hint {
    show on
    description "Mixed Analog Output - Use analog outputs, converting samples, format, and rate as necessary. Allows mixing with system sounds."
  }
}

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

# Alias for (converted) digital (HDMI) output on the card
pcm.digital {
  type plug
  slave.pcm "digital-hw"
  hint {
    show on
    description "Digital Output - Use digital outputs, converting samples, format, and rate as necessary."
  }
}

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

# Alias for mixed (converted) digital (HDMI) output on the card

pcm.mixed-digital {
  type plug
  slave.pcm "dmix-digital"
  hint {
    show on
    description "Mixed Digital Output - Use digital outputs, converting samples, format, and rate as necessary. Allows mixing with system sounds."
  }
}

# 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
  device 0
}

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

# Alias for digital (HDMI) output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.digital-hw {
  type hw
  card 0
  device 3
}

# 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
}

# Make joint analog/HDMI the default
pcm.!default {
  type plug
  slave {
    pcm multi
    rate 48000
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
}

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

pcm.xbmc {
[color=red]  type plug
  slave {
    pcm multi
    rate 48000
    channels 4
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0[/color]
}


ctl.xbmc {
  type hw
  card 0
}

pcm.multi {
  type multi
  slaves.a.pcm "analog-hw"
  slaves.a.channels 2
[color=red] slaves.b.pcm "digital-hw"
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1[/color]
}

ctl.multi {
  type hw
  card 0
}


The code I highlighted red is where I believe my problems lie. Can someone explain to me how I can change the HDMI code to carry 5.1 and how I can map my speakers? Or point me to a good tutorial. I have looked at ALSA's page, googled, asked nicely and still have no joy.
Unfortunately I do not understand bindings, ttables etc so am quite lost.
As I only really use the analog output for music I am quite happy to have this all set to 5.1 if that helps. i.e I don't care about surround sound being downmixed to 2 channels...
Please help!
Justin
Reply
#42
...sorry ... I don't have any 5:1 HDMI toys to play with.

Otherwise I'd gladly have a go for you ...
Reply
#43
Thanks.
It works for me!
The error that "alsactl restore" showed, was: Unknown hardware: "SI7018" "C-Media Electronics CMI9738,Silicon Laboratory Si3036,8 rev 1" "AC97a:434d4941 AC97m:53494c21" "0x1039" "0x7018"

Bye.
Reply
#44
thx a lot for this Post!
I´ve got Sound over HDMI on my Television and over Analog AMP.
It runs fine.... but and i am satisfied.

The only thing is:

I´ve got some Delay between HDMI Sound and Analgo Sound. Is there a way to get rid of that? It´s about some milliseconds but thats annoying...
I think that is caused by the mixing (downmix) progress?
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX] ALSA audio, HDMI and analog, on Acer Revo 36100