I'm a busy guy. It's been very, very hard for me to find the time to learn enough about the innards of LinuxMCE to tackle the problem of the non-working HDMI sound on my Jetway Mini-top. However, a week ago after several months of wimpy twiddling and random bashing of the keyboard, I finally figured out how to get HDMI sound working in the crappy 10.04 release (note: I do not like Ubuntu, but don't take that to mean I don't like LinuxMCE. I will be randomly raging against Upoontu, so don't cry).
I have no idea if what I'm about to spell out will work on the current stable LinuxMCE release. I gave up on it while ago because of stupidness (e.g. my second NIC not working without manually building a new driver). I also pieced together most of what needed to be done from several different sources. However, figuring out the order and the repeated testing, plus some key pieces to the final solution were all my doing. If I wasn't already very well experienced with Linux systems, I would have been completely lost. Overall it was not fun, but man was I happy when it all came together.
So...
PRO TIP: make sure the Mini-top's (or whatever it is you're using for your MD) HDMI port is actually plugged into something and that something is powered ON!
NOTE: All these steps were performed on the MD after I logged into it via SSH. I did not do a "chroot" to the MD's directory on the core (i.e. /usr/pluto/diskless/XX).
1. In /etc/modprobe.conf/blacklist, add at the bottom the following:
blacklist snd-usb-audio
This was important. I needed to blacklist this module to prevent it from breaking the MD's boot process and to ensure ONLY the nvidia HDMI audio was enabled.
2. In /etc/modprobe.conf/alsa-base.conf, add this, again at the bottom of the file:
alias snd-card-0 snd-hda-intel
options snd-hda-intel enable_msi=0 probe_mask=0xfff2
This alias bullshit I pulled from memory....from way, way back in the early days of Fedora when I had to battle with alsa to get sound working. I'm not sure it's actually needed here, but I put the crap in anyway. The second line came from the xbmc forums and the xbmc wiki - so awesome.
3. Upgrade alsa. I used this page as a guide:
http://monespaceperso.org/blog-en/2010/05/02/upgrade-alsa-1-0-23-on-ubuntu-lucid-lynx-10-04/
I only upgraded alsa-driver and alsa-libs. There's no need to update alsa-utils.
4. Reboot
5, Upgrade the nvidia drivers. Nothing special to note here.
6. Reboot
7. Install this package:
apt-get install linux-backports-modules-alsa-$(uname -r)
This was the biggest piece of the puzzle. Without this package, the nvidia soundcard would not be detected by alsa. I have no idea how the shit I figured this crap out. I think I read about it somewhere on the net. I know for sure it wasn't at all in reference to LinuxMCE, the ION2 or HDMI sound. FUCK!
8. Reboot
9. Edit, /usr/pluto/bin/AVWizard_AudioConnector.sh, like so:
#!/bin/bash
. /usr/pluto/bin/AVWizard-Common.sh
. /usr/pluto/bin/Utils.sh
Param="$1"
case "$Param" in
'Analog Stereo')
XineConfSet audio.output.speaker_arrangement 'Stereo 2.0' "$XineConf"
XineConfSet audio.device.alsa_front_device plughw:0 "$XineConf"
XineConfSet audio.device.alsa_default_device plughw:0 "$XineConf"
;;
'SPDIF Coaxial'|'SPDIF Optical')
XineConfSet audio.output.speaker_arrangement 'Pass Through' "$XineConf"
XineConfSet audio.device.alsa_front_device asym_spdif "$XineConf"
XineConfSet audio.device.alsa_default_device asym_spdif "$XineConf"
XineConfSet audio.device.alsa_passthrough_device "iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2" "$XineConf"
;;
'HDMI')
XineConfSet audio.output.speaker_arrangement 'Pass Through' "$XineConf"
#XineConfSet audio.device.alsa_front_device asym_hdmi "$XineConf"
XineConfSet audio.device.alsa_front_device nvidia_hdmi "$XineConf"
#XineConfSet audio.device.alsa_default_device asym_hdmi "$XineConf"
XineConfSet audio.device.alsa_default_device nvidia_hdmi "$XineConf"
XineConfSet audio.device.alsa_passthrough_device "hdmi:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2" "$XineConf"
;;
esac
/usr/pluto/bin/SetupAudioVideo.sh
Makes sure Xine uses the nvidia HDMI card (configured below).
10. At the bottom of /usr/pluto/templates/asound.conf, add this:
pcm.nvidia_hdmi {
type hw
card 0
device 3
}
This configures the HDMI "card" for use with alsa.
8. Edit, the Setup_AsoundConf() function in /usr/pluto/bin/SetupAudioVideo.sh like so:
Setup_AsoundConf()
{
local AudioSetting="$1"
local SoundCard
SoundCard=$(GetDeviceData "$PK_Device" "$DEVICEDATA_Sound_Card"|cut -f2 -d";")
SoundCard=$(TranslateSoundCard "$SoundCard")
if [[ -z "$SoundCard" ]]; then
SoundCard=0
fi
sed -r "s,%MAIN_CARD%,$SoundCard,g" /usr/pluto/templates/asound.conf >/etc/asound.conf
case "$AudioSetting" in
*[CO]*)
# audio setting is Coaxial or Optical, i.e. S/PDIF
#echo 'pcm.!default asym_spdif' >>/etc/asound.conf
echo 'pcm.!default nvidia_hdmi' >> /etc/asound.conf
EnableDigitalOutputs
;;
*H*)
# audio setting is HDMI
#echo 'pcm.!default asym_hdmi' >>/etc/asound.conf
echo 'pcm.!default nvidia_hdmi' >> /etc/asound.conf
EnableDigitalOutputs
;;
*)
# audio setting is Stereo or something unknown
echo 'pcm.!default asym_analog' >>/etc/asound.conf
;;
esac
}
That makes the nvidia HDMI card configured in the previous step the default output for sound.
9. Reboot
When the MD came back up, "aplay -L" correctly reported the NVidia HDMI sound card, and because of the mask (in alsa-base.conf), only one soundcard was shown. You should see the same.
Now everything works. mp3s, MKVs, AVIs, stereo sound, multichannel, dolby, DTS, LPCM...you name it. Sound over HDMI works flawlessly. Also, my changes to a couple of the scripts have assured reboots won't adversely affect sound over HDMI.
The only problem is I'm sure a future update will likely blow some of my changes away. I hope the devs can incorporate what I've done into the setup scripts, thereby truly automating this particular MD's LinuxMCE setup.
Oh, one final note: I'll make sure the wiki article has a better flow for the steps (a couple are out of logical order, though the way I wrote the above how-to won't prevent HDMI sound from being correctly setup).
I hope this helps someone!
m3freak,
nice.
Could you amend your script changes in a way, that it detects the Jetway hardware and does the changes only for that hardware? A patch like that would be helpful, and could be incorporated into svn, so other people directly have a successful experience, without needing to modify scripts themselves.
Quote from: posde on February 05, 2012, 11:05:03 AM
m3freak,
nice.
Could you amend your script changes in a way, that it detects the Jetway hardware and does the changes only for that hardware? A patch like that would be helpful, and could be incorporated into svn, so other people directly have a successful experience, without needing to modify scripts themselves.
The only problem is I don't know what to modify. Where does the detection happen?
I would do the detection in the scripts itself.
I'll take this on, i've opened ticket http://svn.linuxmce.org/trac.cgi/ticket/1461 to track the integration work and testing
Make sure to confer with l3mce, as he is working on everything install related atm.
Ticket updated
Sounds good, I've reassigned the ticket to L3mce - if i can help please let me know!
It occurs now after looking over this that an alsa upgrade AND and nvidia upgrade is occurring.
In 1004 this will not be automated. Alsa is pegged there for reasons which apply to other areas of the system as I understand it. I cannot break parts of the system automatically for this.
However, I would be interested in working to make this happen in 1004 with the native nvidia-glx-260 and alsa .23. It appears that the video driver upgrade doesn't really make any difference. While working with someone in IRC they were able to get their audio going with the alsa upgrade on nvidia-glx-195, having forgotten to add the ppa before forcing the nvidia-current install.
So... I am given to believe it is just an alsa thing, and as alsa upgrade is required for the nvidia 295 driver from swat (the .40 edition has regression issues btw), I am not sure if anyone has tried to get alsa .23 going, as people presume it is the graphics driver which is failing to even run avwizard, or play movies in MD... when in truth it is the same busted alsa config causing this behavior.
The only possible reason to upgrade to the new driver is for the 5 chipsets which have the new VDPAU rev D.
Anyway... until I get my hands on the hardware, or an ssh hole to it, I can only guess at what might work. If you don't mind investing the time, I would be curious if you could similarly make this HW work with our native drivers.
Unfortunately it does require an update from nvidia 265 (so the ion2 architecture may be recognized) AND an update to alsa (to recognize and understand how to work with the updated nvidia hardware), in terms what revision they need to be at or what the cutoff is I don't know and that's pretty much where my investigation died off a couple of months back.
Considering the fundamental nature of these updates, when will 12.04 go into alpha testing? It may be worthy to test the updates we need to recognize this hardware there.
I got tekoholic through avwizard on a zotac ID41 on the nvidia-glx-195 driver sans hdmi audio. http://reviews.cnet.com/barebones-pcs/zotac-zbox-id41-u/4507-11485_7-34666140.html
I was unable to get esperegu through avwizard on a gt520 (rev D) on the nvidia-glx-260
So... I need to test more. I was also able to get at least one other chipset that is only identified as covered by 295 going on 260 (see http://svn.linuxmce.org/trac.cgi/browser/branches/LinuxMCE-1004/src/BootScripts/nvidia-install.sh for my preparation to switch over to x-swat ppa before encountering the alsa reqs)
So, at least SOME chipsets WILL fire under 260. There are only 5 rev D chipsets.
Big ups to esperegu for giving me access to his.
Good job!
Quote from: Murdock on May 06, 2012, 05:57:01 PM
Good job!
I have totally hosed Xconfigure.sh however, and could really use some help when you have some time. I know you are busy. I have hacked it up to work, but I am not convinced that is enough. Drop into IRC when you have time and I will explain/show you what I have done.
Will do
Noodled it.
Still be cool to chat... drop in sometime :)
Hah, noodled? Ill drop by today.
btw, want to say big ups to m3freak for the workup on this.
Here is what I am going to do... I am going to automate the process and make it available in web-admin... so you can just select an upgraded alsa version if your hardware requires it, keeping the rest of the world on our rock solid version.
My only fear is the people who think that they HAVE to have the newest bluest, and break something trying to get it, simply because it is there. I will try and adequately warn users not to select it if they don't need it.
so...
Either I need to put together a matrix to hard map some of the configurations to specific hardware, or I need to work out a way to test/detect it automatically.
However, for the lazy at heart... I did find this which should make your lives a little easier.
https://launchpad.net/~team-iquik/+archive/alsa
sudo add-apt-repository ppa:team-iquik/alsa
Then we dont need to download source and compile it ourselves.
Thanks L3.Definitely going to have a look at this. So I guess that makes me lazy at heart ;D
Quote from: l3mce on May 09, 2012, 04:15:35 PM
btw, want to say big ups to m3freak for the workup on this.
Don't mention it. I'm glad I got my problem resolved, but if it helps you out with LinuxMCE overall, it's a bonus! :)
BTW, I've noticed lately I'm having problems getting some MKVs to play that played before without any issue. I don't remember the exact error - I'll have to recreate it. I'll start a new thread for this new problem.
Quote from: l3mce on May 09, 2012, 04:15:35 PM
Here is what I am going to do... I am going to automate the process and make it available in web-admin... so you can just select an upgraded alsa version if your hardware requires it, keeping the rest of the world on our rock solid version.
My only fear is the people who think that they HAVE to have the newest bluest, and break something trying to get it, simply because it is there. I will try and adequately warn users not to select it if they don't need it.
This sounds yummy. Can't wait to see it.