pipelka / xbmc-addon-xvdr

DISCONTINUED - Standalone XVDR addon for XBMC
GNU General Public License v2.0
43 stars 17 forks source link

feature request: set audio track automatically based on VDR language priority #46

Open tjormola opened 12 years ago

tjormola commented 12 years ago

Hi!

Thanks for great software. However, I'm unable to switch using XBMC exclusively as the frontend for my VDR system due to a limitation related to the handling of audio tracks in XBMC. In my country (Finland), foreign shows are never dubbed (excluding programs for children) so the original audio track is broadcasted and the language of the track is flagged appropriately in the DVB stream. However, some channels also broadcast an extra audio track. The track consists of speech synthesis of the subtitles and the track is flagged as being Dutch language. Blind people can configure their set-top boxes to play Dutch language track by default so they can follow the program this way.

In VDR you can also configure the priority of the languages (AudioLanguages property in setup.conf of VDR, configurable in DVB settings menu of VDR setup). The first matching audio track for a program is then selected for playback when using one of the native VDR frontend plugins. However, when using XBMC with XVDR, it appears that XBMC always selects the last audio track. When this fake Dutch track is broadcasted, it's always selected for playback as it's the last track. This is very frustrating as it's impossible to switch the audio track manually using a remote control (at least I've not figured out how to do that), you need to grab the keyboard for that. It's so frustrating, in fact, that in my opinion this makes XBMC pretty much unusable for watching TV in Finland (unless you're blind, I suppose ;).

In the XBMC audio menu for the program you can choose "always use these settings" after selecting the correct audio track but that doesn't seem to work. After selecting the correct audio track and checking this option the Dutch track is still always played by default if it exists. Maybe this is because you can select only one language as the audio track but the language varies from program to program depending on the origin country of the program so the always use these settings selection for the audio track is reset each time the audio track language changes.

Since it's not possible to define the language priority using XBMC in a similar way as with VDR, would it be possible for the XBMC XVDR plugin to use the language priority list of VDR (I hope it's possible to extend the XVDR protocol to support exporting of VDR config settings if it's not yet possible) and then use this list to select the desired audio track that XBMC will play automatically each time the channel is changed?

pipelka commented 12 years ago

Are you using the lastest "master" of the VDR plugin ? We had that issue there. Please see pipelka/vdr-plugin-xvdr#52 (the changes from there are already in master) There is language priority in XVDR it uses your XBMC main language and the configured audio type (from the XVDR configuration) to order audio streams.

If you're already using the lastest "master" please rebuild your VDR plugin with:

make DEBUG=1

and post the log for switching the channel. There should by a list with detected audio-streams (and stream ordering).

BTW, '#' on the remote is your friend ;-)

tjormola commented 12 years ago

I'm using the packages from yaVDR unstable PPA and they just got updated with fresh snapshots after filing this request. I've now updated both XBMC and VDR XVDR plugins (both snapshots are dated 20140414 and there seems to be no commits since this date for either one so it's the latest code) and re-tested and found out something strage. I rebuilt the vdr-plugin-xvdr package locally with DEBUG=1 and this is what I got in the logs when changing to a channel with the Dutch audio track

Apr 19 21:16:10 host231 vdr: [2365] XVDR: -------------------------------------- Apr 19 21:16:10 host231 vdr: [2365] XVDR: Channel streaming request: 4 - Nelonen Apr 19 21:16:10 host231 vdr: [2365] XVDR: Found available device 1 Apr 19 21:16:10 host231 vdr: [2365] XVDR: cStreamdevPatFilter("Nelonen") Apr 19 21:16:10 host231 vdr: [2365] XVDR: Starting live receiver Apr 19 21:16:10 host231 vdr: [2365] XVDR: Creating demuxers Apr 19 21:16:10 host231 vdr: [2365] XVDR: Starting PAT scanner Apr 19 21:16:10 host231 vdr: [2365] XVDR: VDR active, sending stream start message Apr 19 21:16:10 host231 vdr: [2365] XVDR: Successfully switched to channel 4 - Nelonen Apr 19 21:16:10 host231 vdr: [2365] XVDR: Started streaming of channel Nelonen (timeout 10 seconds, priority 0) Apr 19 21:16:10 host231 vdr: [2543] XVDR: LiveQueue started Apr 19 21:16:10 host231 vdr: [2254] XVDR: PMT scanner adding PID 512 (ISO/IEC 13818-2 Video) Apr 19 21:16:10 host231 vdr: [2254] XVDR: PMT scanner adding PID 650 (ISO/IEC 13818-3 Audio) (fin) Apr 19 21:16:10 host231 vdr: [2254] XVDR: PMT scanner adding PID 658 (ISO/IEC 13818-3 Audio) (dut) Apr 19 21:16:10 host231 vdr: [2254] XVDR: PMT scanner: adding PID 5012 (ISO/IEC 13818-1 Private PES data) Teletext Apr 19 21:16:10 host231 vdr: [2544] XVDR: no payload, size 0 Apr 19 21:16:10 host231 vdr: [2544] XVDR: -------------------------------------- Apr 19 21:16:10 host231 vdr: [2544] XVDR: NEW AUDIO INFORMATION: Apr 19 21:16:10 host231 vdr: [2544] XVDR: Channels: 2 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Samplerate: 48000 Hz Apr 19 21:16:10 host231 vdr: [2544] XVDR: Bitrate: 128000 bps Apr 19 21:16:10 host231 vdr: [2544] XVDR: -------------------------------------- Apr 19 21:16:10 host231 vdr: [2544] XVDR: -------------------------------------- Apr 19 21:16:10 host231 vdr: [2544] XVDR: NEW AUDIO INFORMATION: Apr 19 21:16:10 host231 vdr: [2544] XVDR: Channels: 2 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Samplerate: 48000 Hz Apr 19 21:16:10 host231 vdr: [2544] XVDR: Bitrate: 224000 bps Apr 19 21:16:10 host231 vdr: [2544] XVDR: -------------------------------------- Apr 19 21:16:10 host231 vdr: [2544] XVDR: no payload, size 0 Apr 19 21:16:10 vdr: last message repeated 6 times Apr 19 21:16:10 host231 vdr: [2544] XVDR: -------------------------------------- Apr 19 21:16:10 host231 vdr: [2544] XVDR: NEW PICTURE INFORMATION: Apr 19 21:16:10 host231 vdr: [2544] XVDR: Picture Width: 720 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Picture Height: 576 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Display Aspect Ratio: 1.78 Apr 19 21:16:10 host231 vdr: [2544] XVDR: -------------------------------------- Apr 19 21:16:10 host231 vdr: [2544] XVDR: streaming of channel started Apr 19 21:16:10 host231 vdr: [2544] XVDR: sendStreamChange Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 0 / fin Weight: 401 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 0 / dut Weight: 102 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 22 / Weight: 3 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 10 / Weight: 0 Apr 19 21:16:10 host231 vdr: [2544] XVDR: MPEG2AUDIO: 650 (fin) Apr 19 21:16:10 host231 vdr: [2544] XVDR: MPEG2AUDIO: 658 (dut) Apr 19 21:16:10 host231 vdr: [2544] XVDR: TELETEXT: 5012 Apr 19 21:16:10 host231 vdr: [2544] XVDR: MPEG2VIDEO: 512 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 0 / fin Weight: 400 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 0 / dut Weight: 101 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 10 / Weight: 3 Apr 19 21:16:10 host231 vdr: [2544] XVDR: Stream : Type 22 / Weight: 2 Apr 19 21:16:10 host231 vdr: [2544] XVDR: sendStreamInfo Apr 19 21:16:10 host231 vdr: [2544] XVDR: no payload, size 0 Apr 19 21:16:12 vdr: last message repeated 54 times

The Finnish language track has bigger weight than the Dutch language but still the Dutch track was still played. My XBMC is configured to be English (UK24). Despite speaking Finnish as my mother tongue I really hate Finnish translations of any computer interface. In my opinion tying the audio track language preference or priorization to the interface language is just silly. It would make a great choice for the default setting, but this setting should be configurable, IMHO. It's configurable in VDR and also just about any commercial dedicated DVB settop box. Also what about the foreigners in the country who don't know the language so they must use their programs in English or their native language but still they'd probably prefer the TV audio to be what ever the native track for the program is instead of the subtitles in a language foreign to them spoken aloud by computer voice.

Ok anyway, I switched XBMC to Finnish and restarted XBMC just in case and got the following logs

Apr 19 21:22:38 host231 vdr: [2986] XVDR: -------------------------------------- Apr 19 21:22:38 host231 vdr: [2986] XVDR: Channel streaming request: 4 - Nelonen Apr 19 21:22:38 host231 vdr: [2986] XVDR: Found available device 1 Apr 19 21:22:38 host231 vdr: [2986] XVDR: cStreamdevPatFilter("Nelonen") Apr 19 21:22:38 host231 vdr: [2986] XVDR: Starting live receiver Apr 19 21:22:38 host231 vdr: [2986] XVDR: Creating demuxers Apr 19 21:22:38 host231 vdr: [2986] XVDR: Starting PAT scanner Apr 19 21:22:38 host231 vdr: [2986] XVDR: VDR active, sending stream start message Apr 19 21:22:38 host231 vdr: [2986] XVDR: Successfully switched to channel 4 - Nelonen Apr 19 21:22:38 host231 vdr: [2986] XVDR: Started streaming of channel Nelonen (timeout 10 seconds, priority 0) Apr 19 21:22:38 host231 vdr: [3130] XVDR: LiveQueue started Apr 19 21:22:38 host231 vdr: [2254] XVDR: PMT scanner adding PID 512 (ISO/IEC 13818-2 Video) Apr 19 21:22:38 host231 vdr: [2254] XVDR: PMT scanner adding PID 650 (ISO/IEC 13818-3 Audio) (fin) Apr 19 21:22:38 host231 vdr: [2254] XVDR: PMT scanner adding PID 658 (ISO/IEC 13818-3 Audio) (dut) Apr 19 21:22:38 host231 vdr: [2254] XVDR: PMT scanner: adding PID 5012 (ISO/IEC 13818-1 Private PES data) Teletext Apr 19 21:22:38 host231 vdr: [3131] XVDR: no payload, size 0 Apr 19 21:22:38 host231 vdr: [3131] XVDR: -------------------------------------- Apr 19 21:22:38 host231 vdr: [3131] XVDR: NEW AUDIO INFORMATION: Apr 19 21:22:38 host231 vdr: [3131] XVDR: Channels: 2 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Samplerate: 48000 Hz Apr 19 21:22:38 host231 vdr: [3131] XVDR: Bitrate: 224000 bps Apr 19 21:22:38 host231 vdr: [3131] XVDR: -------------------------------------- Apr 19 21:22:38 host231 vdr: [3131] XVDR: -------------------------------------- Apr 19 21:22:38 host231 vdr: [3131] XVDR: NEW AUDIO INFORMATION: Apr 19 21:22:38 host231 vdr: [3131] XVDR: Channels: 2 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Samplerate: 48000 Hz Apr 19 21:22:38 host231 vdr: [3131] XVDR: Bitrate: 128000 bps Apr 19 21:22:38 host231 vdr: [3131] XVDR: -------------------------------------- Apr 19 21:22:38 host231 vdr: [3131] XVDR: -------------------------------------- Apr 19 21:22:38 host231 vdr: [3131] XVDR: NEW PICTURE INFORMATION: Apr 19 21:22:38 host231 vdr: [3131] XVDR: Picture Width: 720 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Picture Height: 576 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Display Aspect Ratio: 1.78 Apr 19 21:22:38 host231 vdr: [3131] XVDR: -------------------------------------- Apr 19 21:22:38 host231 vdr: [3131] XVDR: streaming of channel started Apr 19 21:22:38 host231 vdr: [3131] XVDR: sendStreamChange Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 0 / fin Weight: 10401 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 0 / dut Weight: 102 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 22 / Weight: 3 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 10 / Weight: 0 Apr 19 21:22:38 host231 vdr: [3131] XVDR: MPEG2AUDIO: 650 (fin) Apr 19 21:22:38 host231 vdr: [3131] XVDR: MPEG2AUDIO: 658 (dut) Apr 19 21:22:38 host231 vdr: [3131] XVDR: TELETEXT: 5012 Apr 19 21:22:38 host231 vdr: [3131] XVDR: MPEG2VIDEO: 512 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 0 / fin Weight: 10400 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 0 / dut Weight: 101 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 10 / Weight: 3 Apr 19 21:22:38 host231 vdr: [3131] XVDR: Stream : Type 22 / Weight: 2 Apr 19 21:22:38 host231 vdr: [3131] XVDR: sendStreamInfo Apr 19 21:22:40 host231 vdr: [3131] XVDR: no payload, size 0

Indeed, the Finnish language got a 10000 points boost and was now selected for playback. Now the funny things started to happen. I switched XBMC back to English, restarted and now I can't reproduce this anymore! The native audio track seemed to always play even when there was the Dutch track available with the weight being the same as in the first log snippet! I swear the Dutch track was playing when I first tested this with the latest snapshots of both XVDR XBMC and VDR plugins, but now it seems to be fine for a couple of hours at least. Must test some more.

Also thanks for pointing out the # key, I'm using a Logitech Harmony multidevice remote which emulates Windows Media Center remote. I didn't have the # key bound anywhere on the Harmony, but I now programmed it and it works great.

tjormola commented 12 years ago

Interesting development on XBMC side regarding this topic: http://forum.xbmc.org/showthread.php?tid=30160&pid=1130436#pid1130436

Maybe the language selection logic in XVDR plugin should be adapted to use this new generic mechanism.