[fixed] [MP2-786] Cannot play audio playlist with >=1000 entries (1 Viewer)

Nikki Locke

Development Group
  • Team MediaPortal
  • February 2, 2019
    457
    59
    68
    United Kingdom United Kingdom
    Country flag
    MediaPortal 2 Version: 2.2

    Description
    I have reproduced the problem with VS2017 compiled current master branch (SHA-1: 11cc07571c5240288128e4dae4ce69b66085569c).

    I have created a playlist of all my music (4860 tracks altogether), but any attempt to play it results in the following exception in the log:

    [2019-02-06 17:36:00,342] [562187 ] [2 ] [ERROR] - ApplicationLauncher: Unhandled exception in application
    System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.AggregateException: One or more errors occurred. ---> UPnP.Infrastructure.CP.UPnPException: Error invoking action 'X_MediaPortal_LoadCustomPlaylist' ---> UPnP.Infrastructure.CP.UPnPRemoteException: Action Failed
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.AsyncActionCallResult.GetOutParams() in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 100
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.EndInvokeAction(IAsyncResult result) in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 316
    --- End of inner exception stack trace ---
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.EndInvokeAction(IAsyncResult result) in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 320
    at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
    at MediaPortal.Common.Services.ServerCommunication.UPnPContentDirectoryServiceProxy.<LoadCustomPlaylistAsync>d__48.MoveNext() in E:\MediaPortal-2\MediaPortal\Source\Core\MediaPortal.Common\Services\ServerCommunication\UPnPContentDirectoryServiceProxy.cs:line 501
    --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
    at System.Threading.Tasks.Task`1.get_Result()
    at MediaPortal.UiComponents.Media.Models.ManagePlaylistsModel.<>c__DisplayClass47_0.<LoadPlaylist>b__1(IList`1 itemIds)
    at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
    at MediaPortal.UiComponents.Media.Models.PlayItemsModel.<AsyncAddToPlaylist>d__46.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    at MediaPortal.UiComponents.Media.Models.PlayItemsModel.<>c__DisplayClass47_0.<<PlayOrEnqueueItemsInternal>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    at MediaPortal.UiComponents.Media.Models.PlayItemsModel.<PlayOrEnqueueItemsInternal>d__47.MoveNext()
    --- End of inner exception stack trace ---
    ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> UPnP.Infrastructure.CP.UPnPException: Error invoking action 'X_MediaPortal_LoadCustomPlaylist' ---> UPnP.Infrastructure.CP.UPnPRemoteException: Action Failed
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.AsyncActionCallResult.GetOutParams() in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 100
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.EndInvokeAction(IAsyncResult result) in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 316
    --- End of inner exception stack trace ---
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.EndInvokeAction(IAsyncResult result) in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 320
    at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
    at MediaPortal.Common.Services.ServerCommunication.UPnPContentDirectoryServiceProxy.<LoadCustomPlaylistAsync>d__48.MoveNext() in E:\MediaPortal-2\MediaPortal\Source\Core\MediaPortal.Common\Services\ServerCommunication\UPnPContentDirectoryServiceProxy.cs:line 501
    --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
    at System.Threading.Tasks.Task`1.get_Result()
    at MediaPortal.UiComponents.Media.Models.ManagePlaylistsModel.<>c__DisplayClass47_0.<LoadPlaylist>b__1(IList`1 itemIds)
    at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
    at MediaPortal.UiComponents.Media.Models.PlayItemsModel.<AsyncAddToPlaylist>d__46.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    at MediaPortal.UiComponents.Media.Models.PlayItemsModel.<>c__DisplayClass47_0.<<PlayOrEnqueueItemsInternal>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    at MediaPortal.UiComponents.Media.Models.PlayItemsModel.<PlayOrEnqueueItemsInternal>d__47.MoveNext()
    ---> (Inner Exception #0) UPnP.Infrastructure.CP.UPnPException: Error invoking action 'X_MediaPortal_LoadCustomPlaylist' ---> UPnP.Infrastructure.CP.UPnPRemoteException: Action Failed
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.AsyncActionCallResult.GetOutParams() in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 100
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.EndInvokeAction(IAsyncResult result) in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 316
    --- End of inner exception stack trace ---
    at UPnP.Infrastructure.CP.DeviceTree.CpAction.EndInvokeAction(IAsyncResult result) in E:\MediaPortal-2\MediaPortal\Source\Core\UPnP\Infrastructure\CP\DeviceTree\CpAction.cs:line 320
    at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
    at MediaPortal.Common.Services.ServerCommunication.UPnPContentDirectoryServiceProxy.<LoadCustomPlaylistAsync>d__48.MoveNext() in E:\MediaPortal-2\MediaPortal\Source\Core\MediaPortal.Common\Services\ServerCommunication\UPnPContentDirectoryServiceProxy.cs:line 501<---
    <---
    Steps to Reproduce:
    Have lots of music (I have 4680 tracks in my playlist, but I suspect anything over 1000 would do).

    Create a playlist with lots of tracks.

    Go to playlists and choose the playlist.

    Click Load playlist.

    Click Play audio items.

    Nothing is played, and the exception above appears in the log.
     

    Nikki Locke

    Development Group
  • Team MediaPortal
  • February 2, 2019
    457
    59
    68
    United Kingdom United Kingdom
    Country flag
    Note - I am happy to try to debug this further, and even fix it, but I don't really understand the way the clustering works, and where to put a breakpoint to find the error.
     

    HTPCSourcer

    MP2 Product Manager
  • Team MediaPortal
  • May 16, 2008
    11,431
    2,333
    Germany Germany
    Country flag
    @Nikki Locke , now I start getting annoyed:
    1. We cannot accept any bug report that is based on own builds
    2. I have absolutely no problem to play a 12000 track playlist on my system.
    Use the official release and things will work. If not, upload DEBUG logs.

    Marking as No Bug.
     
    Last edited:

    Nikki Locke

    Development Group
  • Team MediaPortal
  • February 2, 2019
    457
    59
    68
    United Kingdom United Kingdom
    Country flag
    It happens exactly the same with the official release - sorry I didn't mention that. I only compiled my own version to try to find out what was happening, but I got lost in a twisty maze of async remote function calls.

    Interesting that it works for you (with the official release, I assume?)

    I wonder what is wrong with my system?
     

    HTPCSourcer

    MP2 Product Manager
  • Team MediaPortal
  • May 16, 2008
    11,431
    2,333
    Germany Germany
    Country flag
    It happens exactly the same with the official release - sorry I didn't mention that.
    That would have avoided the annoyance at my side. Still, we won't be looking at custom builds in the bug section for obvious reasons.

    I wonder what is wrong with my system
    This is why we are asking for full Logs.

    At my side I can for example start with the artist view and select ''Add all to Playlist'. This adds my complete collection to the playlist, which then starts playing automatically. Does this work for you?
     

    Nikki Locke

    Development Group
  • Team MediaPortal
  • February 2, 2019
    457
    59
    68
    United Kingdom United Kingdom
    Country flag
    Herewith the logs. Steps used:
    Reboot machine.
    Go to Settings/System/Diagnostics/Enable DEBUG logging, and turn on
    Go to Audio/Audio/Playlists and select large playlist.
    Click Load playlist button. Rectangle (dialog) appears on screen saying "Adding items to playlist 0", then goes away again.
    Click Show audio playlist - it says <No items in playlist>
     

    Attachments

    Nikki Locke

    Development Group
  • Team MediaPortal
  • February 2, 2019
    457
    59
    68
    United Kingdom United Kingdom
    Country flag
    I guess the initial problem is at the server end:

    [ERROR] - Unable to query
    code = Error (1), message = System.Data.SQLite.SQLiteException (0x800007BF): SQL logic error
    too many SQL variables
    at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
    at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
    at System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index)
    at System.Data.SQLite.SQLiteDataReader.NextResult()
    at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
    at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
    at System.Data.SQLite.SQLiteCommand.ExecuteDbDataReader(CommandBehavior behavior)
    at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
    at MediaPortal.Backend.Services.MediaLibrary.QueryEngine.CompiledMediaItemQuery.GetMediaItems(ISQLDatabase database, ITransaction transaction, Boolean singleMode, IEnumerable`1 selectedMIAs, IList`1& mediaItemIds, IDictionary`2& complexMediaItems, Boolean forceSingleMIAMode)
    at MediaPortal.Backend.Services.MediaLibrary.QueryEngine.CompiledMediaItemQuery.Query(ISQLDatabase database, ITransaction transaction, Boolean singleMode)

    and the client end is not trapping and reporting the exception (except to the log) - but maybe that is working as designed, as an error message would not help most users.
     

    HTPCSourcer

    MP2 Product Manager
  • Team MediaPortal
  • May 16, 2008
    11,431
    2,333
    Germany Germany
    Country flag
    Can you please try this:
    At my side I can for example start with the artist view and select ''Add all to Playlist'. This adds my complete collection to the playlist, which then starts playing automatically. Does this work for you?
     

    Nikki Locke

    Development Group
  • Team MediaPortal
  • February 2, 2019
    457
    59
    68
    United Kingdom United Kingdom
    Country flag
    Sorry, I thought I had replied to that one.

    Yes, I can add all my music to the currently playing playlist, and that works fine.

    But if I save that playlist as a saved playlist, and try to load it again, that causes the exception at the server end (and creates an empty audio playlist at the client end, which shows as playing in the little icon at the top left of the screen, but obviously no music happens).
     

    HTPCSourcer

    MP2 Product Manager
  • Team MediaPortal
  • May 16, 2008
    11,431
    2,333
    Germany Germany
    Country flag
    Yes, I can add all my music to the currently playing playlist, and that works fine.
    Good. So at least this is working.

    But if I save that playlist as a saved playlist, and try to load it again, that causes the exception at the server end
    I'll try to reproduce this. You mentioned 1000+ tracks. Did you try with a small number, e.g. 20, 50, 100?
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    G [fixed] [MP2-786] Party Music Player can only play playlists with less than 1000 items 2.2 Archive 7
    mp2-ulrich [solved] MP 2.2.3 spielt nur manche Sender Allgemeines Support- und Diskussionsforum 2
    H MP2 database won't keep in synch with recordings General 8
    H [solved] MP2 Wiedergabe von Aufnahmen und Live TV geht nicht Allgemeines Support- und Diskussionsforum 6
    ge2301 [WiP] MP2Web - A platform independent web client for MP2 MediaPortal 2 68
    F Problems with new install of MP2 Newcomers Forum 3
    catalpa Bug MP2-837 Allgemeines Support- und Diskussionsforum 2
    P MP2: US user, OTA - can NOT get SchedulesDirect plugin to work on MP1 or MP2 --> how do I get OTA schedule? General 5
    bigboss97 Does anyone has a SoundGraph imon remote file for MP2 to share? General 0
    ge2301 Android based client for MP2 MediaPortal 2 3
    R MP2 GUI Issues General 7
    P [solved] MP2 new install, 2 x hdhomerun tuners, client on same PC unable to view TV & recordings Newcomers Forum 8
    Lichloathe MP2 importing keyart instead of poster General 0
    Lichloathe Trakt for MP2 question General 7
    C Streaming/transcoding MP2 vs MP1? General 4
    P MP 2 - Request to add an additional TV series Filename protocal Feature Requests 0
    C Streaming to clients over Wifi. MP1 or MP2? Newcomers Forum 0
    CyberSimian MP2 synchronising of stoptime MediaPortal 1 Talk 5
    M Initial Setup MP2 (On Wndows 10) General 2
    R [solved] MP2 Client ist extrem langsam Allgemeines Support- und Diskussionsforum 5
    D [solved] EPG Buddy for MP2 - Does it work? General 5
    T Amazon und Netflix in MP2 - Wie? Allgemeines Support- und Diskussionsforum 6
    J [solved] How to in MP2 General 19
    M [fixed] [MP2-831] 12h time format shown in TV Guide with Swedish language settings Submit: Bug Reports 27
    Volker MP2 Rewind / zurückspulen bei Live TV funktioniert nicht Allgemeines Support- und Diskussionsforum 3
    Similar threads

























    Top Bottom