Difference between revisions of "Using Rygel and Lightmediascanner"

From eLinux.org
Jump to: navigation, search
(Created page with "=Overview= ==Rygel== ==Light Media Scanner== =Usage= ==Manually== The following articles explains how to manually use Rygel and LMS to scan for multimedia files, list and...")
 
(Using Systemd services)
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=Overview=
 
=Overview=
  
==Rygel==
+
This article describes how to list files from embedded device to other devices in the same network over Universal Plug and Play (UPnP) using Rygel and Light Media Scanner.
  
 
==Light Media Scanner==
 
==Light Media Scanner==
 +
 +
[http://lms.garage.maemo.org/ Lightweight media scanner (LMS)] has been created for embedded systems. It uses SQLite for storing data. The project started in 2007. [https://github.com/profusion/lightmediascanner The source code is available at GitHub under GNU Lesser General Public License 2.1.]
 +
 +
==Rygel==
 +
[https://wiki.gnome.org/action/show/Projects/Rygel Rygel] is a home media solution. There is LMS plugin for Rygel.
  
 
=Usage=
 
=Usage=
Line 9: Line 14:
 
==Manually==
 
==Manually==
  
The following articles explains how to manually use Rygel and LMS to scan for multimedia files, list and share them over Universal Plug and Play (UPnP).  
+
The instructions below explain how to manually use Rygel and LMS to scan for multimedia files, list and share them over Universal Plug and Play (UPnP). It has been tested with [https://wiki.tizen.org/wiki/HummingBoard the Tizen distribution for i.MX6 built with Yocto/OE] and [https://wiki.automotivelinux.org/agl-distro/source-code meta-agl, the Yocto Layer of Automotive Grade Linux (AGL)].
 +
 
 +
 
 +
* Ensure that the embedded device and your personal computer and in the same network.
 +
 
 +
* Ensure that Light Media Scanner (LMS), Rygel and its LMS plugin has been installed on the embedded device.
 +
 
 +
* Login as root on the embedded device.
 +
 
 +
* Ensure that /usr/share/media exists and place in it '''FLAC''' (with metadata) and '''JPG''' files.
 +
 
 +
*  Type the following on the embedded device to start a message bus:
 +
 
 +
<pre>
 +
eval $( dbus-launch --auto-syntax )
 +
</pre>
 +
 
 +
* Type the following on the embedded device to launch Light Media Scanner:
 +
 
 +
<pre>
 +
lightmediascannerd --startup-scan --directory=/usr/share/media &
 +
</pre>
 +
 
 +
* Type the following on the embedded device:
 +
<pre>
 +
ls ~/.config/lightmediascannerd/
 +
</pre>
 +
 
 +
* verify that lightmediascannerd has successfully created SQLite database:
 +
<pre>
 +
db.sqlite3  db.sqlite3-journal
 +
</pre>
 +
 
 +
* Type the following on the embedded device to verify that lightmediascannerd has successfully retrieved the multimedia files and inserted the to the SQLite database:
 +
<pre>
 +
sqlite3 ~/.config/lightmediascannerd/db.sqlite3
 +
 
 +
sqlite> .tables
 +
audio_albums      audios            lms_internal      videos_audios 
 +
audio_artists    files            playlists        videos_subtitles
 +
audio_genres      images            videos            videos_videos
 +
 
 +
sqlite> SELECT * FROM images;
 +
1|Jpeg||1352977249|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
 +
2|Jpeg||1352977246|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
 +
3|DSCN0024||1361553676|4320|3240|0|0.0|0.0|0.0||application/octet-stream|jpeg
 +
 
 +
sqlite> .quit
 +
</pre>
 +
 
 +
* Type the following on the embedded device to launch Rygel:
 +
<pre>
 +
rygel -c /etc/rygel.conf
 +
</pre>
 +
 
 +
* Install eezUPnP on your personal computer.
 +
* Launch eezUPnP on your personal computer and verify that the embedded device and the lists of the mutimedia files on it are displayed.
 +
 
 +
[[File:EezUPnP.png|430px|A list of files shared over UPnP]]
  
 
==Using Systemd services==
 
==Using Systemd services==
 +
 +
Systemd services for Rygel and Light Media Scanner have been included in [https://wiki.automotivelinux.org/agl-distro/source-code Automotive Grade Linux (AGL) through meta-agl] and the [https://github.com/konsulko/tizen-distro fork of the Tizen distribution for i.MX6].
 +
 +
* Ensure that the embedded device and your personal computer and in the same network.
 +
 +
* Ensure that Light Media Scanner (LMS), Rygel and its LMS plugin has been installed on the embedded device.
 +
 +
* Login as root on the embedded device.
 +
 +
* Ensure that /usr/share/media exists and place in it '''FLAC''' (with metadata) and '''JPG''' files.
 +
 +
* Type the following on the embedded device and verify that lightmediascanner.service is enabled:
 +
 +
<pre>
 +
systemctl is-enabled lightmediascanner.service
 +
</pre>
 +
 +
* Type the following on the embedded device and verify that rygel.service is enabled:
 +
 +
<pre>
 +
systemctl is-enabled rygel.service
 +
</pre>
 +
 +
* Type the following on the embedded device and verify that lightmediascanner.service is active and running:
 +
 +
<pre>
 +
systemctl status lightmediascanner.service
 +
</pre>
 +
 +
* Type the following on the embedded device and verify that rygel.service is active and running:
 +
 +
<pre>
 +
systemctl status rygel.service
 +
</pre>
 +
 +
* Type the following on the embedded device:
 +
<pre>
 +
ls /root/.config/lightmediascannerd/
 +
</pre>
 +
 +
* Verify that lightmediascannerd has successfully created SQLite database:
 +
<pre>
 +
db.sqlite3  db.sqlite3-journal
 +
</pre>
 +
 +
* Type the following on the embedded device to verify that lightmediascannerd has successfully retrieved the multimedia files and inserted the to the SQLite database:
 +
<pre>
 +
sqlite3 /root/.config/lightmediascannerd/db.sqlite3
 +
 +
sqlite> .tables
 +
audio_albums      audios            lms_internal      videos_audios 
 +
audio_artists    files            playlists        videos_subtitles
 +
audio_genres      images            videos            videos_videos
 +
 +
sqlite> SELECT * FROM images;
 +
1|Jpeg||1352977249|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
 +
2|Jpeg||1352977246|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
 +
3|DSCN0024||1361553676|4320|3240|0|0.0|0.0|0.0||application/octet-stream|jpeg
 +
 +
sqlite> .quit
 +
</pre>
 +
 +
* Install eezUPnP on your personal computer.
 +
 +
* Launch eezUPnP on your personal computer and verify that the embedded device and the lists of the multimedia files on it are displayed.
 +
 +
=Troubleshooting=
 +
 +
* VLC (version 2.2.1) is unable to list shared over UPnP FLAC files without metadata.
 +
 +
=See Also=
 +
[[DLNA_Open_Source_Projects]]

Latest revision as of 06:48, 10 November 2015

Overview

This article describes how to list files from embedded device to other devices in the same network over Universal Plug and Play (UPnP) using Rygel and Light Media Scanner.

Light Media Scanner

Lightweight media scanner (LMS) has been created for embedded systems. It uses SQLite for storing data. The project started in 2007. The source code is available at GitHub under GNU Lesser General Public License 2.1.

Rygel

Rygel is a home media solution. There is LMS plugin for Rygel.

Usage

Manually

The instructions below explain how to manually use Rygel and LMS to scan for multimedia files, list and share them over Universal Plug and Play (UPnP). It has been tested with the Tizen distribution for i.MX6 built with Yocto/OE and meta-agl, the Yocto Layer of Automotive Grade Linux (AGL).


  • Ensure that the embedded device and your personal computer and in the same network.
  • Ensure that Light Media Scanner (LMS), Rygel and its LMS plugin has been installed on the embedded device.
  • Login as root on the embedded device.
  • Ensure that /usr/share/media exists and place in it FLAC (with metadata) and JPG files.
  • Type the following on the embedded device to start a message bus:
eval $( dbus-launch --auto-syntax )
  • Type the following on the embedded device to launch Light Media Scanner:
lightmediascannerd --startup-scan --directory=/usr/share/media &
  • Type the following on the embedded device:
ls ~/.config/lightmediascannerd/
  • verify that lightmediascannerd has successfully created SQLite database:
db.sqlite3  db.sqlite3-journal
  • Type the following on the embedded device to verify that lightmediascannerd has successfully retrieved the multimedia files and inserted the to the SQLite database:
sqlite3 ~/.config/lightmediascannerd/db.sqlite3

sqlite> .tables
audio_albums      audios            lms_internal      videos_audios   
audio_artists     files             playlists         videos_subtitles
audio_genres      images            videos            videos_videos

sqlite> SELECT * FROM images;
1|Jpeg||1352977249|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
2|Jpeg||1352977246|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
3|DSCN0024||1361553676|4320|3240|0|0.0|0.0|0.0||application/octet-stream|jpeg

sqlite> .quit
  • Type the following on the embedded device to launch Rygel:
rygel -c /etc/rygel.conf
  • Install eezUPnP on your personal computer.
  • Launch eezUPnP on your personal computer and verify that the embedded device and the lists of the mutimedia files on it are displayed.

A list of files shared over UPnP

Using Systemd services

Systemd services for Rygel and Light Media Scanner have been included in Automotive Grade Linux (AGL) through meta-agl and the fork of the Tizen distribution for i.MX6.

  • Ensure that the embedded device and your personal computer and in the same network.
  • Ensure that Light Media Scanner (LMS), Rygel and its LMS plugin has been installed on the embedded device.
  • Login as root on the embedded device.
  • Ensure that /usr/share/media exists and place in it FLAC (with metadata) and JPG files.
  • Type the following on the embedded device and verify that lightmediascanner.service is enabled:
systemctl is-enabled lightmediascanner.service
  • Type the following on the embedded device and verify that rygel.service is enabled:
systemctl is-enabled rygel.service
  • Type the following on the embedded device and verify that lightmediascanner.service is active and running:
systemctl status lightmediascanner.service
  • Type the following on the embedded device and verify that rygel.service is active and running:
systemctl status rygel.service
  • Type the following on the embedded device:
ls /root/.config/lightmediascannerd/
  • Verify that lightmediascannerd has successfully created SQLite database:
db.sqlite3  db.sqlite3-journal
  • Type the following on the embedded device to verify that lightmediascannerd has successfully retrieved the multimedia files and inserted the to the SQLite database:
sqlite3 /root/.config/lightmediascannerd/db.sqlite3

sqlite> .tables
audio_albums      audios            lms_internal      videos_audios   
audio_artists     files             playlists         videos_subtitles
audio_genres      images            videos            videos_videos

sqlite> SELECT * FROM images;
1|Jpeg||1352977249|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
2|Jpeg||1352977246|3264|1836|0|0.0|0.0|0.0|JPEG_LRG|image/jpeg|jpeg
3|DSCN0024||1361553676|4320|3240|0|0.0|0.0|0.0||application/octet-stream|jpeg

sqlite> .quit
  • Install eezUPnP on your personal computer.
  • Launch eezUPnP on your personal computer and verify that the embedded device and the lists of the multimedia files on it are displayed.

Troubleshooting

  • VLC (version 2.2.1) is unable to list shared over UPnP FLAC files without metadata.

See Also

DLNA_Open_Source_Projects