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

Nikki Locke

Portal Pro
February 2, 2019
459
59
69
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

Portal Pro
February 2, 2019
459
59
69
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

Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,431
    2,334
    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

    Portal Pro
    February 2, 2019
    459
    59
    69
    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

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,431
    2,334
    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

    Portal Pro
    February 2, 2019
    459
    59
    69
    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

    Portal Pro
    February 2, 2019
    459
    59
    69
    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

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,431
    2,334
    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

    Portal Pro
    February 2, 2019
    459
    59
    69
    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

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,431
    2,334
    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

    Similar threads
    OP Title Forum Replies Date
    G [fixed] [MP2-786] Party Music Player can only play playlists with less than 1000 items 2.2 Archive 7
    porky996t Outdated Tuning Parameters in MP2 TVServer Config TV-Server 0
    B IRSS shows button presses, nothing happening out-of-the-box in MP2 Newcomers Forum 1
    D MP2 DLNA status? General 10
    N [solved] MP2 TV-Server DD cine 2 V6, Astra keine deutschen Sender mehr General 4
    H MP2 - V2.4 [MP2-855] Extend Nereus HomeMenuEditor to allow configuration of HomeContent features MediaPortal 2 4
    M MP2 - V2.3 MP2 & USB Problems Submit: Bug Reports 43
    L MP2 - V2.3 Troubles upgrading from MP2 2.2.3 to 2.3 General 0
    T MP2 - V2.3 MP2 x64 won't run Submit: Bug Reports 5
    J Copying Old VHS tapes Newcomers Forum 8
    W MP2 - V2.3 MP2 2.3 Import von Audioquellen / Datenbankprobleme Allgemeines Support- und Diskussionsforum 26
    G MP2 - V2.3 New install and crashing MP2-2.3 General 6
    S MP2 - V2.3 MP2 No video General 6
    W [solved] MP2 Server stürzt immer nach kurzer Zeit ab Allgemeines Support- und Diskussionsforum 89
    toricred MP2 - V2.3 MP2 2.3 Client won't start General 7
    Grisu002 MP2 - V2.3 MP2 2.3 Client startet nicht - bleibt beim Laden hängen Allgemeines Support- und Diskussionsforum 64
    M [solved] MP2 PROBLEME Standby Allgemeines Support- und Diskussionsforum 2
    Scheibes Was passiert bei MP2? Allgemeines Support- und Diskussionsforum 42
    S Programmierte Aufnahme in MP2 - kein Aufwachen des PC Allgemeines Support- und Diskussionsforum 5
    morpheus_xx [Finished] "What's New" plugin for MP2 upgrades MediaPortal 2 20
    da3dsoul [Request] An MVP Plugin example for custom settings in MP2 Plugin Development 2
    morpheus_xx MP2 - V2.4 Porting MP2 to .Net (Core) 5 MediaPortal 2 47
    da3dsoul Does MP2 not have any active devs? General 8
    da3dsoul MP2 Plugin - Getting Started (Directory Tree and Player) Plugin Development 27
    rainbowforest [solved] Kein Player registriert Allgemeines Support- und Diskussionsforum 1

    Similar threads

    Top Bottom