Re: [pulseaudio-discuss] [WIP] Passthrough support

2011-03-25 Thread Anssi Hannula
On 25.03.2011 03:35, Dark Shadow wrote:
> Unless I am missing something all the movies I play say 48kHz on my
> receivers OSD when played through my PS3 so I thought that was the
> best they have, and higher was not used on average Blu-Ray's.
> 
> If they have better why is it not being used considering my receiver
> supports it. I know from this dmesg output

The sample rates outputted in dmesg and in /proc by ALSA are incorrect
due to a kernel bug.

48000 88200 176400 192000 384000
in your log means
44100 48000 88200 96000 176400 (+192000)

Basically there is a bitfield of

static unsigned int rates[] =
{ 5512, 8000, 11025, 16000, 22050, 32000, 44100,
 48000, 64000, 88200, 96000, 176400, 192000 };

which gets interpreted as:

static unsigned int rates[] = {
   8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200,
   96000, 176400, 192000, 384000 };

so the wrong values are printed and possible 192000 is not printed at all.

> [  182.696452] HDMI: detected monitor TX-SR608
> [  182.696456] at connection type HDMI
> [  182.696462] HDMI: available speakers: FL/FR LFE FC RL/RR RLC/RRC
> [  182.696472] HDMI: supports coding type LPCM: channels = 2, rates =
> 44100 48000 88200 176400 192000 384000, bits = 16 20 24
> [  182.696481] HDMI: supports coding type LPCM: channels = 8, rates =
> 44100 48000 88200 176400 192000 384000, bits = 16 20 24
> [  182.696489] HDMI: supports coding type AC-3: channels = 8, rates =
> 44100 48000 88200, max bitrate = 64
> [  182.696495] HDMI: supports coding type DTS: channels = 8, rates =
> 48000 88200, max bitrate = 1536000
> [  182.696501] HDMI: supports coding type DSD (One Bit Audio):
> channels = 6, rates = 48000
> [  182.696507] HDMI: supports coding type E-AC-3/DD+ (Dolby Digital
> Plus): channels = 8, rates = 48000 88200
> [  182.696514] HDMI: supports coding type DTS-HD: channels = 8, rates
> = 48000 88200 176400 192000 384000
> [  182.696520] HDMI: supports coding type MLP (Dolby TrueHD): channels
> = 8, rates = 88200 192000
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


-- 
Anssi Hannula
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [WIP] Passthrough support

2011-03-25 Thread Anssi Hannula
On 25.03.2011 02:58, Dark Shadow wrote:
> On Thu, Mar 24, 2011 at 10:50 AM, Anssi Hannula  wrote:
>> On 24.03.2011 16:18, pl bossart wrote:
>>>> 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.
>>
>> Indeed for HBR you need to always specify 8 channels and use rate to
>> control the final rate (i.e. you either use "normal" 2 channel
>> passthrough or HBR 8 channel passthrough).
>>
>> For example to passthrough the abovementioned 384 kHz stream you need to
>> use 8 channels and rate of 96000. However, I think 384kHz DTS bitstream
>> is generally *not* supported by A/V receivers, so you probably want to
>> use 768kHz (8 channels, 192kHz).
>>
>> (note: I haven't tested whether HBR works with pulseaudio or not)
>>
>>
>>> 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.
>>
>>
>> --
>> Anssi Hannula
>> ___
>> pulseaudio-discuss mailing list
>> pulseaudio-discuss@mail.0pointer.de
>> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>>
> 
> Would anyone know where I could get a hold of some DTS-HD samples in
> 192Khz and 384kHz for testing?

Compile ffmpeg and use it for the samples at
http://samples.mplayerhq.hu/A-codecs/DTS/dts/

-- 
Anssi Hannula
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [WIP] Passthrough support

2011-03-24 Thread Anssi Hannula
On 24.03.2011 16:18, pl bossart wrote:
>> 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.

Indeed for HBR you need to always specify 8 channels and use rate to
control the final rate (i.e. you either use "normal" 2 channel
passthrough or HBR 8 channel passthrough).

For example to passthrough the abovementioned 384 kHz stream you need to
use 8 channels and rate of 96000. However, I think 384kHz DTS bitstream
is generally *not* supported by A/V receivers, so you probably want to
use 768kHz (8 channels, 192kHz).

(note: I haven't tested whether HBR works with pulseaudio or not)


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


-- 
Anssi Hannula
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] HDMI sink is stereo-only

2011-01-23 Thread Anssi Hannula
On 23.01.2011 09:19, Xavier Bestel wrote:
> Hi,

Hi!

> sorry to poke you about that, but that problem isn't a PA one, it's
> either ALSA or Radeon, but none of them even answered. So I figured you
> guys have had a lot of experience dealing with ALSA drivers troubles and
> could tell me where to look for solutions (or at least correct
> diagnostic).
> 
> I have a Radeon HD2600, linked though a DVI-to-HDMI cable to a Yamaha
> RX-1600 amp. ALSA doesn't accept something else than stereo files, e.g:

Radeon devices have nonstandard multichannel support which is not
presently documented, and it is not supported by kernel/ALSA.

-- 
Anssi Hannula
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss