Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CpProxyAvOpenhomeOrgInfo1 problems
01-05-2013, 06:29 PM
Post: #1
CpProxyAvOpenhomeOrgInfo1 problems
Hi,

First of all thanks for all the help you gave me whilst I was developing my Java MediaRenderer. I now have it working.

My next project isto build another Java app, this time it would subscribe to the Info service of the MediaRenderer to receive any notifications when the playing track changes. The idea is that it will then display the cover art and perform web searches for lyrics/band information.

I have modified the TestProxy application but am having some problems. It fails if I subscribe to the Info service, but if I use DeviceSpy to subscribe to my MediaRenderer it works, also if I use my modified TestProxy to subscribe for another MediaRenderer (dbPowerAmp Rennassance) Info service that works. If I use TestProxy to subscribe for the Volume or Time service to my Java MediaRenderer that also works...

Again could it be something stupid I have done..

Looking at the logs :

My Test Proxy subscribes to Java MediaRenderer (no track playing)

Quote:Subscribing - service = urn:av-openhome-org:service:Info:1
subscriber = http://192.168.1.66:50795/
Subscription for urn:av-openhome-org:service:Info:1 completed
Sid is device-Eclipse-D067E5492684-MediaRenderer-9
Renew in 1800 secs
EventSessionUpnp::Run, sid - device-Eclipse-D067E5492684-MediaRenderer-9 seq - 0

In the MediaRenderer I see the subscription

Quote:2013-05-01 19:08:23,210 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] Method:
2013-05-01 19:08:23,210 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] GET
2013-05-01 19:08:23,210 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] , uri:
2013-05-01 19:08:23,210 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] /device-Eclipse-D067E5492684-MediaRenderer/Upnp/device.xml
2013-05-01 19:08:23,210 [Thread-8] INFO [org.rpi.main.OpenHomeLogger]

2013-05-01 19:08:23,291 [Thread-6] INFO [org.rpi.main.OpenHomeLogger] Method:
2013-05-01 19:08:23,291 [Thread-6] INFO [org.rpi.main.OpenHomeLogger] SUBSCRIBE
2013-05-01 19:08:23,291 [Thread-6] INFO [org.rpi.main.OpenHomeLogger] , uri:
2013-05-01 19:08:23,291 [Thread-6] INFO [org.rpi.main.OpenHomeLogger] /device-Eclipse-D067E5492684-MediaRenderer/av.openhome.org-Info-1/event
2013-05-01 19:08:23,291 [Thread-6] INFO [org.rpi.main.OpenHomeLogger]

All is stable until I start a track playing and the info service updates.

Then in the TestProxy I see the following messages over and over again

Quote:EventSessionUpnp::Run, ReaderError handling
sid - device-Eclipse-D067E5492684-MediaRenderer-1985 seq - 0
Unsubscribing sid device-Eclipse-D067E5492684-MediaRenderer-1985
Unsubscribed sid device-Eclipse-D067E5492684-MediaRenderer-1985
Subscribing - service = urn:av-openhome-org:service:Info:1
subscriber = http://192.168.1.66:50795/
Subscription for urn:av-openhome-org:service:Info:1 completed
Sid is device-Eclipse-D067E5492684-MediaRenderer-1986
Renew in 1800 secs
EventSessionUpnp::Run, ReaderError handling
sid - device-Eclipse-D067E5492684-MediaRenderer-1986 seq - 0
Unsubscribing sid device-Eclipse-D067E5492684-MediaRenderer-1986
Unsubscribed sid device-Eclipse-D067E5492684-MediaRenderer-1986
Subscribing - service = urn:av-openhome-org:service:Info:1
subscriber = http://192.168.1.66:50795/
Subscription for urn:av-openhome-org:service:Info:1 completed
Sid is device-Eclipse-D067E5492684-MediaRenderer-1987
Renew in 1800 secs
EventSessionUpnp::Run, ReaderError handling
sid - device-Eclipse-D067E5492684-MediaRenderer-1987 seq - 0
Unsubscribing sid device-Eclipse-D067E5492684-MediaRenderer-1987
Unsubscribed sid device-Eclipse-D067E5492684-MediaRenderer-1987
Subscribing - service = urn:av-openhome-org:service:Info:1
subscriber = http://192.168.1.66:50795/
Subscription for urn:av-openhome-org:service:Info:1 completed
Sid is device-Eclipse-D067E5492684-MediaRenderer-1988
Renew in 1800 secs

In the MediaRenderer I see the subscription being unsubscribed and then resubscribed..

Quote:2013-05-01 19:10:09,757 [Thread-9] INFO [org.rpi.main.OpenHomeLogger] Method:
2013-05-01 19:10:09,757 [Thread-9] INFO [org.rpi.main.OpenHomeLogger] UNSUBSCRIBE
2013-05-01 19:10:09,757 [Thread-9] INFO [org.rpi.main.OpenHomeLogger] , uri:
2013-05-01 19:10:09,757 [Thread-9] INFO [org.rpi.main.OpenHomeLogger] /device-Eclipse-D067E5492684-MediaRenderer/av.openhome.org-Info-1/event
2013-05-01 19:10:09,757 [Thread-9] INFO [org.rpi.main.OpenHomeLogger]

2013-05-01 19:10:09,758 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] Method:
2013-05-01 19:10:09,758 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] SUBSCRIBE
2013-05-01 19:10:09,758 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] , uri:
2013-05-01 19:10:09,758 [Thread-8] INFO [org.rpi.main.OpenHomeLogger] /device-Eclipse-D067E5492684-MediaRenderer/av.openhome.org-Info-1/event
2013-05-01 19:10:09,758 [Thread-8] INFO [org.rpi.main.OpenHomeLogger]

The code for the TestProxy is just a quick test but it works for Time and Volume and it also works for other MediaRenderers which made me wonder is there was an issue between the CpProxyAVOpenhomeOrgInfo1 and the DvProviderAvOpenhomeOrgInfo1 classes.

A snippet of the code is below, it's a bit crude but I was trying to keep it as simple as possible..

Code:
    public void deviceAdded(CpDevice aDevice) {
        CpAttribute name = aDevice.getAttribute("Upnp.FriendlyName");
        System.out.println("DeviceAdded: " + aDevice.getUdn() + " Name: " + name.getValue());
        if(name.getValue().equals("Eclipse")){
            //subscribeToVolume(aDevice);
            subscribeToInfo(aDevice);
        }
    }
    
    private void subscribeToVolume(CpDevice aDevice)
    {
        CpProxyAvOpenhomeOrgVolume1 volume = new CpProxyAvOpenhomeOrgVolume1(aDevice);
        volume.setPropertyChanged(this);
        volume.subscribe();
    }
    
    private void subscribeToInfo(CpDevice aDevice)
    {
        info = new CpProxyAvOpenhomeOrgInfo1(aDevice);
        info.setPropertyChanged(this);
        info.subscribe();
        System.out.println("Subscribed for Info Changes");
    }
    
    public void notifyChange() {
        System.out.println("SomeThing Changed");
    }

Thanks again,

Pete.
Find all posts by this user
02-05-2013, 09:02 AM
Post: #2
RE: CpProxyAvOpenhomeOrgInfo1 problems
(01-05-2013 06:29 PM)PeteManchester Wrote:  The code for the TestProxy is just a quick test but it works for Time and Volume and it also works for other MediaRenderers which made me wonder is there was an issue between the CpProxyAVOpenhomeOrgInfo1 and the DvProviderAvOpenhomeOrgInfo1 classes.

A control point will try resubscribing (unsubscribe followed immediately by a new subscribe) if a proxy's properties get into an inconsistent state. The most common (only?) such states are
  • An event being set to a value not allowed by the service xml
  • Not all evented state variables being updated by the initial event
There are no limits on the Info service state variables so the first issue shouldn't be relevant here. How about the second one? Is there any chance you haven't enabled or set initial values for all 12 properties in your provider's constructor?
Find all posts by this user
02-05-2013, 10:51 AM
Post: #3
RE: CpProxyAvOpenhomeOrgInfo1 problems
Hi Simon,

I seem to have all 12 variables declared..

I forgot to mention that as well as working with DeviceSpy the Info service also works with Kinsky.



Code:
    public PrvInfo(DvDevice iDevice) {
        super(iDevice);
        log.debug("Creating Info");

        enablePropertyTrackCount();
        enablePropertyDetailsCount();
        enablePropertyMetatextCount();
        enablePropertyUri();
        enablePropertyMetadata();
        enablePropertyDuration();
        enablePropertyBitRate();
        enablePropertyBitDepth();
        enablePropertySampleRate();
        enablePropertyLossless();
        enablePropertyCodecName();
        enablePropertyMetatext();

        setPropertyTrackCount(0);
        setPropertyDetailsCount(0);
        setPropertyMetatextCount(0);
        setPropertyUri("");
        setPropertyMetadata("");
        setPropertyDuration(0);
        setPropertyBitRate(0);
        setPropertyBitDepth(0);
        setPropertySampleRate(0);
        setPropertyLossless(false);
        setPropertyCodecName("");
        setPropertyMetatext("");

        enableActionCounters();
        enableActionTrack();
        enableActionDetails();
        enableActionMetatext();
    }
Find all posts by this user
02-05-2013, 04:33 PM
Post: #4
RE: CpProxyAvOpenhomeOrgInfo1 problems
(02-05-2013 10:51 AM)PeteManchester Wrote:  Hi Simon,

I seem to have all 12 variables declared..

I forgot to mention that as well as working with DeviceSpy the Info service also works with Kinsky.

Thanks for the extra detail Pete.

While its good to know that your device works against other control points, DeviceSpy is pretty lax in its subscription handling and Kinsky is much more forgiving of bad input than ohNet so having them working doesn't completely rule out device-side errors I'm afraid.

I tried to reproduce the problem using a simple C# app (below). This seems to subscribe successfully to an Info service provider. Can you update this test (or provider a Java equivalent) that demonstrates your problem please? I'm not sure what else I'll be able to do without being able to reproduce your problem.

Code:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Diagnostics;
using OpenHome.Net.Core;
using OpenHome.Net.ControlPoint;
using OpenHome.Net.Device;
using OpenHome.Net.Device.Providers;
using OpenHome.Net.ControlPoint.Proxies;

namespace OpenHome.Net.Device
{
    class Program
    {
        public static void Main(string[] args)
        {
            InitParams initParams = new InitParams
            {
                MsearchTimeSecs = 1,
                UseLoopbackNetworkAdapter = true,
            };
            using (Library lib = Library.Create(initParams))
            {
                SubnetList subnetList = new SubnetList();
                NetworkAdapter nif = subnetList.SubnetAt(0);
                uint subnet = nif.Subnet();
                subnetList.Dispose();
                lib.StartCombined(subnet);
                new Runner();
            }
        }
    }

    class Runner
    {
        private List<CpDevice> iDeviceList;
        static private string kUdn = "TestInfoCs";

        public Runner()
        {
            Console.Write("TestInfoCs - starting\n");

            DvDevice device = new DvDeviceStandard(kUdn);
            device.SetAttribute("Upnp.Domain", "openhome.org");
            device.SetAttribute("Upnp.Type", "Test");
            device.SetAttribute("Upnp.Version", "1");
            device.SetAttribute("Upnp.FriendlyName", "ohNetTestDevice");
            device.SetAttribute("Upnp.Manufacturer", "None");
            device.SetAttribute("Upnp.ModelName", "ohNet test device");
            ProviderInfo provider = new ProviderInfo(device);
            device.SetEnabled();
            
            iDeviceList = new List<CpDevice>();
            CpDeviceList.ChangeHandler added = new CpDeviceList.ChangeHandler(DeviceAdded);
            CpDeviceList.ChangeHandler removed = new CpDeviceList.ChangeHandler(DeviceRemoved);
            CpDeviceListUpnpServiceType list = new CpDeviceListUpnpServiceType("av.openhome.org", "Info", 1, added, removed);
            Semaphore sem = new Semaphore(0, 1);
            sem.WaitOne(1000);
            Debug.Assert(iDeviceList.Count == 1);
            
            CpProxyAvOpenhomeOrgInfo1 proxy = new CpProxyAvOpenhomeOrgInfo1(iDeviceList[0]);
            proxy.SetPropertyInitialEvent(() => sem.Release());
            proxy.Subscribe();
            sem.WaitOne();
            Console.WriteLine("Subscribe completed - sampleRate={0}", proxy.PropertySampleRate());

            proxy.Dispose();
            list.Dispose();
            lock (this)
            {
                for (int i = 0; i < iDeviceList.Count; i++)
                {
                    iDeviceList[i].RemoveRef();
                }
            }
            device.Dispose();
            provider.Dispose();

            Console.Write("TestInfoCs - completed\n");
        }

        private void DeviceAdded(CpDeviceList aList, CpDevice aDevice)
        {
            lock (this)
            {
                if (iDeviceList.Count == 0 && aDevice.Udn() == kUdn)
                {
                    aDevice.AddRef();
                    iDeviceList.Add(aDevice);
                }
            }
        }

        private void DeviceRemoved(CpDeviceList aList, CpDevice aDevice)
        {
        }
    }

    class ProviderInfo : DvProviderAvOpenhomeOrgInfo1
    {
        public ProviderInfo(DvDevice aDevice)
            : base(aDevice)
        {
            EnablePropertyTrackCount();
            EnablePropertyDetailsCount();
            EnablePropertyMetatextCount();
            EnablePropertyUri();
            EnablePropertyMetadata();
            EnablePropertyDuration();
            EnablePropertyBitRate();
            EnablePropertyBitDepth();
            EnablePropertySampleRate();
            EnablePropertyLossless();
            EnablePropertyCodecName();
            EnablePropertyMetatext();

            SetPropertyTrackCount(0);
            SetPropertyDetailsCount(0);
            SetPropertyMetatextCount(0);
            SetPropertyUri("");
            SetPropertyMetadata("");
            SetPropertyDuration(0);
            SetPropertyBitRate(0);
            SetPropertyBitDepth(0);
            SetPropertySampleRate(0);
            SetPropertyLossless(false);
            SetPropertyCodecName("");
            SetPropertyMetatext("");
        }
    }
}
Find all posts by this user
03-05-2013, 08:33 AM
Post: #5
RE: CpProxyAvOpenhomeOrgInfo1 problems
Hi Simon,

That was a big help thanks, it looks like I need to trim down my metadata to just the relevant information, to me it looks like there is a limit on the length of the String..

I modified the code below as a test and it seems as though it breaks when with the metadata is too long..

Code:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Diagnostics;
using OpenHome.Net.Core;
using OpenHome.Net.ControlPoint;
using OpenHome.Net.Device;
using OpenHome.Net.Device.Providers;
using OpenHome.Net.ControlPoint.Proxies;

namespace OpenHome.Net.Device
{
    class Program
    {
        public static void Main(string[] args)
        {
            InitParams initParams = new InitParams
            {
                MsearchTimeSecs = 1,
                UseLoopbackNetworkAdapter = true,
            };
            using (Library lib = Library.Create(initParams))
            {
                SubnetList subnetList = new SubnetList();
                NetworkAdapter nif = subnetList.SubnetAt(0);
                uint subnet = nif.Subnet();
                subnetList.Dispose();
                lib.StartCombined(subnet);
                new Runner();
            }
        }
    }

    class Runner
    {
        private List<CpDevice> iDeviceList;
        static private string kUdn = "TestInfoCs";

        public Runner()
        {
            Console.Write("TestInfoCs - starting\n");

            DvDevice device = new DvDeviceStandard(kUdn);
            device.SetAttribute("Upnp.Domain", "openhome.org");
            device.SetAttribute("Upnp.Type", "Test");
            device.SetAttribute("Upnp.Version", "1");
            device.SetAttribute("Upnp.FriendlyName", "ohNetTestDevice");
            device.SetAttribute("Upnp.Manufacturer", "None");
            device.SetAttribute("Upnp.ModelName", "ohNet test device");
            ProviderInfo provider = new ProviderInfo(device);
            device.SetEnabled();

            iDeviceList = new List<CpDevice>();
            CpDeviceList.ChangeHandler added = new CpDeviceList.ChangeHandler(DeviceAdded);
            CpDeviceList.ChangeHandler removed = new CpDeviceList.ChangeHandler(DeviceRemoved);
            CpDeviceListUpnpServiceType list = new CpDeviceListUpnpServiceType("av.openhome.org", "Info", 1, added, removed);
            Semaphore sem = new Semaphore(0, 1);
            sem.WaitOne(1000);
            Debug.Assert(iDeviceList.Count == 1);

            CpProxyAvOpenhomeOrgInfo1 proxy = new CpProxyAvOpenhomeOrgInfo1(iDeviceList[0]);
            proxy.SetPropertyInitialEvent(() => sem.Release());
            proxy.Subscribe();
            sem.WaitOne();
            Console.WriteLine("Subscribe completed - sampleRate={0}", proxy.PropertyMetadata());

            proxy.Dispose();
            list.Dispose();
            lock (this)
            {
                for (int i = 0; i < iDeviceList.Count; i++)
                {
                    iDeviceList[i].RemoveRef();
                }
            }
            device.Dispose();
            provider.Dispose();

            Console.Write("TestInfoCs - completed\n");
        }

        private void DeviceAdded(CpDeviceList aList, CpDevice aDevice)
        {
            lock (this)
            {
                if (iDeviceList.Count == 0 && aDevice.Udn() == kUdn)
                {
                    aDevice.AddRef();
                    iDeviceList.Add(aDevice);
                }
            }
        }

        private void DeviceRemoved(CpDeviceList aList, CpDevice aDevice)
        {
        }
    }

    class ProviderInfo : DvProviderAvOpenhomeOrgInfo1
    {
        public ProviderInfo(DvDevice aDevice)
            : base(aDevice)
        {
            EnablePropertyTrackCount();
            EnablePropertyDetailsCount();
            EnablePropertyMetatextCount();
            EnablePropertyUri();
            
            EnablePropertyMetadata();
            EnablePropertyDuration();
            EnablePropertyBitRate();
            EnablePropertyBitDepth();
            EnablePropertySampleRate();
            EnablePropertyLossless();
            EnablePropertyCodecName();
            EnablePropertyMetatext();

            SetPropertyTrackCount(0);
            SetPropertyDetailsCount(0);
            SetPropertyMetatextCount(0);
            SetPropertyUri("");

            //string meta_data = "<DIDL-Lite xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/\"><item id=\"d73430-co1811\" parentID=\"co1811\" restricted=\"0\"><dc:title xmlns:dc=\"http://purl.org/dc/elements/1.1/\"> 1.   Digital</dc:title><dc:creator xmlns:dc=\"http://purl.org/dc/elements/1.1/\">Joy Division</dc:creator><dc:date xmlns:dc=\"http://purl.org/dc/elements/1.1/\">1998-01-01</dc:date><upnp:artist role=\"AlbumArtist\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Joy Division</upnp:artist><upnp:artist role=\"Composer\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Ian Curtis</upnp:artist><upnp:artist role=\"Composer\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Peter Hook</upnp:artist><upnp:artist role=\"Composer\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Stephen Morris</upnp:artist><upnp:artist role=\"Composer\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Bernard Sumner</upnp:artist><upnp:artist role=\"Performer\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Joy Division</upnp:artist><upnp:album xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Heart and Soul</upnp:album><upnp:genre xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">Pop/Rock</upnp:genre><upnp:albumArtURI dlna:profileID=\"JPEG_TN\" xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">http://192.168.1.205:26125/aa/157341/656268630/cover.jpg?size=0</upnp:albumArtURI><upnp:originalTrackNumber xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">1</upnp:originalTrackNumber><upnp:originalDiscNumber xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">1</upnp:originalDiscNumber><upnp:originalDiscCount xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">4</upnp:originalDiscCount><res duration=\"0:02:52.000\" size=\"30430100\" bitrate=\"176400\" bitsPerSample=\"16\" sampleFrequency=\"44100\" nrAudioChannels=\"2\" protocolInfo=\"http-get:*:audio/wav:DLNA.ORG_PN=WAV;DLNA.ORG_OP=01\">http://192.168.1.205:26125/content/c2/b16/f44100/d73430-co1811.forced.wav</res><upnp:class xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\">object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite>";
            //string meta_data = "http://purl.org/dc/elements/1.1/";
            //string meta_data = "<DIDL-Lite xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/\"> </DIDL-Lite>";
            //string meta_data = "<DIDL-Lite xmlns='urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/'><item id='d73430-co1811' parentID='co1811' restricted='0'><dc:title xmlns:dc='http://purl.org/dc/elements/1.1/'> 1.   Digital</dc:title><dc:creator xmlns:dc='http://purl.org/dc/elements/1.1/'>Joy Division</dc:creator><dc:date xmlns:dc='http://purl.org/dc/elements/1.1/'>1998-01-01</dc:date><upnp:artist role='AlbumArtist' xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Joy Division</upnp:artist><upnp:artist role='Composer' xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Ian Curtis</upnp:artist><upnp:artist role='Composer' xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Peter Hook</upnp:artist><upnp:artist role='Composer' xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Stephen Morris</upnp:artist><upnp:artist role='Composer' xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Bernard Sumner</upnp:artist><upnp:artist role='Performer' xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Joy Division</upnp:artist><upnp:album xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Heart and Soul</upnp:album><upnp:genre xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>Pop/Rock</upnp:genre><upnp:albumArtURI dlna:profileID='JPEG_TN' xmlns:dlna='urn:schemas-dlna-org:metadata-1-0/' xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>http://192.168.1.205:26125/aa/157341/656268630/cover.jpg?size=0</upnp:albumArtURI><upnp:originalTrackNumber xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>1</upnp:originalTrackNumber><upnp:originalDiscNumber xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>1</upnp:originalDiscNumber><upnp:originalDiscCount xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>4</upnp:originalDiscCount><res duration='0:02:52.000' size='30430100' bitrate='176400' bitsPerSample='16' sampleFrequency='44100' nrAudioChannels='2' protocolInfo='http-get:*:audio/wav:DLNA.ORG_PN=WAV;DLNA.ORG_OP=01'>http://192.168.1.205:26125/content/c2/b16/f44100/d73430-co1811.forced.wav</res><upnp:class xmlns:upnp='urn:schemas-upnp-org:metadata-1-0/upnp/'>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite>";
            string meta_data = "ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss​ssssssssssssssssssssssssssssssssssssssssssssssss";
            SetPropertyMetadata(meta_data);
            SetPropertyDuration(0);
            SetPropertyBitRate(0);
            SetPropertyBitDepth(0);
            SetPropertySampleRate(0);
            SetPropertyLossless(false);
            SetPropertyCodecName("");
            SetPropertyMetatext("");
        }
    }
}
Find all posts by this user
03-05-2013, 08:55 AM
Post: #6
RE: CpProxyAvOpenhomeOrgInfo1 problems
(03-05-2013 08:33 AM)PeteManchester Wrote:  That was a big help thanks, it looks like I need to trim down my metadata to just the relevant information, to me it looks like there is a limit on the length of the String..

The limit turns out to be on the length of the body in an evented update message. This was set to 1k which is much too low. I'll change it to 16k for now. You might want to consider truncating (or discarding) metadata which is too long in your provider to avoid this problem re-appearing later.

We may change things later to remove these hard-coded limits from the control point. Its not an easy problem though - we'd be happy with dynamic memory allocation in CPs using managed bindings but want to avoid heap churn for other embedded users of the stack.

The fix I've committed is below. You could apply this locally if you're currently blocked and can't wait for the updates to make it to github.

Code:
diff --git a/OpenHome/Net/ControlPoint/Upnp/EventUpnp.h b/OpenHome/Net/ControlPoint/Upnp/EventUpnp.h
index 1da54ea..25d0d6c 100644
--- a/OpenHome/Net/ControlPoint/Upnp/EventUpnp.h
+++ b/OpenHome/Net/ControlPoint/Upnp/EventUpnp.h
@@ -24,7 +24,7 @@ private:
     virtual void Run();
     void ProcessNotification(IEventProcessor& aEventProcessor, const Brx& aEntity);
private:
-    static const TUint kMaxReadBytes = 1024;
+    static const TUint kMaxReadBytes = 16 * 1024;
     static const TUint kReadTimeoutMs = 5 * 1000;
     static const Brn kMethodNotify;
     static const Brn kExpectedNt;
diff --git a/OpenHome/Net/ControlPoint/Upnp/ProtocolUpnp.h b/OpenHome/Net/ControlPoint/Upnp/ProtocolUpnp.h
index 733b704..4cecd7a 100644
--- a/OpenHome/Net/ControlPoint/Upnp/ProtocolUpnp.h
+++ b/OpenHome/Net/ControlPoint/Upnp/ProtocolUpnp.h
@@ -34,7 +34,7 @@ private:
     // IInterruptHandler
     void Interrupt();
private:
-    static const TUint kMaxReadBytes = 4096;
+    static const TUint kMaxReadBytes = 16 * 1024;
     static const TUint kResponseTimeoutMs = 60 * 1000;
     CpStack& iCpStack;
     Invocation& iInvocation;
Find all posts by this user
03-05-2013, 01:41 PM
Post: #7
RE: CpProxyAvOpenhomeOrgInfo1 problems
Thanks Simon,

That makes sense, I did try trimming down the meta data because there is a lot of info that's not needed in there but it was still hard to get down to 1k.. So it looks like the increase to 16k will be useful..

Thanks again,

Pete.
Find all posts by this user


Forum Jump: