[mythtv-users] 0.26 -> 0.27 UPnP Failure?

John Pilkington J.Pilk at tesco.net
Wed Nov 4 23:32:08 UTC 2015


On 04/11/15 22:03, Nigel Jewell wrote:
> On 07/10/2013 12:55, Nicolas Riendeau wrote:
>> Hi!
>>
>> On 2013-10-07 7:10 AM, John Pilkington wrote:
>>> On 06/10/13 20:43, Nigel Jewell wrote:
>>>> On 06/10/2013 20:20, Bill Meek wrote:
>>>>> You could try running:
>>>>>
>>>>>     mythbackend --setverbose upnp
>>>>
>>>> Thanks for this Bill.  It got me a little closer.  I've just got to
>>>> work
>>>> out what is causing the 404s I guess.
>>
>> A MythTV dev, Stuart Morgan, analyzed the communication and found out
>> it was caused by improper commands sent by VLC (actually libupnp which
>> they use).
>>
>>>>
>>>> 2013-10-06 20:41:14.713689 I [1316/15251] HttpServer120
>>>> httprequest.cpp:1366 (ExtractMethodFromURL) - ExtractMethodFromURL(end)
>>>> : getDeviceDesc : /
>>
>> This is OK.
>>
>>>> 2013-10-06 20:41:14.723720 I [1316/15251] HttpServer120
>>>> httprequest.cpp:1366 (ExtractMethodFromURL) - ExtractMethodFromURL(end)
>>>> : CDS_EventDesc : /
>>
>> This is not...
>>
>>>> httpserver.cpp:185 (DelegateRequest) - m_sBaseUrl: /CDS_Controlsc
>>>> 2013-10-06 20:41:14.733150 I [1316/15252] HttpServer120
>>>> httprequest.cpp:764 (FormatFileResponse) -
>>>> HTTPRequest::FormatFileResponse() - cannot find file
>>
>> And neither is this....
>>
>> Neither CDS_EventDesc nor CDS_Controlsc are acceptable, it's supposed
>> to be CDS_Event and CDS_Control.
>>
>> Now let's put them one over the other:
>>
>> GetDeviceDesc
>> CDS_EventDesc
>> CDS_Controlsc
>>
>> They are sending the last characters of the previous one which
>> corrupts them (either because they haven't cleared their buffer
>> properly or are always sending the same numbers of characters not
>> taking into account that they are not all of the same length).
>>
>>> vlc versions have changed too, of course.
>>
>> and this is where problem comes from...
>>
>> I do believe Stuart intends to report this to the libupnp guys... When
>> will it be fixed in VLC, I have no idea...
>
> It seems that the fix was investigated by the Portable UPnP team
> (http://sourceforge.net/p/pupnp/mailman/message/32290824/) but hasn't
> yet made it into VLC.  Rather than wait any longer I've created a small
> patch (i.e. big fudge) for MythTV 0.27 that works around this.  Posting
> below in case it carries any value for anyone else (complete with over
> zealous debugging).
>
> Using this patch combined with disabling the firewall on my Mac (OS X
> 10.11) I've been able to consistently playback recorded programs and
> videos without issues for a while now.
>
> Kind Regards,
> Nige
>
> --- a/mythtv/libs/libmythupnp/httprequest.cpp
> +++ b/mythtv/libs/libmythupnp/httprequest.cpp
> @@ -1211,6 +1211,22 @@ void HTTPRequest::ProcessRequestLine( const
> QString &sLine )
>               m_sBaseUrl = (QUrl::fromPercentEncoding(tokens[1].toUtf8()))
>                                 .section( '?', 0, 0).trimmed();
>
> +            // Experimental hack for Portable SDK for UPnP
> devices/1.6.19 in VLC
> +            if (m_sBaseUrl.compare("/CDS_Controlsc") == 0)
> +            {
> +                LOG(VB_UPNP, LOG_DEBUG, QString("BaseUrl <-
> %1").arg(m_sBaseUrl));
> +                m_sBaseUrl = "/CDS_Control";
> +                LOG(VB_UPNP, LOG_DEBUG, QString("BaseUrl ->
> %1").arg(m_sBaseUrl));
> +            }
> +            else if (m_sBaseUrl.compare("/CDS_EventDesc") == 0)
> +            {
> +                LOG(VB_UPNP, LOG_DEBUG, QString("BaseUrl <-
> %1").arg(m_sBaseUrl));
> +                m_sBaseUrl = "/CDS_Event";
> +                LOG(VB_UPNP, LOG_DEBUG, QString("BaseUrl ->
> %1").arg(m_sBaseUrl));
> +            }
> +            else
> +                LOG(VB_UPNP, LOG_DEBUG, QString("BaseUrl ==
> %1").arg(m_sBaseUrl));
> +
>               m_sResourceUrl = m_sBaseUrl; // Save complete url without
> parameters
>
>               // Process any Query String Parameters
> @@ -1358,6 +1374,16 @@ void HTTPRequest::ExtractMethodFromURL()
>       {
>           m_sMethod = sList.last();
>           sList.pop_back();
> +
> +        // Experimental hack for Portable SDK for UPnP devices/1.6.19
> in VLC
> +        if (m_sMethod.compare("CDS_EventDesc") == 0)
> +        {
> +            LOG(VB_UPNP, LOG_DEBUG, QString("Method <-
> %1").arg(m_sMethod));
> +            m_sMethod = "CDS_Event";
> +            LOG(VB_UPNP, LOG_DEBUG, QString("Method ->
> %1").arg(m_sMethod));
> +        }
> +        else
> +            LOG(VB_UPNP, LOG_DEBUG, QString("Method ==
> %1").arg(m_sMethod));
>       }
>
>       m_sBaseUrl = '/' + sList.join( "/" );

=============

For clarification, I understand that this is a patch-to-MythTV to make 
VLC play content from a patched MythTV server?

My Panasonic TV has done a pretty good job with MythTV content from 
0.28-pre since around Nov 2014, and with 0.27.4 from rpmfusion.  IIRC, 
StuartM has said that the VLC implementation of UPnP is 'completely 
broken' and that VLC appear to have no interest in changing it.

John P





More information about the mythtv-users mailing list