[WIP] Passthrough support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> It seems that 384k sample rates aren't supported directly in alsa, I did
> some patching to no avail yet.
>
> In any case if the channel count can be specified with passthrough the
> following should work.
>
> paplay --raw --channels=2 --rate=192000 --passthrough File.dts.spdif192khz (
> this works).
>
> paplay --raw --channels=4 --rate=192000 --passthrough File.dts.spdif384khz (
> this fails).
>
> To passthrough dolby true-hd it looks like it'll be necessary for more than
> two channels to work.

There was a thread on dts-hd in alsa-devel at some point. Anssi
(cc:ed) contributed some patches for HDMI and provided the information
below on ffmpeg configurations.
You may want to try at the alsa level before trying with pulseaudio to
make sure your setup is correct. I tend to believe you have to go for
8ch @ 192kHz to make this work based on my limited understanding of
HBR.
-Pierre



The DTS-HD part is not merged yet (patch is in ffmpeg-devel@), but the
TrueHD and E-AC-3 support is already there in ffmpeg trunk.

The ffmpeg commandline to use is:
ffmpeg -i input.file -f spdif output.spdif

For DTS-HD files, to get full passthrough (i.e. not only core), a
-dtshd_rate parameter is needed, which sets the output IEC958 rate.
ffmpeg -i input.file -f spdif -dtshd_rate 192000 output.spdif
ffmpeg -i input.file -f spdif -dtshd_rate 768000 output.spdif
192000Hz is enough for streams that have a bitrate below 6.144Mbps, which
means all DTS-HD High Resolution Audio files and even many of the DTS-HD
Master Audio (the latter are lossless VBR).

To play the spdif files back, I use
aplay -D hdmi:CARD=$CARDNAME,DEV=$DEVICENUM,AES0=0x06 -c $CHANCOUNT -r
$RATE file.spdif

- replacing $CARDNAME with the card name
- replacing $DEVICENUM with 0..3 depending on card and hdmi port (for
non-zero DEVICENUM you'll need a patch from alsa git:
http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=e6d5dcf1f625984605d362338d71162de45a6c60
)
- set $CHANCOUNT and $RATE as per below
 - rate 192000 and channels 2 for IEC958 rate 192 kHz (for e.g. 48 kHz
E-AC-3, and DTS-HD when the IEC958 rate was set to 192000 in ffmpeg)
 - rate 192000 and channels 8 for IEC958 rate 768 kHz (for most TrueHD
files, and for DTS-HD when the rate was set to 768000)
- note that having the 0x02 bit (non-pcm) set in AES0 is mandatory when
$CHANCOUNT is larger than 2, as ALSA uses it to determine whether to use
HBR or not. The additional 0x04 (non-copyright) I use above is not
mandatory, but is the alsa default so I kept it.



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux