Prefer AC3 audio sporadically fails (1 Viewer)

MPUserFromGER

MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    TV-Server Version: SVN 16673 (19.12.2007)
    MediaPortal Version: 0.2.3 final with SVN 16673 (19.12.2007)
    MediaPortal Skin: Xface 1.3
    Windows Version: Windows XP Professional MCE Edition with SP2
    CPU Type: AMD Sempron 3400+ (AM2)
    HDD: Samsung 250GB + HAMA SSD 4GB (timeshifting)
    Memory: 1GB DDR
    Motherboard: MSI Platinum Board
    Motherboard Chipset: nForce 570
    Motherboard Bios: Award
    Video Card: Gigabyte Radeon 2600XT
    Video Card Driver: Catalyst V7.11
    Sound Card: On-Board
    Sound Card AC3: AC3 / optical SPDIF out
    Sound Card Driver:
    1. TV Card: Technotrend S2-3200
    1. TV Card Type: DVB-S and DVB-S2
    1. TV Card Driver: 5.0.0.6
    2. TV Card:
    2. TV Card Type:
    2. TV Card Driver:
    3. TV Card:
    3. TV Card Type:
    3. TV Card Driver:
    4. TV Card:
    4. TV Card Type:
    4. TV Card Driver:
    MPEG2 Video Codec: Cyberlink PowerDVD 7.3 codecs
    MPEG2 Audio Codec: DSCALER
    Satelite/CableTV Provider: Astra 19.2 E
    HTPC Case: Ahanix MCE 601
    Cooling: power supply fan, CPU boxed cooler, 2 housing fans (all controlled by SpeedFan)
    Power Supply: Ahanix
    Remote: Logitech Harmony 525
    TV: Samsung LCD 32"
    TV - HTPC Connection: DVI to HDMI


    In the latest SVNs, the audio selection does not work properly any more.
    I am experiencing the following issues:
    1. When switching from a channel with AC3 audio active to another channel, which has AC3 audio, sporadically MPEG is choosen and played instead of AC3
    2. Sporadically, after a channel change to a new channel, which has AC3 audio, MPEG audio is played instead of AC3 but the audio menu shows AC3 as active.

    Logs of issue #1 is attached.

    Please note that the exact same configuration worked with SVN 16607 for me (same codecs, same TV card, everything the same). However, in the latest SVNs, it does not work anymore...
    I have "Prefer AC3" and "Prefer audiotype over language" selected. It makes no difference, if no or any language is selected.
     

    MPUserFromGER

    MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    /written by gibman/
    About the audio context menu. Well sometimes the visually indicated chosen audio track is the wrong one.
    but the audio track being sent to the filters is the right one. If u know what I mean.

    I am aware of this problem and will try and find a fix.

    But if u are saying that u have preferac3 enabled and the audio track selected for u automatically is mpeg -then there is a problem.
    Please bear in mind that ac3 is also ac3 stereo 2.0. U really need to run MP in windowed mode (alt-return)
    then tune a channel that is causing trouble for u - now use a directshow ac3 filter that gives u some information on the received audio stream. ac3filter and ffdaudio does this. This is the only way to acutally determine what audio is being sent.

    Also according to your log you have not specified any language preferences - this means when picking an ac3 track, that it simply picks the first one found regardless of language.

    but as I said, the visual indication in the list of audio tracks in the audio selection menu is often wrong ...sometimes it's the first audio track being selected, while in fact it is the 2nd audio track being used.

    I am using a receiver with optical SPDIF input. This receiver shows exactly which audio format is received.
    So I can clearly differentiate between:
    1. Stereo (MPEG)
    2. AC3 Dolby 2.0
    3. AC3 Dolby 5.1

    For issue #1, I am switching from a channel that is curently active and playing AC3 2.0 to another channel that has 3 audio streams (MPEG1, MPEG2, AC3 2.0). Now instead of selecting the AC3 2.0, one of the MPEG streams is selected. I know for sure that this new channel sends AC3 because with the SVN 16607 it worked like a charm.
    What I sometimes recognize is that after the channel change there is a very short high pitching noise and then the audio is there. I have observed this in earlier SVNs (months ago) but in the build up to 16607 this was never observed. With the latest changes, this is back again. I assume that this is the reason for not having AC3 sound... but this is just a guess.

    Please advise, what I can provide to help you solving this issue.
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    Lets combine the tv.log and mp.log for the sake of making it more understandable.

    You tune 3 channels.
    Prosieben, RTL and Das Erste.

    ------------------------
    ProSieben

    Client
    2007-12-19 22:14:35.625000 [Debug][MPMain]: TVHome.GetPreferedAudioStreamIndex(): preferred LANG(s): preferAC3:True preferAudioTypeOverLang:True
    2007-12-19 22:14:35.625000 [Debug][MPMain]: Audio streams avail: 2
    2007-12-19 22:14:35.625000 [Info.][MPMain]: Audio stream: switching to preferred AC3 audio stream 1, NOT based on LANG (none avail. matching )

    Client reports 2 found audio channels. It correctly chooses audio stream 1. Audio stream 0 is the first stream. So it's a zero based index!!

    Server
    2007-12-19 22:14:34.109375 [12]: subch:0 pid:200 audio lang:deu type:MPEG-2
    2007-12-19 22:14:34.109375 [12]: subch:0 map pid:200 audio lang:deu type:MPEG-2

    2007-12-19 22:14:34.109375 [12]: subch:0 pid:203 audio lang:deu type:AC3
    2007-12-19 22:14:34.109375 [12]: subch:0 map pid:203 audio lang:deu type:AC3

    2007-12-19 22:14:34.234375 [15]: subch:0 set timeshift 4:pid:200 audio lang:deu type:MPEG-2 (new add stream method (Mpeg2Audio))
    2007-12-19 22:14:34.250000 [15]: subch:0 set timeshift 129:pid:203 audio lang:deu type:AC3 (new add stream method (ac3))

    Server reports 2 found audio channels. nr 1 mpeg, and nr 2 ac3.

    conclusion; client finds and selects the right audio track.
    ------------------------
    RTL Television

    Client
    2007-12-19 22:15:03.390625 [Debug][MPMain]: TVHome.GetPreferedAudioStreamIndex(): preferred LANG(s): preferAC3:True preferAudioTypeOverLang:True
    2007-12-19 22:15:03.390625 [Debug][MPMain]: Audio streams avail: 2
    2007-12-19 22:15:03.390625 [Info.][MPMain]: Audio stream: switching to preferred AC3 audio stream 1, NOT based on LANG (none avail. matching )

    Client reports 2 found audio channels. It correctly chooses audio stream 1. Audio stream 0 is the first stream. So it's a zero based index!!

    Server
    2007-12-19 22:15:01.796875 [12]: subch:0 pid:68 audio lang: type:MPEG-2
    2007-12-19 22:15:01.796875 [12]: subch:0 map pid:68 audio lang: type:MPEG-2
    2007-12-19 22:15:01.812500 [12]: subch:0 pid:6A audio lang: type:AC3
    2007-12-19 22:15:01.812500 [12]: subch:0 map pid:6A audio lang: type:AC3

    2007-12-19 22:15:01.859375 [12]: subch:0 set timeshift 3:pid:68 audio lang: type:MPEG-2 (new add stream method (Mpeg1Audio))
    2007-12-19 22:15:01.890625 [12]: subch:0 set timeshift 129:pid:6A audio lang: type:AC3 (new add stream method (ac3))

    Server reports 2 found audio channels. nr 1 mpeg, and nr 2 ac3.

    conclusion; client finds and selects the right audio track.
    ------------------------
    Das Erste

    Client
    2007-12-19 22:38:22.187500 [Debug][MPMain]: TVHome.GetPreferedAudioStreamIndex(): preferred LANG(s): preferAC3:True preferAudioTypeOverLang:True
    2007-12-19 22:38:22.187500 [Debug][MPMain]: Audio streams avail: 3
    2007-12-19 22:38:22.187500 [Info.][MPMain]: Audio stream: switching to preferred AC3 audio stream 2, NOT based on LANG (none avail. matching )

    Client reports 3 found audio channels. It correctly chooses audio stream 2. Audio stream 0 is the first stream. So it's a zero based index!!

    Server
    2007-12-19 22:38:21.281250 [12]: subch:0 pid:66 audio lang: type:MPEG-2
    2007-12-19 22:38:21.281250 [12]: subch:0 map pid:66 audio lang: type:MPEG-2

    2007-12-19 22:38:21.281250 [12]: subch:0 pid:67 audio lang: type:MPEG-2
    2007-12-19 22:38:21.296875 [12]: subch:0 pid:819 type:5

    2007-12-19 22:38:21.296875 [12]: subch:0 pid:6A audio lang: type:AC3
    2007-12-19 22:38:21.296875 [12]: subch:0 map pid:6A audio lang: type:AC3

    2007-12-19 22:38:21.343750 [12]: subch:0 set timeshift 3:pid:66 audio lang: type:MPEG-2 (new add stream method (Mpeg1Audio))
    2007-12-19 22:38:21.359375 [12]: subch:0 set timeshift 3:pid:67 audio lang: type:MPEG-2 (new add stream method (Mpeg1Audio))
    2007-12-19 22:38:21.390625 [12]: subch:0 set timeshift 129:pid:6A audio lang: type:AC3 (new add stream method (ac3))

    Server reports 3 found audio channels. nr 1 mpeg, and nr 2 mpeg and nr 3 ac3.

    conclusion; client finds and selects the right audio track.

    Edit; try the attached core.dll


    /gibman
     

    MPUserFromGER

    MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    Hi gibman,

    thanks for the log analysis.
    So if I did get it right, the code seems to work correct. However, in fact the wrong audio is played... So I think the issue is somewhere after the "right" audio channel has been selected...

    I tried your new core.dll. Unfortunately, it did not make any difference from a users perspective but maybe you gain more info from the logs. What I did (should match the attached logs):
    - I used SVN 16673 from yesterday (MP, TV plugin and TV server)
    - I replaced the core.dll in MP root directory
    - I started MP
    - I selected LiveTV
    - I selected fullscreen
    - now, channel "Das Erste" is shown with AC3 2.0. Correct so far.
    - I pressed "7" on the remote to switch to channel "Pro 7". This channel always sends AC3 2.0 audio.
    - "Pro 7" is displayed correctly but MPEG-2 audio is played instead of AC3 :confused:
    - I pressed "1" to switch back to "Das Erste", which has been played with AC3 2.0 before (when I started TV)
    - "Das Erste" is shown but with MPEG-2 audio! Before, AC3 2.0 has been played. :mad:

    Please find attached the logs.

    As a side note: DVB-S radio is not working for me anymore with this SVN (worked okay with SVN 16607). It doesn't matter if old or new core.dll. So there is definitely a problem too. Do you want logs?
     

    MPUserFromGER

    MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    I have done some more testing and here are my results:

    1. With DScaler as audio decoder and Default WaveOut Device, it works as described before (sometimes, wrong audio is played). I made 2 screenshots of graph edit (see attached). What you can see is that in the bad case the DScaler has already the "wrong" audio at its input Pin (MPEG2_Audio).

    2. With DScaler and Default DirectSound Device, I do not get audio in TV at all! The picture is not moving (only updated every other second) and there is no audio at all.

    3. With Cyberlink Audio Decoder and Default DirectSound Device, there is audio again but when changing channels there are these horrible high pitching noises again.

    All 3 combinations have worked okay with SVN 16607.
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    On each channel change, the audio index value is written to registry.

    ex.

    [HKEY_CURRENT_USER\Software\MediaPortal\TsReader]
    "audioidx"=dword:00000002


    Could u try and have a look at this ?
    It should correspond with the audio index chosen by MP (tvplugin).

    tsreader.ax (the filter) now reads this value from registery upon channel change and sets the audio index as indicated there.

    So on each channel change a new value is written to registry.

    Run regedit and MP in windowed mode. This is easier.
    Remeber to refresh regedit each time u do a channel change.

    If the value is ok in registry, then something must be wrong in tsreader.
    Did u try and hook up vlcplayer to the timeshifted TS file ? And see how many audio tracks are reported along with type and language descriptions.

    Maybe it would be a good idea to join the IRC channel to speed things up.

    /gibman
     

    MPUserFromGER

    MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    Hi giman,

    ok here are the details out of the windows registry:
    - I started LiveTV as before with channel "Das Erste". AC3 2.0 is played correctly. The registry shows "audioidx=0x00000002", which is correct.
    - I switched to channel "Pro 7". Now MPEG-2 audio is played and the registry shows "audioidx=0x00000001". So that matched. The issue is that the audio menu within MP shows "1 Mpeg2:deu" and "2 AC3:deu". So why has not AC3 been choosen?
    - I switched back to "Das Erste". Now MPEG-2 audio is played (wrong!). The registry shows "audioidx=0x00000002". So this seems to be a TSReader issue!. Also, the audio menu shows "1 Mpeg2:deu", "2 Mpeg2:ch" and "3 AC3:dd" (AC3 is highlited!).

    So I think we have 2 issues here.

    Regarding VLCPlayer: I have never used it, so I would need some instructions here. Or do you want to have a TS file sample?

    EDIT:
    I played the corresponding TS file with PowerDVD and "Pro7" as well as "Das Erste" is played with MPEG-2 audio.
    EDIT
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    VLCplayer is good for troubleshooting in general.

    Install it ...then drag and drop the timeshifting file to the player ..it should start.
    look through the menus of vlcplayer, it should give u the possibility to change audio and subs..if avail.
    it also gives u current stream info ... what types the various audio tracks are, what languages etc.

    The audio track selection contet menu --- u cant currently rely on it showing the right audio track that is currently being used. I am aware of this problem. But this is only cometic for the time being.

    So perhaps it's tsreader failing to find the right audio track.

    if u look in tsreader.log for "read audioindex from registry : "
    here u have the values that are fetched from registry.

    edit;

    I took a short look on tsreader.log

    look at audio1+2 and audio3 (tsreader sees 3 tracks -this is good)
    but later on down u have "read audioindex from registry : 1"
    this is NOT good.
    Seems like the registry value is being written to late.

    19-12-2007 22:38:21.453 [810]New channel found
    19-12-2007 22:38:21.453 [810] video pid:30 type:2
    19-12-2007 22:38:21.453 [810] audio1 pid:40 type:4
    19-12-2007 22:38:21.453 [810] audio2 pid:41 type:4
    19-12-2007 22:38:21.453 [810] audio3 pid:42 type:81
    19-12-2007 22:38:21.453 [810] audio4 pid:0 type:0
    19-12-2007 22:38:21.453 [810] audio5 pid:0 type:0
    19-12-2007 22:38:21.453 [810] audio6 pid:0 type:0
    19-12-2007 22:38:21.453 [810] audio7 pid:0 type:0
    19-12-2007 22:38:21.453 [810] audio8 pid:0 type:0
    19-12-2007 22:38:21.453 [810] Pcr pid:30
    19-12-2007 22:38:21.453 [810] Pmt pid:20
    19-12-2007 22:38:21.453 [810] Subtitle pid:0
    19-12-2007 22:38:21.453 [810] Subtitle pid:0
    19-12-2007 22:38:21.453 [810] Subtitle pid:0
    19-12-2007 22:38:21.453 [810] Subtitle pid:0
    19-12-2007 22:38:21.453 [810]read audioindex from registry : 1
    19-12-2007 22:38:21.453 [810]Setting audio index : 1

    /gibman
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    Try tvplugin attached.

    remove the core.dll from before

    Also this new audio selection algo. is now used on tv recordings, when playing them back from tvhome that is.

    /gibman
     

    MPUserFromGER

    MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    /EDIT:
    This test is NOT with the plugin you provided! Have seen it just now!
    Will try your new plugin now.
    EDIT/


    Yes gibman, I think the registry is one problem. I repeated my test from earlier and compared TSReaderlog with the registry:

    I started LiveTV as before with channel "Das Erste". AC3 2.0 is played correctly. The registry shows "audioidx=0x00000002", which is correct. Also, TSReader log shows:
    Code:
    20-12-2007 16:10:20.828 [a04]read audioindex from registry : 2
    20-12-2007 16:10:20.828 [a04]Setting audio index : 2

    - I switched to channel "Pro 7". Now MPEG-2 audio is played and the registry shows "audioidx=0x00000001". So that matched. However, the weired thing is that TSReader lo shows:
    Code:
    20-12-2007 16:11:25.859 [8d0]read audioindex from registry : 2
    20-12-2007 16:11:25.859 [8d0]Setting audio index : 0
    So the real registry value differs from the value in the log. However, why dows the log says "read 2" but then "set 0"???

    - I switched back to "Das Erste". Now MPEG-2 audio is played (wrong!). The registry shows "audioidx=0x00000002". The TsReader log shows:
    Code:
    20-12-2007 16:12:32.500 [4f8]read audioindex from registry : 1
    20-12-2007 16:12:32.500 [4f8]Setting audio index : 1
    So here again the reg value differs from the log. However, the log is consistent this time ("read 1" and then "set 1").


    When I open the corresponding TS file with VLCPlayer, then I see the following:
    - For "Das Erste", which has been played correctly with AC3 2.0, the VLC player shows:
    a) Audio tracks: Track 1 - [deutsch], Track 2 - [ch], Track 3 - [dd]; Track 1 is selected
    b) Audio device: Mono, Stereo; Stereo is selected.
    If I change the audio track to Track 3, I still hear the normal stereo sound and my receiver still shows stereo and NOT AC3. However, the audio device menu has changed and shows now a new device "A/52 over S/PDIF". If I select this, my receiver shows "AC3 2.0". However, the audio is not fluent! It stutters a lot!

    - For "Pro 7" the VLC player shows:
    a) Audio tracks: Track 1 - [Deutsch], Track 3 - [Deutsch]; Track 1 is active.
    b) Audio device: same as before (Mono and Stereo)
    If I change the audio track to 3, the same happens as before (after also changing the audio device, I have a huge stuttering).

    - "Das Erste" (again, after switching back): VLC shows now difference than before (same audio tracks and devices).

    So very strange that there is such a huge stuttering...



    /EDIT
    Has been merged as double post :)
    EDIT/




    Hi gibman,

    the new TVPlugin.dll that you provided works now from a users perspective. In all the cases mentioned above, AC3 2.0 audio is now played. That's great news!

    However, the TsReader.log is still strange:
    Code:
    20-12-2007 16:41:45.421 [9c0]read audioindex from registry : 2
    --> Windows Registry shows 2 (ok)
    20-12-2007 16:41:45.421 [9c0]Setting audio index : 2
    
    20-12-2007 16:42:50.937 [ef8]read audioindex from registry : 2
    --> Windows Registry shows 1 (maybe ok because there are only 2 audio tracks)
    20-12-2007 16:42:50.937 [ef8]Setting audio index : 0
    
    20-12-2007 16:43:42.562 [648]read audioindex from registry : 1
    --> Windows Registry shows 2 (ok)
    20-12-2007 16:43:42.562 [648]Setting audio index : 1

    So Windows registry (might be ok), TsReader log (definitely not ok) and actual behaviour (ok!) do not fit together at all.

    Test result of plugin see above. The forum has merged the threads as double post...

    Test result of plugin see above. The forum has merged the threads as double post...

    ok, some more info:
    1. Channel changes from a channel, which has MPEG-2 audio only to a channel, which has MPEG-2 and AC3 audio still results in MPEG-2 audio instead of AC3

    2. Only the combination of DScaler with Direct WaveOut Device is working for me. Cyberlink Audio decoder and Direct Sound Device do not work properly. Why?
     

    Users who are viewing this thread

    Top Bottom