Tutorial / Howto / How-To ...

article en cours de rédaction

Dans cette page, j’ai mis mes notes sur les tests UPnP que je suis en train de réaliser. Les logiciels testés sont de préférence sous GNU/Linux :) Pour avoir plus d’informations concernant l’installatino de ces logiciels, vous pouvez voir mon article précédent : Partager des contenus avec UPnP.

J’utilise les logiciels suivants sur mon réseau (en attendant de vrais périphériques UPnP :) :

  • uShare (UPnP Server)
  • gmediaserver (UPnP Server)
  • mediatomb (UPnP Server)
  • djmount (UPnP Client)
  • gmediarender (UPnP Renderer ou Client)
  • cidero (UPnP Controller)

Description de la configuration

Le répertoire /home/petrus/share est partagé en UPnP ; il contient 3 sous-répertoires : audios, pictures, videos.

$ tree /home/petrus/share
/home/petrus/share
|-- audios
|   |-- Brother John
|   |   |-- JunkyFazz.mp3
|   |   |-- album1
|   |   |   |-- GodMakeMeDubby.mp3
|   |   |   `-- OrganDonuts.mp3
|   |   `-- album2
|   |       |-- SergeEnPetitsMorceaux.mp3
|   |       `-- tenderness.mp3
|   `-- recursive_test
|       `-- Brother John -> ../Brother John
|-- pictures
|   |-- covers
|   |   |-- da_vinci_code_poster.jpg
|   |   |-- kingkong_200510112253.jpg
|   |   |-- supermanreturns_200512081503.jpg
|   |   |-- vforvendetta_200512151209.jpg
|   |   `-- x3_200512051032.jpg
|   `-- wallpapers
`-- videos
   `-- trailers
       |-- da_vinci_code-tsr2_h480p.mov
       |-- king_kong_h480p.mov
       `-- x-men_3-pre_teaser_h480p.mov

Utilisation de djmount

$ djmount /mnt/upnp
$ ls /mnt/upnp
debug/  devices  GMediaRender/  gmediaserver/  MediaTomb/  test/  ushare/
$ tree /mnt/upnp/ushare
/mnt/upnp/ushare
|-- browse
|   `-- share
|       |-- audios
|       |   |-- Brother John
|       |   |   |-- JunkyFazz.mp3
|       |   |   |-- JunkyFazz.xml
|       |   |   |-- album1
|       |   |   |   |-- GodMakeMeDubby.mp3
|       |   |   |   |-- GodMakeMeDubby.xml
|       |   |   |   |-- OrganDonuts.mp3
|       |   |   |   `-- OrganDonuts.xml
|       |   |   `-- album2
|       |   |       |-- SergeEnPetitsMorceaux.mp3
|       |   |       |-- SergeEnPetitsMorceaux.xml
|       |   |       |-- tenderness.mp3
|       |   |       `-- tenderness.xml
|       |   `-- recursive_test
|       |       `-- Brother John
|       |           |-- JunkyFazz.mp3
|       |           |-- JunkyFazz.xml
|       |           |-- album1
|       |           |   |-- GodMakeMeDubby.mp3
|       |           |   |-- GodMakeMeDubby.xml
|       |           |   |-- OrganDonuts.mp3
|       |           |   `-- OrganDonuts.xml
|       |           `-- album2
|       |               |-- SergeEnPetitsMorceaux.mp3
|       |               |-- SergeEnPetitsMorceaux.xml
|       |               |-- tenderness.mp3
|       |               `-- tenderness.xml
|       |-- pictures
|       |   |-- covers
|       |   |   |-- da_vinci_code_poster.jpg
|       |   |   |-- da_vinci_code_poster.xml
|       |   |   |-- kingkong_200510112253.jpg
|       |   |   |-- kingkong_200510112253.xml
|       |   |   |-- supermanreturns_200512081503.jpg
|       |   |   |-- supermanreturns_200512081503.xml
|       |   |   |-- vforvendetta_200512151209.jpg
|       |   |   |-- vforvendetta_200512151209.xml
|       |   |   |-- x3_200512051032.jpg
|       |   |   `-- x3_200512051032.xml
|       |   `-- wallpapers
|       `-- videos
|           `-- trailers
|               |-- da_vinci_code-tsr2_h480p.mov
|               |-- da_vinci_code-tsr2_h480p.xml
|               |-- king_kong_h480p.mov
|               |-- king_kong_h480p.xml
|               |-- x-men_3-pre_teaser_h480p.mov
|               `-- x-men_3-pre_teaser_h480p.xml
`-- status

Utilisation de test_upnp

La commande test_upnp est fournie avec djmount ; elle permet de lancer quelques commandes UPnP :

$ test_upnp
[...]
>> help
Valid Commands:
 help          
 loglevel       <max log level (0-3)>
 leak          
 leakfull      
 listdev        
 refresh        
 printdev       <devname>
 browse         <devname> <objectId>
 metadata       <devname> <objectId>
 ls             <devname> <path>
 action         <devname> <serviceId> <actionName>
 exit          

>> listdev
DeviceList:
gmediaserver         -- uuid:5177fca0-c42d-11d8-9669-0800200c9a66
GMediaRender         -- uuid:GMediaRender-1_0-000-000-002
ushare               -- uuid:00:11:2F:C7:56:0E
MediaTomb            -- uuid:65a0aae2-80ef-40eb-b15c-4eb34ecd5bb9

>> printdev ushare
Device "ushare" (expires in 1770 seconds)
 |
 +- Discovered on  = Sat Dec 24 03:20:27 2005 (51 seconds ago)
 +- UDN            = uuid:00:11:2F:C7:56:0E
 +- DeviceType     = urn:schemas-upnp-org:device:MediaServer:1
 +- DescDocURL     = http://10.0.0.4:49152/description.xml
 +- FriendlyName   = ushare
 +- PresURL        = http://10.0.0.4:49152/web/ushare.html
 +- talloc memory  = 20 blocks / 17270 bytes
 |
 +- Service
 |   |
 |   +- Class           = Service
 |   +- Object Name     = Service
 |   +- ServiceId       = urn:upnp-org:serviceId:ConnectionManager
 |   +- ServiceType     = urn:schemas-upnp-org:service:ConnectionManager:1
 |   +- EventURL        = http://10.0.0.4:49152/web/cms_event
 |   +- ControlURL      = http://10.0.0.4:49152/web/cms_control
 |   +- ServiceStateTable
 |   +- Last Action     = (null)
 |   +- SID             = uuid:d934a63c-1dd1-11b2-9c97-9c58ff6c7302
 |
 +- Service
     |
     +- Class           = ContentDir
     +- Object Name     = ContentDir
     +- ServiceId       = urn:upnp-org:serviceId:ContentDirectory
     +- ServiceType     = urn:schemas-upnp-org:service:ContentDirectory:1
     +- EventURL        = http://10.0.0.4:49152/web/cds_event
     +- ControlURL      = http://10.0.0.4:49152/web/cds_control
     +- ServiceStateTable
     +- Last Action     = (null)
     +- SID             = uuid:d934ef34-1dd1-11b2-9c97-9c58ff6c7302
     +- Cache size      = 1024
     +- Cached entries  = 0 (0%)
     +- Cache timeout   = 60 seconds
     +- Cache access    = 0

>> browse ushare 0
 share
>> browse ushare 1
 audios
 pictures
 videos
>> browse ushare 2
 Brother John
 recursive_test
>> ls ushare /share/
ls '/share/' :
 audios
 pictures
 videos
-> path left to match : '/'

Utilisation du module CPAN Net ::UPnP

Pour lister mes périphériques UPnP, j’ai écrit un script perl upnp-controller.pl utilisant la librairie CPAN Net ::UPnP disponible sur le site de cybergarage. Il est en cours de développement. Pour le moment, il liste tous les périphériques UPnP et affiche automatiquement les partages des périphériques UPnP A/V. Je suis en train d’écrire une version en Gtk2 pour que ce soit plus joli :o)

$ upnp-controller.pl
UPNP Devices (4)
|
+- [1] Device "gmediaserver"
|      |
|      +- DeviceType = urn:schemas-upnp-org:device:MediaServer:1
|      +- FriendlyName = gmediaserver
|      +- Manufacturer = Oskar Liljeblad
|      +- ManufacturerURL =
|      +- ModelDescription =
|      +- ModelName = gmediaserver
|      +- ModelNumber = 0.9.0
|      +- ModelURL =
|      +- SerialNumber = 0000001
|      +- PresentationURL = http://10.0.0.4:49154/description.xml
|      +- UDN = uuid:5177fca0-c42d-11d8-9669-0800200c9a66
|      +- UPC =
|      |
|      +- Services (2)
|              |
|              +- [1] Service
|              |       |
|              |       +- ServiceId = urn:upnp-org:serviceId:ContentDirectory
|              |       +- ServiceType = urn:schemas-upnp-org:service:ContentDirectory:1
|              |       +- ScpdURL = /upnp/ContentDirectory.xml
|              |       +- ControlURL = /ContentDirectory/Control
|              |       +- EventSubURL = /ContentDirectory/Event
|              |       |
|              |       +- Content (3)
|              |               +- 1 = audios (2)
|              |               |       |
|              |               |       +- 2 = Brother John (3)
|              |               |       |       |
|              |               |       |       +- 3 = album1 (2)
|              |               |       |       |       |
|              |               |       |       |       +- 4 = God make Me Dubby (http://10.0.0.4:49154/files/4 - audio/mpeg)
|              |               |       |       |       +- 5 = Organ Donuts (http://10.0.0.4:49154/files/5 - audio/mpeg)
|              |               |       |       |
|              |               |       |       +- 6 = album2 (2)
|              |               |       |       |       |
|              |               |       |       |       +- 7 = Serge en petits morceaux (http://10.0.0.4:49154/files/7 - audio/mpeg)
|              |               |       |       |       +- 8 = Tenderness (http://10.0.0.4:49154/files/8 - audio/mpeg)
|              |               |       |       |
|              |               |       |       +- 9 = Junky Fazz (http://10.0.0.4:49154/files/9 - audio/mpeg)
|              |               |       |
|              |               |       +- 10 = recursive_test (1)
|              |               |               |
|              |               |               +- 11 = Brother John (3)
|              |               |                       |
|              |               |                       +- 12 = album1 (2)
|              |               |                       |       |
|              |               |                       |       +- 13 = God make Me Dubby (http://10.0.0.4:49154/files/13 - audio/mpeg)
|              |               |                       |       +- 14 = Organ Donuts (http://10.0.0.4:49154/files/14 - audio/mpeg)
|              |               |                       |
|              |               |                       +- 15 = album2 (2)
|              |               |                       |       |
|              |               |                       |       +- 16 = Serge en petits morceaux (http://10.0.0.4:49154/files/16 - audio/mpeg)
|              |               |                       |       +- 17 = Tenderness (http://10.0.0.4:49154/files/17 - audio/mpeg)
|              |               |                       |
|              |               |                       +- 18 = Junky Fazz (http://10.0.0.4:49154/files/18 - audio/mpeg)
|              |               |                
|              |               |        
|              |               |
|              |               +- 19 = pictures (2)
|              |               |       |
|              |               |       +- 20 = covers (0)
|              |               |       +- 21 = wallpapers (0)
|              |               |
|              |               +- 22 = videos (1)
|              |                       |
|              |                       +- 23 = trailers (0)
|              |                
|              |
|              +- [2] Service
|                      |
|                      +- ServiceId = urn:upnp-org:serviceId:ConnectionManager
|                      +- ServiceType = urn:schemas-upnp-org:service:ConnectionManager:1
|                      +- ScpdURL = /upnp/ConnectionManager.xml
|                      +- ControlURL = /ConnectionManager/Control
|                      +- EventSubURL = /ConnectionManager/Event
|
+- [2] Device "GMediaRender"
|      |
|      +- DeviceType = urn:schemas-upnp-org:device:MediaRenderer:1
|      +- FriendlyName = GMediaRender
|      +- Manufacturer = Ivo Clarysse
|      +- ManufacturerURL = http://soggie.soti.org/
|      +- ModelDescription = GMediaRender 0.0.2
|      +- ModelName = GMediaRender
|      +- ModelNumber = 0.0.2
|      +- ModelURL = http://soggie.soti.org/gmediarender/
|      +- SerialNumber = 1
|      +- PresentationURL = http://10.0.0.4:49153/description.xml
|      +- UDN = uuid:GMediaRender-1_0-000-000-002
|      +- UPC = 123456789
|      |
|      +- Services (3)
|              |
|              +- [1] Service
|              |       |
|              |       +- ServiceId = urn:upnp-org:serviceId:RenderingControl
|              |       +- ServiceType = urn:schemas-upnp-org:service:RenderingControl:1
|              |       +- ScpdURL = /upnp/rendercontrolSCPD.xml
|              |       +- ControlURL = /upnp/control/rendercontrol1
|              |       +- EventSubURL = /upnp/event/rendercontrol1
|              |
|              +- [2] Service
|              |       |
|              |       +- ServiceId = urn:upnp-org:serviceId:ConnectionManager
|              |       +- ServiceType = urn:schemas-upnp-org:service:ConnectionManager:1
|              |       +- ScpdURL = /upnp/renderconnmgrSCPD.xml
|              |       +- ControlURL = /upnp/control/renderconnmgr1
|              |       +- EventSubURL = /upnp/event/renderconnmgr1
|              |
|              +- [3] Service
|                      |
|                      +- ServiceId = urn:upnp-org:serviceId:AVTransport
|                      +- ServiceType = urn:schemas-upnp-org:service:AVTransport:1
|                      +- ScpdURL = /upnp/rendertransportSCPD.xml
|                      +- ControlURL = /upnp/control/rendertransport1
|                      +- EventSubURL = /upnp/event/rendertransport1
+- [3] Device "ushare"
|      |
|      +- DeviceType = urn:schemas-upnp-org:device:MediaServer:1
|      +- FriendlyName = ushare
|      +- Manufacturer = GeeXboX Team
|      +- ManufacturerURL = http://ushare.geexbox.org/
|      +- ModelDescription = GeeXboX uShare : UPnP Media Server
|      +- ModelName = uShare
|      +- ModelNumber = 001
|      +- ModelURL = http://ushare.geexbox.org/
|      +- SerialNumber = GEEXBOX-USHARE-01
|      +- PresentationURL = http://10.0.0.4:49152/description.xml
|      +- UDN = uuid:00:11:2F:C7:56:0E
|      +- UPC =
|      |
|      +- Services (2)
|              |
|              +- [1] Service
|              |       |
|              |       +- ServiceId = urn:upnp-org:serviceId:ConnectionManager
|              |       +- ServiceType = urn:schemas-upnp-org:service:ConnectionManager:1
|              |       +- ScpdURL = /web/cms.xml
|              |       +- ControlURL = /web/cms_control
|              |       +- EventSubURL = /web/cms_event
|              |
|              +- [2] Service
|                      |
|                      +- ServiceId = urn:upnp-org:serviceId:ContentDirectory
|                      +- ServiceType = urn:schemas-upnp-org:service:ContentDirectory:1
|                      +- ScpdURL = /web/cds.xml
|                      +- ControlURL = /web/cds_control
|                      +- EventSubURL = /web/cds_event
|                      |
|                      +- Content (1)
|                              +- 1 = share (3)
|                                      |
|                                      +- 2 = audios (2)
|                                      |       |
|                                      |       +- 3 = Brother John (3)
|                                      |       |       |
|                                      |       |       +- 4 = album1 (2)
|                                      |       |       |       |
|                                      |       |       |       +- 5 = GodMakeMeDubby (http://10.0.0.4:49152/web/5 - audio/mpeg)
|                                      |       |       |       +- 6 = OrganDonuts (http://10.0.0.4:49152/web/6 - audio/mpeg)
|                                      |       |       |
|                                      |       |       +- 7 = album2 (2)
|                                      |       |       |       |
|                                      |       |       |       +- 8 = SergeEnPetitsMorceaux (http://10.0.0.4:49152/web/8 - audio/mpeg)
|                                      |       |       |       +- 9 = tenderness (http://10.0.0.4:49152/web/9 - audio/mpeg)
|                                      |       |       |
|                                      |       |       +- 10 = JunkyFazz (http://10.0.0.4:49152/web/10 - audio/mpeg)
|                                      |       |
|                                      |       +- 11 = recursive_test (1)
|                                      |               |
|                                      |               +- 12 = Brother John (3)
|                                      |                       |
|                                      |                       +- 13 = album1 (2)
|                                      |                       |       |
|                                      |                       |       +- 14 = GodMakeMeDubby (http://10.0.0.4:49152/web/14 - audio/mpeg)
|                                      |                       |       +- 15 = OrganDonuts (http://10.0.0.4:49152/web/15 - audio/mpeg)
|                                      |                       |
|                                      |                       +- 16 = album2 (2)
|                                      |                       |       |
|                                      |                       |       +- 17 = SergeEnPetitsMorceaux (http://10.0.0.4:49152/web/17 - audio/mpeg)
|                                      |                       |       +- 18 = tenderness (http://10.0.0.4:49152/web/18 - audio/mpeg)
|                                      |                       |
|                                      |                       +- 19 = JunkyFazz (http://10.0.0.4:49152/web/19 - audio/mpeg)
|                                      |                
|                                      |        
|                                      |
|                                      +- 20 = pictures (2)
|                                      |       |
|                                      |       +- 21 = covers (5)
|                                      |       |       |
|                                      |       |       +- 22 = da_vinci_code_poster (http://10.0.0.4:49152/web/22 - image/jpeg)
|                                      |       |       +- 23 = kingkong_200510112253 (http://10.0.0.4:49152/web/23 - image/jpeg)
|                                      |       |       +- 24 = supermanreturns_200512081503 (http://10.0.0.4:49152/web/24 - image/jpeg)
|                                      |       |       +- 25 = vforvendetta_200512151209 (http://10.0.0.4:49152/web/25 - image/jpeg)
|                                      |       |       +- 26 = x3_200512051032 (http://10.0.0.4:49152/web/26 - image/jpeg)
|                                      |       |
|                                      |       +- 27 = wallpapers (0)
|                                      |
|                                      +- 28 = videos (1)
|                                              |
|                                              +- 29 = trailers (3)
|                                                      |
|                                                      +- 30 = da_vinci_code-tsr2_h480p (http://10.0.0.4:49152/web/30 - video/quicktime)
|                                                      +- 31 = king_kong_h480p (http://10.0.0.4:49152/web/31 - video/quicktime)
|                                                      +- 32 = x-men_3-pre_teaser_h480p (http://10.0.0.4:49152/web/32 - video/quicktime)
+- [4] Device "MediaTomb"
       |
       +- DeviceType = urn:schemas-upnp-org:device:MediaServer:1
       +- FriendlyName = MediaTomb
       +- Manufacturer = (c) 2004, 2005 Gena Batyan &lt;bgeradz@deadlock.dhs.org&gt;, Sergey Bostandzhyan &lt;jin@deadlock.dhs.org&gt;
       +- ManufacturerURL = http://www.deadlock.dhs.org/upnp
       +- ModelDescription = Free UPnP AV MediaServer, GNU GPL
       +- ModelName = MediaTomb
       +- ModelNumber = 0.8.1
       +- ModelURL =
       +- SerialNumber = 1
       +- PresentationURL = http://10.0.0.4:49155/description.xml
       +- UDN = uuid:65a0aae2-80ef-40eb-b15c-4eb34ecd5bb9
       +- UPC =
       |
       +- Services (2)
               |
               +- [1] Service
               |       |
               |       +- ServiceId = urn:schemas-upnp-org:service:ConnectionManager
               |       +- ServiceType = urn:schemas-upnp-org:service:ConnectionManager:1
               |       +- ScpdURL = cm.xml
               |       +- ControlURL = /upnp/control/cm
               |       +- EventSubURL = /upnp/event/cm
               |
               +- [2] Service
                       |
                       +- ServiceId = urn:schemas-upnp-org:service:ContentDirectory
                       +- ServiceType = urn:schemas-upnp-org:service:ContentDirectory:1
                       +- ScpdURL = cds.xml
                       +- ControlURL = /upnp/control/cds
                       +- EventSubURL = /upnp/event/cds
                       |
                       +- Content (1)
                               +- 1 = MediaTomb (1)
                                       |
                                       +- 3 = home (1)
                                               |
                                               +- 4 = petrus (1)
                                                       |
                                                       +- 5 = share (3)

[...]

Utilisation de cidero

Cidero - Interface