PDA

View Full Version : [LINUX] LPCM over HDMI audio resampling questions?


alanwww1
2009-06-08, 18:43
There is a really good news for Nvidia 8200, 8300, 9300, 9400 integrated motherboard users:

Nvidia started to implement the lossless 8 channel linear pcm over hdmi hd sound for their hardware. There is already a simple patch which applies to Alsa 1.0.20.

With the patched file currently 16bit, 48khz 8channel lossless sound is available, except the channel mapping is wrong and mixed up. With a little modification to the patch i was able to get full 192khz/24bit 6 channel, full hd lossless sound over hdmi cable. To use this feature you need to have an AV receiver with the minimum hdmi 1.0 standard input.

Here is the patch:
http://www.spinics.net/lists/alsa-devel/msg24325.html

Here is me emailing with Nvidia developer about the issues:
http://www.spinics.net/lists/alsa-devel/msg24437.html

I think with this option we are getting closer to get dolby tru-hd and dts master audio movie tracks, along with listening music with 24/96 multichannel format. All we need to have is ffmpeg guys implementing the decode of the new audio standards (maybe they already did, i am not sure) and xbmc to output the decoded high def lpcm without downsample.

By the time i think we can still get a great use of the increased bit/sample and sampling rate. I think xbmc's smoothvideo feature could benefit from this as i think resampling of 48khz audio to 48khz has a lot more quality loss than resampling it to eg. 192khz/24bits.

@Bobo1on1: How is libsamplerate work now in xbmc ? Is it possible to make the resampling to a higher quality sound format ?

How is it with hd audio formats in xbmc. Is it always downsampled to 48khz when i play a movie or an audio file ?

The implementation nvidia made is very cool becasue with it hw:0,3 device shows as a multichannel "analog" device. So it can be used as regular analog hda codec.

If someone wants to try this feature. Here is what i did:
(Note that this process could screw up your installation and make Ubuntu package management wrong with Alsa packages. Also the patch are being developed and changed regulary which would need some maintaining)

This only works for Ubuntu Jaunty and Alsa 1.0.20

Install Alsa 1.0.20 with the famous universal Alsa Upgrade script.

http://ubuntuforums.org/showthread.php?p=6589810#post6589810

run the script with:

sudo ./AlsaUpgrade-1.0.x-rev-1.17.sh

Get the patched patch_nvhdmi.c file here:


http://git.alsa-project.org/?p=alsa-kernel.git;a=blob_plain;f=sound/pci/hda/patch_nvhdmi.c;h=f5792e2eea82dd412dd18f7aca3b6f328 027444b

Don't be fooled with the name as it is already patched to enable 8ch lpcm.

Copy the patch_nvhdmi.c file to Alsa source directory downloaded previously by the upgrade script.

cp ./patch_nvhdmi.c /usr/src/Alsa-1.0.20/alsa-driver-1.0.20/sound/pci/hda/patch_nvhdmi.c

Now compile the kernel modules:

cd /usr/src/Alsa-1.0.20/alsa-driver-1.0.20/
sudo make clean
sudo make

Copy only the Nvidia kernel module to the overwriting the Ubuntu 1.0.20 kernel module.

sudo cp pci/hda/snd-hda-codec-nvhdmi.ko /lib/modules/2.6.28-11-generic/kernel/sound/pci/hda/snd-hda-codec-nvhdmi.ko
sudo reboot

After reboot you can test the feature with

speaker-test -Dhdmi -c6

magically it will start sending multichannel lpcm to your av receiver over hdmi. Note that it is only working if X is loaded. At least you have to start an Xterminal, because the alsa module is not working without the nvidia display kernel module.

I think from now we only need a good .asoundrc file to map the correct channels to the correct place and we can play any type of multichannel format without a bunch of analog cables attached to the receiver. Even multichannel aac tracks or flac tracks are possible this way, without the loss of quality.

Anyone can make the .asoundrc files ? I was thinking of making virtual surround51, surround40 etc devices with correct channel mapping.

Have fun, Alan:)

althekiller
2009-06-08, 20:50
You're suffering a common misconception here. Up sampling does NOT improve quality one bit. If anything it's just a potential point to introduce artifacts. The only legitimate reason to up sample audio is if your hardware doesn't support the lower sample rate (or I suppose to slow the audio down slightly for a/v sync, if you're ok with that sort of thing).

It's good that nvidia is finally getting 8ch LPCM going (this by no means implies lossless, not sure where you picked that up). Maybe we can finally shut the folks with 6+ch ogg, flac, etc up. :)

alanwww1
2009-06-08, 21:00
You're suffering a common misconception here. Up sampling does NOT improve quality one bit. If anything it's just a potential point to introduce artifacts. The only legitimate reason to up sample audio is if your hardware doesn't support the lower sample rate (or I suppose to slow the audio down slightly for a/v sync, if you're ok with that sort of thing).

It's good that nvidia is finally getting 8ch LPCM going (this by no means implies lossless, not sure where you picked that up). Maybe we can finally shut the folks with 6+ch ogg, flac, etc up. :)

Yes Althekiller you are right about upsampling itself does not improve quality, but...
if you HAVE to resample something, like xbmc does with audio if sync to video option is on, than the quality could be a lot better if you resample the lower bitrate material to a higher bitrate format in one step. It is analog what we do with video with high quality upscaling, or this is the reason why mp3 encoders resample 44khz CD material to 48khz while dealing with the sound.

So i am perfectly sure that it makes sense to make the resampling of the audio speed to a higher bitrate format. This is more true on those cases where the speed of the audio playback only has to be changed a few %, like when we upspeed 24fps movie to 25fps. This case we have to stretch the 48khz data grid by 4% to the same grid. If we have this grid more dense (192khz) than we can reproduce the original sound quality better sped up 4%.

this is my oppinion. The real question is that can libsamplerate support this method ?

bobo1on1
2009-06-10, 23:45
Libsamplerate can do it just fine, but upsampling is not implemented right now.

alanwww1
2009-06-11, 09:44
Libsamplerate can do it just fine, but upsampling is not implemented right now.

@Bobo1on1

Thanks for the info. So as it is implemented now, it is resampling everything to 16/48khz or to the same format as the movie is in ?

I think in the future it would be a good idea that if the soundcard supports higher bitrate than the movie sound track's format than xbmc should upsample the sound before resamples it to the needed speed.

I think higher bitrate and bit formats are already an option to every intel hda codec users in analog mode and it will be more users to have this as this new feature is finished to the Nvidia MCP78 and MCP7A chipstes (which ION is also using). Also i read that on Intel G45 chipsets HD LPCM sound is already working for months.

Thanks for the great work Bobo1on1,

Alan

bobo1on1
2009-06-11, 18:41
It just resamples to the same rate, this might be changed in the future to allow upsampling, but it doesn't have a very high priority at the moment.

alanwww1
2009-06-11, 23:54
Thank's for the info !
Keep up the great work ! You made xbmc so much better with smoothvideo !

Alan

Hannes The Hun
2009-06-12, 00:10
well, I just read something about Dolby TruHD and DTS Master Audio and got wet... is that actually related to that stuff, and will it be possible?

snoxbox
2009-06-12, 01:21
I'm interested in getting 6 channel LPCM over analog (my receiver doesn't have HDMI). Is this possible in XBMC?

Matt Devo
2009-06-12, 08:08
I'm interested in getting 6 channel LPCM over analog (my receiver doesn't have HDMI). Is this possible in XBMC?

it's not possible period, since LPCM is a digital format. You either output LPCM over HDMI or SPDIF, or you output analog.

I assume you mean is it possible for XBMC to output a file with a 6-ch LPCM (or FLAC) audio track via analog, and the answer is yes

alanwww1
2009-06-12, 09:43
I'm interested in getting 6 channel LPCM over analog (my receiver doesn't have HDMI). Is this possible in XBMC?

You can get 6 (or eight) channel audio via analog connection as well. If you have for example Intel HDA codec on your board, all you need to do is connect 3 jack to 2rca cables from the computer to your av receiver. Your av receiver needs to have six channel discrete analog input supported. You can even use HD formats as HDA Codec supports up to 24/192khz.

The difference is just the way we transport audio. In case of lpcm over HDMI we have a completely quality lossless connection, in case of lpcm converted to analog and connected to the receiver, we could have a little quality loss depending on your cable quality, sound card quality, receiver quality etc.

Theortically if you use 6 channel analog connection with 24bits / 192khz sample format, with a HD quality sound track you can still have a lot better audio quality than if you use 16bits/48khz spdif connection with lossy codecs like ac3 or dts. And you can also have multichannel audio in case of other formats than ac3 and dts for example: WMA, FLAC, AAC multichannel formats which you can NOT achieve with normal spdif of 2 channel analog connection.

And YES it is possible in XBMC. If your audio card supports it, you have to set analog output in Audio Hardware settings and uncheck the downsample to 2 channels option.
You can verify if your card is capable of 6 channel discrete output by the following. Open up a terminal and:

aplay -L

This lists the available virtual sound devices. If you see surround51 than you are good to go.
You can also try:

speaker-test -Ddefault -c6

This tests is your cables are plugged in the right places sounding all channels after each other.

snoxbox
2009-06-12, 10:02
And YES it is possible in XBMC. If your audio card supports it, you have to set analog output in Audio Hardware settings and uncheck the downsample to 2 channels option.


Great. But is it possible with TrueHD etc.? From what I understand, I'll be better off decoding TrueHD on my htpc, and sending 6 channel audio over analog to my receiver, than if I downsample to DTS or whatever and send it via optical (obviously depending on the quality of the components used). I'd like to know if XBMC can decode TrueHD, or if I'm better off encoding all my Blu-Rays with 6 channel FLAC (which apparently works 'accidentally' in the win builds, according to another thread, not sure about linux).

Just trying to figure out the best possible sound I can get from a blu-ray rip, not using HDMI.


Edit: By the way, it's not that I'm too lazy to try it. I'm waiting for those damn Zotac ION boards to come out here so I can build my htpc. Currently stuck on an xbox. And I'm in the process of converting all my blu-rays now, so I'm trying to work out what to do with the audio streams.

alanwww1
2009-06-12, 15:34
It is for sure that you need to decode TruHD audio on the PC. At least for now, because there is no hardware capable (allowed) to directly stream these formats over hdmi. But you have 8channel lpcm which now we can use to send the decoded stream directly to the AV receiver without any quality loss.

xbmc can decode whatever ffmpeg can so theoretically it can decode dolby truhd streams, but it is a bit confusing what i read, because it might be that it can only decode it if it is demuxed from the ac3 core.

spiff
2009-06-12, 16:44
ffmpeg (should) decode mlp/truehd just fine.

Bahndit
2009-06-14, 06:51
Okay,

So I have been playing around with this LPCM patch from NVIDIA. As Alan said the channel mapping is a bit mixed up at the moment. I have found a little hack to get around this for the moment. According to the asound.conf file found in /usr/share/xbmc/system/ the correct channel mapping for 5.1 in Linux is:
Channel 0: FL
Channel 1: FR
Channel 2: BL
Channel 3: BR
Channel 4: Center
Channel 5: LFE

After applying this patch and running
speaker-test -Dhdmi -c6
speaker-test reports that it is sending sound to:

0 - Front Left
4 - Center
1 - Front Right
3 - Rear Right
2 - Rear Left
5 - LFE


That looks like it should line up with the Linux mapping standard but what it outputs doesn't match up. It actually sounds like this:
Screen output-----------Actual Output through Denon AV Receiver
0 - Front Left -------------------> 0 - Front Left (correct)
4 - Center ----------------------> 2 - Back Left (incorrect)
1 - Front Right ------------------> 1 - Front Right (correct)
3 - Rear Right -------------------> 5 - LFE (incorrect)
2 - Rear Left --------------------> 4 - Center (incorrect)
5 - LFE -------------------------> 3 - Back Right (incorrect)

or in a more simple way to look at it:

0 -> 0
1 -> 1
2 -> 4
3 -> 5
4 -> 2
5 -> 3

Well if you look at the asound.conf file that XBMC uses again (/usr/share/xbmc/system/) you will notice a similar mapping in the ttable under pcm_win51:
pcm.xbmc_win51 {
@args.0 SLAVE
@args.SLAVE {
type string
default "default"
}
type route
slave {
pcm $SLAVE
channels 6
}
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.2= 1
5.3= 1
}
}


When I saw this I decided to change the ttable to:
pcm.xbmc_win51 {
@args.0 SLAVE
@args.SLAVE {
type string
default "default"
}
type route
slave {
pcm $SLAVE
channels 6
}
ttable {
0.0= 1
1.1= 1
2.2= 1
3.3= 1
4.4= 1
5.5= 1
}
}

As to directly map the channels instead of redirecting them. After doing this speaker-test still doesn't work but 5.1 FLAC files in XBMC do! I haven't tested a direct TrueHD stream yet but all of the Blu-Ray/HD-DVD mkv's I've created with TrueHD or Uncompressed tracks re-encoded to FLAC sound great. My 3:10 Yuma MKV that has a 7.1 FLAC track works as well and even shows up as 7.1 on my Denon receiver. My FLAC tracks sound great.
The only problem that I have run into so far was playing back an BluRay MKV I made from a Dave Matthew's Concert. The FLAC track is sampled @ 96kHz (since the TrueHD track is as well) and when I select the FLAC track the video and audio play in slow motion and my receiver reports that it is receiving a 48kHz signal. I'm guessing it has something to do with XBMC resampling the audio to 48kHz from 96kHz ???
Anyway, try modifying your asound.conf to look like mine and let me know how it goes for you.

Bahndit
2009-06-14, 07:13
With the patched file currently 16bit, 48khz 8channel lossless sound is available, except the channel mapping is wrong and mixed up. With a little modification to the patch i was able to get full 192khz/24bit 6 channel, full hd lossless sound over hdmi cable. To use this feature you need to have an AV receiver with the minimum hdmi 1.0 standard input.



Alan,
What did you do to the patch to get 192khz/24bit?

-Will

alanwww1
2009-06-14, 10:11
Weel done Will, you found the solution for the greates problem we have, the channel mapping.

Well the solution for supporting other formats than 48k/16bits, i know form Nvidia developer Wei Ni, who we should thank all this great thing happaning to hdmi audio on nvidia hardware.

You have to change 6 lines in the patch_nvidia.c file

sudo nano /usr/src/Alsa-1.0.20/alsa-driver-1.0.20/sound/pci/hda/patch_nvhdmi.c

Both of the sections where you find 48000 you have to change like this:

.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000,
.maxbps = 24,
.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,

Thank you need to recompile the kernel module. Just repeat my steps in the first post, after you
cd /usr/src/Alsa-1.0.20/alsa-driver-1.0.20/
sudo make clean
sudo make

Just copy the ko file to where it belongs, reboot than you will have a device supporting from 48/16 to 192/24 formats. You can test it with this:

speaker-test -Dhdmi -c8 -r192000 FS32_LE

Channel mapping will be wrong because you only changed the asound.conf in xbmc dir. To make a general remaping of channels there is a solution to have a .asoundrc filr in your home dir. But your solution is a lot better because it routes the channels into the right place already in xbmc. So far i don't want to use this device other than in xbmc. I think Wei will find a solution in the driver so that we won't need this anymore in the future.

I still have the following issues need to be solved.

- When i play 44khz CD flacs i have the music played slightly faster because the hdmi device does not support 44khz. I tried to put it in the patch_nvidia.c file but it won't even compile as i think these lines SNDRV_PCM_RATE_48000 are defined somewhere in alsa as constants and there is no constant named SNDRV_PCM_RATE_44000. So i want to have all by 44khz playbacks resampled by nvidia (or xbmc) to 192khz, but in a way that other formats (which are supported by nvidia hdmi) should NOT be touched (resampled). I know a way to make a .asoundrc file with resampling EVERYTHING to a certain format, but that is no solution. I don't know how to make conditions in that file.

Software mixing of course needed if we want to have crossfade for example with music playing. I don't know how to make it in a way that quality won't degrade. We can try to put in .asoundrc file a device that upsamples and software mixes everything into 192/24 but still i think we will loose quality.

I think for both of these problems we could have a solution in xbmc's Masteraudio branch. I already started this discussion in the Masteraudio branch.

Other problem i have is that ffmpeg (so xbmc) can not decode dts 96/24 tracks. If i have this passthroughed to the AV Receiver it shows 96/24 DTS info, but when i decode it with xbmc (and mplayer) also shows only 48/16 track. Here are some samples

https://www.mplayerhq.hu/MPlayer/samples/A-codecs/DTS/dts/
So i think i need to recode them to for example flac files. But that would result a bigger file for the same quality as DTS is a lossy codec.

Will, which tools have you used for reencoding tru-HD tracks to flac ?

alanwww1
2009-06-14, 11:20
I solved the 44khz problem. It was actually 44100 in the patch_nvidia.c file we have to use and i found some other formats as well. It is in the /usr/src/Alsa-1.0.20/alsa-driver-1.0.20/sound/pci/hda/hda_codec.c/usr/src/Alsa-1.0.20/alsa-driver-1.0.20/sound/pci/hda/hda_codec.c

{ 8000, SNDRV_PCM_RATE_8000, 0x0500 }, /* 1/6 x 48 */
{ 11025, SNDRV_PCM_RATE_11025, 0x4300 }, /* 1/4 x 44 */
{ 16000, SNDRV_PCM_RATE_16000, 0x0200 }, /* 1/3 x 48 */
{ 22050, SNDRV_PCM_RATE_22050, 0x4100 }, /* 1/2 x 44 */
{ 32000, SNDRV_PCM_RATE_32000, 0x0a00 }, /* 2/3 x 48 */
{ 44100, SNDRV_PCM_RATE_44100, 0x4000 }, /* 44 */
{ 48000, SNDRV_PCM_RATE_48000, 0x0000 }, /* 48 */
{ 88200, SNDRV_PCM_RATE_88200, 0x4800 }, /* 2 x 44 */
{ 96000, SNDRV_PCM_RATE_96000, 0x0800 }, /* 2 x 48 */
{ 176400, SNDRV_PCM_RATE_176400, 0x5800 },/* 4 x 44 */
{ 192000, SNDRV_PCM_RATE_192000, 0x1800 }, /* 4 x 48 */

So i just added another column into the nvidia.c file like this:

.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000,
.maxbps = 24,
.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,

I think we should add all available formats to the file (like 22,05khz and so)

Now we can listen to CD music with untouced signal at native 44,1 khz !

alanwww1
2009-06-14, 12:06
Well if you look at the asound.conf file that XBMC uses again (/usr/share/xbmc/system/) you will notice a similar mapping in the ttable under pcm_win51:
pcm.xbmc_win51 {
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.2= 1
5.3= 1


When I saw this I decided to change the ttable to:
pcm.xbmc_win51 {
ttable {
0.0= 1
1.1= 1
2.2= 1
3.3= 1
4.4= 1
5.5= 1
}
}

After doing this speaker-test still doesn't work but 5.1 FLAC files in XBMC do! Anyway, try modifying your asound.conf to look like mine and let me know how it goes for you.

Well i tried to modify the asound.conf in /usr/share/xbmc/system/ according to what you suggested. I have not tested multichannel flac files, but with ac3, dts streams it is not changing anything. I still need a custom .asondrc file in the home dir like this:

pcm.ch51remap {
slave.pcm hdmi
type route
ttable.0.0 1
ttable.1.1 1
ttable.2.4 1
ttable.3.5 1
ttable.4.2 1
ttable.5.3 1
}

And i have to use "ch51remap" device instead of hdmi in xbmc.
Any Devs can help how to set channel mapping for various file formats DTS, AC3 in DVDPlayer and PAPPlayer in xbmc LINUX ?

Bahndit
2009-06-14, 21:42
Other problem i have is that ffmpeg (so xbmc) can not decode dts 96/24 tracks. If i have this passthroughed to the AV Receiver it shows 96/24 DTS info, but when i decode it with xbmc (and mplayer) also shows only 48/16 track. Here are some samples

https://www.mplayerhq.hu/MPlayer/samples/A-codecs/DTS/dts/
So i think i need to recode them to for example flac files. But that would result a bigger file for the same quality as DTS is a lossy codec.


Alan, why don't you want your receiver to do the decoding? Personally I would rather have my receiver do the decoding where possible. If I leave the "AC3 and DTS capable" options selected then XBMC simply switches to bitstream over LPCM where capable. Is there any reason that you wouldn't want that to happen?


Will, which tools have you used for reencoding tru-HD tracks to flac ?

I use the eac3to tool. I will write more on this later.

-Will

alanwww1
2009-06-15, 10:22
One reason could be if you want to resample audio for changing playback speed (Smoothvideo function) or if you want mixing done with the sound etc. I just noted that ffmpeg does not yet support dts 24/96 format.

Bahndit
2009-06-15, 11:04
So Smoothvideo doesn't work if you use bitstream?

alanwww1
2009-06-15, 12:35
So Smoothvideo doesn't work if you use bitstream?

It works but only with skip/duplicate method which is only suitable if you have the refresh rate very near to the fps of the film (or 2x). So you can't do things like making a 24fps movie sped up to 25fps suitable for PAL system. This can only be done with resampling of audio.

Bahndit
2009-06-15, 13:00
Alan,
Do you have any issues with VDPAU skipping on you at all when watching a movie using a lossless codec. Sometimes during an intense audio scene the movie skips like it's dropping frames but no frame drops are reported. If I watch the same scene with the standard AC3 track I don't have any issues. Any thoughts?

-Will

alanwww1
2009-06-15, 13:55
Unfortunatelly i don't have a movie with tru-HD audio track so i can not tell. What audio sync method have you set ? Is is resampling ? What is the CPU utilization during playback. It can be that eighter decoding or resampling of HD audio is eating up too much of the cpu time.

alanwww1
2009-06-15, 18:16
Will, Is your channel mapping ok with ac3, dts files, with the modifications you made in asound.conf ? You said that with flac files it is ok.

swevo24
2009-06-15, 23:12
Sorry if this comes off as stupid, but I'd like a bit of clarification if possible.

So with this and a MKV containing FLAC audio transcoded from the THD/DTS-MA track, my receiver will see 6 channel LPCM and not something like stereo PCM?

I've been having tons of fun with Vista, Reclock, and MadFLAC trying to get this to work, so this would be a nice change.

Nevertheless, thanks for all the work guys.

alanwww1
2009-06-15, 23:57
Sorry if this comes off as stupid, but I'd like a bit of clarification if possible.

So with this and a MKV containing FLAC audio transcoded from the THD/DTS-MA track, my receiver will see 6 channel LPCM and not something like stereo PCM?

I've been having tons of fun with Vista, Reclock, and MadFLAC trying to get this to work, so this would be a nice change.

Nevertheless, thanks for all the work guys.

This is Exactly what it means (or even 8 channels if you have that much speakers) and it supports up to 24 bits/192khz.

I tried playing some 24/96 format multichannel flac encoded hd music tracks. It sounds really great.

mlmc
2009-06-16, 10:32
Sorry if this comes off as stupid, but I'd like a bit of clarification if possible.

So with this and a MKV containing FLAC audio transcoded from the THD/DTS-MA track, my receiver will see 6 channel LPCM and not something like stereo PCM?

I've been having tons of fun with Vista, Reclock, and MadFLAC trying to get this to work, so this would be a nice change.

Nevertheless, thanks for all the work guys.

I do this in Vista, my Mediaportal installation (i use both Mediaportal-Vista / XBMC-Ubuntu). I use ReClock and ffdshow, i pass all to my receiver as LPCM. My receiver shows: Multichannel-PCM.

It's so nice, i never have to worry. Just as long ffdshow can handle the codec my receiver will do the playback flawlessly.. :)


This is Exactly what it means (or even 8 channels if you have that much speakers) and it supports up to 24 bits/192khz.

I tried playing some 24/96 format multichannel flac encoded hd music tracks. It sounds really great.

Yes, the sound is great. No loss, and the transportation is digital all the way.

joel_ezekiel
2009-06-24, 10:07
thank you for the information on this topic, this is the only source of information on 8 channel lpcm with nvidia on linux ive been able to find.

i actually found it easier to get this working (although not working properly) then i did with windows, still didnt get it working properly with windows but i didnt spend enough time on it.

anyway i wanted to ask you guys a question, ive upgraded alsa and applied the patch and remapped the channels. however when i play the dark knight ripped strait from a bluray disk the channels were still wrong and the lpcm steam is on off, on off, on off etc. as the reciever detects it anyway. so i converted the same soundtrack to flac and that played flawlessly and sounded great. anyway im formatting my htpc now and setting up xbmc on a minimal install of jaunty and wondering if im asking to much to be able to use dumphd to dump a bluray to my hdd and play it with xbmc, with or without lossless audio? as i still havent been able to get it to work properly.

thanks for you help

Bahndit
2009-06-27, 06:55
Hey Joel,
How did you do the remapping of your channels? The original way that I did it is not as good as Alan's .asoundrc fix. I had problems with an PCM rip that I made as well until I used Alan's method. (See this post (http://xbmc.org/forum/showpost.php?p=351517&postcount=19))
I don't know anything about dumphd but I am going to have to check it out.

-Will

plue
2009-07-01, 07:06
Anyone can make the .asoundrc files ? I was thinking of making virtual surround51, surround40 etc devices with correct channel mapping.


Here the virtual surround devices with correct mapping. It was created by reading the alsa nvhdmi driver and also the intelhdmi driver for ca_index configuration referenced by nvhdmi.

Configuring to use for analog audio the device plug:surround71 should be fine.


# Linux has channel order
# FL, FR, RL, RR, C, LFE, SL, SR
# HDMI has this one
# FL, FR, LFE, FC, RL, RR, RLC, RRC

pcm.!front {
type route
slave.pcm hdmi
slave.channels 2
ttable {
0.0= 1
1.1= 1
}
}
pcm.!surround21 {
type route
slave.pcm hdmi
slave.channels 4
ttable {
0.0= 1
1.1= 1
2.2= 1
}
}
pcm.!surround30 {
type route
slave.pcm hdmi
slave.channels 4
ttable {
0.0= 1
1.1= 1
2.3= 1
}
}
pcm.!surround31 {
type route
slave.pcm hdmi
slave.channels 4
ttable {
0.0= 1
1.1= 1
2.3= 1
3.2= 1
}
}
pcm.!surround40 {
type route
slave.pcm hdmi
slave.channels 6
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
}
}
pcm.!surround41 {
type route
slave.pcm hdmi
slave.channels 6
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.2= 1
}
}
pcm.!surround50 {
type route
slave.pcm hdmi
slave.channels 6
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.3= 1
}
}
pcm.!surround51 {
type route
slave.pcm hdmi
slave.channels 6
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.3= 1
5.2= 1
}
}
pcm.!surround71 {
type route
slave.pcm hdmi
slave.channels 8
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.3= 1
5.2= 1
6.6= 1
7.7= 1
}
}


If you want that stereo sound arrives as stereo to the amp, remove all lines starting with: slave.channels

ylagace
2009-07-02, 18:05
I am having some problems in applying the patch and I am not very knowledgeable of Linux.

I have Ion Zotac N330 board with minimal Ubuntu. XBMC is working fine but I get audio initialization error when running movies with HD audio codecs (True-HD, DTS-HD).

when I try to apply the patch:

sudo ./AlsaUpgrade-1.0.x-rev-1.17.sh

It shows me the options -di (download and install) or -d (download only) and -i (install only).

I tried -d first and then copied the patch.c file to the Alsa driver source directory and then ran with -i option.

The problem is when I run the sudo make clean and sudu make commands, I get a few warnings about no config files and it does not create a .ko file.

I think I need some more explicit instructions on how to apply the patch as the behavior is different from the instructions above.

Thanks,

plue
2009-07-02, 23:07
I have Ion Zotac N330 board with minimal Ubuntu. XBMC is working fine but I get audio initialization error when running movies with HD audio codecs (True-HD, DTS-HD).


I haven't tested with True-HD and DTS-HD because I didn't have any file that contains content with this codecs (if anybody has any link to download samples for testing, please post them).

I suppose that XBMC or the driver isn't capable to bitstream the content as True-HD or DTS-HD. So I propose to you to first test playing as analog (it will appear as Multichannel LPCM to your AMP).

The patch above permits multiple channels at 48kHz. If you applied the patch correctly and you configure the analog sound (not bitstream) output to hdmi it will not be able to play because HD codecs use to be of 192kHz.

So you have 2 possible solutions:

Configure the analog output to play to plug:hdmi
Apply another patch (http://mailman.alsa-project.org/pipermail/alsa-devel/2009-July/019047.html) to permit up to 192kHz LPCM

In the above solutions it will output as Multichannel LPCM (but in wrong speakers order).
Thats why I send this configuration to solve it:
Here the virtual surround devices with correct mapping.



To test digital bitstream output as True-HD and DTS-HD should know:
-This is unaffected by speakers order (any digital bitstream shouldn't be affected)
-I didn't found any information about if it is possible by XBMC or by any driver (so please if you or anybody achieve the AMP to display True-HD or DTS-HD, please post that it is possible somewhere)

For this test you should configure to digital output, also that the AMP accepts DTS and Dobly and the bitstream digital output to hdmi (here without plug: !!, plug:hdmi to analog output).

ylagace
2009-07-03, 04:00
OK now working after I ran with the option -di then reboot then copy patch file and re-compile.

The speaker test is working.

Thanks

plue
2009-07-03, 15:00
OK now working after I ran with the option -di then reboot then copy patch file and re-compile.

Hi ylagace,
This means that XBMC streams the HD bitstream to the AMP or xbmc decodes it and in the AMP appears PCM.

Thanks in advance.

alanwww1
2009-07-03, 16:18
Hi guys.

It's good to know that others also experiment with lpcm audio.

I have a promise from Wei Ni Nvidia developer that he will find a general solution for channel mapping based on the hdmi report about available channels and sample formats of your receiver.

Here is what he wrote:

Hi, Alan

I will look the patch_intelhdmi.c, if I have a general solution, I will submit to the kernel.

Thanks

Wei.

Let's hope the best.

I think if there is an official solution we will see it here first:

http://git.alsa-project.org/?p=alsa-kernel.git;a=tree;f=sound/pci/hda;h=17cb1188a6107a3d59d19ac8c9ab014976b5695f;hb= HEAD

ylagace
2009-07-03, 18:24
Hi guys,

I need to make it clear that I have only tested with speaker-test.

I still have problems with bluray playback in xbmc. I do not get audio initialization error anymore but it keeps buffering the movie and I do not get anything beyond that. So i have no idea if I can get the LPCM multichannel to light up on my AVR (Onkyo SR705). I have many blurays with True-HD and DTS-HD working on my PCH and AVR so I will be able to try things.

I need to start looking at the xbmc log file, etc. first but I have very liitle time to spend on it and I am away starting tomorrow for a week. I will report on my experiment results once I can free up more time...

alanwww1
2009-07-03, 19:09
Hi guys,

I need to make it clear that I have only tested with speaker-test.

I still have problems with bluray playback in xbmc. I do not get audio initialization error anymore but it keeps buffering the movie and I do not get anything beyond that. So i have no idea if I can get the LPCM multichannel to light up on my AVR (Onkyo SR705). I have many blurays with True-HD and DTS-HD working on my PCH and AVR so I will be able to try things.

I need to start looking at the xbmc log file, etc. first but I have very liitle time to spend on it and I am away starting tomorrow for a week. I will report on my experiment results once I can free up more time...

At first start just try to play a normal dts or ac3 file, but with passthrough disabled. This way you can test the lpcm capability in xbmc.

ylagace
2009-07-03, 20:33
I might be able to try that tonight and i assume by deselecting AC3 and DTS in the xbmc audio hardware setup I will achieve this.

Please correct me if I am wrong and/or if I have to do something else to disable the passthrough.

ylagace
2009-07-04, 01:41
I have removed the passthrough and I get multichannel LPCM on my AVR with the channels mixed up as you described for both AC3 and DTS.

alanwww1
2009-07-04, 21:29
I have removed the passthrough and I get multichannel LPCM on my AVR with the channels mixed up as you described for both AC3 and DTS.

It is a good sign. You hardware is working. HD audio is only possible if you patch the source file to add the higher sampling rates and bits to the available formats. See the earlier posts.

ylagace
2009-07-06, 01:12
No chance for me to try the patch as I am away for a while but in meantime I have the log of a TrueHD example. This movie (Indiana Crystal Skull) has a TrueHD stream in the first position. You can see the error message and the first stream is showing as AC3?? in the log.

I hope this might be useful to some of you until I return and try the patch.

The video is playing good but I get the audio by very short dribble like 1 sec out of 10 or 20 secs. The AVR is showing Digital Dolby then PCM and back (keep cycling). I had passthrough enable. Now I realize I should have tried without passthrough (too late now!). Anyway just in case I post it here:

http://pastebin.com/m3ceac9f2

ultrabrutal
2009-07-06, 13:45
Asrock ION 330. I got the patch applied no problems there...

┌────────────────────[AlsaMixer v1.0.20 (Press Escape to quit)]────────────────────┐
│ Card: HDA NVidia │
│ Chip: Nvidia MCP7A HDMI │
│ View: [Playback] Capture All │
│ Item: Master Front [dB gain=12.00, 12.00] │
│ │
│ │
│ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ >
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ >
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ >
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ >
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ >
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ >
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │ │ │
│ ├──┤ └──┘ ├──┤ ├──┤ ├──┤ ┌──┐ ┌──┐ ┌──┐ │
│ │OO│ │OO│ │MO│ │MM│ │OO│ │OO│ │OO│ │
│ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ │
│ 100<>100 100<>100 100<>100 10<>10 0<>0 │
│ <Master F> PCM Front Line Mic IEC958 IEC958 D IEC958 1 │
└───────────────────────────────────────────────── ─────────────────────────────────┘

xbmc@Stuen:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: VT1708S Analog [VT1708S Analog]
Subdevices: 1/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
card 0: NVidia [HDA NVidia], device 1: VT1708S Digital [VT1708S Digital]
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0


xbmc@Stuen:~$ aplay -L
default:CARD=NVidia
HDA NVidia, VT1708S Analog
Default Audio Device
front:CARD=NVidia,DEV=0
HDA NVidia, VT1708S Analog
Front speakers
surround40:CARD=NVidia,DEV=0
HDA NVidia, VT1708S Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
HDA NVidia, VT1708S Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
HDA NVidia, VT1708S Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
HDA NVidia, VT1708S Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
HDA NVidia, VT1708S Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
HDA NVidia, VT1708S Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
HDA NVidia, NVIDIA HDMI
HDMI Audio Output
null
Discard all samples (playback) or generate zero samples (capture)

xbmc@Stuen:~$ speaker-test -Dhdmi -c8

speaker-test 1.0.20

Playback device is hdmi
Stream parameters are 48000Hz, S16_LE, 8 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 16 to 4096
Period size range from 8 to 2048
Using max buffer size 4096
Periods = 4
was set period_size = 1024
was set buffer_size = 4096
0 - Front Left
4 - Center
1 - Front Right
7 - Side Right
^C

Not a sound is heard via my Onkyo 876 receiver (7.1 setup) nor the Pioneer KRL-37V TV. Tried both hdmi and plughw:0,3.

I'm going crazy here... Any ideas guys?

alanwww1
2009-07-06, 19:16
VERY IMPORTANT !

EVERYONE HAVE TO START XSERVER TO HEAR ANY HDMI SOUND !

Start X and then start an xterm, there try the speaker test !

This could be your problem.

alanwww1
2009-07-06, 19:28
No chance for me to try the patch as I am away for a while but in meantime I have the log of a TrueHD example. This movie (Indiana Crystal Skull) has a TrueHD stream in the first position. You can see the error message and the first stream is showing as AC3?? in the log.

I hope this might be useful to some of you until I return and try the patch.

The video is playing good but I get the audio by very short dribble like 1 sec out of 10 or 20 secs. The AVR is showing Digital Dolby then PCM and back (keep cycling). I had passthrough enable. Now I realize I should have tried without passthrough (too late now!). Anyway just in case I post it here:

http://pastebin.com/m3ceac9f2

You can not passthrough any type of "protected" hd audio formats, like tru-hd or dts master audio. There is no hardware that supports protected audio path yet. Auzentech will bring the first card capable of bitstream these formats through protected audio path:

http://www.auzentech.com/site/company/pressrelease_06262009_x-fi_homet.php

There is no chance to have support for this functionality in Linux for a LONG time. Even in windows only some selected properiaty software player will have support for this. So for example you won't have a directshow filter that does this job. Because they are afraid that people will steal the "bits" of the sound stream.

There are solutions that decode and rip the stream into lpcm. Like eac3to.

So the stream have to be uncrypted and decoded first. I'm afraid ffmpeg can not do the decoding and uncrypting of the hd sound yet... There are plans for it but it is niot there yet. I think.

So first thing is to check wheter ffmpeg can decode it. If it can than hdmi lpcm works like a regular analog multichannel output to pass the decoded, unrypted LPCM (not tru-hd) stream to the receiver.

If not, you have to rip the soundtrack into multichannel flac format, which is playable as lpcm in xbmc.

ultrabrutal
2009-07-06, 20:06
VERY IMPORTANT !

EVERYONE HAVE TO START XSERVER TO HEAR ANY HDMI SOUND !

Start X and then start an xterm, there try the speaker test !

This could be your problem.

This is news to me. Didn't come by this info before... Now perhaps you can explain this in greater detail for us? :)

Do I have to have XBMC stopped? tnx

xbmc@Stuen:~$ sudo X
[sudo] password for xbmc:

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.


Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.

ddxSigGiveUp: Closing log


xbmc@Stuen:~$ xterm
xterm Xt error: Can't open display:
xterm: DISPLAY is not set

alanwww1
2009-07-06, 20:54
This is news to me. Didn't come by this info before... Now perhaps you can explain this in greater detail for us? :)

Do I have to have XBMC stopped? tnx

xbmc@Stuen:~$ sudo X
[sudo] password for xbmc:

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.


Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.

ddxSigGiveUp: Closing log


xbmc@Stuen:~$ xterm
xterm Xt error: Can't open display:
xterm: DISPLAY is not set

You seem to have X already running. This is not the problem you have. Do you have normal stereo sound over HDMI ?

If not, than check out alsamixer if all iec channels are unmuted !

ultrabrutal
2009-07-06, 21:05
I have no sound at all. :( I've tried a million things now by now.
Yesterday I set up a Revo with USB spdif dongle with a minimal install also. No problems there.

Today I installed a XBMC Live on my ASRock ION 330 and was able to get some sound out though only 2 channels of the 6 which were in the movie.

But my own minimal install fails to produce any sounds eventhough everything looks fine to me. :(

Alsamixer settings for you, though I cannot see the relevance for IEC since those are used for the spdif in the ASRock?

┌───────────────────────[AlsaMixer v1.0.20 (Press Escape to quit)]───────────────────────┐
│ Card: HDA NVidia │
│ Chip: Nvidia MCP7A HDMI │
│ View: [Playback] Capture All │
│ Item: IEC958 Default PCM │
│ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │ │ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │ │ │
│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │ │ │
│ ├──┤ └──┘ ├──┤ ├──┤ ├──┤ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │
│ │OO│ │OO│ │MO│ │MM│ │OO│ │OO│ │OO│ │OO│ │
│ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ │
│ 100<>100 100<>100 100<>100 10<>10 0<>0 │
│ Master F PCM Front Line Mic IEC958 <IEC958 D> IEC958 1 IEC958 2 │
└───────────────────────────────────────────────── ───────────────────────────────────────┘

ylagace
2009-07-06, 22:37
I have the Zotac not the ASrock but I had a HDMI setting in the BIOS to set first.

After that I only had to enter hdmi, hdmi for the xbmc passthrough and device setting in XBCM Settings->System->Audio hardware to get sound. It was working even before I applied the NVIDIA patch.

Hope it helps...

Alan, I will try the TrueHD without passthrough when I return later this week.

donalddk
2009-07-07, 16:53
Did any of you get DTS working on the ION330 ?

ultrabrutal
2009-07-07, 17:01
Sound is such a show stopper. I've given up. Nothing works. I can probably get spdif to work (did that with a revo with usb dongle), but then it's bye to HD sound :(
Some day a solution might turn up...

ylagace
2009-07-07, 23:48
Yep AC3 and DTS is working on my Zotac ION330. It was working before I applied the patch (and after). I am still working on the True-HD and DTS-HD.

DarthV
2009-07-08, 16:28
Definitely interested in getting DTS-MA and TrueHD working with my ION box. Had no problem getting DTS/AC3 to work.

nmiller
2009-07-09, 02:52
Sound is such a show stopper. I've given up. Nothing works. I can probably get spdif to work (did that with a revo with usb dongle), but then it's bye to HD sound :(
Some day a solution might turn up...

Stupid questions...but have you tried the following:

- Make sure Audio over HDMI is setup in BIOS (If that is even an option)
- Make sure ALL the IEC958 options in ALSAMIXER are unmuted
- Make sure to set the audio output device and passthrough output device to 'hdmi' (no quotes) in the System/Audio Hardware Settings in XBMC
- Create a file sudo nano /etc/asound.conf and insert the following:

pcm.!default {

type plug
slave {
pcm "hdmi"
}
}

You may want to reboot after any changes just to make sure it all takes

I've had no problem getting HDMI working to my receiver doing a minimal Ubuntu install 9.04 with the latest of XBMC...no additional patches or drivers outside of the updated NVidia Display driver. I may be using a different motherboard, GIGABYTE GA-E7AUM-DS2H, but it is generally the same hardware and path to getting sound up and running. Let me know if you have any questions

alanwww1
2009-07-09, 12:39
Stupid questions...but have you tried the following:

- Make sure Audio over HDMI is setup in BIOS (If that is even an option)
- Make sure ALL the IEC958 options in ALSAMIXER are unmuted
- Make sure to set the audio output device and passthrough output device to 'hdmi' (no quotes) in the System/Audio Hardware Settings in XBMC
- Create a file sudo nano /etc/asound.conf and insert the following:

pcm.!default {

type plug
slave {
pcm "hdmi"
}
}

You may want to reboot after any changes just to make sure it all takes

I've had no problem getting HDMI working to my receiver doing a minimal Ubuntu install 9.04 with the latest of XBMC...no additional patches or drivers outside of the updated NVidia Display driver. I may be using a different motherboard, GIGABYTE GA-E7AUM-DS2H, but it is generally the same hardware and path to getting sound up and running. Let me know if you have any questions



Hi Nmiller !

I have issues with navigation sound. It seems to work with the settings you wrote for .asoundrc, but from time to time i loose navsounds. I realized that i loose it in case i play an ac3, dts passthrough movie and i PAUSE it for 3-4 secs and restart it. After that my navsounds dissapear.

Can you test this with your config ?

Haggy
2009-07-09, 13:13
Moved to hardware - fits better in here.

ylagace
2009-07-09, 20:22
I have installed the second patch (i.e. the new rates - 44100, 96000, 192000) and I still cannot get True-HD and DTS-HD sound. I have the exact same symptoms as my previous log.

I will try first to get VLC and/or mplayer working on my rig with VDPAU to see if I can use them as external players if they can handle these codecs in Linux. I can tell it is not going to be easy.

But first I need to get them to work with VDPAU and also manage to mount my NAS drives so I can access my movies. XBMC has no trouble mounting those drives but whenever I tried to mount them manually it never works. Ubuntu/Linux is a bitch when it comes to mount network drives...

I am stumbling around all that documentation since I know so little about Linux/Ubuntu.

Oh well it is going to be a long term project...

I will also try to start another thread in Linux support with my log file to see if someone can help with this stuff.

alanwww1
2009-07-10, 00:06
I have installed the second patch (i.e. the new rates - 44100, 96000, 192000) and I still cannot get True-HD and DTS-HD sound. I have the exact same symptoms as my previous log.

I will try first to get VLC and/or mplayer working on my rig with VDPAU to see if I can use them as external players if they can handle these codecs in Linux. I can tell it is not going to be easy.

But first I need to get them to work with VDPAU and also manage to mount my NAS drives so I can access my movies. XBMC has no trouble mounting those drives but whenever I tried to mount them manually it never works. Ubuntu/Linux is a bitch when it comes to mount network drives...

I am stumbling around all that documentation since I know so little about Linux/Ubuntu.

Oh well it is going to be a long term project...

I will also try to start another thread in Linux support with my log file to see if someone can help with this stuff.

Ylagace!

I repeat, you can not play tru-hd or DTS-HD tracks on the fly yet !!

You have to decrypt it with eac3to to flac, only after that you can play it as hd lpcm over hdmi.

ylagace
2009-07-10, 18:18
Alan,

I was under the impression that the latest version of XBMC (SVN) since early May was compiled with the new version of ffmpeg which now does the True-HD decoding. I though that once we had it decoded it would be available as a LPCM multi channel stream:

from "http://xbmc.org/trac/milestone/9.04"


Updated FFmpeg (libavcodec/libavformat) adding new audio/video codecs, like:


• M2TS/M2T/MTS ( Blu-ray and AVCHD video format) container support

• EVO (Enhanced VOB) for HD DVD video format container support

• AVS (Audio Video Standard) audio/video decoder and container support

• Dolby Digital Plus and Dolby TrueHD audio software decoder

• MLP (Meridian Lossless Packing) / Packed PCM (PPCM) audio decoder

•WMA Pro Audio Codec (Windows Media Audio 9 Professional)

•...and many more, for a full list see XBMC Supported Formats and Codecs


What is your understanding of what is available via ffmpeg??

Do you know if anyone can get True-HD decoding via mplayer or VLC for Linux (since they both use ffmpeg)?? We could then use them as external players...

I must admit I do not understand what the limitations are once ffmeg can decode the True-HD stream... I always thought that this would give us LPCM audio?!

Anyway I can always do FLAC or I keep playing them as is on the PCH A-110. I am alway trying to avoid those extra steps :)

nmiller
2009-07-11, 00:26
Hi Nmiller !

I have issues with navigation sound. It seems to work with the settings you wrote for .asoundrc, but from time to time i loose navsounds. I realized that i loose it in case i play an ac3, dts passthrough movie and i PAUSE it for 3-4 secs and restart it. After that my navsounds dissapear.

Can you test this with your config ?

I believe what you're seeing or rather hearing is the fact that when no sound is being transmitted the signal is no longer being sent from your HTPC, thus your Receiver changes modes. It is something I see as well. As an example...if I am going through the menu's slowly I won't hear some of the menu sounds and if I watch my Receiver while I'm doing that I can see it losing the signal...but if I'm going through the menu's quickly the signal never drops and the Receiver plays all the sounds. Try moving around the menus quicker and watching the Receiver and tell me what happens.

I don't think this is specific to XBMC but rather hardware related because I see this in Windows as well when XBMC isn't even running. It may even just be specific to HDMI but I haven't tested enough to prove that.

If you're seeing this as just a linux problem I don't know how much help I can be...I'm really a linux noob. I've been a PC guy for ages, am a IT Network/Security Engineer by trade and have had to touch on linux here and there but never anything too advanced. Most of my stuff I've figured out has been due to hours and hours of reading and research in multiple forums and a lucky guess or two...if it wasn't for others posting their success and knowledge I'd probably still be at step 10 out of 50 :)

Good Luck!

Nathan

plue
2009-07-13, 13:43
Not a sound is heard via my Onkyo 876 receiver (7.1 setup) nor the Pioneer KRL-37V TV. Tried both hdmi and plughw:0,3.

I'm going crazy here... Any ideas guys?

Take a look to this post:

With NVIDIA driver if you disable EDID in xorg to use Modlines of standard HD resolutions, you will lost HDMI audio.

You can check by enabling again EDID (the default behavior).

But if you don't want to use the EDID resolutions nor any other options, you should use this options:


Option "RandRRotation" "False"
Option "TwinView" "False"
Option "UseEdidFreqs" "False"
Option "UseEdid" "True"
Option "ExactModeTimingsDVI" "True"
Option "UseEdidDpi" "False"
Option "DynamicTwinView" "False"
Option "ModeValidation" "AllowNon60HzDFPModes,NoEdidMaxPClkCheck,AllowInter lacedModes,NoHorizSyncCheck,NoVertRefreshCheck,NoD FPNativeResolutionCheck,NoVesaModes,NoEdidModes,No XServerModes,NoPredefinedModes,NoUserModes"
Option "UseEvents" "True"

hotlobster
2009-07-20, 13:46
Hi,

I already had alsa 1.0.20as i'm running kernel 2.6.30.
My alsa-utils from debien testing repo are 1.0.20 too.

I've patched as mentionned in this post the patch_nvhdmi.c, recompiled modules, installed and loaded them.

Unfortunatly i still only have stereo sound with speaker-test or any other test i've made.
No other channels.


Do you think i should recompile asla 1.0.20 from git ? Or did i forget something important to recompile than only the related nv module ?

Thanks

hotlobster
2009-07-24, 12:24
bump.

Need your advice on my issue.

Thanks.

plue
2009-07-27, 14:15
Hi,
I've patched as mentionned in this post the patch_nvhdmi.c, recompiled modules, installed and loaded them.

Unfortunatly i still only have stereo sound with speaker-test or any other test i've made.
No other channels.


Could be that you have: "MCP67 HDMI" or "MCP73 HDMI".
This models only support stereo.

You can see it if you look to the snd_hda_preset_nvhdmi static structure in the patch file.

hotlobster
2009-07-27, 14:25
I have a MCP79 chipset, so it's supposed to works normally i think.

plue
2009-08-03, 11:47
Unfortunatly i still only have stereo sound with speaker-test or any other test i've made.
No other channels.

Do you have Xorg up and you are viewing Xorg content on the screen? (you see gnome or kde or whatever that use Xorg.

Ensure that your Xorg with latests nvidia drivers and the config to use EDID (the default behavior).

Ensure that when Xorg is started when your HDMI cable is connected to an amplifier that had previously turned on.

Try 8channels 16bits.

rickardkk
2009-09-07, 16:20
What's the status on this one?

Is it possible to get correct mapping, unaltered bit depth and sample rate when using LPCM output over HDMI?

ubiq
2009-09-25, 23:42
Hi!

What is the current status of 8 channel LPCM over HDMI for the modern NVidia chipsets with Alsa 1.0.21(a)? I noticed that in the changelog for the 1.0.21 version it states:

- ALSA: hda - Support NVIDIA 8 channel HDMI audio

does this mean that the patch is no longer needed?

I would test this myself, but atm my receiver doesn't support LPCM over HDMI and would like to buy a new receiver if all the major problems have been sorted out. Has alanwww1 or anyone else tested the latest Alsa version and if you have do we still need to manually edit something to get all bit depths and sample rates working?

Edit: I just downloaded the Alsa source and took a look at the patch file that is now part of the source. It seems to be only enabling 48kHz and 16bits. So it seems that first downloading the Alsa source with the latest Alsa update script and modifying the patch:
.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000,
.maxbps = 24,
.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
at appropriate lines and then proceeding with the installation would do the trick.

markdr
2009-09-28, 11:23
Following this thread it would seem that people have had success in getting multi-channel audio working out of their Nvidia integrated motherboards over HDMI. Unfortunately I was not able to get the same result on my setup.

I have a Zotac ION based MiniITX running Ubuntu 9.04 with the 2.6.28-14-generic #47-Ubuntu SMP kernel. I have used the Alsa upgrade script to bring my Alsa drivers/libs etc up to v1.0.21 and I am running a recent trunk build of XBMC (needed to playback local freeview recordings).

I can only get stereo out of XBMC and speaker-test does not produce any output (which seems strange). This setup is designed to replace my existing original XBOX running XBMC but so far it can't compete when it comes to surround audio.

To be sure that the recently patched 8ch Alsa code was being loaded I updated the info string in the nvcodec module to include "8ch" which I can see when I do an aplay -l :

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI 8ch [NVIDIA HDMI 8ch]
Subdevices: 1/1
Subdevice #0: subdevice #0

All of my testing is done with X running using the latest NVidia graphics drivers. I would love to get this working, any help much appreciated.

chris2922
2009-10-04, 13:09
I have updated my 9.04.1 LIVE install to 9.04.2 (on a usb stick) using Putty from a Windows PC using this guide:

http://marshalleq.wordpress.com/2009/08/22/how-to-upgrade-xbmc-live-to-latest-stable-and-enable-smoothvideo-playback/

Before i upgraded, my Zotac ION330 board would only send 6 channel AAC encoded audio via 'hdmi' or 'iec958' as Stereo PCM. I was informed that this was a limitation of the current drivers for the ION330 board. I was directed to this thread but did not want to apply a patch i didnt really understand (im new to linux), so decided to live without Multichannel PCM from AAC audio for now.

Following my upgrade, 6 channel AAC encoded audio is being seen by the amp as 'multichannel pcm' and no longer as stereo.

Doing the speaker test 'speaker-test -Dhdmi -c6' sound comes through each channel seperately. Unfortunately, the channels are not set correctly as described in this thread.

I seem to have applied this patch by upgrading XBMC. How is this possible?
Has the patch been added to the current build?

My channels are set correctly when i read from AC3 (dolby) encoded audio.

Can i apply a change to fix the channel placements for AAC and not change them when i listen to AC3? (I Dont want to fix one thing by breaking another.)

markdr
2009-10-06, 00:06
@chris2922: Can't help with the channel problem as I still don't get more than Stereo PCM but I assume that it will take some Alsa config trickery to get the channels sorted.

Great to hear you made some progress, can you please describe the current state of your setup, kernel version, alsa version, NVidia driver version, any alsa config files in use (/etc/asound.conf or .asoundrc), XBMC audio settings etc.

alanwww1
2009-10-12, 14:46
I will post a detailed guide how to set up alsa for multichannel hd audio with RIGHT speaker matching.

I just need a little time, but i think somewhere this week you will get it.

I will open up a new thread about it.

I am in contact with an Alsa developer who again promised to add the patch for enabling hd rates to the kernel tree, so soon there will be an easier setup. But for the mixed channels there is only the custom .asoundrc file solution so far. I will post that too.

Stay tuned !

UglyBob
2009-11-09, 10:58
Please help out a confused guy a bit... Do I understand correctly that this patch solves getting 44.1 kHz audio pass through with nVidia cards (i.e. with my Asrock ION box)? I really don't want my audio to be altered in any way before reaching the receiver...