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
Code:
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:
Code:
.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
Code:
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:
Code:
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...s/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 ?