Dolby Pro Logic II configuration
#1
Question 
Hi y'all

I've been researching the ALSA sound system but I'm lost at the moment and I'm not entirely sure anymore that I can achieve what I want.

I have a working XBMC installation running on a Ubuntu box which is connected to my Panasic TV through HDMI. The Panasonic TV is then connected to a Dolby Pro Logic II receiver using analog jacks.

The Dolby Pro Logic II system as some of you may know creates 5.1 surround from a stereo source if this stereo source is mixed correctly.

Alsa should support this since there exists a /usr/share/alsa/pcm/dpl.conf file in which the following is defined:

Quote:pcm.!dpl2 {
@args [SLAVE]
@args.SLAVE {
type string
}
type route
slave.pcm $SLAVE
slave.channels 2
# input: FL/FR/SL/SR/C/LFE
# LFE not used
ttable.0.0 1
ttable.1.1 1
ttable.2.0 0.866
ttable.2.1 -0.5
ttable.3.0 0.5
ttable.3.1 -0.866
ttable.4.0 0.707
ttable.4.1 0.707
ttable.5.0 0
ttable.5.1 0
}

So now my question is how to setup my .asoundrc file in order to output the DPL2 signal to my HDMI as passthrough (and then hope my TV doesn't screw it up)

Hopefully you can help me out or point me in the right direction.
Reply
#2
What exactly is it you want? Because you don't need to do anything about audio that has already been Dolby Surround / Pro Logic (2) encoded. You can send it as 2-channel audio and your receiver will pick up that signal and matrix decode it to surround sound.

But I assume what you want is to 'downmix'/transcode multichannel DTS/DD/FLAC/AAC/LPCM to Dolby Surround encoded stereo, right? I found a link here that might be useful: http://www.mail-archive.com/[email protected]
Reply
#3
Correct, I would like to transcode/downmix most formats (especially, AC3, perhaps mp3 audio) to DPL2. I also found that link and have included that into my current .asoundrc file:

Quote:<confdir:pcm/dpl.conf>

#first try default alsa hdmi device
#pcm.hdmi {
# type hw
# card 0
# device 0
#}

pcm.mydpl {
type plug
slave.pcm {
type upmix
slave.pcm "dpl2:hdmi"
channels 6
}
}

Now all that remains is to tell XBMC to use this pcm.mydpl interface by using the custom field in the passthrough audio (I hope).

I'm not entirely sure about the dpl2:hdmi statement, but my hdmi output is card 0, subdevice 0.

Is this correctly formated or not?
Reply
#4
devil103 Wrote:Correct, I would like to transcode/downmix most formats (especially, AC3, perhaps mp3 audio) to DPL2. I also found that link and have included that into my current .asoundrc file:



Now all that remains is to tell XBMC to use this pcm.mydpl interface by using the custom field in the passthrough audio (I hope).

I'm not entirely sure about the dpl2:hdmi statement, but my hdmi output is card 0, subdevice 0.

Is this correctly formated or not?
I'm not sure. I'm not an alsa expert. But I don't think it's necessary to define an hdmi device in .asoundrc if you already have the proper one (see aplay -L).

But afaik, dpl2:hdmi seems consistent with the example. Just test it.

As for you TV not screwing things up, you could at least for testing purposes hook up your source/XBMC box to the receiver directly and use a regular line out jack or S/PDIF if available.
Reply
#5
No such luck...
Even with custom audio field: alsa:plug:mydpl I'm getting an audio initialized error.

I've been trying with the alsa-utils such as speaker-test but to no avail.

speaker-test -Dplug:mydpl -c6 also gives an Playback open error: -2,No such file or directory unfortunatly.

Perhaps something is wrong with reading my .asoundrc file? Any specific permissions? Right now it's owned by my xbmc user (part of the audio group) and the permissions are 777 for now
Reply
#6
devil103 Wrote:The Dolby Pro Logic II system as some of you may know creates 5.1 surround from a stereo source if this stereo source is mixed correctly.

Dolby Pro Logic II creates 5.1 surround from any stereo source it doesn't have to be mixed in any way
Current HTPC Lian-Li PC-C37 • Gigabyte GA-E7AUM-DS2H • Intel C2D E8400 E0 Stepping • OCZ Vertex SSD • 4GB Corsair TwinX XMS2 DDR2 • Corsair HX650W Modular PSU (Free Upgrade) • LG CH08LS10 Blu-Ray Drive • Scythe Big Shuriken • Acousti DustPROOF 70mm Fan
Reply
#7
>>X<<' Wrote:Dolby Pro Logic II creates 5.1 surround from any stereo source it doesn't have to be mixed in any way
It does if you want to maintain an approximation of the discrete surround channels from the source signals Smile.

The DPL II decoder can do two things: matrix decode a Dolby Surround encoded stream into multichannel audio, or it can indeed upmix a regular stereo stream to multichannel.

You can't however, simply squash a discrete 5.1 signal (e.g. Dolby Digital) to stereo and then expect it to be decoded with the surround info maintained. For that in needs to be Dolby Pro Logic (II) matrix encoded. You cannot magically construct audio for the center and surround channels when they're simply not known. All DPL2 can do then is create the illusion of surround, basically by sending some 'echoes' of everything that's being outputted to the fronts to the surround channels.

I found this file: http://elft.org/ddl/5_1_DOLBY_dpl2_160kbps.m4v. Try sending it over a regular line out jack (or simply check if really only two channels are transmitted) to a DPL2 capable decoder and see that the output is somehow truly multichannel. Basically this is the predecessor of Dolby Digital 5.1. I hope you can hear that this is definitely different from regular upmixed stereo.
Reply
#8
Thanks for the answers so far!

My current .asoundrc:

Quote:<confdir:pcm/dpl.conf>

pcm.!default {
type plug
slave.pcm "plug:hdmi"
}
pcm.mydpl {
slave.pcm {
type upmix
slave.pcm "dpl2:default"
channels 6
}
}

Running a speaker test 6 channel over plug:hdmi works (however the center and rear speakers do not receive any sound)

However I've not been able to run a speaker test on mydpl which errors out on an error 2 non existent device I'm afraid.
Reply
#9
About mydpl not working: sorry, I don't know how that works. Probably you should start reading about alsa, plug(in)s and how to use them. It'll probably be a minor error.

edit1: nvm this one

edit2: this works for me

Code:
<confdir:pcm/dpl.conf>

pcm.mydpl {
    type plug
    slave.pcm {
        type upmix
        slave.pcm "dpl2:hdmi"
        channels 6
    }
}

mplayer /path/to/ac3-test.avi -channels 6 -ao alsa:device=mydpl
speaker-test -c6 -Dmydpl

Proof that it's not digital discrete sound (which I normally use of course) but really matrix encoded DPL2:

Code:
cat /proc/asound/card0/pcm3p/sub0/hw_params
access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 262144
buffer_size: 1048576

versus normal discrete multichannel:
Code:
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 6
rate: 48000 (48000/1)
period_size: 174752
buffer_size: 349504
Reply
#10
Great! That works for me as well!
For future reference: I forget the type plug in my .asoundrc config of 'mydpl'

However, the
Quote:pcm.!default {
type plug
slave.pcm "plug:mydpl"
}

statement doesn't work, so for now: no XBMC menu sounds.

Thanks for the help!
Reply
#11
Code:
<confdir:pcm/dpl.conf>

pcm.!default {
    type plug
    slave.pcm {
        type upmix
        slave.pcm "dpl2:hdmi"
        channels 6
    }
}

And remove the other default section.
Reply
#12
Just mentioning for future reference:

The .asoundrc detailed in this topic is working great for me.
Menu sounds and all. The only problem experienced was the playback of some(!) mp3's which were speeded up. This was more my fault then anything else since some of my mp3 were encoded with a sample rate of 22100 (or something around that number) due to some private mp3 codec back in the day which promised same quality with less file size. Fixed the issue by adding this to the advancedsettings.xml file

Quote:<audio>
<resample>48000</resample>
</audio>
Reply
#13
Glad you got everything working, but have you never given any though to switching to DD/DTS or even HD audio? Or let's say to the 21st century :p. You already have the HDMI stuff, you just need a receiver.

Resampling works, but note that it will slightly reduce the audio quality when playing music, which is sampled at 44100Hz (and you apparently have some 22050).

Videos are almost always 48000Hz though, so that should be ok.
Reply
#14
LB06 Wrote:Glad you got everything working, but have you never given any though to switching to DD/DTS or even HD audio? Or let's say to the 21st century :p. You already have the HDMI stuff, you just need a receiver.

Resampling works, but note that it will slightly reduce the audio quality when playing music, which is sampled at 44100Hz (and you apparently have some 22050).

Videos are almost always 48000Hz though, so that should be ok.

I realize that :p But we have a saying here, never look a gifted horse in the mouth. The surround system / HDTV was a gift from folks who were upgrading their setup; The surround system is even from a previous TV and is part of a media cabinet and I was more interested in the cabinet then the actual surround system.

But since it works... Big Grin
Reply
#15
Hi everyone,
Sorry to bring back an old topic but I need some help with setting up prologic 2 on my raspberry pi running OSMC (kodi 16 I believe...)
I have tried the configuration suggested above but speaker-test reports that the device hdmi isn't recognized... What should I be putting instead?
Thanks for any suggestions,
Seb.
Reply

Logout Mark Read Team Forum Stats Members Help
Dolby Pro Logic II configuration0