https://wiki.archlinux.org/api.php?action=feedcontributions&user=Sambul13&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:10:04ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Xrdp&diff=232760Xrdp2012-10-31T14:13:09Z<p>Sambul13: /* Usage */</p>
<hr />
<div>[[Category:Remote Desktop Protocol]]<br />
'''xrdp''' is a daemon that supports Microsoft's [[Wikipedia:Remote Desktop Protocol|Remote Desktop Protocol]] (RDP).<br />
It uses Xvnc or X11rdp as a backend.<br />
<br />
== Installation ==<br />
There is {{AUR|xrdp}} in the [[AUR]]. However, this doesn't work without further changes and it depends on {{Pkg|tightvnc}}, which has severe problems giving the correct colors.<br />
<br />
With {{AUR|xrdp-git}} there is currently a better alternative. It depends on {{AUR|tigervnc}}, which is a successor of ''tightvnc'' that doesn't have the mentioned problems.<br />
<br />
=== Fixing Problems in {{AUR|xrdp}} ===<br />
You won't have these problems when you use {{AUR|xrdp-git}} so you can skip this section when you chose the git version.<br />
<br />
If Xvnc (tightvnc) fails with<br />
{{bc|Fatal server error:<br />
could not open default font 'fixed'}}<br />
you must create a symlink at {{ic|/usr/X11R6/lib/X11/fonts}} pointing to {{ic|/usr/share/fonts}}.<br />
<br />
''xrdp'' will just fail without giving you that error. You can only see the error message when you try to start Xvnc manually for a test.<br />
<br />
To fix the message {{ic|Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'}} copy {{ic|/usr/share/X11/rgb.txt}} to {{ic|/usr/X11R6/lib/X11/rgb.txt}} or create a symlink. If this file is missing, standard X11 colors are wrong (pink or blue instead of black) and Xterm is broken.<br />
<br />
=== Autoboot at Startup ===<br />
When you installed {{AUR|xrdp-git}} you can just add rdpd to the DAEMONS section of /etc/rc.conf file.<br />
<br />
Otherwise you have to copy {{ic|/etc/xrdp/xrdp.sh}} to {{ic|/etc/rc.d}} and use that.<br />
<br />
== Usage ==<br />
After starting xrdp you can point any RDP client to localhost (on standard RDP port 3389)<br />
''xrdp'' will give a small message window.<br />
<br />
When you choose ''sessman-Xvnc'' you can give a username and password for any account on your host<br />
and ''xrdp'' will start another ''Xvnc'' instance for you.<br />
Opening a window manager out of a ''SESSION'' list provided in {{ic|/etc/xrdp/startwm.sh}}.<br />
<br />
When you just close the session window and RDP connection, you can access the same session again next time you connect with RDP. When you exit the window manager or desktop environment from the session window, the session will close and a new session will be opened the next time.<br />
<br />
''xrdp'' checks only if a session with the same geometry is already opened.<br />
It will start a new session if the geometry/resolution doesn't match.<br />
<br />
== See also ==<br />
* [[Virtual Network Computing]] - VNC, an alternative to RDP, also used as backend here</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232423Netconsole2012-10-29T16:37:17Z<p>Sambul13: /* Build-in Configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Installation ==<br />
<br />
If not included with OS, ''Netconsole'' can be installed from the depository:<br />
<br />
pacman -Sy netcat<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Plug Computer ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start two ''netconsole'' instances on the monitoring PC (one to read output, another for input), and restart it on the PC or device you are logging as shown in ''Dynamic Configuration'':<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
<br />
nc -l -u -p 6666 &<br />
nc -u 192.168.1.28 6666<br />
</pre><br />
One may need to switch off PC and router firewall, and setup proper router port forwarding to monitor and input data in ''Netconsole''.<br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232422Netconsole2012-10-29T16:36:42Z<p>Sambul13: /* Build-in Configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Installation ==<br />
<br />
If not included with OS, ''Netconsole'' can be installed from the depository:<br />
<br />
pacman -Sy netcat<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Plug Computer ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start two ''netconsole'' instances on the monitoring PC (one to read output, another for input), and restart it on the PC or device you are logging as shown in ''Dynamic Configuration'':<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
<br />
nc -l -u -p 6666 &<br />
nc -u 192.168.1.28 6666<br />
</pre><br />
One may need to switch off firewall and setup proper router port forwarding to monitor and input data in ''Netconsole''.<br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232421Netconsole2012-10-29T16:36:17Z<p>Sambul13: /* Build-in Configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Installation ==<br />
<br />
If not included with OS, ''Netconsole'' can be installed from the depository:<br />
<br />
pacman -Sy netcat<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Plug Computer ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start two ''netconsole'' instances on the monitoring PC (one to read output, another for input), and restart it on the PC or device you are logging as shown in ''Dynamic Configuration'':<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
<br />
nc -l -u -p 6666 &<br />
nc -u 192.168.1.28 6666<br />
</pre><br />
One may need to switch off firewall and setup proper port forwarding to monitor and input data in ''Netconsole''.<br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232420Netconsole2012-10-29T16:27:30Z<p>Sambul13: </p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Installation ==<br />
<br />
If not included with OS, ''Netconsole'' can be installed from the depository:<br />
<br />
pacman -Sy netcat<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Plug Computer ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start two ''netconsole'' instances on the monitoring PC (one to read output, another for input), and restart it on the PC or device you are logging as shown in ''Dynamic Configuration'':<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
<br />
nc -l -u -p 6666 &<br />
nc -u 192.168.1.28 6666<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232419Netconsole2012-10-29T16:26:17Z<p>Sambul13: </p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
== Installation ==<br />
<br />
If not included with OS, ''Netconsole'' can be installed:<br />
<br />
pacman -Sy netcat<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Plug Computer ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start two ''netconsole'' instances on the monitoring PC (one to read output, another for input), and restart it on the PC or device you are logging as shown in ''Dynamic Configuration'':<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
<br />
nc -l -u -p 6666 &<br />
nc -u 192.168.1.28 6666<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232417Netconsole2012-10-29T16:22:50Z<p>Sambul13: /* Build-in Configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Plug Computer ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start two ''netconsole'' instances on the monitoring PC (one to read output, another for input), and restart it on the PC or device you are logging as shown in ''Dynamic Configuration'':<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
<br />
nc -l -u -p 6666 &<br />
nc -u 192.168.1.28 6666<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232416Netconsole2012-10-29T16:16:28Z<p>Sambul13: /* Build-in Configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Dockstar ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start two ''netconsole'' instances on a remote PC (one to monitor output, another for input), and restart it on the PC or device you are logging as shown in ''Dynamic Configuration'' section:<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
<br />
nc -l -u -p 6666 &<br />
nc -u 192.168.1.100 6666<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=232415Netconsole2012-10-29T16:05:16Z<p>Sambul13: /* Build-in Configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Dockstar ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start ''netconsole'' on a remote PC and restart it on the PC or device you are logging:<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre><br />
<br />
<br />
== Starting at Boot ==<br />
Just add the netconsole to the kernel cmd line. It takes a string configuration parameter "netconsole" in the following format:<br />
<br />
{{bc|<nowiki> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]<br />
src-port source for UDP packets (defaults to 6665)<br />
src-ip source IP to use (interface address)<br />
dev network interface (eth0)<br />
tgt-port port for logging agent (6666)<br />
tgt-ip IP address for logging agent<br />
tgt-macaddr ethernet MAC address for logging agent (broadcast)</nowiki>}}<br />
<br />
Examples:<br />
linux /vmlinuz-linux root=UUID=a322511e-b028-4f11-87b6-e48b5d99bbd8 ro netconsole=514@10.0.0.1/eth1,514@10.0.0.2/12:34:56:78:9a:bc<br />
linux /vmlinuz-linux root=/dev/disk/by-label/ROOT ro netconsole=514@10.0.0.2/12:34:56:78:9a:bc<br />
<br />
From: [[Boot_Debugging#Net_Console|Net Console for Boot Debugging]].</div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=226590Netconsole2012-10-02T23:06:02Z<p>Sambul13: /* Dynamic configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st IP is Dockstar ArchLinux device's netconsole Out IP and Port, and 2nd IP is your PC's netconsole In IP and Port:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start ''netconsole'' on a remote PC and restart it on the PC or device you are logging:<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6665@192.168.0.111/eth0,6665@192.168.0.17/00:43:24:96:d7:v5<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of ''kernel modules'' manually after boot or auto during boot depending on this module config. See [[kernel modules]] for configuring it to load at boot. For loading manually any time after boot:<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre></div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=226589Netconsole2012-10-02T23:04:20Z<p>Sambul13: /* Dynamic configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st IP is Dockstar ArchLinux device's netconsole Out IP and Port, and 2nd IP is your PC's netconsole In IP and Port:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start ''netconsole'' on a remote PC and restart it on the PC or device you are logging:<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6665@192.168.0.111/eth0,6665@192.168.0.17/00:43:24:96:d7:v5<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of [[kernel modules]] manually after boot or auto during boot depending on this module config.<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre></div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=226586Netconsole2012-10-02T22:01:42Z<p>Sambul13: /* Dynamic configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st IP is Dockstar ArchLinux device's netconsole Out IP and Port, and 2nd IP is your PC's netconsole In IP and Port:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start ''netconsole'' on a remote PC and restart it on the PC or device you are logging:<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6665@192.168.0.111/eth0,6665@192.168.0.17/00:43:24:96:d7:v5<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of [[kernel modules]] after boot manually or at boot depending on your config.<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre></div>Sambul13https://wiki.archlinux.org/index.php?title=Netconsole&diff=226585Netconsole2012-10-02T22:00:53Z<p>Sambul13: /* Dynamic configuration */</p>
<hr />
<div>[[Category:Kernel]]<br />
[[Category:Networking]]<br />
'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.<br />
<br />
It can be used either built-in or as a module. Built-in ''netconsole'' initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.<br />
<br />
Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''<br />
<br />
<br />
== Build-in Configuration ==<br />
<br />
''Netconsole'' and other modules' [[Kernel parameters]] can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st IP is Dockstar ArchLinux device's netconsole Out IP and Port, and 2nd IP is your PC's netconsole In IP and Port:<br />
<br />
fw_setenv usb_custom_params 'loglevel=7 netconsole=6666@192.168.1.28/eth0,6666@192.168.1.19/00:13:32:20:r9:a5'<br />
<br />
Logging is done by your ArchLinux set logger like ''syslog-ng'', so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass ''netconsole'' string parameters at kernel runtime (no config file required), then start ''netconsole'' on a remote PC and restart it on the PC or device you are logging:<br />
<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
netconsole=6665@192.168.0.111/eth0,6665@192.168.0.17/00:43:24:96:d7:v5<br />
</pre><br />
<br />
== Dynamic configuration ==<br />
<br />
Netconsole can be loaded as one of [[kernel modules]] after boot manually or at boot depending on your module config.<br />
<pre><br />
# set log level for kernel messages<br />
dmesg -n 8<br />
<br />
modprobe configfs<br />
modprobe netconsole<br />
mount none -t configfs /sys/kernel/config<br />
<br />
# 'netconsole' dir is auto created if the module is loaded <br />
mkdir /sys/kernel/config/netconsole/target1<br />
cd /sys/kernel/config/netconsole/target1<br />
<br />
# set local IP address<br />
echo 192.168.0.111 > local_ip<br />
# set destination IP address<br />
echo 192.168.0.17 > remote_ip<br />
# find destination MAC address<br />
arping `cat remote_ip` -f |grep -o ..:..:..:..:..:.. > remote_mac<br />
<br />
echo 1 > enabled<br />
</pre><br />
<br />
netconsole should now be configured. To verify, run 'dmesg |tail' and you should see "netconsole: network logging started". Check available log levels by running 'dmesg -h'.<br />
<br />
== Receiver ==<br />
<pre><br />
nc -u -l 6666<br />
</pre><br />
or<br />
<pre><br />
nc -u -l -p 6666<br />
</pre></div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=226487ReadyMedia2012-10-02T13:25:54Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot, or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|/etc/rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in terminal and media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add to ''Media_Collection'' and ''Media_DB'' drives' mount options your FS language [http://en.wikipedia.org/wiki/Code_page codepage] for transcoding to short DOS file names, and [http://en.wikipedia.org/wiki/Character_encoding iocharset] for converting long file names to your terminal's locale, i.g. ''codepage=cp866,iocharset=utf8 (or ISO-8859-5)''. Set ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,codepage=cp866,iocharset=utf8 0 0}}<br />
<br />
While your ''iocharset'' would be present in the system with a matching [[locale]], if your terminal or player supports only short file names, check if the set ''codepage'' is also present and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in a local charset, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while network file systems like Samba, NFS or iSCSI allow import to Windows any Linux FS with slower data copy. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=226409ReadyMedia2012-10-01T15:34:23Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot, or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in terminal and media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add to ''Media_Collection'' and ''Media_DB'' drives' mount options your FS language [http://en.wikipedia.org/wiki/Code_page codepage] for transcoding to short DOS file names, and [http://en.wikipedia.org/wiki/Character_encoding iocharset] for converting long file names to your terminal's locale, i.g. ''codepage=cp866,iocharset=utf8 (or ISO-8859-5)''. Set ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,codepage=cp866,iocharset=utf8 0 0}}<br />
<br />
While your ''iocharset'' would be present in the system with a matching [[locale]], if your terminal or player supports only short file names, check if the set ''codepage'' is also present and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in a local charset, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while network file systems like Samba, NFS or iSCSI allow import to Windows any Linux FS with slower data copy. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=226408ReadyMedia2012-10-01T15:31:47Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot, or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in terminal and media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add to ''Media_Collection'' and ''Media_DB'' drives' mount options your FS language [http://en.wikipedia.org/wiki/Code_page codepage] for transcoding to short DOS file names, and [http://en.wikipedia.org/wiki/Character_encoding iocharset] for converting long file names to your terminal's locale, i.g. ''codepage=cp866,iocharset=utf8 (or ISO-8859-5)''. Set ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,codepage=cp866,iocharset=utf8 0 0}}<br />
<br />
While your ''iocharset'' would be present in the system with a matching [[locale]], if your terminal or player supports only short file names, check if the set ''codepage'' is also present and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while network file systems like Samba, NFS or iSCSI allow import to Windows any Linux FS with slower data copy. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=226407ReadyMedia2012-10-01T15:24:56Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot, or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in terminal and media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add to ''Media_Collection'' and ''Media_DB'' drives' mount options your FS language [http://en.wikipedia.org/wiki/Code_page codepage] for transcoding to short DOS file names, and [http://en.wikipedia.org/wiki/Character_encoding iocharset] for converting long file names to your terminal's locale, i.g. ''codepage=cp866,iocharset=utf8 (or ISO-8859-5)''. Set ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,codepage=cp866,iocharset=utf8 0 0}}<br />
<br />
While your ''iocharset'' would be present in the system with a matching [[locale]], you may need to check if the ''codepage'' for your DOS-only (if any) terminal or device ''locale'' is also present and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it if required: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while network file systems like Samba, NFS or iSCSI allow import to Windows any Linux FS with slower data copy. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=226405ReadyMedia2012-10-01T15:07:58Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot, or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in terminal and media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add to ''Media_Collection'' and ''Media_DB'' drives' mount options your FS language [http://en.wikipedia.org/wiki/Code_page codepage] for transcoding to short DOS file names, and [http://en.wikipedia.org/wiki/Character_encoding iocharset] for converting long file names to your terminal's locale, i.g. ''codepage=cp866,iocharset=utf8 (or ISO-8859-5)''. Set ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,codepage=cp866,iocharset=utf8 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while network file systems like Samba, NFS or iSCSI allow import to Windows any Linux FS with slower data copy. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=226067ReadyMedia2012-09-29T00:57:01Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot, or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while network file systems like Samba, NFS or iSCSI allow import to Windows any Linux FS with slower data copy. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225390ReadyMedia2012-09-26T19:53:43Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot, or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225389ReadyMedia2012-09-26T19:53:05Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external ''Media_Collection'' drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225388ReadyMedia2012-09-26T19:52:26Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external media storage drive, just make sure to set the user's ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225387ReadyMedia2012-09-26T19:50:58Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external media storage drive, just make sure to set the user's ''rw'' permissions, and [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot or [[udev]] automount rules if attached after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225386ReadyMedia2012-09-26T19:49:52Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external media storage drive, just make sure to set the user's ''rw'' permissions, and [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] if present at boot and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225385ReadyMedia2012-09-26T19:48:55Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external media storage drive, just make sure to set the user's ''rw'' permissions, and [http://linux.die.net/man/8/mount mount options] for the drive mounted at boot in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225384ReadyMedia2012-09-26T19:47:26Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
If you change MiniDLNA user, you can login as that user and create a symbolic link in the default ''Media_DB'' directory to a mounted in the system external media storage drive, just make sure to set the user's ''rw'' permissions and [http://linux.die.net/man/8/mount mount options] for the drive mounted at boot in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225382ReadyMedia2012-09-26T19:40:54Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI allow import to Windows over network any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225381ReadyMedia2012-09-26T19:37:53Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI can export over network to Windows any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning, block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225380ReadyMedia2012-09-26T19:37:15Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI can export over network to Windows any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper drive partitioning and block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225379ReadyMedia2012-09-26T19:36:01Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI can export over network to Windows any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed among other [http://en.wikipedia.org/w/index.php?title=Logical_Disk_Manager&section=6 advantages].<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225377ReadyMedia2012-09-26T19:24:37Z<p>Sambul13: /* Media Handling */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI can export over network to Windows any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a '''Thumbnail Maker''', and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225376ReadyMedia2012-09-26T19:24:16Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an '''ID3 Tag Converter'''.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI can export over network to Windows any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225373ReadyMedia2012-09-26T19:22:54Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI can export over network to Windows any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...- choice depends on file system and memory type) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=225371ReadyMedia2012-09-26T19:20:27Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage. NTFS is most compatible with Windows when plugging a drive directly for faster copy, while Samba, NFS or iSCSI can export over network to Windows any Linux file system. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 may affect memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash and HD drive speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=Start_X_at_login&diff=225079Start X at login2012-09-25T15:13:29Z<p>Sambul13: /* shell profile file */</p>
<hr />
<div>[[Category:X Server]]<br />
[[Category:Boot process]]<br />
[[es:Start X at Boot]]<br />
[[fr:Startx]]<br />
[[hu:Start X at Boot]]<br />
[[it:Start X at Boot]]<br />
[[pt:Start X at Boot]]<br />
[[ru:Start X at Boot]]<br />
[[th:Start X at Boot]]<br />
[[zh-CN:Start X at Login]]<br />
{{Article summary start}}<br />
{{Article summary text|Starting X automatically at login to a virtual terminal.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Automatic login to virtual console}}<br />
{{Article summary wiki|Display Manager}}<br />
{{Article summary wiki|Xinitrc}}<br />
{{Article summary end}}<br />
<br />
A [[Display Manager|display manager]] can be used to provide a login screen and start the [[X server]]. This article explains how this can be done using an existing virtual terminal.<br />
<br />
To manually start X, {{ic|startx}} or {{ic|xinit}} are used. Both will execute {{ic|~/.xinitrc}}, which may be customized to start the window manager of choice as described in the [[xinitrc]] article.<br />
<br />
== shell profile file ==<br />
<br />
{{Note|This runs X on the same tty used to login, which is required in order to maintain local permissions.}}<br />
<br />
For bash, add the following to the bottom of {{ic|~/.bash_profile}}. If the file does not exist, copy a skeleton version from {{ic|/etc/skel/.bash_profile}}.<br />
<br />
For zsh, add the following to {{ic|~/.zprofile}} instead.<br />
<br />
{{hc|shell profile file|<nowiki><br />
vt=$(fgconsole 2>/dev/null)<br />
(( vt == 1 )) && exec startx -- vt$vt &> ~/.xlog<br />
unset vt<br />
</nowiki>}}<br />
<br />
The user will be logged out when X is killed. In order to avoid this, remove the {{ic|exec}} part from the script. Also note the redirection of the output to {{ic|~/.xlog}}.<br />
<br />
If you experience Power Management and/or Disk Automount issues after starting X as a user, replace the above code in [https://bbs.archlinux.org/viewtopic.php?pid=1106828#p1106828 .xinitrc] and [https://bbs.archlinux.org/viewtopic.php?pid=1114594#p1114594 .bash_profile] in your user folder with the linked code.<br />
<br />
{{Tip|This method can be combined with [[automatic login to virtual console]] to provide autologin.}}</div>Sambul13https://wiki.archlinux.org/index.php?title=Start_X_at_login&diff=225077Start X at login2012-09-25T15:10:51Z<p>Sambul13: /* shell profile file */</p>
<hr />
<div>[[Category:X Server]]<br />
[[Category:Boot process]]<br />
[[es:Start X at Boot]]<br />
[[fr:Startx]]<br />
[[hu:Start X at Boot]]<br />
[[it:Start X at Boot]]<br />
[[pt:Start X at Boot]]<br />
[[ru:Start X at Boot]]<br />
[[th:Start X at Boot]]<br />
[[zh-CN:Start X at Login]]<br />
{{Article summary start}}<br />
{{Article summary text|Starting X automatically at login to a virtual terminal.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Automatic login to virtual console}}<br />
{{Article summary wiki|Display Manager}}<br />
{{Article summary wiki|Xinitrc}}<br />
{{Article summary end}}<br />
<br />
A [[Display Manager|display manager]] can be used to provide a login screen and start the [[X server]]. This article explains how this can be done using an existing virtual terminal.<br />
<br />
To manually start X, {{ic|startx}} or {{ic|xinit}} are used. Both will execute {{ic|~/.xinitrc}}, which may be customized to start the window manager of choice as described in the [[xinitrc]] article.<br />
<br />
== shell profile file ==<br />
<br />
{{Note|This runs X on the same tty used to login, which is required in order to maintain local permissions.}}<br />
<br />
For bash, add the following to the bottom of {{ic|~/.bash_profile}}. If the file does not exist, copy a skeleton version from {{ic|/etc/skel/.bash_profile}}.<br />
<br />
For zsh, add the following to {{ic|~/.zprofile}} instead.<br />
<br />
{{hc|shell profile file|<nowiki><br />
vt=$(fgconsole 2>/dev/null)<br />
(( vt == 1 )) && exec startx -- vt$vt &> ~/.xlog<br />
unset vt<br />
</nowiki>}}<br />
<br />
The user will be logged out when X is killed. In order to avoid this, remove the {{ic|exec}} part from the script. Also note the redirection of the output to {{ic|~/.xlog}}.<br />
<br />
If you experience Power Management and/or Disk Automount issues after starting X as a user, replace the above code in [https://bbs.archlinux.org/viewtopic.php?pid=1114594#p1114594 .bash_profile] and [https://bbs.archlinux.org/viewtopic.php?pid=1106828#p1106828 .xinitrc] in your user folder with the linked code.<br />
<br />
{{Tip|This method can be combined with [[automatic login to virtual console]] to provide autologin.}}</div>Sambul13https://wiki.archlinux.org/index.php?title=Xfce&diff=224923Xfce2012-09-24T18:47:53Z<p>Sambul13: /* Change mount options */</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[cs:Xfce]]<br />
[[de:Xfce]]<br />
[[es:Xfce]]<br />
[[fr:Xfce]]<br />
[[it:Xfce]]<br />
[[ja:Xfce]]<br />
[[pl:Xfce]]<br />
[[ru:Xfce]]<br />
[[tr:Xfce_Masaüstü_Ortamı]]<br />
[[uk:Xfce]]<br />
[[zh-CN:Xfce]]<br />
{{Article summary start}}<br />
{{Article summary text|Xfce is a lightweight desktop environment for Unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and user friendly. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|Xfce uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Thunar}}<br />
{{Article summary wiki|Improve GTK Application Looks}}<br />
{{Article summary wiki|Autostart applications#Graphical}}<br />
{{Article summary end}}<br />
<br />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
== What is Xfce? ==<br />
Xfce is a Desktop Environment, like [[GNOME]] or [[KDE]]. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Features:<br />
*Lighter on resources than the other major DEs (KDE, GNOME).<br />
*Most settings are exposed via a GUI, Xfce does not try to hide stuff from the user.<br />
*Xfwm has an optional built-in compositor which allows for true transparency and all the benefits of GPU acceleration (minimizes tearing, etc.).<br />
*It works great with multiple monitors.<br />
<br />
==Installation==<br />
<br />
Before starting, make sure you have the [[Xorg|X server]] installed and configured correctly.<br />
<br />
{{Note|Xfce is somewhat modular. That means there is no need for you to run every part, you can pick and choose some of them.}}<br />
<br />
The base Xfce system can be [[pacman|installed]] with the group {{Grp|xfce4}}, available in the [[Official Repositories]]. Pacman will ask you to select the packages to install, but you probably want to get them all by simply pressing {{Keypress|Enter}}. Additional packages, like panel plugins, notifications, and system tools are available in the {{Grp|xfce4-goodies}} group.<br />
<br />
{{Tip|Installing [[Gamin]] (the successor of [[FAM]]) is highly recommended.}}<br />
<br />
In order to get the xfce4-mixer to work with [[ALSA]], you need to install {{Pkg|gstreamer0.10-base-plugins}}. See [[#OSS|below]] for help with [[OSS]].<br />
<br />
== Running Xfce ==<br />
<br />
===Automatically at boot time===<br />
There are two methods to start Xfce (and in fact, any desktop or window manager) at boot time:<br />
<br />
* Run Xfce through a Display Manager<br />
* Run Xfce automatically using [[Bash#Configuration_file_overview|bash_profile]] or [[inittab]]<br />
<br />
See [[Display Manager]] for details about installing and configuring a Display Manager (be sure to configure it properly for [[PolicyKit]]). See [[Start X at Boot]] for configuration instructions on using bash_profile or inittab.<br />
<br />
===Manually===<br />
<br />
You can execute:<br />
$ startxfce4<br />
from the console, or configure [[xinitrc]] and use xinit or startx.<br />
<br />
If you have not created a {{ic|~/.xinitrc}} yet, do so with:<br />
<br />
$ cp /etc/skel/.xinitrc ~/.xinitrc<br />
<br />
and add the following line:<br />
<br />
exec startxfce4 --with-ck-launch<br />
<br />
Example:<br />
{{hc|~/.xinitrc|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
[ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
<br />
{{Note|<br />
*{{ic|--with-ck-launch}} starts a clean ConsoleKit session needed by Xfce for power management, automounting, shutting down, rebooting, etc. ConsoleKit/PolicyKit capable display managers such as gdm do this for you automatically and thus the command does not need to be specified seperatly.<br />
*{{pkg|xorg-xdm}} is also ConsoleKit/PolicyKit capable since version 1.1.11. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or .xsession for xdm.<br />
*[[SLiM]] is also ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or slim.conf login_cmd.<br />
*In case you are wondering, {{ic|dbus-launch}} will be launched by the {{ic|xinitrc.d}} code at the beginning of the file. {{ic|dbus-launch}} starts a dbus-daemon instance to provide communication with PolicyKit.<br />
*The proper command for launching Xfce is {{ic|startxfce4}}: do not start {{ic|xfce4-session}} directly, since it is already run by {{ic|startxfce4}} itself.<br />
*If you are running an Xfce older than 4.10, you will have to use {{ic|exec ck-launch-session startxfce4}}<br />
}}<br />
{{Note|{{ic|dbus-launch}} should actually be called '''after''' launching ConsoleKit, otherwise there will be authorization problems when mounting disks as a regular user, see {{Bug|25031}}. For a '''temporary''' workaround you can edit the {{ic|xinitrc.d}} script at the beginning of the file as follows, and '''keep an eye on the evolution of the bug report''' (and possibly vote it):<br />
{{hc|~/.xinitrc [temporary workaround]|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
# Do not launch dbus before ConsoleKit (FS#25031)<br />
#[ -x "$f" ] && . "$f"<br />
[ "$f" -ne "/etc/X11/xinit/xinitrc.d/30-dbus" ] && [ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
There is still no need to start {{ic|dbus-launch}} explicitly since {{ic|startxfce4}} takes care of doing that anyway.}}<br />
<br />
===Shutting down, rebooting, and automounting from within Xfce===<br />
* Make sure that '''dbus''' is enabled in the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}.<br />
* If a display manager is used:<br />
** Make sure that you are using {{ic|exec startxfce4 --with-ck-launch}} in {{ic|~/.xinitrc}} (along with sourcing xinitrc.d scripts, which is done for you in the skel file) '''or''' a ConsoleKit/PolicyKit capable [[display manager]].<br />
* If no display manager is used:<br />
** Make sure you use the bash_profile method to auto-login (not inittab).<br />
** For automounting to work the default Policykit has to be [https://bbs.archlinux.org/viewtopic.php?pid=881377#p881377 edited]. You can also install {{pkg|polkit-gnome}} for authorization.<br />
* If you want to automount removable disk in thunar, install and [https://wiki.archlinux.org/index.php/Thunar#Thunar_Volume_Manager configure] {{pkg|thunar-volman}} and {{pkg|gamin}}, and make sure {{pkg|gvfs}} and {{pkg|gvfs-afc}} is installed, see [https://bbs.archlinux.org/viewtopic.php?id=119992 details] .<br />
====Shutdown & reboot from shutdown menu when using systemd====<br />
If you are using systemd instead of sysvinit, when trying to shutdown or reboot from the shutdown menu of xfce4 it actually logout to DM; installing systemd-sysvcompat corrects this misbehavior.<br />
do {{ic|pacman -Sy systemd-sysvcompat}} as root and it should work right away.<br />
<br />
==Tips and tricks==<br />
===Configuring Xfconf settings===<br />
Xfconf is XFCE's system for storing configuration options, and most XFCE configuration is done by editing settings in Xfconf (one way or another). There are several ways to modify these settings:<br />
* The most obvious and easiest way is to go to "Settings" in the main menu and select the category you want to customize. However, not all customization options are available this way. <br />
* A less user-friendly but more general way is to go to {{bc|Main menu -> Settings -> Settings Editor}} where you can see and modify all the customization options. Any settings modified here will take effect immediately. The Settings Editor can also be launched from the command line by invoking {{ic|xfce4-settings-editor}}.<br />
* Customization can be done completely from the command line using the program {{ic|xfconf-query}}. See [http://docs.xfce.org/xfce/xfconf/xfconf-query the XFCE online documentation] for more information and examples and the rest of this wiki page for more examples. Settings changed here will take effect immediately.<br />
* The settings are stored in XML files in {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/}} which can be edited by hand. However, changes made here will not take effect immediately.<br />
* For more information: [http://docs.xfce.org/xfce/xfconf/start Xfconf documentation]<br />
===Panel===<br />
====How to customize xfce panel background====<br />
Edit {{ic|~/.gtkrc-2.0}}.<br />
Note that you must place the image in the same directory as the configuration, which is {{ic|~/}}. You can not specify the path to the image, or it will not work.<br />
style "panel-background" {<br />
bg_pixmap[NORMAL] = "foo.bar"<br />
bg_pixmap[PRELIGHT] = "foo.bar"<br />
bg_pixmap[ACTIVE] = "foo.bar"<br />
bg_pixmap[SELECTED] = "foo.bar"<br />
bg_pixmap[INSENSITIVE] = "foo.bar"<br />
}<br />
widget_class "*Panel*" style "panel-background"<br />
<br />
==== Replacements for the default 'menu' panel applet ====<br />
The "Ubuntu System Panel" (GNOME) panel applet has similar features to those found in its KDE v4.2 equivalent. It can be added to an Xfce panel via the 'XfApplet' panel applet, which allows GNOME applets to be used in Xfce.<br />
<br />
It is available in the [[Arch User Repository|AUR]] as the {{AUR|usp2}} package.<br />
<br />
====How to remove menu entries from the System menu====<br />
===== Method 1 =====<br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Open Terminal (Xfce menu > System > Terminal) and go to the {{ic|/usr/share/applications}} folder: {{bc|$ cd /usr/share/applications}}<br />
# This folder should be full of {{ic|.desktop}} files. To see a list type: {{bc|$ ls}}<br />
# Add {{ic|1=NoDisplay=true}} to the {{ic|.desktop}} file. For example, if you want to hide Firefox, type in the terminal:{{bc|1=$ sudo sh -c 'echo "NoDisplay=true" >> firefox.desktop'}} This command appends the text {{ic|1=NoDisplay=true}} to the end of the {{ic|.desktop}} file.<br />
<br />
===== Method 2 =====<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under {{ic|/usr/share/applications/}}.<br />
# In a terminal, copy everything from {{ic|/usr/share/applications}} to {{ic|~/.local/share/applications/}}: {{bc|$ cp /usr/share/applications/* ~/.local/share/applications/}}<br />
# For any entry you wish to hide from the menu, add the {{ic|1=NoDisplay=true}} option: {{bc|1=$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop}}<br />
<br />
You can also edit the application's category by editing the {{ic|.desktop}} file with a text editor and modifying the {{ic|1=Categories=}} line.<br />
<br />
===== Method 3 =====<br />
The third method is the '''cleanest''' and recommended in the [http://wiki.xfce.org/howto/customize-menu Xfce wiki].<br />
<br />
Create the file {{ic|~/.config/menus/xfce-applications.menu}} and copy the following in it:<br />
{{bc|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"><br />
<br />
<Menu><br />
<Name>Xfce</Name><br />
<MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile><br />
<br />
<Exclude><br />
<Filename>xfce4-run.desktop</Filename><br />
<br />
<Filename>exo-terminal-emulator.desktop</Filename><br />
<Filename>exo-file-manager.desktop</Filename><br />
<Filename>exo-mail-reader.desktop</Filename><br />
<Filename>exo-web-browser.desktop</Filename><br />
<br />
<Filename>xfce4-about.desktop</Filename><br />
<Filename>xfhelp4.desktop</Filename><br />
</Exclude><br />
<br />
<Layout><br />
<Merge type="all"/><br />
<Separator/><br />
<br />
<Menuname>Settings</Menuname><br />
<Separator/><br />
<br />
<Filename>xfce4-session-logout.desktop</Filename><br />
</Layout><br />
<br />
</Menu><br />
</nowiki>}}<br />
<br />
The {{ic|<MergeFile>}} tag includes the default Xfce menu in our file. This is important.<br />
<br />
The {{ic|<Exclude>}} tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude {{ic|firefox.desktop}} or any other application.<br />
<br />
The {{ic|<Layout>}} tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the aforementioned Xfce wiki page.<br />
<br />
===== Method 4 =====<br />
Alternatively a tool called [http://lxmed.sourceforge.net/ lxmed] can be used. Lxmed is a GUI tool written in Java for editing menu entires in LXDE, but it also works in Xfce4. Lxmed is available in the {{AUR|lxmed}} package from the [[AUR]].<br />
<br />
==== But what do you do with menu entries which do not show up in /usr/share/applications (e.g., apps installed via Wine)? ====<br />
I have found some shortcuts that show in the category “Other” in this directory:<br />
{{ic|~/.local/share/applications/wine/}}.<br />
<br />
====Panel autohide delay====<br />
Add this to {{ic|~/.gtkrc-2.0}}.<br />
style "xfce-panel-window-style"<br />
{<br />
# Time in miliseconds before the panel will unhide on an enter event<br />
XfcePanelWindow::popup-delay = 225<br />
<br />
# Time in miliseconds before the panel will hide on a leave event<br />
XfcePanelWindow::popdown-delay = 350<br />
}<br />
class "XfcePanelWindow" style "xfce-panel-window-style"<br />
<br />
====Panel at desktop level====<br />
<br />
If you want a panel at desktop level (i.e., other windows will stack over it) you need a little hack, ensure you have installed the '''wmctrl''' package.<br />
<br />
Create a script in {{ic|~/.config/xfce4/xfce4-fix-panel}} with this content and make it executable (you can use {{ic|chmod 755 xfce4-fix-panel}}).<br />
<br />
#!/bin/bash<br />
set -e<br />
<br />
function getPanelIdImpl() {<br />
# get panel id<br />
PANEL="`wmctrl -l | sed -n -e '/ xfce4-panel$/ s_ .*$__ p' | sed -n -e $1' p'`"<br />
}<br />
<br />
function getPanelId() {<br />
# eventually await the panel to appear<br />
getPanelIdImpl $1<br />
while [ x = x$PANEL ] ;do<br />
sleep 0.5s<br />
getPanelIdImpl $1<br />
done<br />
}<br />
<br />
function putPanelDown() {<br />
PANEL=""<br />
getPanelId $1<br />
wmctrl -i -r $PANEL -b add,below<br />
}<br />
<br />
# call the program with a list of panel numbers as arguments<br />
# for example, xfce4-fix-panel 1 2 3<br />
# for the first three panels<br />
for i in $* ;do<br />
putPanelDown $i<br />
done<br />
<br />
<br />
Once wrote the script, and tested it, you need to auto-execute it at each login. You can use the {{ic|Session and StartUp -> Application Autostart}} gui.<br />
<br />
This passage will put your panels at desktop level, but if your panel is sticking to a border the maximized windows will not stack over it. You can enable this behavior with the following command, fortunately you need to do this only once. (change the $ID with the panel number of interest)<br />
<br />
xfconf-query -c xfce4-panel -p /panels/panel-$ID/disable-struts -n -t bool -s true<br />
<br />
=== Desktop ===<br />
<br />
==== Use a transparent background for desktop icon titles ====<br />
To change the default white background of desktop icon titles to something more suitable, edit the {{ic|.gtkrc-2.0}} file in your home directory (or create the file if needed) and add the following:<br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71FFAD"<br />
fg[NORMAL] = "#ffffff"<br />
fg[SELECTED] = "#71B9FF"<br />
fg[ACTIVE] = "#71FFAD" }<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
<br />
==== Hide selected partitions on the desktop ====<br />
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example {{ic|/etc/udev/rules.d/10-local.rules}}:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_IGNORE}="1"<br />
<br />
Would show all partitions with the exception of sda1 and sda2 on your desktop.<br />
<br />
==== Switch to old desktop right click menu without Thunar things ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
==== Adding the kill window shortcut ====<br />
<br />
Xfce does not support the ''kill window'' shortcut directly, but you can add one with a simple script. Ensure you have the '''xorg-xkill''' package installed.<br />
<br />
Create a script in {{ic|~/.config/xfce4/killwindow.sh}} with this content and make it executable (you can use {{ic|chmod 755 killwindow.sh}}).<br />
<br />
xkill -id "`xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p'`"<br />
<br />
Now associate a shortcut using {{ic|Settings -> Keyboard}} to that script.<br />
<br />
=== XFWM4 ===<br />
==== How to enable the compositor in Xfce ====<br />
Xfce comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your {{ic|/etc/xorg.conf}}. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
==== Disable window roll-up ====<br />
xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false<br />
<br />
==== Disable/enable automatic resizing/tiling of windows at edge of screen ====<br />
XFWM4 has the ability to "tile" a window automatically when it is moved to the edge of the screen by resizing it to fill the top half of the screen. (The official XFCE website says this feature is disabled by default in XFCE 4.10, but it seems to be enabled by default on Arch Linux.) This behavior can be enabled or disabled in {{ic|Window Manager Tweaks --> Accessibility --> Automatically tile windows when moving toward the screen edge}}, or:<br />
<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s false # To disable<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s true # To enable<br />
<br />
=== Commands for the settings manager ===<br />
<br />
There is no official documentation for the commands executed. One must look at {{ic|.desktop}} files {{ic|/usr/share/applications/}} folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce4-accessibility-settings<br />
xfce4-power-manager-settings<br />
xfce4-settings-editor<br />
xfdesktop-settings<br />
xfce4-display-settings<br />
xfce4-keyboard-settings<br />
xfce4-mouse-settings<br />
xfce4-session-settings<br />
xfce4-settings-manager<br />
xfce4-appearance-settings<br />
xfwm4-settings<br />
xfwm4-tweaks-settings<br />
xfwm4-workspace-settings<br />
orage -p<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep '^Exec=' /usr/share/applications/xfce*settings* | sed -e 's_^.*=_ _'<br />
<br />
===Session===<br />
====Customizing Startup Applications====<br />
This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file {{ic|/etc/xdg/xfce4/xinitrc}} to {{ic|~/.config/xfce4/}}<br />
* Edit this file. For example, you can add something like this somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
====Switch between users====<br />
Xfce4 allows this behavior under the 'action buttons' menu item. Currently, both [[gdm]] and [[Lightdm#User_switching_under_xfce4|lightdm]] provide this functionality.<br />
<br />
==== Modify XML settings files directly ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the {{ic|~/.config/xfce4/xfconf/}} folder. For application keyboard shortcuts for example, the file is {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml}}. It is faster to copy and paste the XML keys that you want rather than using the GUI.<br />
<br />
===Removable Devices===<br />
If you want an icon appearing on your desktop and in thunar when you plug in external devices, make sure gvfs is installed:<br />
<br />
# pacman -S --needed gvfs<br />
<br />
You could also need to install gvfs-afc (read [https://bbs.archlinux.org/viewtopic.php?pid=889018 this discussion]):<br />
<br />
# pacman -S gvfs-afc<br />
<br />
It is also a good idea to install thunar-volman (included in the {{ic|xfce4-goodies}} group):<br />
<br />
# pacman -S thunar-volman<br />
<br />
Udisk and a udisk wrapper are recommended if you want to automount optical and external drives easily<br />
<br />
* [http://igurublog.wordpress.com/downloads/script-devmon/ devmon] - devmon ([https://aur.archlinux.org/packages.php?ID=45842 AUR]) is a configuration-less bash wrapper script for udisks which automounts optical discs and removable drives. It can also selectively autostart apps or execute commands after mounting, ignore specified devices and volume labels, and unmount removable drives.<br />
<br />
===How to add themes to XFCE===<br />
1. Go to [http://www.xfce-look.org www.xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using Squeeze/Xarchiver/CLI.<br />
<br />
3. Move the extracted folder to {{ic|/usr/share/themes}} (for all users) or {{ic|~/.themes}} (for just you). Inside {{ic|/usr/share/themes/abc}}, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. GTK theme is available here:<br />
Menu --> Settings --> Appearance<br />
You select your xfwm theme in:<br />
Menu --> Settings --> Window Manager<br />
<br />
=== Cursors ===<br />
Main article: [[X11 Cursors]]<br />
<br />
If you have alternative X cursor themes installed, Xfce can find them with:<br />
Menu --> Settings --> Mouse --> Theme<br />
<br />
=== Icons ===<br />
1. First find and download your desired icon pack. Recommended places to download icons from are [http://www.customize.org Customize.org], [http://opendesktop.org Opendesktop.org] and [http://xfce-look.org/ Xfce-look.org].<br />
<br />
2. Go to the directory where you downloaded the icon pack and extract it. Example {{ic|tar -xzf /home/user/downloads/icon-pack.tar.gz}}.<br />
<br />
3. Move the extracted folder containing the icons to {{ic|/usr/share/icons}} (if you want all users on the system to make use of the icons) or {{ic|~/.icons}} (if only you want to use the icons).<br />
<br />
Optional: run {{ic|gtk-update-icon-cache -f -t ~/.icons/<theme_name>}} to update icon cache<br />
<br />
4. Switch your icons by going to:<br />
Menu --> Settings --> Appearance --> Icons<br />
<br />
When you have icon theme problems, it is also recommended to install the {{Pkg|hicolor-icon-theme}} package if it was not already installed.<br />
<br />
=== Fonts ===<br />
<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearence click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<br />
<br />
=== Sound ===<br />
<br />
==== Configuring xfce4-mixer ====<br />
<br />
{{Pkg|xfce4-mixer}} is the GUI mixer app / panel plugin made by the Xfce team. It is part of the xfce4 group, so you probably already have it installed. Xfce 4.6 uses {{Pkg|gstreamer}} as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer. One or more of the gstreamer plugin packages listed as optional dependencies to xfce4-mixer must be installed. Without one of these required plugins packages, the following error arises when clicking on the mixer panel item.<br />
<br />
GStreamer was unable to detect any sound devices. Some sound system specific GStreamer packages may be missing. It may also be a permissions problem.<br />
<br />
(It is probably not a permissions problem. It is no longer required to add audio users to the "audio" group.) Which plugins are needed depends on the hardware. Most people should be fine with {{Pkg|gstreamer0.10-base-plugins}} which can be [[pacman|installed]] from [[Official Repositories]]. <br />
<br />
If the xfce4-mixer panel item was already running before one of the plugins packages was installed, logout and login to see if it worked, or just remove the mixer plugin from the panel and add it again. If that does not work, you might need more or different gstreamer plugins. Try to [[pacman|install]] package {{pkg|gstreamer0.10-good-plugins}} or {{pkg|gstreamer0.10-bad-plugins}}.<br />
<br />
For further details, for example how to set the default sound card, see [[Advanced Linux Sound Architecture]]. Alternatively you can use [[PulseAudio]] together with {{Pkg|pavucontrol}}.<br />
<br />
==== How do I get xfce4-mixer and OSS4 to work together? ====<br />
<br />
If you tried the above section to get {{Pkg|xfce4-mixer}} to work and it does not work at all, then you may have to compile gstreamer0.10-good-plugins yourself. Download the PKGBUILD and other files needed from ABS or [http://projects.archlinux.org/svntogit/packages.git/tree/gstreamer0.10-good/repos here], edit the PKGBUILD, add --enable-oss. <br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \<br />
'''--enable-oss \'''<br />
--disable-static --enable-experimental \<br />
--disable-schemas-install \<br />
--disable-hal \<br />
--with-package-name="GStreamer Good Plugins (Archlinux)" \<br />
--with-package-origin="http://www.archlinux.org/"<br />
<br />
and then run makepkg -i. <br />
<br />
makepkg -i<br />
<br />
Still not working? Try this package in AUR {{AUR|gstreamer0.10-good-plugins-ossv4}}, modify the pkgver to the newest in the PKGBUILD, and it should work.<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Change volume with keyboard volume buttons ====<br />
<br />
Go to <br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+ unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%- unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{ic|amixer set Master toggle}} does not work, try the PCM channel ({{ic|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{ic|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
Use one of these scripts: http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
===== Xfce4-volumed =====<br />
<br />
[https://aur.archlinux.org/packages.php?ID=31693 xfce4-volumed] daemon from the [[AUR]] automatically maps volume keys of your keyboard to Xfce-mixer. Additionally you get OSD through Xfce4-notifyd when changing volume. Xfce4-volumed does not need any configuration and is started automatically with Xfce.<br />
<br />
{{accuracy|reason=There should be a short explanation of what this does and why it fixes the issue (bug?).}}<br />
<br />
If you use pulseaudio and xfce4-volumed unmute does not work, try this:<br />
<br />
$ xfconf-query -c xfce4-mixer -p /active-card -s `xfconf-query -c xfce4-mixer -p /sound-card`<br />
<br />
===== Volumeicon =====<br />
<br />
{{pkg|volumeicon}} is an alternative to xfce4-volumed in the community repo also handling keybindings and notifications through {{pkg|xfce4-notifyd}}.<br />
<br />
==== Adding startup/boot sound ====<br />
<br />
Arch does not have a built-in startup sound configuration tool, but there is a workaround by adding the following command to your Application Autostart settings:<br />
<br />
aplay /boot/startupsound.wav<br />
<br />
The file location and filename can be whatever you want, but naming it descriptively and putting it in /boot keeps things tidy.<br />
<br />
=== xdg-open integration (Preferred Applications) ===<br />
<br />
Most applications rely on [[xdg-open]] for opening a preferred application for a given file or URL.<br />
<br />
In order for xdg-open and xdg-settings to detect and integrate with the XFCE desktop environment correctly, you need to [[pacman|install]] the {{Pkg|xorg-xprop}} package.<br />
<br />
If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed.<br />
Installing the package and allowing ''xdg-open'' to detect that you are running XFCE makes it forward all calls to ''exo-open'' instead, which correctly uses all your preferred applications preferences.<br />
<br />
To make sure xdg-open integration is working correctly, ask ''xdg-settings'' for the default web browser and see what the result is:<br />
<br />
# xdg-settings get default-web-browser<br />
<br />
If it replies with:<br />
<br />
xdg-settings: unknown desktop environment<br />
<br />
it means that it has failed to detect XFCE as your desktop environment, which is likely due to a missing {{Pkg|xorg-xprop}} package.<br />
<br />
=== Screenshots ===<br />
<br />
==== Using print-screen key ====<br />
<br />
A simple way is to use a command-line screenshot utility:<br />
<br />
# pacman -S scrot<br />
<br />
Then go to:<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "scrot" command to use the "PrintScreen" key.<br />
<br />
All screenshots will be placed in your home folder with unique names (i.e. {{ic|2009-02-19-063052_1280x1024_scrot.png}}).<br />
<br />
====Screenshooter====<br />
<br />
There is also an a screenshot plugin for the Xfce panel, which can be used instead of scrot, that is available in extra:<br />
<br />
# pacman -S xfce4-screenshooter<br />
<br />
You can add a keyboard binding for it using the command<br />
<br />
xfce4-screenshooter -f<br />
<br />
instead of "scrot". You will get a dialog window after pressing "Print" where you can copy the image to the clipboard or save it.<br />
<br />
=== Change mount options ===<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved by changing the default iocharset to utf8, which is easily done adding a line to {{ic|/etc/xdg/xfce4/mount.rc}}:<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
flush=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files, so be careful.<br />
<br />
It is possible to mount vfat devices with ''flush'' option, so that when copying to USB sticks data flushes more often, thus making thunar's progress bar to stays up until finished. Adding ''async'' instead will speed up write ops, but make sure to use ''Eject'' option in Thunar to unmount the stick. Globally, mount options for storage devices present at boot can be set in [[fstab]], and for other devices in [[udev]] rules.<br />
<br />
===Terminal tango color theme===<br />
Open with your favorite editor<br />
<br />
~/.config/Terminal/terminalrc<br />
<br />
And add(replace) this lines:<br />
<br />
ColorForeground=White<br />
ColorBackground=#323232323232<br />
ColorPalette1=#2e2e34343636<br />
ColorPalette2=#cccc00000000<br />
ColorPalette3=#4e4e9a9a0606<br />
ColorPalette4=#c4c4a0a00000<br />
ColorPalette5=#34346565a4a4<br />
ColorPalette6=#757550507b7b<br />
ColorPalette7=#060698989a9a<br />
ColorPalette8=#d3d3d7d7cfcf<br />
ColorPalette9=#555557575353<br />
ColorPalette10=#efef29292929<br />
ColorPalette11=#8a8ae2e23434<br />
ColorPalette12=#fcfce9e94f4f<br />
ColorPalette13=#72729f9fcfcf<br />
ColorPalette14=#adad7f7fa8a8<br />
ColorPalette15=#3434e2e2e2e2<br />
ColorPalette16=#eeeeeeeeecec<br />
<br />
=== Colour management ===<br />
xfce4-settings-manager does not yet have any colour management / calibration settings, nor is there any specific XFCE program to characterise your monitor.<br />
<br />
==== Loading a profile ====<br />
If you wish to '''load an icc profile''' (that you have previously created or downloaded) to calibrate your display on startup, you can download {{AUR|xcalib}} from [[AUR]], then open the XFCE4 Settings Manager, click Session and Startup icon, the Autostart tab, and add a new entry where the command is {{ic|/usr/bin/xcalib /path/to/your/profile.icc}}. You still need to tell your applications, which display profile should be used to have the displayed images colour managed.<br />
<br />
Another option is dispwin. Dispwin not only calibrates the display, but also sets the _ICC_PROFILE atom in X so that some applications can use a "system" display profile instead of requiring the user to set the display profile manually (GIMP, Inkscape, darktable, UFRaw, etc.).<br />
<br />
See [[ICC_Profiles#Loading_ICC_Profiles]] for more information.<br />
<br />
==== Creating a profile ====<br />
<br />
If you wish to '''create an icc profile''' for your display (ie. characterising/profiling, e.g. with the [[ColorHug]], or some other colorimeter, or a spectrophotometer, or "by eye"), the simplest option may be to install [https://aur.archlinux.org/packages.php?ID=25883 dispcalGUI] from [[AUR]]. <br />
<br />
Another option is {{ic|gnome-control-center}} (available in extra), which has a much simpler GUI, but less options and requires installing some Gnome dependencies. In order to start the calibration from the command line, first do {{ic|colormgr get-devices}} and look for the "Device ID" line of your monitor. If this is e.g. "xrandr-Lenovo Group Limited", you start calibration with the commabnd {{ic|gcm-calibrate --device "xrandr-Lenovo Group Limited"}}.<br />
{{Note|1=It seems like you need to run the full gnome-control-center because XFCE does not yet have a session component for colord: https://bugzilla.xfce.org/show_bug.cgi?id=8559}}<br />
<br />
See [[ICC Profiles]] for more information.<br />
<br />
=== XDG User Directories ===<br />
freedesktop.org specifies the "well known" user directories like the desktop folder and the music folder. The {{Pkg|xdg-user-dirs}} to manage them and it also handles localization (i.e. translation) of the filenames.<br />
# pacman -S xdg-user-dirs<br />
If you want to use the directories with your localized names, run the following command on your user:<br />
$ xdg-user-dirs-update<br />
If you want to revert to English, run the following:<br />
$ LC_ALL=C xdg-user-dirs-update<br />
It then creates localized (or English) versions of these directories in your home directory and sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config). The Xfce and other softwares complying the freedesktop.org knows that is where those types of files should go by default.<br />
<br />
In the case of the French:<br />
<br />
{{hc|~/.config/user-dirs.locale|<br />
fr_FR}}<br />
{{hc|~/.config/user-dirs.dirs|<nowiki><br />
XDG_DESKTOP_DIR="$HOME/Bureau"<br />
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"<br />
XDG_TEMPLATES_DIR="$HOME/Exemples"<br />
XDG_PUBLICSHARE_DIR="$HOME/Public"<br />
XDG_DOCUMENTS_DIR="$HOME/Documents"<br />
XDG_MUSIC_DIR="$HOME/Musiques"<br />
XDG_PICTURES_DIR="$HOME/Images"<br />
XDG_VIDEOS_DIR="$HOME/Vidéos"</nowiki>}}<br />
<br />
You can edit these files directly by using text editor.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Unable to open external windows partitions ===<br />
If you have external partitions like a fat32 drive connected via eSata, and launching them from the desktop results in a dialog telling you 'Authentication is required', you need to ensure polkit-gnome is installed and PolicyKit Authentication Agent is started by xfce4.<br />
pacman -S polkit-gnome<br />
Restart xfce4 and go:<br />
Applications Menu > Settings > Sessions and Startup<br />
Check that PolicyKit Authentication Agent is enabled under the Application Autostart tab.<br />
<br />
=== xfce4-power-manager is not working ===<br />
Check you have added dbus to the {{ic|DAEMONS}} array in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Xfce4-xkb-plugin settings issue ===<br />
There is a bug in version ''0.5.4.1-1'' which causes xkb-plugin to ''lose keyboard, layout switching and compose key'' settings. As a workaround you may enable ''Use system defaults'' option in keyboard settings. To do so run<br />
xfce4-keyboard-settings<br />
Go to ''Layout'' tab and set the ''Use system defaults'' flag, then reconfigure xkb-plugin.<br />
<br />
=== Thunar does not display any thumbnail ===<br />
<br />
Thunar relies on '''Tumbler''' to generate thumbnails. You can install Tumbler by issuing<br />
<br />
pacman -S tumbler<br />
<br />
More details in [[Thunar#Thunar_Thumbnailers|Thunar's page]].<br />
<br />
=== Locales ignored with GDM ===<br />
Become superuser and add your locale to /var/lib/AccountsService/users/$USER:<br />
su -c "nano /var/lib/AccountsService/users/$USER"<br />
Replace hu_HU.UTF-8 with your own locale:<br />
[User]<br />
Language=hu_HU.UTF-8<br />
XSession=xfce<br />
You may also do it with sed. Note the backslash before .UTF-8:<br />
su -c "sed -i 's/Language=.*/Language=hu_HU\.UTF-8/' /var/lib/AccountsService/users/$USER"<br />
Restart GDM to take effect.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming {{ic|~/.config/xfce4-session/}} and {{ic|~/.config/xfce4/}}<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Logout and login for changes to take effect.<br />
<br />
=== NVIDIA and xfce4-sensors-plugin ===<br />
To detect and use sensors of nvidia gpu you need to install {{AUR|libxnvctrl}} and then recompile {{Pkg|xfce4-sensors-plugin}} package.<br />
<br />
=== Session failure ===<br />
If the window manager does not load correctly (The mouse is a X and you cannot close windows) you maybe got an session error.<br />
To remove a corrupt session you can delete the session folder at the {{ic|.cache}} folder.<br />
# rm -r ~/.cache/sessions/<br />
The easy way to reload the session is to reboot the computer. You can also restart xfce.<br />
<br />
=== Clock/notification area no longer pushed to the right edge of the panel in Xfce 4.10 ===<br />
<br />
This is due to a change in the Window Buttons panel plugin which no longer expands to fill the available space.<br />
<br />
To emulate the old behavior, add a transparent separator between the window buttons and the clock/notification area, setting its expand property.<br />
<br />
=== Preferred Applications preferences have no effect ===<br />
<br />
If you have set your preferred applications with ''exo-preferred-applications'', but they do not seem to be taken into consideration, see [[Xfce#xdg-open_integration_.28Preferred_Applications.29]]<br />
<br />
==See also==<br />
* http://docs.xfce.org/ - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]</div>Sambul13https://wiki.archlinux.org/index.php?title=Xfce&diff=224754Xfce2012-09-23T16:02:56Z<p>Sambul13: /* Change mount options */</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[cs:Xfce]]<br />
[[de:Xfce]]<br />
[[es:Xfce]]<br />
[[fr:Xfce]]<br />
[[it:Xfce]]<br />
[[ja:Xfce]]<br />
[[pl:Xfce]]<br />
[[ru:Xfce]]<br />
[[tr:Xfce_Masaüstü_Ortamı]]<br />
[[uk:Xfce]]<br />
[[zh-CN:Xfce]]<br />
{{Article summary start}}<br />
{{Article summary text|Xfce is a lightweight desktop environment for Unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and user friendly. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|Xfce uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Thunar}}<br />
{{Article summary wiki|Improve GTK Application Looks}}<br />
{{Article summary wiki|Autostart applications#Graphical}}<br />
{{Article summary end}}<br />
<br />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
== What is Xfce? ==<br />
Xfce is a Desktop Environment, like [[GNOME]] or [[KDE]]. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Features:<br />
*Lighter on resources than the other major DEs (KDE, GNOME).<br />
*Most settings are exposed via a GUI, Xfce does not try to hide stuff from the user.<br />
*Xfwm has an optional built-in compositor which allows for true transparency and all the benefits of GPU acceleration (minimizes tearing, etc.).<br />
*It works great with multiple monitors.<br />
<br />
==Installation==<br />
<br />
Before starting, make sure you have the [[Xorg|X server]] installed and configured correctly.<br />
<br />
{{Note|Xfce is somewhat modular. That means there is no need for you to run every part, you can pick and choose some of them.}}<br />
<br />
The base Xfce system can be [[pacman|installed]] with the group {{Grp|xfce4}}, available in the [[Official Repositories]]. Pacman will ask you to select the packages to install, but you probably want to get them all by simply pressing {{Keypress|Enter}}. Additional packages, like panel plugins, notifications, and system tools are available in the {{Grp|xfce4-goodies}} group.<br />
<br />
{{Tip|Installing [[Gamin]] (the successor of [[FAM]]) is highly recommended.}}<br />
<br />
In order to get the xfce4-mixer to work with [[ALSA]], you need to install {{Pkg|gstreamer0.10-base-plugins}}. See [[#OSS|below]] for help with [[OSS]].<br />
<br />
== Running Xfce ==<br />
<br />
===Automatically at boot time===<br />
There are two methods to start Xfce (and in fact, any desktop or window manager) at boot time:<br />
<br />
* Run Xfce through a Display Manager<br />
* Run Xfce automatically using [[Bash#Configuration_file_overview|bash_profile]] or [[inittab]]<br />
<br />
See [[Display Manager]] for details about installing and configuring a Display Manager (be sure to configure it properly for [[PolicyKit]]). See [[Start X at Boot]] for configuration instructions on using bash_profile or inittab.<br />
<br />
===Manually===<br />
<br />
You can execute:<br />
$ startxfce4<br />
from the console, or configure [[xinitrc]] and use xinit or startx.<br />
<br />
If you have not created a {{ic|~/.xinitrc}} yet, do so with:<br />
<br />
$ cp /etc/skel/.xinitrc ~/.xinitrc<br />
<br />
and add the following line:<br />
<br />
exec startxfce4 --with-ck-launch<br />
<br />
Example:<br />
{{hc|~/.xinitrc|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
[ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
<br />
{{Note|<br />
*{{ic|--with-ck-launch}} starts a clean ConsoleKit session needed by Xfce for power management, automounting, shutting down, rebooting, etc. ConsoleKit/PolicyKit capable display managers such as gdm do this for you automatically and thus the command does not need to be specified seperatly.<br />
*{{pkg|xorg-xdm}} is also ConsoleKit/PolicyKit capable since version 1.1.11. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or .xsession for xdm.<br />
*[[SLiM]] is also ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or slim.conf login_cmd.<br />
*In case you are wondering, {{ic|dbus-launch}} will be launched by the {{ic|xinitrc.d}} code at the beginning of the file. {{ic|dbus-launch}} starts a dbus-daemon instance to provide communication with PolicyKit.<br />
*The proper command for launching Xfce is {{ic|startxfce4}}: do not start {{ic|xfce4-session}} directly, since it is already run by {{ic|startxfce4}} itself.<br />
*If you are running an Xfce older than 4.10, you will have to use {{ic|exec ck-launch-session startxfce4}}<br />
}}<br />
{{Note|{{ic|dbus-launch}} should actually be called '''after''' launching ConsoleKit, otherwise there will be authorization problems when mounting disks as a regular user, see {{Bug|25031}}. For a '''temporary''' workaround you can edit the {{ic|xinitrc.d}} script at the beginning of the file as follows, and '''keep an eye on the evolution of the bug report''' (and possibly vote it):<br />
{{hc|~/.xinitrc [temporary workaround]|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
# Do not launch dbus before ConsoleKit (FS#25031)<br />
#[ -x "$f" ] && . "$f"<br />
[ "$f" -ne "/etc/X11/xinit/xinitrc.d/30-dbus" ] && [ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
There is still no need to start {{ic|dbus-launch}} explicitly since {{ic|startxfce4}} takes care of doing that anyway.}}<br />
<br />
===Shutting down, rebooting, and automounting from within Xfce===<br />
* Make sure that '''dbus''' is enabled in the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}.<br />
* If a display manager is used:<br />
** Make sure that you are using {{ic|exec startxfce4 --with-ck-launch}} in {{ic|~/.xinitrc}} (along with sourcing xinitrc.d scripts, which is done for you in the skel file) '''or''' a ConsoleKit/PolicyKit capable [[display manager]].<br />
* If no display manager is used:<br />
** Make sure you use the bash_profile method to auto-login (not inittab).<br />
** For automounting to work the default Policykit has to be [https://bbs.archlinux.org/viewtopic.php?pid=881377#p881377 edited]. You can also install {{pkg|polkit-gnome}} for authorization.<br />
* If you want to automount removable disk in thunar, install and [https://wiki.archlinux.org/index.php/Thunar#Thunar_Volume_Manager configure] {{pkg|thunar-volman}} and {{pkg|gamin}}, and make sure {{pkg|gvfs}} and {{pkg|gvfs-afc}} is installed, see [https://bbs.archlinux.org/viewtopic.php?id=119992 details] .<br />
====Shutdown & reboot from shutdown menu when using systemd====<br />
If you are using systemd instead of sysvinit, when trying to shutdown or reboot from the shutdown menu of xfce4 it actually logout to DM; installing systemd-sysvcompat corrects this misbehavior.<br />
do {{ic|pacman -Sy systemd-sysvcompat}} as root and it should work right away.<br />
<br />
==Tips and tricks==<br />
===Configuring Xfconf settings===<br />
Xfconf is XFCE's system for storing configuration options, and most XFCE configuration is done by editing settings in Xfconf (one way or another). There are several ways to modify these settings:<br />
* The most obvious and easiest way is to go to "Settings" in the main menu and select the category you want to customize. However, not all customization options are available this way. <br />
* A less user-friendly but more general way is to go to {{bc|Main menu -> Settings -> Settings Editor}} where you can see and modify all the customization options. Any settings modified here will take effect immediately. The Settings Editor can also be launched from the command line by invoking {{ic|xfce4-settings-editor}}.<br />
* Customization can be done completely from the command line using the program {{ic|xfconf-query}}. See [http://docs.xfce.org/xfce/xfconf/xfconf-query the XFCE online documentation] for more information and examples and the rest of this wiki page for more examples. Settings changed here will take effect immediately.<br />
* The settings are stored in XML files in {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/}} which can be edited by hand. However, changes made here will not take effect immediately.<br />
* For more information: [http://docs.xfce.org/xfce/xfconf/start Xfconf documentation]<br />
===Panel===<br />
====How to customize xfce panel background====<br />
Edit {{ic|~/.gtkrc-2.0}}.<br />
Note that you must place the image in the same directory as the configuration, which is {{ic|~/}}. You can not specify the path to the image, or it will not work.<br />
style "panel-background" {<br />
bg_pixmap[NORMAL] = "foo.bar"<br />
bg_pixmap[PRELIGHT] = "foo.bar"<br />
bg_pixmap[ACTIVE] = "foo.bar"<br />
bg_pixmap[SELECTED] = "foo.bar"<br />
bg_pixmap[INSENSITIVE] = "foo.bar"<br />
}<br />
widget_class "*Panel*" style "panel-background"<br />
<br />
==== Replacements for the default 'menu' panel applet ====<br />
The "Ubuntu System Panel" (GNOME) panel applet has similar features to those found in its KDE v4.2 equivalent. It can be added to an Xfce panel via the 'XfApplet' panel applet, which allows GNOME applets to be used in Xfce.<br />
<br />
It is available in the [[Arch User Repository|AUR]] as the {{AUR|usp2}} package.<br />
<br />
====How to remove menu entries from the System menu====<br />
===== Method 1 =====<br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Open Terminal (Xfce menu > System > Terminal) and go to the {{ic|/usr/share/applications}} folder: {{bc|$ cd /usr/share/applications}}<br />
# This folder should be full of {{ic|.desktop}} files. To see a list type: {{bc|$ ls}}<br />
# Add {{ic|1=NoDisplay=true}} to the {{ic|.desktop}} file. For example, if you want to hide Firefox, type in the terminal:{{bc|1=$ sudo sh -c 'echo "NoDisplay=true" >> firefox.desktop'}} This command appends the text {{ic|1=NoDisplay=true}} to the end of the {{ic|.desktop}} file.<br />
<br />
===== Method 2 =====<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under {{ic|/usr/share/applications/}}.<br />
# In a terminal, copy everything from {{ic|/usr/share/applications}} to {{ic|~/.local/share/applications/}}: {{bc|$ cp /usr/share/applications/* ~/.local/share/applications/}}<br />
# For any entry you wish to hide from the menu, add the {{ic|1=NoDisplay=true}} option: {{bc|1=$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop}}<br />
<br />
You can also edit the application's category by editing the {{ic|.desktop}} file with a text editor and modifying the {{ic|1=Categories=}} line.<br />
<br />
===== Method 3 =====<br />
The third method is the '''cleanest''' and recommended in the [http://wiki.xfce.org/howto/customize-menu Xfce wiki].<br />
<br />
Create the file {{ic|~/.config/menus/xfce-applications.menu}} and copy the following in it:<br />
{{bc|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"><br />
<br />
<Menu><br />
<Name>Xfce</Name><br />
<MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile><br />
<br />
<Exclude><br />
<Filename>xfce4-run.desktop</Filename><br />
<br />
<Filename>exo-terminal-emulator.desktop</Filename><br />
<Filename>exo-file-manager.desktop</Filename><br />
<Filename>exo-mail-reader.desktop</Filename><br />
<Filename>exo-web-browser.desktop</Filename><br />
<br />
<Filename>xfce4-about.desktop</Filename><br />
<Filename>xfhelp4.desktop</Filename><br />
</Exclude><br />
<br />
<Layout><br />
<Merge type="all"/><br />
<Separator/><br />
<br />
<Menuname>Settings</Menuname><br />
<Separator/><br />
<br />
<Filename>xfce4-session-logout.desktop</Filename><br />
</Layout><br />
<br />
</Menu><br />
</nowiki>}}<br />
<br />
The {{ic|<MergeFile>}} tag includes the default Xfce menu in our file. This is important.<br />
<br />
The {{ic|<Exclude>}} tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude {{ic|firefox.desktop}} or any other application.<br />
<br />
The {{ic|<Layout>}} tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the aforementioned Xfce wiki page.<br />
<br />
===== Method 4 =====<br />
Alternatively a tool called [http://lxmed.sourceforge.net/ lxmed] can be used. Lxmed is a GUI tool written in Java for editing menu entires in LXDE, but it also works in Xfce4. Lxmed is available in the {{AUR|lxmed}} package from the [[AUR]].<br />
<br />
==== But what do you do with menu entries which do not show up in /usr/share/applications (e.g., apps installed via Wine)? ====<br />
I have found some shortcuts that show in the category “Other” in this directory:<br />
{{ic|~/.local/share/applications/wine/}}.<br />
<br />
====Panel autohide delay====<br />
Add this to {{ic|~/.gtkrc-2.0}}.<br />
style "xfce-panel-window-style"<br />
{<br />
# Time in miliseconds before the panel will unhide on an enter event<br />
XfcePanelWindow::popup-delay = 225<br />
<br />
# Time in miliseconds before the panel will hide on a leave event<br />
XfcePanelWindow::popdown-delay = 350<br />
}<br />
class "XfcePanelWindow" style "xfce-panel-window-style"<br />
<br />
====Panel at desktop level====<br />
<br />
If you want a panel at desktop level (i.e., other windows will stack over it) you need a little hack, ensure you have installed the '''wmctrl''' package.<br />
<br />
Create a script in {{ic|~/.config/xfce4/xfce4-fix-panel}} with this content and make it executable (you can use {{ic|chmod 755 xfce4-fix-panel}}).<br />
<br />
#!/bin/bash<br />
set -e<br />
<br />
function getPanelIdImpl() {<br />
# get panel id<br />
PANEL="`wmctrl -l | sed -n -e '/ xfce4-panel$/ s_ .*$__ p' | sed -n -e $1' p'`"<br />
}<br />
<br />
function getPanelId() {<br />
# eventually await the panel to appear<br />
getPanelIdImpl $1<br />
while [ x = x$PANEL ] ;do<br />
sleep 0.5s<br />
getPanelIdImpl $1<br />
done<br />
}<br />
<br />
function putPanelDown() {<br />
PANEL=""<br />
getPanelId $1<br />
wmctrl -i -r $PANEL -b add,below<br />
}<br />
<br />
# call the program with a list of panel numbers as arguments<br />
# for example, xfce4-fix-panel 1 2 3<br />
# for the first three panels<br />
for i in $* ;do<br />
putPanelDown $i<br />
done<br />
<br />
<br />
Once wrote the script, and tested it, you need to auto-execute it at each login. You can use the {{ic|Session and StartUp -> Application Autostart}} gui.<br />
<br />
This passage will put your panels at desktop level, but if your panel is sticking to a border the maximized windows will not stack over it. You can enable this behavior with the following command, fortunately you need to do this only once. (change the $ID with the panel number of interest)<br />
<br />
xfconf-query -c xfce4-panel -p /panels/panel-$ID/disable-struts -n -t bool -s true<br />
<br />
=== Desktop ===<br />
<br />
==== Use a transparent background for desktop icon titles ====<br />
To change the default white background of desktop icon titles to something more suitable, edit the {{ic|.gtkrc-2.0}} file in your home directory (or create the file if needed) and add the following:<br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71FFAD"<br />
fg[NORMAL] = "#ffffff"<br />
fg[SELECTED] = "#71B9FF"<br />
fg[ACTIVE] = "#71FFAD" }<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
<br />
==== Hide selected partitions on the desktop ====<br />
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example {{ic|/etc/udev/rules.d/10-local.rules}}:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_IGNORE}="1"<br />
<br />
Would show all partitions with the exception of sda1 and sda2 on your desktop.<br />
<br />
==== Switch to old desktop right click menu without Thunar things ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
==== Adding the kill window shortcut ====<br />
<br />
Xfce does not support the ''kill window'' shortcut directly, but you can add one with a simple script. Ensure you have the '''xorg-xkill''' package installed.<br />
<br />
Create a script in {{ic|~/.config/xfce4/killwindow.sh}} with this content and make it executable (you can use {{ic|chmod 755 killwindow.sh}}).<br />
<br />
xkill -id "`xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p'`"<br />
<br />
Now associate a shortcut using {{ic|Settings -> Keyboard}} to that script.<br />
<br />
=== XFWM4 ===<br />
==== How to enable the compositor in Xfce ====<br />
Xfce comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your {{ic|/etc/xorg.conf}}. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
==== Disable window roll-up ====<br />
xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false<br />
<br />
==== Disable/enable automatic resizing/tiling of windows at edge of screen ====<br />
XFWM4 has the ability to "tile" a window automatically when it is moved to the edge of the screen by resizing it to fill the top half of the screen. (The official XFCE website says this feature is disabled by default in XFCE 4.10, but it seems to be enabled by default on Arch Linux.) This behavior can be enabled or disabled in {{ic|Window Manager Tweaks --> Accessibility --> Automatically tile windows when moving toward the screen edge}}, or:<br />
<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s false # To disable<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s true # To enable<br />
<br />
=== Commands for the settings manager ===<br />
<br />
There is no official documentation for the commands executed. One must look at {{ic|.desktop}} files {{ic|/usr/share/applications/}} folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce4-accessibility-settings<br />
xfce4-power-manager-settings<br />
xfce4-settings-editor<br />
xfdesktop-settings<br />
xfce4-display-settings<br />
xfce4-keyboard-settings<br />
xfce4-mouse-settings<br />
xfce4-session-settings<br />
xfce4-settings-manager<br />
xfce4-appearance-settings<br />
xfwm4-settings<br />
xfwm4-tweaks-settings<br />
xfwm4-workspace-settings<br />
orage -p<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep '^Exec=' /usr/share/applications/xfce*settings* | sed -e 's_^.*=_ _'<br />
<br />
===Session===<br />
====Customizing Startup Applications====<br />
This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file {{ic|/etc/xdg/xfce4/xinitrc}} to {{ic|~/.config/xfce4/}}<br />
* Edit this file. For example, you can add something like this somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
====Switch between users====<br />
Xfce4 allows this behavior under the 'action buttons' menu item. Currently, both [[gdm]] and [[Lightdm#User_switching_under_xfce4|lightdm]] provide this functionality.<br />
<br />
==== Modify XML settings files directly ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the {{ic|~/.config/xfce4/xfconf/}} folder. For application keyboard shortcuts for example, the file is {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml}}. It is faster to copy and paste the XML keys that you want rather than using the GUI.<br />
<br />
===Removable Devices===<br />
If you want an icon appearing on your desktop and in thunar when you plug in external devices, make sure gvfs is installed:<br />
<br />
# pacman -S --needed gvfs<br />
<br />
You could also need to install gvfs-afc (read [https://bbs.archlinux.org/viewtopic.php?pid=889018 this discussion]):<br />
<br />
# pacman -S gvfs-afc<br />
<br />
It is also a good idea to install thunar-volman (included in the {{ic|xfce4-goodies}} group):<br />
<br />
# pacman -S thunar-volman<br />
<br />
Udisk and a udisk wrapper are recommended if you want to automount optical and external drives easily<br />
<br />
* [http://igurublog.wordpress.com/downloads/script-devmon/ devmon] - devmon ([https://aur.archlinux.org/packages.php?ID=45842 AUR]) is a configuration-less bash wrapper script for udisks which automounts optical discs and removable drives. It can also selectively autostart apps or execute commands after mounting, ignore specified devices and volume labels, and unmount removable drives.<br />
<br />
===How to add themes to XFCE===<br />
1. Go to [http://www.xfce-look.org www.xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using Squeeze/Xarchiver/CLI.<br />
<br />
3. Move the extracted folder to {{ic|/usr/share/themes}} (for all users) or {{ic|~/.themes}} (for just you). Inside {{ic|/usr/share/themes/abc}}, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. GTK theme is available here:<br />
Menu --> Settings --> Appearance<br />
You select your xfwm theme in:<br />
Menu --> Settings --> Window Manager<br />
<br />
=== Cursors ===<br />
Main article: [[X11 Cursors]]<br />
<br />
If you have alternative X cursor themes installed, Xfce can find them with:<br />
Menu --> Settings --> Mouse --> Theme<br />
<br />
=== Icons ===<br />
1. First find and download your desired icon pack. Recommended places to download icons from are [http://www.customize.org Customize.org], [http://opendesktop.org Opendesktop.org] and [http://xfce-look.org/ Xfce-look.org].<br />
<br />
2. Go to the directory where you downloaded the icon pack and extract it. Example {{ic|tar -xzf /home/user/downloads/icon-pack.tar.gz}}.<br />
<br />
3. Move the extracted folder containing the icons to {{ic|/usr/share/icons}} (if you want all users on the system to make use of the icons) or {{ic|~/.icons}} (if only you want to use the icons).<br />
<br />
Optional: run {{ic|gtk-update-icon-cache -f -t ~/.icons/<theme_name>}} to update icon cache<br />
<br />
4. Switch your icons by going to:<br />
Menu --> Settings --> Appearance --> Icons<br />
<br />
When you have icon theme problems, it is also recommended to install the {{Pkg|hicolor-icon-theme}} package if it was not already installed.<br />
<br />
=== Fonts ===<br />
<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearence click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<br />
<br />
=== Sound ===<br />
<br />
==== Configuring xfce4-mixer ====<br />
<br />
{{Pkg|xfce4-mixer}} is the GUI mixer app / panel plugin made by the Xfce team. It is part of the xfce4 group, so you probably already have it installed. Xfce 4.6 uses {{Pkg|gstreamer}} as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer. One or more of the gstreamer plugin packages listed as optional dependencies to xfce4-mixer must be installed. Without one of these required plugins packages, the following error arises when clicking on the mixer panel item.<br />
<br />
GStreamer was unable to detect any sound devices. Some sound system specific GStreamer packages may be missing. It may also be a permissions problem.<br />
<br />
(It is probably not a permissions problem. It is no longer required to add audio users to the "audio" group.) Which plugins are needed depends on the hardware. Most people should be fine with {{Pkg|gstreamer0.10-base-plugins}} which can be [[pacman|installed]] from [[Official Repositories]]. <br />
<br />
If the xfce4-mixer panel item was already running before one of the plugins packages was installed, logout and login to see if it worked, or just remove the mixer plugin from the panel and add it again. If that does not work, you might need more or different gstreamer plugins. Try to [[pacman|install]] package {{pkg|gstreamer0.10-good-plugins}} or {{pkg|gstreamer0.10-bad-plugins}}.<br />
<br />
For further details, for example how to set the default sound card, see [[Advanced Linux Sound Architecture]]. Alternatively you can use [[PulseAudio]] together with {{Pkg|pavucontrol}}.<br />
<br />
==== How do I get xfce4-mixer and OSS4 to work together? ====<br />
<br />
If you tried the above section to get {{Pkg|xfce4-mixer}} to work and it does not work at all, then you may have to compile gstreamer0.10-good-plugins yourself. Download the PKGBUILD and other files needed from ABS or [http://projects.archlinux.org/svntogit/packages.git/tree/gstreamer0.10-good/repos here], edit the PKGBUILD, add --enable-oss. <br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \<br />
'''--enable-oss \'''<br />
--disable-static --enable-experimental \<br />
--disable-schemas-install \<br />
--disable-hal \<br />
--with-package-name="GStreamer Good Plugins (Archlinux)" \<br />
--with-package-origin="http://www.archlinux.org/"<br />
<br />
and then run makepkg -i. <br />
<br />
makepkg -i<br />
<br />
Still not working? Try this package in AUR {{AUR|gstreamer0.10-good-plugins-ossv4}}, modify the pkgver to the newest in the PKGBUILD, and it should work.<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Change volume with keyboard volume buttons ====<br />
<br />
Go to <br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+ unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%- unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{ic|amixer set Master toggle}} does not work, try the PCM channel ({{ic|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{ic|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
Use one of these scripts: http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
===== Xfce4-volumed =====<br />
<br />
[https://aur.archlinux.org/packages.php?ID=31693 xfce4-volumed] daemon from the [[AUR]] automatically maps volume keys of your keyboard to Xfce-mixer. Additionally you get OSD through Xfce4-notifyd when changing volume. Xfce4-volumed does not need any configuration and is started automatically with Xfce.<br />
<br />
{{accuracy|reason=There should be a short explanation of what this does and why it fixes the issue (bug?).}}<br />
<br />
If you use pulseaudio and xfce4-volumed unmute does not work, try this:<br />
<br />
$ xfconf-query -c xfce4-mixer -p /active-card -s `xfconf-query -c xfce4-mixer -p /sound-card`<br />
<br />
===== Volumeicon =====<br />
<br />
{{pkg|volumeicon}} is an alternative to xfce4-volumed in the community repo also handling keybindings and notifications through {{pkg|xfce4-notifyd}}.<br />
<br />
==== Adding startup/boot sound ====<br />
<br />
Arch does not have a built-in startup sound configuration tool, but there is a workaround by adding the following command to your Application Autostart settings:<br />
<br />
aplay /boot/startupsound.wav<br />
<br />
The file location and filename can be whatever you want, but naming it descriptively and putting it in /boot keeps things tidy.<br />
<br />
=== xdg-open integration (Preferred Applications) ===<br />
<br />
Most applications rely on [[xdg-open]] for opening a preferred application for a given file or URL.<br />
<br />
In order for xdg-open and xdg-settings to detect and integrate with the XFCE desktop environment correctly, you need to [[pacman|install]] the {{Pkg|xorg-xprop}} package.<br />
<br />
If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed.<br />
Installing the package and allowing ''xdg-open'' to detect that you are running XFCE makes it forward all calls to ''exo-open'' instead, which correctly uses all your preferred applications preferences.<br />
<br />
To make sure xdg-open integration is working correctly, ask ''xdg-settings'' for the default web browser and see what the result is:<br />
<br />
# xdg-settings get default-web-browser<br />
<br />
If it replies with:<br />
<br />
xdg-settings: unknown desktop environment<br />
<br />
it means that it has failed to detect XFCE as your desktop environment, which is likely due to a missing {{Pkg|xorg-xprop}} package.<br />
<br />
=== Screenshots ===<br />
<br />
==== Using print-screen key ====<br />
<br />
A simple way is to use a command-line screenshot utility:<br />
<br />
# pacman -S scrot<br />
<br />
Then go to:<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "scrot" command to use the "PrintScreen" key.<br />
<br />
All screenshots will be placed in your home folder with unique names (i.e. {{ic|2009-02-19-063052_1280x1024_scrot.png}}).<br />
<br />
====Screenshooter====<br />
<br />
There is also an a screenshot plugin for the Xfce panel, which can be used instead of scrot, that is available in extra:<br />
<br />
# pacman -S xfce4-screenshooter<br />
<br />
You can add a keyboard binding for it using the command<br />
<br />
xfce4-screenshooter -f<br />
<br />
instead of "scrot". You will get a dialog window after pressing "Print" where you can copy the image to the clipboard or save it.<br />
<br />
=== Change mount options ===<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved by changing the default iocharset to utf8, which is easily done adding a line to {{ic|/etc/xdg/xfce4/mount.rc}}:<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
flush=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files, so be careful.<br />
<br />
It is possible to mount vfat devices with the ''flush'' option, so that when copying to USB sticks data flushes more often, thus making thunar's progress bar to stays up until finished. Adding ''async'' instead will speed up write ops, but use ''Eject'' option in Thunar to unmount the stick. Globally, mount options for storage devices present at boot can be set in [[fstab]], and for other devices in [[udev]] rules.<br />
<br />
===Terminal tango color theme===<br />
Open with your favorite editor<br />
<br />
~/.config/Terminal/terminalrc<br />
<br />
And add(replace) this lines:<br />
<br />
ColorForeground=White<br />
ColorBackground=#323232323232<br />
ColorPalette1=#2e2e34343636<br />
ColorPalette2=#cccc00000000<br />
ColorPalette3=#4e4e9a9a0606<br />
ColorPalette4=#c4c4a0a00000<br />
ColorPalette5=#34346565a4a4<br />
ColorPalette6=#757550507b7b<br />
ColorPalette7=#060698989a9a<br />
ColorPalette8=#d3d3d7d7cfcf<br />
ColorPalette9=#555557575353<br />
ColorPalette10=#efef29292929<br />
ColorPalette11=#8a8ae2e23434<br />
ColorPalette12=#fcfce9e94f4f<br />
ColorPalette13=#72729f9fcfcf<br />
ColorPalette14=#adad7f7fa8a8<br />
ColorPalette15=#3434e2e2e2e2<br />
ColorPalette16=#eeeeeeeeecec<br />
<br />
=== Colour management ===<br />
xfce4-settings-manager does not yet have any colour management / calibration settings, nor is there any specific XFCE program to characterise your monitor.<br />
<br />
==== Loading a profile ====<br />
If you wish to '''load an icc profile''' (that you have previously created or downloaded) to calibrate your display on startup, you can download {{AUR|xcalib}} from [[AUR]], then open the XFCE4 Settings Manager, click Session and Startup icon, the Autostart tab, and add a new entry where the command is {{ic|/usr/bin/xcalib /path/to/your/profile.icc}}. You still need to tell your applications, which display profile should be used to have the displayed images colour managed.<br />
<br />
Another option is dispwin. Dispwin not only calibrates the display, but also sets the _ICC_PROFILE atom in X so that some applications can use a "system" display profile instead of requiring the user to set the display profile manually (GIMP, Inkscape, darktable, UFRaw, etc.).<br />
<br />
See [[ICC_Profiles#Loading_ICC_Profiles]] for more information.<br />
<br />
==== Creating a profile ====<br />
<br />
If you wish to '''create an icc profile''' for your display (ie. characterising/profiling, e.g. with the [[ColorHug]], or some other colorimeter, or a spectrophotometer, or "by eye"), the simplest option may be to install [https://aur.archlinux.org/packages.php?ID=25883 dispcalGUI] from [[AUR]]. <br />
<br />
Another option is {{ic|gnome-control-center}} (available in extra), which has a much simpler GUI, but less options and requires installing some Gnome dependencies. In order to start the calibration from the command line, first do {{ic|colormgr get-devices}} and look for the "Device ID" line of your monitor. If this is e.g. "xrandr-Lenovo Group Limited", you start calibration with the commabnd {{ic|gcm-calibrate --device "xrandr-Lenovo Group Limited"}}.<br />
{{Note|1=It seems like you need to run the full gnome-control-center because XFCE does not yet have a session component for colord: https://bugzilla.xfce.org/show_bug.cgi?id=8559}}<br />
<br />
See [[ICC Profiles]] for more information.<br />
<br />
=== XDG User Directories ===<br />
freedesktop.org specifies the "well known" user directories like the desktop folder and the music folder. The {{Pkg|xdg-user-dirs}} to manage them and it also handles localization (i.e. translation) of the filenames.<br />
# pacman -S xdg-user-dirs<br />
If you want to use the directories with your localized names, run the following command on your user:<br />
$ xdg-user-dirs-update<br />
If you want to revert to English, run the following:<br />
$ LC_ALL=C xdg-user-dirs-update<br />
It then creates localized (or English) versions of these directories in your home directory and sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config). The Xfce and other softwares complying the freedesktop.org knows that is where those types of files should go by default.<br />
<br />
In the case of the French:<br />
<br />
{{hc|~/.config/user-dirs.locale|<br />
fr_FR}}<br />
{{hc|~/.config/user-dirs.dirs|<nowiki><br />
XDG_DESKTOP_DIR="$HOME/Bureau"<br />
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"<br />
XDG_TEMPLATES_DIR="$HOME/Exemples"<br />
XDG_PUBLICSHARE_DIR="$HOME/Public"<br />
XDG_DOCUMENTS_DIR="$HOME/Documents"<br />
XDG_MUSIC_DIR="$HOME/Musiques"<br />
XDG_PICTURES_DIR="$HOME/Images"<br />
XDG_VIDEOS_DIR="$HOME/Vidéos"</nowiki>}}<br />
<br />
You can edit these files directly by using text editor.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Unable to open external windows partitions ===<br />
If you have external partitions like a fat32 drive connected via eSata, and launching them from the desktop results in a dialog telling you 'Authentication is required', you need to ensure polkit-gnome is installed and PolicyKit Authentication Agent is started by xfce4.<br />
pacman -S polkit-gnome<br />
Restart xfce4 and go:<br />
Applications Menu > Settings > Sessions and Startup<br />
Check that PolicyKit Authentication Agent is enabled under the Application Autostart tab.<br />
<br />
=== xfce4-power-manager is not working ===<br />
Check you have added dbus to the {{ic|DAEMONS}} array in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Xfce4-xkb-plugin settings issue ===<br />
There is a bug in version ''0.5.4.1-1'' which causes xkb-plugin to ''lose keyboard, layout switching and compose key'' settings. As a workaround you may enable ''Use system defaults'' option in keyboard settings. To do so run<br />
xfce4-keyboard-settings<br />
Go to ''Layout'' tab and set the ''Use system defaults'' flag, then reconfigure xkb-plugin.<br />
<br />
=== Thunar does not display any thumbnail ===<br />
<br />
Thunar relies on '''Tumbler''' to generate thumbnails. You can install Tumbler by issuing<br />
<br />
pacman -S tumbler<br />
<br />
More details in [[Thunar#Thunar_Thumbnailers|Thunar's page]].<br />
<br />
=== Locales ignored with GDM ===<br />
Become superuser and add your locale to /var/lib/AccountsService/users/$USER:<br />
su -c "nano /var/lib/AccountsService/users/$USER"<br />
Replace hu_HU.UTF-8 with your own locale:<br />
[User]<br />
Language=hu_HU.UTF-8<br />
XSession=xfce<br />
You may also do it with sed. Note the backslash before .UTF-8:<br />
su -c "sed -i 's/Language=.*/Language=hu_HU\.UTF-8/' /var/lib/AccountsService/users/$USER"<br />
Restart GDM to take effect.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming {{ic|~/.config/xfce4-session/}} and {{ic|~/.config/xfce4/}}<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Logout and login for changes to take effect.<br />
<br />
=== NVIDIA and xfce4-sensors-plugin ===<br />
To detect and use sensors of nvidia gpu you need to install {{AUR|libxnvctrl}} and then recompile {{Pkg|xfce4-sensors-plugin}} package.<br />
<br />
=== Session failure ===<br />
If the window manager does not load correctly (The mouse is a X and you cannot close windows) you maybe got an session error.<br />
To remove a corrupt session you can delete the session folder at the {{ic|.cache}} folder.<br />
# rm -r ~/.cache/sessions/<br />
The easy way to reload the session is to reboot the computer. You can also restart xfce.<br />
<br />
=== Clock/notification area no longer pushed to the right edge of the panel in Xfce 4.10 ===<br />
<br />
This is due to a change in the Window Buttons panel plugin which no longer expands to fill the available space.<br />
<br />
To emulate the old behavior, add a transparent separator between the window buttons and the clock/notification area, setting its expand property.<br />
<br />
=== Preferred Applications preferences have no effect ===<br />
<br />
If you have set your preferred applications with ''exo-preferred-applications'', but they do not seem to be taken into consideration, see [[Xfce#xdg-open_integration_.28Preferred_Applications.29]]<br />
<br />
==See also==<br />
* http://docs.xfce.org/ - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]</div>Sambul13https://wiki.archlinux.org/index.php?title=Xfce&diff=224753Xfce2012-09-23T16:00:55Z<p>Sambul13: /* Change mount options */</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[cs:Xfce]]<br />
[[de:Xfce]]<br />
[[es:Xfce]]<br />
[[fr:Xfce]]<br />
[[it:Xfce]]<br />
[[ja:Xfce]]<br />
[[pl:Xfce]]<br />
[[ru:Xfce]]<br />
[[tr:Xfce_Masaüstü_Ortamı]]<br />
[[uk:Xfce]]<br />
[[zh-CN:Xfce]]<br />
{{Article summary start}}<br />
{{Article summary text|Xfce is a lightweight desktop environment for Unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and user friendly. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|Xfce uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Thunar}}<br />
{{Article summary wiki|Improve GTK Application Looks}}<br />
{{Article summary wiki|Autostart applications#Graphical}}<br />
{{Article summary end}}<br />
<br />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
== What is Xfce? ==<br />
Xfce is a Desktop Environment, like [[GNOME]] or [[KDE]]. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Features:<br />
*Lighter on resources than the other major DEs (KDE, GNOME).<br />
*Most settings are exposed via a GUI, Xfce does not try to hide stuff from the user.<br />
*Xfwm has an optional built-in compositor which allows for true transparency and all the benefits of GPU acceleration (minimizes tearing, etc.).<br />
*It works great with multiple monitors.<br />
<br />
==Installation==<br />
<br />
Before starting, make sure you have the [[Xorg|X server]] installed and configured correctly.<br />
<br />
{{Note|Xfce is somewhat modular. That means there is no need for you to run every part, you can pick and choose some of them.}}<br />
<br />
The base Xfce system can be [[pacman|installed]] with the group {{Grp|xfce4}}, available in the [[Official Repositories]]. Pacman will ask you to select the packages to install, but you probably want to get them all by simply pressing {{Keypress|Enter}}. Additional packages, like panel plugins, notifications, and system tools are available in the {{Grp|xfce4-goodies}} group.<br />
<br />
{{Tip|Installing [[Gamin]] (the successor of [[FAM]]) is highly recommended.}}<br />
<br />
In order to get the xfce4-mixer to work with [[ALSA]], you need to install {{Pkg|gstreamer0.10-base-plugins}}. See [[#OSS|below]] for help with [[OSS]].<br />
<br />
== Running Xfce ==<br />
<br />
===Automatically at boot time===<br />
There are two methods to start Xfce (and in fact, any desktop or window manager) at boot time:<br />
<br />
* Run Xfce through a Display Manager<br />
* Run Xfce automatically using [[Bash#Configuration_file_overview|bash_profile]] or [[inittab]]<br />
<br />
See [[Display Manager]] for details about installing and configuring a Display Manager (be sure to configure it properly for [[PolicyKit]]). See [[Start X at Boot]] for configuration instructions on using bash_profile or inittab.<br />
<br />
===Manually===<br />
<br />
You can execute:<br />
$ startxfce4<br />
from the console, or configure [[xinitrc]] and use xinit or startx.<br />
<br />
If you have not created a {{ic|~/.xinitrc}} yet, do so with:<br />
<br />
$ cp /etc/skel/.xinitrc ~/.xinitrc<br />
<br />
and add the following line:<br />
<br />
exec startxfce4 --with-ck-launch<br />
<br />
Example:<br />
{{hc|~/.xinitrc|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
[ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
<br />
{{Note|<br />
*{{ic|--with-ck-launch}} starts a clean ConsoleKit session needed by Xfce for power management, automounting, shutting down, rebooting, etc. ConsoleKit/PolicyKit capable display managers such as gdm do this for you automatically and thus the command does not need to be specified seperatly.<br />
*{{pkg|xorg-xdm}} is also ConsoleKit/PolicyKit capable since version 1.1.11. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or .xsession for xdm.<br />
*[[SLiM]] is also ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or slim.conf login_cmd.<br />
*In case you are wondering, {{ic|dbus-launch}} will be launched by the {{ic|xinitrc.d}} code at the beginning of the file. {{ic|dbus-launch}} starts a dbus-daemon instance to provide communication with PolicyKit.<br />
*The proper command for launching Xfce is {{ic|startxfce4}}: do not start {{ic|xfce4-session}} directly, since it is already run by {{ic|startxfce4}} itself.<br />
*If you are running an Xfce older than 4.10, you will have to use {{ic|exec ck-launch-session startxfce4}}<br />
}}<br />
{{Note|{{ic|dbus-launch}} should actually be called '''after''' launching ConsoleKit, otherwise there will be authorization problems when mounting disks as a regular user, see {{Bug|25031}}. For a '''temporary''' workaround you can edit the {{ic|xinitrc.d}} script at the beginning of the file as follows, and '''keep an eye on the evolution of the bug report''' (and possibly vote it):<br />
{{hc|~/.xinitrc [temporary workaround]|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
# Do not launch dbus before ConsoleKit (FS#25031)<br />
#[ -x "$f" ] && . "$f"<br />
[ "$f" -ne "/etc/X11/xinit/xinitrc.d/30-dbus" ] && [ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
There is still no need to start {{ic|dbus-launch}} explicitly since {{ic|startxfce4}} takes care of doing that anyway.}}<br />
<br />
===Shutting down, rebooting, and automounting from within Xfce===<br />
* Make sure that '''dbus''' is enabled in the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}.<br />
* If a display manager is used:<br />
** Make sure that you are using {{ic|exec startxfce4 --with-ck-launch}} in {{ic|~/.xinitrc}} (along with sourcing xinitrc.d scripts, which is done for you in the skel file) '''or''' a ConsoleKit/PolicyKit capable [[display manager]].<br />
* If no display manager is used:<br />
** Make sure you use the bash_profile method to auto-login (not inittab).<br />
** For automounting to work the default Policykit has to be [https://bbs.archlinux.org/viewtopic.php?pid=881377#p881377 edited]. You can also install {{pkg|polkit-gnome}} for authorization.<br />
* If you want to automount removable disk in thunar, install and [https://wiki.archlinux.org/index.php/Thunar#Thunar_Volume_Manager configure] {{pkg|thunar-volman}} and {{pkg|gamin}}, and make sure {{pkg|gvfs}} and {{pkg|gvfs-afc}} is installed, see [https://bbs.archlinux.org/viewtopic.php?id=119992 details] .<br />
====Shutdown & reboot from shutdown menu when using systemd====<br />
If you are using systemd instead of sysvinit, when trying to shutdown or reboot from the shutdown menu of xfce4 it actually logout to DM; installing systemd-sysvcompat corrects this misbehavior.<br />
do {{ic|pacman -Sy systemd-sysvcompat}} as root and it should work right away.<br />
<br />
==Tips and tricks==<br />
===Configuring Xfconf settings===<br />
Xfconf is XFCE's system for storing configuration options, and most XFCE configuration is done by editing settings in Xfconf (one way or another). There are several ways to modify these settings:<br />
* The most obvious and easiest way is to go to "Settings" in the main menu and select the category you want to customize. However, not all customization options are available this way. <br />
* A less user-friendly but more general way is to go to {{bc|Main menu -> Settings -> Settings Editor}} where you can see and modify all the customization options. Any settings modified here will take effect immediately. The Settings Editor can also be launched from the command line by invoking {{ic|xfce4-settings-editor}}.<br />
* Customization can be done completely from the command line using the program {{ic|xfconf-query}}. See [http://docs.xfce.org/xfce/xfconf/xfconf-query the XFCE online documentation] for more information and examples and the rest of this wiki page for more examples. Settings changed here will take effect immediately.<br />
* The settings are stored in XML files in {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/}} which can be edited by hand. However, changes made here will not take effect immediately.<br />
* For more information: [http://docs.xfce.org/xfce/xfconf/start Xfconf documentation]<br />
===Panel===<br />
====How to customize xfce panel background====<br />
Edit {{ic|~/.gtkrc-2.0}}.<br />
Note that you must place the image in the same directory as the configuration, which is {{ic|~/}}. You can not specify the path to the image, or it will not work.<br />
style "panel-background" {<br />
bg_pixmap[NORMAL] = "foo.bar"<br />
bg_pixmap[PRELIGHT] = "foo.bar"<br />
bg_pixmap[ACTIVE] = "foo.bar"<br />
bg_pixmap[SELECTED] = "foo.bar"<br />
bg_pixmap[INSENSITIVE] = "foo.bar"<br />
}<br />
widget_class "*Panel*" style "panel-background"<br />
<br />
==== Replacements for the default 'menu' panel applet ====<br />
The "Ubuntu System Panel" (GNOME) panel applet has similar features to those found in its KDE v4.2 equivalent. It can be added to an Xfce panel via the 'XfApplet' panel applet, which allows GNOME applets to be used in Xfce.<br />
<br />
It is available in the [[Arch User Repository|AUR]] as the {{AUR|usp2}} package.<br />
<br />
====How to remove menu entries from the System menu====<br />
===== Method 1 =====<br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Open Terminal (Xfce menu > System > Terminal) and go to the {{ic|/usr/share/applications}} folder: {{bc|$ cd /usr/share/applications}}<br />
# This folder should be full of {{ic|.desktop}} files. To see a list type: {{bc|$ ls}}<br />
# Add {{ic|1=NoDisplay=true}} to the {{ic|.desktop}} file. For example, if you want to hide Firefox, type in the terminal:{{bc|1=$ sudo sh -c 'echo "NoDisplay=true" >> firefox.desktop'}} This command appends the text {{ic|1=NoDisplay=true}} to the end of the {{ic|.desktop}} file.<br />
<br />
===== Method 2 =====<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under {{ic|/usr/share/applications/}}.<br />
# In a terminal, copy everything from {{ic|/usr/share/applications}} to {{ic|~/.local/share/applications/}}: {{bc|$ cp /usr/share/applications/* ~/.local/share/applications/}}<br />
# For any entry you wish to hide from the menu, add the {{ic|1=NoDisplay=true}} option: {{bc|1=$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop}}<br />
<br />
You can also edit the application's category by editing the {{ic|.desktop}} file with a text editor and modifying the {{ic|1=Categories=}} line.<br />
<br />
===== Method 3 =====<br />
The third method is the '''cleanest''' and recommended in the [http://wiki.xfce.org/howto/customize-menu Xfce wiki].<br />
<br />
Create the file {{ic|~/.config/menus/xfce-applications.menu}} and copy the following in it:<br />
{{bc|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"><br />
<br />
<Menu><br />
<Name>Xfce</Name><br />
<MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile><br />
<br />
<Exclude><br />
<Filename>xfce4-run.desktop</Filename><br />
<br />
<Filename>exo-terminal-emulator.desktop</Filename><br />
<Filename>exo-file-manager.desktop</Filename><br />
<Filename>exo-mail-reader.desktop</Filename><br />
<Filename>exo-web-browser.desktop</Filename><br />
<br />
<Filename>xfce4-about.desktop</Filename><br />
<Filename>xfhelp4.desktop</Filename><br />
</Exclude><br />
<br />
<Layout><br />
<Merge type="all"/><br />
<Separator/><br />
<br />
<Menuname>Settings</Menuname><br />
<Separator/><br />
<br />
<Filename>xfce4-session-logout.desktop</Filename><br />
</Layout><br />
<br />
</Menu><br />
</nowiki>}}<br />
<br />
The {{ic|<MergeFile>}} tag includes the default Xfce menu in our file. This is important.<br />
<br />
The {{ic|<Exclude>}} tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude {{ic|firefox.desktop}} or any other application.<br />
<br />
The {{ic|<Layout>}} tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the aforementioned Xfce wiki page.<br />
<br />
===== Method 4 =====<br />
Alternatively a tool called [http://lxmed.sourceforge.net/ lxmed] can be used. Lxmed is a GUI tool written in Java for editing menu entires in LXDE, but it also works in Xfce4. Lxmed is available in the {{AUR|lxmed}} package from the [[AUR]].<br />
<br />
==== But what do you do with menu entries which do not show up in /usr/share/applications (e.g., apps installed via Wine)? ====<br />
I have found some shortcuts that show in the category “Other” in this directory:<br />
{{ic|~/.local/share/applications/wine/}}.<br />
<br />
====Panel autohide delay====<br />
Add this to {{ic|~/.gtkrc-2.0}}.<br />
style "xfce-panel-window-style"<br />
{<br />
# Time in miliseconds before the panel will unhide on an enter event<br />
XfcePanelWindow::popup-delay = 225<br />
<br />
# Time in miliseconds before the panel will hide on a leave event<br />
XfcePanelWindow::popdown-delay = 350<br />
}<br />
class "XfcePanelWindow" style "xfce-panel-window-style"<br />
<br />
====Panel at desktop level====<br />
<br />
If you want a panel at desktop level (i.e., other windows will stack over it) you need a little hack, ensure you have installed the '''wmctrl''' package.<br />
<br />
Create a script in {{ic|~/.config/xfce4/xfce4-fix-panel}} with this content and make it executable (you can use {{ic|chmod 755 xfce4-fix-panel}}).<br />
<br />
#!/bin/bash<br />
set -e<br />
<br />
function getPanelIdImpl() {<br />
# get panel id<br />
PANEL="`wmctrl -l | sed -n -e '/ xfce4-panel$/ s_ .*$__ p' | sed -n -e $1' p'`"<br />
}<br />
<br />
function getPanelId() {<br />
# eventually await the panel to appear<br />
getPanelIdImpl $1<br />
while [ x = x$PANEL ] ;do<br />
sleep 0.5s<br />
getPanelIdImpl $1<br />
done<br />
}<br />
<br />
function putPanelDown() {<br />
PANEL=""<br />
getPanelId $1<br />
wmctrl -i -r $PANEL -b add,below<br />
}<br />
<br />
# call the program with a list of panel numbers as arguments<br />
# for example, xfce4-fix-panel 1 2 3<br />
# for the first three panels<br />
for i in $* ;do<br />
putPanelDown $i<br />
done<br />
<br />
<br />
Once wrote the script, and tested it, you need to auto-execute it at each login. You can use the {{ic|Session and StartUp -> Application Autostart}} gui.<br />
<br />
This passage will put your panels at desktop level, but if your panel is sticking to a border the maximized windows will not stack over it. You can enable this behavior with the following command, fortunately you need to do this only once. (change the $ID with the panel number of interest)<br />
<br />
xfconf-query -c xfce4-panel -p /panels/panel-$ID/disable-struts -n -t bool -s true<br />
<br />
=== Desktop ===<br />
<br />
==== Use a transparent background for desktop icon titles ====<br />
To change the default white background of desktop icon titles to something more suitable, edit the {{ic|.gtkrc-2.0}} file in your home directory (or create the file if needed) and add the following:<br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71FFAD"<br />
fg[NORMAL] = "#ffffff"<br />
fg[SELECTED] = "#71B9FF"<br />
fg[ACTIVE] = "#71FFAD" }<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
<br />
==== Hide selected partitions on the desktop ====<br />
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example {{ic|/etc/udev/rules.d/10-local.rules}}:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_IGNORE}="1"<br />
<br />
Would show all partitions with the exception of sda1 and sda2 on your desktop.<br />
<br />
==== Switch to old desktop right click menu without Thunar things ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
==== Adding the kill window shortcut ====<br />
<br />
Xfce does not support the ''kill window'' shortcut directly, but you can add one with a simple script. Ensure you have the '''xorg-xkill''' package installed.<br />
<br />
Create a script in {{ic|~/.config/xfce4/killwindow.sh}} with this content and make it executable (you can use {{ic|chmod 755 killwindow.sh}}).<br />
<br />
xkill -id "`xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p'`"<br />
<br />
Now associate a shortcut using {{ic|Settings -> Keyboard}} to that script.<br />
<br />
=== XFWM4 ===<br />
==== How to enable the compositor in Xfce ====<br />
Xfce comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your {{ic|/etc/xorg.conf}}. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
==== Disable window roll-up ====<br />
xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false<br />
<br />
==== Disable/enable automatic resizing/tiling of windows at edge of screen ====<br />
XFWM4 has the ability to "tile" a window automatically when it is moved to the edge of the screen by resizing it to fill the top half of the screen. (The official XFCE website says this feature is disabled by default in XFCE 4.10, but it seems to be enabled by default on Arch Linux.) This behavior can be enabled or disabled in {{ic|Window Manager Tweaks --> Accessibility --> Automatically tile windows when moving toward the screen edge}}, or:<br />
<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s false # To disable<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s true # To enable<br />
<br />
=== Commands for the settings manager ===<br />
<br />
There is no official documentation for the commands executed. One must look at {{ic|.desktop}} files {{ic|/usr/share/applications/}} folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce4-accessibility-settings<br />
xfce4-power-manager-settings<br />
xfce4-settings-editor<br />
xfdesktop-settings<br />
xfce4-display-settings<br />
xfce4-keyboard-settings<br />
xfce4-mouse-settings<br />
xfce4-session-settings<br />
xfce4-settings-manager<br />
xfce4-appearance-settings<br />
xfwm4-settings<br />
xfwm4-tweaks-settings<br />
xfwm4-workspace-settings<br />
orage -p<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep '^Exec=' /usr/share/applications/xfce*settings* | sed -e 's_^.*=_ _'<br />
<br />
===Session===<br />
====Customizing Startup Applications====<br />
This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file {{ic|/etc/xdg/xfce4/xinitrc}} to {{ic|~/.config/xfce4/}}<br />
* Edit this file. For example, you can add something like this somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
====Switch between users====<br />
Xfce4 allows this behavior under the 'action buttons' menu item. Currently, both [[gdm]] and [[Lightdm#User_switching_under_xfce4|lightdm]] provide this functionality.<br />
<br />
==== Modify XML settings files directly ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the {{ic|~/.config/xfce4/xfconf/}} folder. For application keyboard shortcuts for example, the file is {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml}}. It is faster to copy and paste the XML keys that you want rather than using the GUI.<br />
<br />
===Removable Devices===<br />
If you want an icon appearing on your desktop and in thunar when you plug in external devices, make sure gvfs is installed:<br />
<br />
# pacman -S --needed gvfs<br />
<br />
You could also need to install gvfs-afc (read [https://bbs.archlinux.org/viewtopic.php?pid=889018 this discussion]):<br />
<br />
# pacman -S gvfs-afc<br />
<br />
It is also a good idea to install thunar-volman (included in the {{ic|xfce4-goodies}} group):<br />
<br />
# pacman -S thunar-volman<br />
<br />
Udisk and a udisk wrapper are recommended if you want to automount optical and external drives easily<br />
<br />
* [http://igurublog.wordpress.com/downloads/script-devmon/ devmon] - devmon ([https://aur.archlinux.org/packages.php?ID=45842 AUR]) is a configuration-less bash wrapper script for udisks which automounts optical discs and removable drives. It can also selectively autostart apps or execute commands after mounting, ignore specified devices and volume labels, and unmount removable drives.<br />
<br />
===How to add themes to XFCE===<br />
1. Go to [http://www.xfce-look.org www.xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using Squeeze/Xarchiver/CLI.<br />
<br />
3. Move the extracted folder to {{ic|/usr/share/themes}} (for all users) or {{ic|~/.themes}} (for just you). Inside {{ic|/usr/share/themes/abc}}, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. GTK theme is available here:<br />
Menu --> Settings --> Appearance<br />
You select your xfwm theme in:<br />
Menu --> Settings --> Window Manager<br />
<br />
=== Cursors ===<br />
Main article: [[X11 Cursors]]<br />
<br />
If you have alternative X cursor themes installed, Xfce can find them with:<br />
Menu --> Settings --> Mouse --> Theme<br />
<br />
=== Icons ===<br />
1. First find and download your desired icon pack. Recommended places to download icons from are [http://www.customize.org Customize.org], [http://opendesktop.org Opendesktop.org] and [http://xfce-look.org/ Xfce-look.org].<br />
<br />
2. Go to the directory where you downloaded the icon pack and extract it. Example {{ic|tar -xzf /home/user/downloads/icon-pack.tar.gz}}.<br />
<br />
3. Move the extracted folder containing the icons to {{ic|/usr/share/icons}} (if you want all users on the system to make use of the icons) or {{ic|~/.icons}} (if only you want to use the icons).<br />
<br />
Optional: run {{ic|gtk-update-icon-cache -f -t ~/.icons/<theme_name>}} to update icon cache<br />
<br />
4. Switch your icons by going to:<br />
Menu --> Settings --> Appearance --> Icons<br />
<br />
When you have icon theme problems, it is also recommended to install the {{Pkg|hicolor-icon-theme}} package if it was not already installed.<br />
<br />
=== Fonts ===<br />
<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearence click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<br />
<br />
=== Sound ===<br />
<br />
==== Configuring xfce4-mixer ====<br />
<br />
{{Pkg|xfce4-mixer}} is the GUI mixer app / panel plugin made by the Xfce team. It is part of the xfce4 group, so you probably already have it installed. Xfce 4.6 uses {{Pkg|gstreamer}} as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer. One or more of the gstreamer plugin packages listed as optional dependencies to xfce4-mixer must be installed. Without one of these required plugins packages, the following error arises when clicking on the mixer panel item.<br />
<br />
GStreamer was unable to detect any sound devices. Some sound system specific GStreamer packages may be missing. It may also be a permissions problem.<br />
<br />
(It is probably not a permissions problem. It is no longer required to add audio users to the "audio" group.) Which plugins are needed depends on the hardware. Most people should be fine with {{Pkg|gstreamer0.10-base-plugins}} which can be [[pacman|installed]] from [[Official Repositories]]. <br />
<br />
If the xfce4-mixer panel item was already running before one of the plugins packages was installed, logout and login to see if it worked, or just remove the mixer plugin from the panel and add it again. If that does not work, you might need more or different gstreamer plugins. Try to [[pacman|install]] package {{pkg|gstreamer0.10-good-plugins}} or {{pkg|gstreamer0.10-bad-plugins}}.<br />
<br />
For further details, for example how to set the default sound card, see [[Advanced Linux Sound Architecture]]. Alternatively you can use [[PulseAudio]] together with {{Pkg|pavucontrol}}.<br />
<br />
==== How do I get xfce4-mixer and OSS4 to work together? ====<br />
<br />
If you tried the above section to get {{Pkg|xfce4-mixer}} to work and it does not work at all, then you may have to compile gstreamer0.10-good-plugins yourself. Download the PKGBUILD and other files needed from ABS or [http://projects.archlinux.org/svntogit/packages.git/tree/gstreamer0.10-good/repos here], edit the PKGBUILD, add --enable-oss. <br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \<br />
'''--enable-oss \'''<br />
--disable-static --enable-experimental \<br />
--disable-schemas-install \<br />
--disable-hal \<br />
--with-package-name="GStreamer Good Plugins (Archlinux)" \<br />
--with-package-origin="http://www.archlinux.org/"<br />
<br />
and then run makepkg -i. <br />
<br />
makepkg -i<br />
<br />
Still not working? Try this package in AUR {{AUR|gstreamer0.10-good-plugins-ossv4}}, modify the pkgver to the newest in the PKGBUILD, and it should work.<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Change volume with keyboard volume buttons ====<br />
<br />
Go to <br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+ unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%- unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{ic|amixer set Master toggle}} does not work, try the PCM channel ({{ic|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{ic|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
Use one of these scripts: http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
===== Xfce4-volumed =====<br />
<br />
[https://aur.archlinux.org/packages.php?ID=31693 xfce4-volumed] daemon from the [[AUR]] automatically maps volume keys of your keyboard to Xfce-mixer. Additionally you get OSD through Xfce4-notifyd when changing volume. Xfce4-volumed does not need any configuration and is started automatically with Xfce.<br />
<br />
{{accuracy|reason=There should be a short explanation of what this does and why it fixes the issue (bug?).}}<br />
<br />
If you use pulseaudio and xfce4-volumed unmute does not work, try this:<br />
<br />
$ xfconf-query -c xfce4-mixer -p /active-card -s `xfconf-query -c xfce4-mixer -p /sound-card`<br />
<br />
===== Volumeicon =====<br />
<br />
{{pkg|volumeicon}} is an alternative to xfce4-volumed in the community repo also handling keybindings and notifications through {{pkg|xfce4-notifyd}}.<br />
<br />
==== Adding startup/boot sound ====<br />
<br />
Arch does not have a built-in startup sound configuration tool, but there is a workaround by adding the following command to your Application Autostart settings:<br />
<br />
aplay /boot/startupsound.wav<br />
<br />
The file location and filename can be whatever you want, but naming it descriptively and putting it in /boot keeps things tidy.<br />
<br />
=== xdg-open integration (Preferred Applications) ===<br />
<br />
Most applications rely on [[xdg-open]] for opening a preferred application for a given file or URL.<br />
<br />
In order for xdg-open and xdg-settings to detect and integrate with the XFCE desktop environment correctly, you need to [[pacman|install]] the {{Pkg|xorg-xprop}} package.<br />
<br />
If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed.<br />
Installing the package and allowing ''xdg-open'' to detect that you are running XFCE makes it forward all calls to ''exo-open'' instead, which correctly uses all your preferred applications preferences.<br />
<br />
To make sure xdg-open integration is working correctly, ask ''xdg-settings'' for the default web browser and see what the result is:<br />
<br />
# xdg-settings get default-web-browser<br />
<br />
If it replies with:<br />
<br />
xdg-settings: unknown desktop environment<br />
<br />
it means that it has failed to detect XFCE as your desktop environment, which is likely due to a missing {{Pkg|xorg-xprop}} package.<br />
<br />
=== Screenshots ===<br />
<br />
==== Using print-screen key ====<br />
<br />
A simple way is to use a command-line screenshot utility:<br />
<br />
# pacman -S scrot<br />
<br />
Then go to:<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "scrot" command to use the "PrintScreen" key.<br />
<br />
All screenshots will be placed in your home folder with unique names (i.e. {{ic|2009-02-19-063052_1280x1024_scrot.png}}).<br />
<br />
====Screenshooter====<br />
<br />
There is also an a screenshot plugin for the Xfce panel, which can be used instead of scrot, that is available in extra:<br />
<br />
# pacman -S xfce4-screenshooter<br />
<br />
You can add a keyboard binding for it using the command<br />
<br />
xfce4-screenshooter -f<br />
<br />
instead of "scrot". You will get a dialog window after pressing "Print" where you can copy the image to the clipboard or save it.<br />
<br />
=== Change mount options ===<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved by changing the default iocharset to utf8, which is easily done adding a line to {{ic|/etc/xdg/xfce4/mount.rc}}:<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
flush=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files, so be careful.<br />
<br />
It is also possible to mount vfat devices with the ''flush'' option, so that when copying to USB sticks data flushes more often, thus making thunar's progress bar to stays up until finished. Adding ''async'' instead will speed up write ops, but use Eject option in Thunar to unmount the Flash. Globally, mount options for storage devices present at boot can be set in [[fstab]], and for other devices in [[udev]] rules.<br />
<br />
===Terminal tango color theme===<br />
Open with your favorite editor<br />
<br />
~/.config/Terminal/terminalrc<br />
<br />
And add(replace) this lines:<br />
<br />
ColorForeground=White<br />
ColorBackground=#323232323232<br />
ColorPalette1=#2e2e34343636<br />
ColorPalette2=#cccc00000000<br />
ColorPalette3=#4e4e9a9a0606<br />
ColorPalette4=#c4c4a0a00000<br />
ColorPalette5=#34346565a4a4<br />
ColorPalette6=#757550507b7b<br />
ColorPalette7=#060698989a9a<br />
ColorPalette8=#d3d3d7d7cfcf<br />
ColorPalette9=#555557575353<br />
ColorPalette10=#efef29292929<br />
ColorPalette11=#8a8ae2e23434<br />
ColorPalette12=#fcfce9e94f4f<br />
ColorPalette13=#72729f9fcfcf<br />
ColorPalette14=#adad7f7fa8a8<br />
ColorPalette15=#3434e2e2e2e2<br />
ColorPalette16=#eeeeeeeeecec<br />
<br />
=== Colour management ===<br />
xfce4-settings-manager does not yet have any colour management / calibration settings, nor is there any specific XFCE program to characterise your monitor.<br />
<br />
==== Loading a profile ====<br />
If you wish to '''load an icc profile''' (that you have previously created or downloaded) to calibrate your display on startup, you can download {{AUR|xcalib}} from [[AUR]], then open the XFCE4 Settings Manager, click Session and Startup icon, the Autostart tab, and add a new entry where the command is {{ic|/usr/bin/xcalib /path/to/your/profile.icc}}. You still need to tell your applications, which display profile should be used to have the displayed images colour managed.<br />
<br />
Another option is dispwin. Dispwin not only calibrates the display, but also sets the _ICC_PROFILE atom in X so that some applications can use a "system" display profile instead of requiring the user to set the display profile manually (GIMP, Inkscape, darktable, UFRaw, etc.).<br />
<br />
See [[ICC_Profiles#Loading_ICC_Profiles]] for more information.<br />
<br />
==== Creating a profile ====<br />
<br />
If you wish to '''create an icc profile''' for your display (ie. characterising/profiling, e.g. with the [[ColorHug]], or some other colorimeter, or a spectrophotometer, or "by eye"), the simplest option may be to install [https://aur.archlinux.org/packages.php?ID=25883 dispcalGUI] from [[AUR]]. <br />
<br />
Another option is {{ic|gnome-control-center}} (available in extra), which has a much simpler GUI, but less options and requires installing some Gnome dependencies. In order to start the calibration from the command line, first do {{ic|colormgr get-devices}} and look for the "Device ID" line of your monitor. If this is e.g. "xrandr-Lenovo Group Limited", you start calibration with the commabnd {{ic|gcm-calibrate --device "xrandr-Lenovo Group Limited"}}.<br />
{{Note|1=It seems like you need to run the full gnome-control-center because XFCE does not yet have a session component for colord: https://bugzilla.xfce.org/show_bug.cgi?id=8559}}<br />
<br />
See [[ICC Profiles]] for more information.<br />
<br />
=== XDG User Directories ===<br />
freedesktop.org specifies the "well known" user directories like the desktop folder and the music folder. The {{Pkg|xdg-user-dirs}} to manage them and it also handles localization (i.e. translation) of the filenames.<br />
# pacman -S xdg-user-dirs<br />
If you want to use the directories with your localized names, run the following command on your user:<br />
$ xdg-user-dirs-update<br />
If you want to revert to English, run the following:<br />
$ LC_ALL=C xdg-user-dirs-update<br />
It then creates localized (or English) versions of these directories in your home directory and sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config). The Xfce and other softwares complying the freedesktop.org knows that is where those types of files should go by default.<br />
<br />
In the case of the French:<br />
<br />
{{hc|~/.config/user-dirs.locale|<br />
fr_FR}}<br />
{{hc|~/.config/user-dirs.dirs|<nowiki><br />
XDG_DESKTOP_DIR="$HOME/Bureau"<br />
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"<br />
XDG_TEMPLATES_DIR="$HOME/Exemples"<br />
XDG_PUBLICSHARE_DIR="$HOME/Public"<br />
XDG_DOCUMENTS_DIR="$HOME/Documents"<br />
XDG_MUSIC_DIR="$HOME/Musiques"<br />
XDG_PICTURES_DIR="$HOME/Images"<br />
XDG_VIDEOS_DIR="$HOME/Vidéos"</nowiki>}}<br />
<br />
You can edit these files directly by using text editor.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Unable to open external windows partitions ===<br />
If you have external partitions like a fat32 drive connected via eSata, and launching them from the desktop results in a dialog telling you 'Authentication is required', you need to ensure polkit-gnome is installed and PolicyKit Authentication Agent is started by xfce4.<br />
pacman -S polkit-gnome<br />
Restart xfce4 and go:<br />
Applications Menu > Settings > Sessions and Startup<br />
Check that PolicyKit Authentication Agent is enabled under the Application Autostart tab.<br />
<br />
=== xfce4-power-manager is not working ===<br />
Check you have added dbus to the {{ic|DAEMONS}} array in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Xfce4-xkb-plugin settings issue ===<br />
There is a bug in version ''0.5.4.1-1'' which causes xkb-plugin to ''lose keyboard, layout switching and compose key'' settings. As a workaround you may enable ''Use system defaults'' option in keyboard settings. To do so run<br />
xfce4-keyboard-settings<br />
Go to ''Layout'' tab and set the ''Use system defaults'' flag, then reconfigure xkb-plugin.<br />
<br />
=== Thunar does not display any thumbnail ===<br />
<br />
Thunar relies on '''Tumbler''' to generate thumbnails. You can install Tumbler by issuing<br />
<br />
pacman -S tumbler<br />
<br />
More details in [[Thunar#Thunar_Thumbnailers|Thunar's page]].<br />
<br />
=== Locales ignored with GDM ===<br />
Become superuser and add your locale to /var/lib/AccountsService/users/$USER:<br />
su -c "nano /var/lib/AccountsService/users/$USER"<br />
Replace hu_HU.UTF-8 with your own locale:<br />
[User]<br />
Language=hu_HU.UTF-8<br />
XSession=xfce<br />
You may also do it with sed. Note the backslash before .UTF-8:<br />
su -c "sed -i 's/Language=.*/Language=hu_HU\.UTF-8/' /var/lib/AccountsService/users/$USER"<br />
Restart GDM to take effect.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming {{ic|~/.config/xfce4-session/}} and {{ic|~/.config/xfce4/}}<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Logout and login for changes to take effect.<br />
<br />
=== NVIDIA and xfce4-sensors-plugin ===<br />
To detect and use sensors of nvidia gpu you need to install {{AUR|libxnvctrl}} and then recompile {{Pkg|xfce4-sensors-plugin}} package.<br />
<br />
=== Session failure ===<br />
If the window manager does not load correctly (The mouse is a X and you cannot close windows) you maybe got an session error.<br />
To remove a corrupt session you can delete the session folder at the {{ic|.cache}} folder.<br />
# rm -r ~/.cache/sessions/<br />
The easy way to reload the session is to reboot the computer. You can also restart xfce.<br />
<br />
=== Clock/notification area no longer pushed to the right edge of the panel in Xfce 4.10 ===<br />
<br />
This is due to a change in the Window Buttons panel plugin which no longer expands to fill the available space.<br />
<br />
To emulate the old behavior, add a transparent separator between the window buttons and the clock/notification area, setting its expand property.<br />
<br />
=== Preferred Applications preferences have no effect ===<br />
<br />
If you have set your preferred applications with ''exo-preferred-applications'', but they do not seem to be taken into consideration, see [[Xfce#xdg-open_integration_.28Preferred_Applications.29]]<br />
<br />
==See also==<br />
* http://docs.xfce.org/ - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]</div>Sambul13https://wiki.archlinux.org/index.php?title=Xfce&diff=224752Xfce2012-09-23T16:00:15Z<p>Sambul13: /* Change mount options */</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[cs:Xfce]]<br />
[[de:Xfce]]<br />
[[es:Xfce]]<br />
[[fr:Xfce]]<br />
[[it:Xfce]]<br />
[[ja:Xfce]]<br />
[[pl:Xfce]]<br />
[[ru:Xfce]]<br />
[[tr:Xfce_Masaüstü_Ortamı]]<br />
[[uk:Xfce]]<br />
[[zh-CN:Xfce]]<br />
{{Article summary start}}<br />
{{Article summary text|Xfce is a lightweight desktop environment for Unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and user friendly. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|Xfce uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Thunar}}<br />
{{Article summary wiki|Improve GTK Application Looks}}<br />
{{Article summary wiki|Autostart applications#Graphical}}<br />
{{Article summary end}}<br />
<br />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
== What is Xfce? ==<br />
Xfce is a Desktop Environment, like [[GNOME]] or [[KDE]]. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Features:<br />
*Lighter on resources than the other major DEs (KDE, GNOME).<br />
*Most settings are exposed via a GUI, Xfce does not try to hide stuff from the user.<br />
*Xfwm has an optional built-in compositor which allows for true transparency and all the benefits of GPU acceleration (minimizes tearing, etc.).<br />
*It works great with multiple monitors.<br />
<br />
==Installation==<br />
<br />
Before starting, make sure you have the [[Xorg|X server]] installed and configured correctly.<br />
<br />
{{Note|Xfce is somewhat modular. That means there is no need for you to run every part, you can pick and choose some of them.}}<br />
<br />
The base Xfce system can be [[pacman|installed]] with the group {{Grp|xfce4}}, available in the [[Official Repositories]]. Pacman will ask you to select the packages to install, but you probably want to get them all by simply pressing {{Keypress|Enter}}. Additional packages, like panel plugins, notifications, and system tools are available in the {{Grp|xfce4-goodies}} group.<br />
<br />
{{Tip|Installing [[Gamin]] (the successor of [[FAM]]) is highly recommended.}}<br />
<br />
In order to get the xfce4-mixer to work with [[ALSA]], you need to install {{Pkg|gstreamer0.10-base-plugins}}. See [[#OSS|below]] for help with [[OSS]].<br />
<br />
== Running Xfce ==<br />
<br />
===Automatically at boot time===<br />
There are two methods to start Xfce (and in fact, any desktop or window manager) at boot time:<br />
<br />
* Run Xfce through a Display Manager<br />
* Run Xfce automatically using [[Bash#Configuration_file_overview|bash_profile]] or [[inittab]]<br />
<br />
See [[Display Manager]] for details about installing and configuring a Display Manager (be sure to configure it properly for [[PolicyKit]]). See [[Start X at Boot]] for configuration instructions on using bash_profile or inittab.<br />
<br />
===Manually===<br />
<br />
You can execute:<br />
$ startxfce4<br />
from the console, or configure [[xinitrc]] and use xinit or startx.<br />
<br />
If you have not created a {{ic|~/.xinitrc}} yet, do so with:<br />
<br />
$ cp /etc/skel/.xinitrc ~/.xinitrc<br />
<br />
and add the following line:<br />
<br />
exec startxfce4 --with-ck-launch<br />
<br />
Example:<br />
{{hc|~/.xinitrc|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
[ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
<br />
{{Note|<br />
*{{ic|--with-ck-launch}} starts a clean ConsoleKit session needed by Xfce for power management, automounting, shutting down, rebooting, etc. ConsoleKit/PolicyKit capable display managers such as gdm do this for you automatically and thus the command does not need to be specified seperatly.<br />
*{{pkg|xorg-xdm}} is also ConsoleKit/PolicyKit capable since version 1.1.11. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or .xsession for xdm.<br />
*[[SLiM]] is also ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or slim.conf login_cmd.<br />
*In case you are wondering, {{ic|dbus-launch}} will be launched by the {{ic|xinitrc.d}} code at the beginning of the file. {{ic|dbus-launch}} starts a dbus-daemon instance to provide communication with PolicyKit.<br />
*The proper command for launching Xfce is {{ic|startxfce4}}: do not start {{ic|xfce4-session}} directly, since it is already run by {{ic|startxfce4}} itself.<br />
*If you are running an Xfce older than 4.10, you will have to use {{ic|exec ck-launch-session startxfce4}}<br />
}}<br />
{{Note|{{ic|dbus-launch}} should actually be called '''after''' launching ConsoleKit, otherwise there will be authorization problems when mounting disks as a regular user, see {{Bug|25031}}. For a '''temporary''' workaround you can edit the {{ic|xinitrc.d}} script at the beginning of the file as follows, and '''keep an eye on the evolution of the bug report''' (and possibly vote it):<br />
{{hc|~/.xinitrc [temporary workaround]|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
# Do not launch dbus before ConsoleKit (FS#25031)<br />
#[ -x "$f" ] && . "$f"<br />
[ "$f" -ne "/etc/X11/xinit/xinitrc.d/30-dbus" ] && [ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
There is still no need to start {{ic|dbus-launch}} explicitly since {{ic|startxfce4}} takes care of doing that anyway.}}<br />
<br />
===Shutting down, rebooting, and automounting from within Xfce===<br />
* Make sure that '''dbus''' is enabled in the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}.<br />
* If a display manager is used:<br />
** Make sure that you are using {{ic|exec startxfce4 --with-ck-launch}} in {{ic|~/.xinitrc}} (along with sourcing xinitrc.d scripts, which is done for you in the skel file) '''or''' a ConsoleKit/PolicyKit capable [[display manager]].<br />
* If no display manager is used:<br />
** Make sure you use the bash_profile method to auto-login (not inittab).<br />
** For automounting to work the default Policykit has to be [https://bbs.archlinux.org/viewtopic.php?pid=881377#p881377 edited]. You can also install {{pkg|polkit-gnome}} for authorization.<br />
* If you want to automount removable disk in thunar, install and [https://wiki.archlinux.org/index.php/Thunar#Thunar_Volume_Manager configure] {{pkg|thunar-volman}} and {{pkg|gamin}}, and make sure {{pkg|gvfs}} and {{pkg|gvfs-afc}} is installed, see [https://bbs.archlinux.org/viewtopic.php?id=119992 details] .<br />
====Shutdown & reboot from shutdown menu when using systemd====<br />
If you are using systemd instead of sysvinit, when trying to shutdown or reboot from the shutdown menu of xfce4 it actually logout to DM; installing systemd-sysvcompat corrects this misbehavior.<br />
do {{ic|pacman -Sy systemd-sysvcompat}} as root and it should work right away.<br />
<br />
==Tips and tricks==<br />
===Configuring Xfconf settings===<br />
Xfconf is XFCE's system for storing configuration options, and most XFCE configuration is done by editing settings in Xfconf (one way or another). There are several ways to modify these settings:<br />
* The most obvious and easiest way is to go to "Settings" in the main menu and select the category you want to customize. However, not all customization options are available this way. <br />
* A less user-friendly but more general way is to go to {{bc|Main menu -> Settings -> Settings Editor}} where you can see and modify all the customization options. Any settings modified here will take effect immediately. The Settings Editor can also be launched from the command line by invoking {{ic|xfce4-settings-editor}}.<br />
* Customization can be done completely from the command line using the program {{ic|xfconf-query}}. See [http://docs.xfce.org/xfce/xfconf/xfconf-query the XFCE online documentation] for more information and examples and the rest of this wiki page for more examples. Settings changed here will take effect immediately.<br />
* The settings are stored in XML files in {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/}} which can be edited by hand. However, changes made here will not take effect immediately.<br />
* For more information: [http://docs.xfce.org/xfce/xfconf/start Xfconf documentation]<br />
===Panel===<br />
====How to customize xfce panel background====<br />
Edit {{ic|~/.gtkrc-2.0}}.<br />
Note that you must place the image in the same directory as the configuration, which is {{ic|~/}}. You can not specify the path to the image, or it will not work.<br />
style "panel-background" {<br />
bg_pixmap[NORMAL] = "foo.bar"<br />
bg_pixmap[PRELIGHT] = "foo.bar"<br />
bg_pixmap[ACTIVE] = "foo.bar"<br />
bg_pixmap[SELECTED] = "foo.bar"<br />
bg_pixmap[INSENSITIVE] = "foo.bar"<br />
}<br />
widget_class "*Panel*" style "panel-background"<br />
<br />
==== Replacements for the default 'menu' panel applet ====<br />
The "Ubuntu System Panel" (GNOME) panel applet has similar features to those found in its KDE v4.2 equivalent. It can be added to an Xfce panel via the 'XfApplet' panel applet, which allows GNOME applets to be used in Xfce.<br />
<br />
It is available in the [[Arch User Repository|AUR]] as the {{AUR|usp2}} package.<br />
<br />
====How to remove menu entries from the System menu====<br />
===== Method 1 =====<br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Open Terminal (Xfce menu > System > Terminal) and go to the {{ic|/usr/share/applications}} folder: {{bc|$ cd /usr/share/applications}}<br />
# This folder should be full of {{ic|.desktop}} files. To see a list type: {{bc|$ ls}}<br />
# Add {{ic|1=NoDisplay=true}} to the {{ic|.desktop}} file. For example, if you want to hide Firefox, type in the terminal:{{bc|1=$ sudo sh -c 'echo "NoDisplay=true" >> firefox.desktop'}} This command appends the text {{ic|1=NoDisplay=true}} to the end of the {{ic|.desktop}} file.<br />
<br />
===== Method 2 =====<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under {{ic|/usr/share/applications/}}.<br />
# In a terminal, copy everything from {{ic|/usr/share/applications}} to {{ic|~/.local/share/applications/}}: {{bc|$ cp /usr/share/applications/* ~/.local/share/applications/}}<br />
# For any entry you wish to hide from the menu, add the {{ic|1=NoDisplay=true}} option: {{bc|1=$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop}}<br />
<br />
You can also edit the application's category by editing the {{ic|.desktop}} file with a text editor and modifying the {{ic|1=Categories=}} line.<br />
<br />
===== Method 3 =====<br />
The third method is the '''cleanest''' and recommended in the [http://wiki.xfce.org/howto/customize-menu Xfce wiki].<br />
<br />
Create the file {{ic|~/.config/menus/xfce-applications.menu}} and copy the following in it:<br />
{{bc|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"><br />
<br />
<Menu><br />
<Name>Xfce</Name><br />
<MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile><br />
<br />
<Exclude><br />
<Filename>xfce4-run.desktop</Filename><br />
<br />
<Filename>exo-terminal-emulator.desktop</Filename><br />
<Filename>exo-file-manager.desktop</Filename><br />
<Filename>exo-mail-reader.desktop</Filename><br />
<Filename>exo-web-browser.desktop</Filename><br />
<br />
<Filename>xfce4-about.desktop</Filename><br />
<Filename>xfhelp4.desktop</Filename><br />
</Exclude><br />
<br />
<Layout><br />
<Merge type="all"/><br />
<Separator/><br />
<br />
<Menuname>Settings</Menuname><br />
<Separator/><br />
<br />
<Filename>xfce4-session-logout.desktop</Filename><br />
</Layout><br />
<br />
</Menu><br />
</nowiki>}}<br />
<br />
The {{ic|<MergeFile>}} tag includes the default Xfce menu in our file. This is important.<br />
<br />
The {{ic|<Exclude>}} tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude {{ic|firefox.desktop}} or any other application.<br />
<br />
The {{ic|<Layout>}} tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the aforementioned Xfce wiki page.<br />
<br />
===== Method 4 =====<br />
Alternatively a tool called [http://lxmed.sourceforge.net/ lxmed] can be used. Lxmed is a GUI tool written in Java for editing menu entires in LXDE, but it also works in Xfce4. Lxmed is available in the {{AUR|lxmed}} package from the [[AUR]].<br />
<br />
==== But what do you do with menu entries which do not show up in /usr/share/applications (e.g., apps installed via Wine)? ====<br />
I have found some shortcuts that show in the category “Other” in this directory:<br />
{{ic|~/.local/share/applications/wine/}}.<br />
<br />
====Panel autohide delay====<br />
Add this to {{ic|~/.gtkrc-2.0}}.<br />
style "xfce-panel-window-style"<br />
{<br />
# Time in miliseconds before the panel will unhide on an enter event<br />
XfcePanelWindow::popup-delay = 225<br />
<br />
# Time in miliseconds before the panel will hide on a leave event<br />
XfcePanelWindow::popdown-delay = 350<br />
}<br />
class "XfcePanelWindow" style "xfce-panel-window-style"<br />
<br />
====Panel at desktop level====<br />
<br />
If you want a panel at desktop level (i.e., other windows will stack over it) you need a little hack, ensure you have installed the '''wmctrl''' package.<br />
<br />
Create a script in {{ic|~/.config/xfce4/xfce4-fix-panel}} with this content and make it executable (you can use {{ic|chmod 755 xfce4-fix-panel}}).<br />
<br />
#!/bin/bash<br />
set -e<br />
<br />
function getPanelIdImpl() {<br />
# get panel id<br />
PANEL="`wmctrl -l | sed -n -e '/ xfce4-panel$/ s_ .*$__ p' | sed -n -e $1' p'`"<br />
}<br />
<br />
function getPanelId() {<br />
# eventually await the panel to appear<br />
getPanelIdImpl $1<br />
while [ x = x$PANEL ] ;do<br />
sleep 0.5s<br />
getPanelIdImpl $1<br />
done<br />
}<br />
<br />
function putPanelDown() {<br />
PANEL=""<br />
getPanelId $1<br />
wmctrl -i -r $PANEL -b add,below<br />
}<br />
<br />
# call the program with a list of panel numbers as arguments<br />
# for example, xfce4-fix-panel 1 2 3<br />
# for the first three panels<br />
for i in $* ;do<br />
putPanelDown $i<br />
done<br />
<br />
<br />
Once wrote the script, and tested it, you need to auto-execute it at each login. You can use the {{ic|Session and StartUp -> Application Autostart}} gui.<br />
<br />
This passage will put your panels at desktop level, but if your panel is sticking to a border the maximized windows will not stack over it. You can enable this behavior with the following command, fortunately you need to do this only once. (change the $ID with the panel number of interest)<br />
<br />
xfconf-query -c xfce4-panel -p /panels/panel-$ID/disable-struts -n -t bool -s true<br />
<br />
=== Desktop ===<br />
<br />
==== Use a transparent background for desktop icon titles ====<br />
To change the default white background of desktop icon titles to something more suitable, edit the {{ic|.gtkrc-2.0}} file in your home directory (or create the file if needed) and add the following:<br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71FFAD"<br />
fg[NORMAL] = "#ffffff"<br />
fg[SELECTED] = "#71B9FF"<br />
fg[ACTIVE] = "#71FFAD" }<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
<br />
==== Hide selected partitions on the desktop ====<br />
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example {{ic|/etc/udev/rules.d/10-local.rules}}:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_IGNORE}="1"<br />
<br />
Would show all partitions with the exception of sda1 and sda2 on your desktop.<br />
<br />
==== Switch to old desktop right click menu without Thunar things ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
==== Adding the kill window shortcut ====<br />
<br />
Xfce does not support the ''kill window'' shortcut directly, but you can add one with a simple script. Ensure you have the '''xorg-xkill''' package installed.<br />
<br />
Create a script in {{ic|~/.config/xfce4/killwindow.sh}} with this content and make it executable (you can use {{ic|chmod 755 killwindow.sh}}).<br />
<br />
xkill -id "`xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p'`"<br />
<br />
Now associate a shortcut using {{ic|Settings -> Keyboard}} to that script.<br />
<br />
=== XFWM4 ===<br />
==== How to enable the compositor in Xfce ====<br />
Xfce comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your {{ic|/etc/xorg.conf}}. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
==== Disable window roll-up ====<br />
xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false<br />
<br />
==== Disable/enable automatic resizing/tiling of windows at edge of screen ====<br />
XFWM4 has the ability to "tile" a window automatically when it is moved to the edge of the screen by resizing it to fill the top half of the screen. (The official XFCE website says this feature is disabled by default in XFCE 4.10, but it seems to be enabled by default on Arch Linux.) This behavior can be enabled or disabled in {{ic|Window Manager Tweaks --> Accessibility --> Automatically tile windows when moving toward the screen edge}}, or:<br />
<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s false # To disable<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s true # To enable<br />
<br />
=== Commands for the settings manager ===<br />
<br />
There is no official documentation for the commands executed. One must look at {{ic|.desktop}} files {{ic|/usr/share/applications/}} folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce4-accessibility-settings<br />
xfce4-power-manager-settings<br />
xfce4-settings-editor<br />
xfdesktop-settings<br />
xfce4-display-settings<br />
xfce4-keyboard-settings<br />
xfce4-mouse-settings<br />
xfce4-session-settings<br />
xfce4-settings-manager<br />
xfce4-appearance-settings<br />
xfwm4-settings<br />
xfwm4-tweaks-settings<br />
xfwm4-workspace-settings<br />
orage -p<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep '^Exec=' /usr/share/applications/xfce*settings* | sed -e 's_^.*=_ _'<br />
<br />
===Session===<br />
====Customizing Startup Applications====<br />
This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file {{ic|/etc/xdg/xfce4/xinitrc}} to {{ic|~/.config/xfce4/}}<br />
* Edit this file. For example, you can add something like this somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
====Switch between users====<br />
Xfce4 allows this behavior under the 'action buttons' menu item. Currently, both [[gdm]] and [[Lightdm#User_switching_under_xfce4|lightdm]] provide this functionality.<br />
<br />
==== Modify XML settings files directly ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the {{ic|~/.config/xfce4/xfconf/}} folder. For application keyboard shortcuts for example, the file is {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml}}. It is faster to copy and paste the XML keys that you want rather than using the GUI.<br />
<br />
===Removable Devices===<br />
If you want an icon appearing on your desktop and in thunar when you plug in external devices, make sure gvfs is installed:<br />
<br />
# pacman -S --needed gvfs<br />
<br />
You could also need to install gvfs-afc (read [https://bbs.archlinux.org/viewtopic.php?pid=889018 this discussion]):<br />
<br />
# pacman -S gvfs-afc<br />
<br />
It is also a good idea to install thunar-volman (included in the {{ic|xfce4-goodies}} group):<br />
<br />
# pacman -S thunar-volman<br />
<br />
Udisk and a udisk wrapper are recommended if you want to automount optical and external drives easily<br />
<br />
* [http://igurublog.wordpress.com/downloads/script-devmon/ devmon] - devmon ([https://aur.archlinux.org/packages.php?ID=45842 AUR]) is a configuration-less bash wrapper script for udisks which automounts optical discs and removable drives. It can also selectively autostart apps or execute commands after mounting, ignore specified devices and volume labels, and unmount removable drives.<br />
<br />
===How to add themes to XFCE===<br />
1. Go to [http://www.xfce-look.org www.xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using Squeeze/Xarchiver/CLI.<br />
<br />
3. Move the extracted folder to {{ic|/usr/share/themes}} (for all users) or {{ic|~/.themes}} (for just you). Inside {{ic|/usr/share/themes/abc}}, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. GTK theme is available here:<br />
Menu --> Settings --> Appearance<br />
You select your xfwm theme in:<br />
Menu --> Settings --> Window Manager<br />
<br />
=== Cursors ===<br />
Main article: [[X11 Cursors]]<br />
<br />
If you have alternative X cursor themes installed, Xfce can find them with:<br />
Menu --> Settings --> Mouse --> Theme<br />
<br />
=== Icons ===<br />
1. First find and download your desired icon pack. Recommended places to download icons from are [http://www.customize.org Customize.org], [http://opendesktop.org Opendesktop.org] and [http://xfce-look.org/ Xfce-look.org].<br />
<br />
2. Go to the directory where you downloaded the icon pack and extract it. Example {{ic|tar -xzf /home/user/downloads/icon-pack.tar.gz}}.<br />
<br />
3. Move the extracted folder containing the icons to {{ic|/usr/share/icons}} (if you want all users on the system to make use of the icons) or {{ic|~/.icons}} (if only you want to use the icons).<br />
<br />
Optional: run {{ic|gtk-update-icon-cache -f -t ~/.icons/<theme_name>}} to update icon cache<br />
<br />
4. Switch your icons by going to:<br />
Menu --> Settings --> Appearance --> Icons<br />
<br />
When you have icon theme problems, it is also recommended to install the {{Pkg|hicolor-icon-theme}} package if it was not already installed.<br />
<br />
=== Fonts ===<br />
<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearence click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<br />
<br />
=== Sound ===<br />
<br />
==== Configuring xfce4-mixer ====<br />
<br />
{{Pkg|xfce4-mixer}} is the GUI mixer app / panel plugin made by the Xfce team. It is part of the xfce4 group, so you probably already have it installed. Xfce 4.6 uses {{Pkg|gstreamer}} as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer. One or more of the gstreamer plugin packages listed as optional dependencies to xfce4-mixer must be installed. Without one of these required plugins packages, the following error arises when clicking on the mixer panel item.<br />
<br />
GStreamer was unable to detect any sound devices. Some sound system specific GStreamer packages may be missing. It may also be a permissions problem.<br />
<br />
(It is probably not a permissions problem. It is no longer required to add audio users to the "audio" group.) Which plugins are needed depends on the hardware. Most people should be fine with {{Pkg|gstreamer0.10-base-plugins}} which can be [[pacman|installed]] from [[Official Repositories]]. <br />
<br />
If the xfce4-mixer panel item was already running before one of the plugins packages was installed, logout and login to see if it worked, or just remove the mixer plugin from the panel and add it again. If that does not work, you might need more or different gstreamer plugins. Try to [[pacman|install]] package {{pkg|gstreamer0.10-good-plugins}} or {{pkg|gstreamer0.10-bad-plugins}}.<br />
<br />
For further details, for example how to set the default sound card, see [[Advanced Linux Sound Architecture]]. Alternatively you can use [[PulseAudio]] together with {{Pkg|pavucontrol}}.<br />
<br />
==== How do I get xfce4-mixer and OSS4 to work together? ====<br />
<br />
If you tried the above section to get {{Pkg|xfce4-mixer}} to work and it does not work at all, then you may have to compile gstreamer0.10-good-plugins yourself. Download the PKGBUILD and other files needed from ABS or [http://projects.archlinux.org/svntogit/packages.git/tree/gstreamer0.10-good/repos here], edit the PKGBUILD, add --enable-oss. <br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \<br />
'''--enable-oss \'''<br />
--disable-static --enable-experimental \<br />
--disable-schemas-install \<br />
--disable-hal \<br />
--with-package-name="GStreamer Good Plugins (Archlinux)" \<br />
--with-package-origin="http://www.archlinux.org/"<br />
<br />
and then run makepkg -i. <br />
<br />
makepkg -i<br />
<br />
Still not working? Try this package in AUR {{AUR|gstreamer0.10-good-plugins-ossv4}}, modify the pkgver to the newest in the PKGBUILD, and it should work.<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Change volume with keyboard volume buttons ====<br />
<br />
Go to <br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+ unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%- unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{ic|amixer set Master toggle}} does not work, try the PCM channel ({{ic|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{ic|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
Use one of these scripts: http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
===== Xfce4-volumed =====<br />
<br />
[https://aur.archlinux.org/packages.php?ID=31693 xfce4-volumed] daemon from the [[AUR]] automatically maps volume keys of your keyboard to Xfce-mixer. Additionally you get OSD through Xfce4-notifyd when changing volume. Xfce4-volumed does not need any configuration and is started automatically with Xfce.<br />
<br />
{{accuracy|reason=There should be a short explanation of what this does and why it fixes the issue (bug?).}}<br />
<br />
If you use pulseaudio and xfce4-volumed unmute does not work, try this:<br />
<br />
$ xfconf-query -c xfce4-mixer -p /active-card -s `xfconf-query -c xfce4-mixer -p /sound-card`<br />
<br />
===== Volumeicon =====<br />
<br />
{{pkg|volumeicon}} is an alternative to xfce4-volumed in the community repo also handling keybindings and notifications through {{pkg|xfce4-notifyd}}.<br />
<br />
==== Adding startup/boot sound ====<br />
<br />
Arch does not have a built-in startup sound configuration tool, but there is a workaround by adding the following command to your Application Autostart settings:<br />
<br />
aplay /boot/startupsound.wav<br />
<br />
The file location and filename can be whatever you want, but naming it descriptively and putting it in /boot keeps things tidy.<br />
<br />
=== xdg-open integration (Preferred Applications) ===<br />
<br />
Most applications rely on [[xdg-open]] for opening a preferred application for a given file or URL.<br />
<br />
In order for xdg-open and xdg-settings to detect and integrate with the XFCE desktop environment correctly, you need to [[pacman|install]] the {{Pkg|xorg-xprop}} package.<br />
<br />
If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed.<br />
Installing the package and allowing ''xdg-open'' to detect that you are running XFCE makes it forward all calls to ''exo-open'' instead, which correctly uses all your preferred applications preferences.<br />
<br />
To make sure xdg-open integration is working correctly, ask ''xdg-settings'' for the default web browser and see what the result is:<br />
<br />
# xdg-settings get default-web-browser<br />
<br />
If it replies with:<br />
<br />
xdg-settings: unknown desktop environment<br />
<br />
it means that it has failed to detect XFCE as your desktop environment, which is likely due to a missing {{Pkg|xorg-xprop}} package.<br />
<br />
=== Screenshots ===<br />
<br />
==== Using print-screen key ====<br />
<br />
A simple way is to use a command-line screenshot utility:<br />
<br />
# pacman -S scrot<br />
<br />
Then go to:<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "scrot" command to use the "PrintScreen" key.<br />
<br />
All screenshots will be placed in your home folder with unique names (i.e. {{ic|2009-02-19-063052_1280x1024_scrot.png}}).<br />
<br />
====Screenshooter====<br />
<br />
There is also an a screenshot plugin for the Xfce panel, which can be used instead of scrot, that is available in extra:<br />
<br />
# pacman -S xfce4-screenshooter<br />
<br />
You can add a keyboard binding for it using the command<br />
<br />
xfce4-screenshooter -f<br />
<br />
instead of "scrot". You will get a dialog window after pressing "Print" where you can copy the image to the clipboard or save it.<br />
<br />
=== Change mount options ===<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved by changing the default iocharset to utf8, which is easily done adding a line to {{ic|/etc/xdg/xfce4/mount.rc}}:<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files, so be careful.<br />
<br />
It is also possible to mount vfat devices with the ''flush'' option, so that when copying to USB sticks data flushes more often, thus making thunar's progress bar to stays up until finished. Adding ''async'' instead will speed up write ops, but use Eject option in Thunar to unmount the Flash. Globally, mount options for storage devices present at boot can be set in [[fstab]], and for other devices in [[udev]] rules.<br />
<br />
[vfat]<br />
flush=true<br />
<br />
===Terminal tango color theme===<br />
Open with your favorite editor<br />
<br />
~/.config/Terminal/terminalrc<br />
<br />
And add(replace) this lines:<br />
<br />
ColorForeground=White<br />
ColorBackground=#323232323232<br />
ColorPalette1=#2e2e34343636<br />
ColorPalette2=#cccc00000000<br />
ColorPalette3=#4e4e9a9a0606<br />
ColorPalette4=#c4c4a0a00000<br />
ColorPalette5=#34346565a4a4<br />
ColorPalette6=#757550507b7b<br />
ColorPalette7=#060698989a9a<br />
ColorPalette8=#d3d3d7d7cfcf<br />
ColorPalette9=#555557575353<br />
ColorPalette10=#efef29292929<br />
ColorPalette11=#8a8ae2e23434<br />
ColorPalette12=#fcfce9e94f4f<br />
ColorPalette13=#72729f9fcfcf<br />
ColorPalette14=#adad7f7fa8a8<br />
ColorPalette15=#3434e2e2e2e2<br />
ColorPalette16=#eeeeeeeeecec<br />
<br />
=== Colour management ===<br />
xfce4-settings-manager does not yet have any colour management / calibration settings, nor is there any specific XFCE program to characterise your monitor.<br />
<br />
==== Loading a profile ====<br />
If you wish to '''load an icc profile''' (that you have previously created or downloaded) to calibrate your display on startup, you can download {{AUR|xcalib}} from [[AUR]], then open the XFCE4 Settings Manager, click Session and Startup icon, the Autostart tab, and add a new entry where the command is {{ic|/usr/bin/xcalib /path/to/your/profile.icc}}. You still need to tell your applications, which display profile should be used to have the displayed images colour managed.<br />
<br />
Another option is dispwin. Dispwin not only calibrates the display, but also sets the _ICC_PROFILE atom in X so that some applications can use a "system" display profile instead of requiring the user to set the display profile manually (GIMP, Inkscape, darktable, UFRaw, etc.).<br />
<br />
See [[ICC_Profiles#Loading_ICC_Profiles]] for more information.<br />
<br />
==== Creating a profile ====<br />
<br />
If you wish to '''create an icc profile''' for your display (ie. characterising/profiling, e.g. with the [[ColorHug]], or some other colorimeter, or a spectrophotometer, or "by eye"), the simplest option may be to install [https://aur.archlinux.org/packages.php?ID=25883 dispcalGUI] from [[AUR]]. <br />
<br />
Another option is {{ic|gnome-control-center}} (available in extra), which has a much simpler GUI, but less options and requires installing some Gnome dependencies. In order to start the calibration from the command line, first do {{ic|colormgr get-devices}} and look for the "Device ID" line of your monitor. If this is e.g. "xrandr-Lenovo Group Limited", you start calibration with the commabnd {{ic|gcm-calibrate --device "xrandr-Lenovo Group Limited"}}.<br />
{{Note|1=It seems like you need to run the full gnome-control-center because XFCE does not yet have a session component for colord: https://bugzilla.xfce.org/show_bug.cgi?id=8559}}<br />
<br />
See [[ICC Profiles]] for more information.<br />
<br />
=== XDG User Directories ===<br />
freedesktop.org specifies the "well known" user directories like the desktop folder and the music folder. The {{Pkg|xdg-user-dirs}} to manage them and it also handles localization (i.e. translation) of the filenames.<br />
# pacman -S xdg-user-dirs<br />
If you want to use the directories with your localized names, run the following command on your user:<br />
$ xdg-user-dirs-update<br />
If you want to revert to English, run the following:<br />
$ LC_ALL=C xdg-user-dirs-update<br />
It then creates localized (or English) versions of these directories in your home directory and sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config). The Xfce and other softwares complying the freedesktop.org knows that is where those types of files should go by default.<br />
<br />
In the case of the French:<br />
<br />
{{hc|~/.config/user-dirs.locale|<br />
fr_FR}}<br />
{{hc|~/.config/user-dirs.dirs|<nowiki><br />
XDG_DESKTOP_DIR="$HOME/Bureau"<br />
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"<br />
XDG_TEMPLATES_DIR="$HOME/Exemples"<br />
XDG_PUBLICSHARE_DIR="$HOME/Public"<br />
XDG_DOCUMENTS_DIR="$HOME/Documents"<br />
XDG_MUSIC_DIR="$HOME/Musiques"<br />
XDG_PICTURES_DIR="$HOME/Images"<br />
XDG_VIDEOS_DIR="$HOME/Vidéos"</nowiki>}}<br />
<br />
You can edit these files directly by using text editor.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Unable to open external windows partitions ===<br />
If you have external partitions like a fat32 drive connected via eSata, and launching them from the desktop results in a dialog telling you 'Authentication is required', you need to ensure polkit-gnome is installed and PolicyKit Authentication Agent is started by xfce4.<br />
pacman -S polkit-gnome<br />
Restart xfce4 and go:<br />
Applications Menu > Settings > Sessions and Startup<br />
Check that PolicyKit Authentication Agent is enabled under the Application Autostart tab.<br />
<br />
=== xfce4-power-manager is not working ===<br />
Check you have added dbus to the {{ic|DAEMONS}} array in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Xfce4-xkb-plugin settings issue ===<br />
There is a bug in version ''0.5.4.1-1'' which causes xkb-plugin to ''lose keyboard, layout switching and compose key'' settings. As a workaround you may enable ''Use system defaults'' option in keyboard settings. To do so run<br />
xfce4-keyboard-settings<br />
Go to ''Layout'' tab and set the ''Use system defaults'' flag, then reconfigure xkb-plugin.<br />
<br />
=== Thunar does not display any thumbnail ===<br />
<br />
Thunar relies on '''Tumbler''' to generate thumbnails. You can install Tumbler by issuing<br />
<br />
pacman -S tumbler<br />
<br />
More details in [[Thunar#Thunar_Thumbnailers|Thunar's page]].<br />
<br />
=== Locales ignored with GDM ===<br />
Become superuser and add your locale to /var/lib/AccountsService/users/$USER:<br />
su -c "nano /var/lib/AccountsService/users/$USER"<br />
Replace hu_HU.UTF-8 with your own locale:<br />
[User]<br />
Language=hu_HU.UTF-8<br />
XSession=xfce<br />
You may also do it with sed. Note the backslash before .UTF-8:<br />
su -c "sed -i 's/Language=.*/Language=hu_HU\.UTF-8/' /var/lib/AccountsService/users/$USER"<br />
Restart GDM to take effect.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming {{ic|~/.config/xfce4-session/}} and {{ic|~/.config/xfce4/}}<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Logout and login for changes to take effect.<br />
<br />
=== NVIDIA and xfce4-sensors-plugin ===<br />
To detect and use sensors of nvidia gpu you need to install {{AUR|libxnvctrl}} and then recompile {{Pkg|xfce4-sensors-plugin}} package.<br />
<br />
=== Session failure ===<br />
If the window manager does not load correctly (The mouse is a X and you cannot close windows) you maybe got an session error.<br />
To remove a corrupt session you can delete the session folder at the {{ic|.cache}} folder.<br />
# rm -r ~/.cache/sessions/<br />
The easy way to reload the session is to reboot the computer. You can also restart xfce.<br />
<br />
=== Clock/notification area no longer pushed to the right edge of the panel in Xfce 4.10 ===<br />
<br />
This is due to a change in the Window Buttons panel plugin which no longer expands to fill the available space.<br />
<br />
To emulate the old behavior, add a transparent separator between the window buttons and the clock/notification area, setting its expand property.<br />
<br />
=== Preferred Applications preferences have no effect ===<br />
<br />
If you have set your preferred applications with ''exo-preferred-applications'', but they do not seem to be taken into consideration, see [[Xfce#xdg-open_integration_.28Preferred_Applications.29]]<br />
<br />
==See also==<br />
* http://docs.xfce.org/ - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]</div>Sambul13https://wiki.archlinux.org/index.php?title=Xfce&diff=224745Xfce2012-09-23T15:40:37Z<p>Sambul13: /* Shutting down, rebooting, and automounting from within Xfce */</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[cs:Xfce]]<br />
[[de:Xfce]]<br />
[[es:Xfce]]<br />
[[fr:Xfce]]<br />
[[it:Xfce]]<br />
[[ja:Xfce]]<br />
[[pl:Xfce]]<br />
[[ru:Xfce]]<br />
[[tr:Xfce_Masaüstü_Ortamı]]<br />
[[uk:Xfce]]<br />
[[zh-CN:Xfce]]<br />
{{Article summary start}}<br />
{{Article summary text|Xfce is a lightweight desktop environment for Unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and user friendly. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|Xfce uses the [[GTK+]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Thunar}}<br />
{{Article summary wiki|Improve GTK Application Looks}}<br />
{{Article summary wiki|Autostart applications#Graphical}}<br />
{{Article summary end}}<br />
<br />
From [http://www.xfce.org/about/ Xfce - About]:<br />
<br />
:''Xfce embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that provide the full functionality one can expect of a modern desktop environment. They are packaged separately and you can pick among the available packages to create the optimal personal working environment.''<br />
<br />
== What is Xfce? ==<br />
Xfce is a Desktop Environment, like [[GNOME]] or [[KDE]]. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Features:<br />
*Lighter on resources than the other major DEs (KDE, GNOME).<br />
*Most settings are exposed via a GUI, Xfce does not try to hide stuff from the user.<br />
*Xfwm has an optional built-in compositor which allows for true transparency and all the benefits of GPU acceleration (minimizes tearing, etc.).<br />
*It works great with multiple monitors.<br />
<br />
==Installation==<br />
<br />
Before starting, make sure you have the [[Xorg|X server]] installed and configured correctly.<br />
<br />
{{Note|Xfce is somewhat modular. That means there is no need for you to run every part, you can pick and choose some of them.}}<br />
<br />
The base Xfce system can be [[pacman|installed]] with the group {{Grp|xfce4}}, available in the [[Official Repositories]]. Pacman will ask you to select the packages to install, but you probably want to get them all by simply pressing {{Keypress|Enter}}. Additional packages, like panel plugins, notifications, and system tools are available in the {{Grp|xfce4-goodies}} group.<br />
<br />
{{Tip|Installing [[Gamin]] (the successor of [[FAM]]) is highly recommended.}}<br />
<br />
In order to get the xfce4-mixer to work with [[ALSA]], you need to install {{Pkg|gstreamer0.10-base-plugins}}. See [[#OSS|below]] for help with [[OSS]].<br />
<br />
== Running Xfce ==<br />
<br />
===Automatically at boot time===<br />
There are two methods to start Xfce (and in fact, any desktop or window manager) at boot time:<br />
<br />
* Run Xfce through a Display Manager<br />
* Run Xfce automatically using [[Bash#Configuration_file_overview|bash_profile]] or [[inittab]]<br />
<br />
See [[Display Manager]] for details about installing and configuring a Display Manager (be sure to configure it properly for [[PolicyKit]]). See [[Start X at Boot]] for configuration instructions on using bash_profile or inittab.<br />
<br />
===Manually===<br />
<br />
You can execute:<br />
$ startxfce4<br />
from the console, or configure [[xinitrc]] and use xinit or startx.<br />
<br />
If you have not created a {{ic|~/.xinitrc}} yet, do so with:<br />
<br />
$ cp /etc/skel/.xinitrc ~/.xinitrc<br />
<br />
and add the following line:<br />
<br />
exec startxfce4 --with-ck-launch<br />
<br />
Example:<br />
{{hc|~/.xinitrc|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
[ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
<br />
{{Note|<br />
*{{ic|--with-ck-launch}} starts a clean ConsoleKit session needed by Xfce for power management, automounting, shutting down, rebooting, etc. ConsoleKit/PolicyKit capable display managers such as gdm do this for you automatically and thus the command does not need to be specified seperatly.<br />
*{{pkg|xorg-xdm}} is also ConsoleKit/PolicyKit capable since version 1.1.11. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or .xsession for xdm.<br />
*[[SLiM]] is also ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must '''not''' use {{ic|--with-ck-launch}} from your .xinitrc or slim.conf login_cmd.<br />
*In case you are wondering, {{ic|dbus-launch}} will be launched by the {{ic|xinitrc.d}} code at the beginning of the file. {{ic|dbus-launch}} starts a dbus-daemon instance to provide communication with PolicyKit.<br />
*The proper command for launching Xfce is {{ic|startxfce4}}: do not start {{ic|xfce4-session}} directly, since it is already run by {{ic|startxfce4}} itself.<br />
*If you are running an Xfce older than 4.10, you will have to use {{ic|exec ck-launch-session startxfce4}}<br />
}}<br />
{{Note|{{ic|dbus-launch}} should actually be called '''after''' launching ConsoleKit, otherwise there will be authorization problems when mounting disks as a regular user, see {{Bug|25031}}. For a '''temporary''' workaround you can edit the {{ic|xinitrc.d}} script at the beginning of the file as follows, and '''keep an eye on the evolution of the bug report''' (and possibly vote it):<br />
{{hc|~/.xinitrc [temporary workaround]|<nowiki>#!/bin/sh<br />
<br />
if [ -d /etc/X11/xinit/xinitrc.d ]; then<br />
for f in /etc/X11/xinit/xinitrc.d/*; do<br />
# Do not launch dbus before ConsoleKit (FS#25031)<br />
#[ -x "$f" ] && . "$f"<br />
[ "$f" -ne "/etc/X11/xinit/xinitrc.d/30-dbus" ] && [ -x "$f" ] && . "$f"<br />
done<br />
unset f<br />
fi<br />
<br />
exec startxfce4 --with-ck-launch</nowiki>}}<br />
There is still no need to start {{ic|dbus-launch}} explicitly since {{ic|startxfce4}} takes care of doing that anyway.}}<br />
<br />
===Shutting down, rebooting, and automounting from within Xfce===<br />
* Make sure that '''dbus''' is enabled in the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}.<br />
* If a display manager is used:<br />
** Make sure that you are using {{ic|exec startxfce4 --with-ck-launch}} in {{ic|~/.xinitrc}} (along with sourcing xinitrc.d scripts, which is done for you in the skel file) '''or''' a ConsoleKit/PolicyKit capable [[display manager]].<br />
* If no display manager is used:<br />
** Make sure you use the bash_profile method to auto-login (not inittab).<br />
** For automounting to work the default Policykit has to be [https://bbs.archlinux.org/viewtopic.php?pid=881377#p881377 edited]. You can also install {{pkg|polkit-gnome}} for authorization.<br />
* If you want to automount removable disk in thunar, install and [https://wiki.archlinux.org/index.php/Thunar#Thunar_Volume_Manager configure] {{pkg|thunar-volman}} and {{pkg|gamin}}, and make sure {{pkg|gvfs}} and {{pkg|gvfs-afc}} is installed, see [https://bbs.archlinux.org/viewtopic.php?id=119992 details] .<br />
====Shutdown & reboot from shutdown menu when using systemd====<br />
If you are using systemd instead of sysvinit, when trying to shutdown or reboot from the shutdown menu of xfce4 it actually logout to DM; installing systemd-sysvcompat corrects this misbehavior.<br />
do {{ic|pacman -Sy systemd-sysvcompat}} as root and it should work right away.<br />
<br />
==Tips and tricks==<br />
===Configuring Xfconf settings===<br />
Xfconf is XFCE's system for storing configuration options, and most XFCE configuration is done by editing settings in Xfconf (one way or another). There are several ways to modify these settings:<br />
* The most obvious and easiest way is to go to "Settings" in the main menu and select the category you want to customize. However, not all customization options are available this way. <br />
* A less user-friendly but more general way is to go to {{bc|Main menu -> Settings -> Settings Editor}} where you can see and modify all the customization options. Any settings modified here will take effect immediately. The Settings Editor can also be launched from the command line by invoking {{ic|xfce4-settings-editor}}.<br />
* Customization can be done completely from the command line using the program {{ic|xfconf-query}}. See [http://docs.xfce.org/xfce/xfconf/xfconf-query the XFCE online documentation] for more information and examples and the rest of this wiki page for more examples. Settings changed here will take effect immediately.<br />
* The settings are stored in XML files in {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/}} which can be edited by hand. However, changes made here will not take effect immediately.<br />
* For more information: [http://docs.xfce.org/xfce/xfconf/start Xfconf documentation]<br />
===Panel===<br />
====How to customize xfce panel background====<br />
Edit {{ic|~/.gtkrc-2.0}}.<br />
Note that you must place the image in the same directory as the configuration, which is {{ic|~/}}. You can not specify the path to the image, or it will not work.<br />
style "panel-background" {<br />
bg_pixmap[NORMAL] = "foo.bar"<br />
bg_pixmap[PRELIGHT] = "foo.bar"<br />
bg_pixmap[ACTIVE] = "foo.bar"<br />
bg_pixmap[SELECTED] = "foo.bar"<br />
bg_pixmap[INSENSITIVE] = "foo.bar"<br />
}<br />
widget_class "*Panel*" style "panel-background"<br />
<br />
==== Replacements for the default 'menu' panel applet ====<br />
The "Ubuntu System Panel" (GNOME) panel applet has similar features to those found in its KDE v4.2 equivalent. It can be added to an Xfce panel via the 'XfApplet' panel applet, which allows GNOME applets to be used in Xfce.<br />
<br />
It is available in the [[Arch User Repository|AUR]] as the {{AUR|usp2}} package.<br />
<br />
====How to remove menu entries from the System menu====<br />
===== Method 1 =====<br />
With the built-in menu editor, you cannot remove menu entries from the System menu. Here’s how to hide them:<br />
# Open Terminal (Xfce menu > System > Terminal) and go to the {{ic|/usr/share/applications}} folder: {{bc|$ cd /usr/share/applications}}<br />
# This folder should be full of {{ic|.desktop}} files. To see a list type: {{bc|$ ls}}<br />
# Add {{ic|1=NoDisplay=true}} to the {{ic|.desktop}} file. For example, if you want to hide Firefox, type in the terminal:{{bc|1=$ sudo sh -c 'echo "NoDisplay=true" >> firefox.desktop'}} This command appends the text {{ic|1=NoDisplay=true}} to the end of the {{ic|.desktop}} file.<br />
<br />
===== Method 2 =====<br />
Another method is to copy the entire contents of the global applications directory over to your local applications directory, and then proceed to modify and/or disable unwanted .desktop entries. This will survive application updates that overwrite changes under {{ic|/usr/share/applications/}}.<br />
# In a terminal, copy everything from {{ic|/usr/share/applications}} to {{ic|~/.local/share/applications/}}: {{bc|$ cp /usr/share/applications/* ~/.local/share/applications/}}<br />
# For any entry you wish to hide from the menu, add the {{ic|1=NoDisplay=true}} option: {{bc|1=$ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop}}<br />
<br />
You can also edit the application's category by editing the {{ic|.desktop}} file with a text editor and modifying the {{ic|1=Categories=}} line.<br />
<br />
===== Method 3 =====<br />
The third method is the '''cleanest''' and recommended in the [http://wiki.xfce.org/howto/customize-menu Xfce wiki].<br />
<br />
Create the file {{ic|~/.config/menus/xfce-applications.menu}} and copy the following in it:<br />
{{bc|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"><br />
<br />
<Menu><br />
<Name>Xfce</Name><br />
<MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile><br />
<br />
<Exclude><br />
<Filename>xfce4-run.desktop</Filename><br />
<br />
<Filename>exo-terminal-emulator.desktop</Filename><br />
<Filename>exo-file-manager.desktop</Filename><br />
<Filename>exo-mail-reader.desktop</Filename><br />
<Filename>exo-web-browser.desktop</Filename><br />
<br />
<Filename>xfce4-about.desktop</Filename><br />
<Filename>xfhelp4.desktop</Filename><br />
</Exclude><br />
<br />
<Layout><br />
<Merge type="all"/><br />
<Separator/><br />
<br />
<Menuname>Settings</Menuname><br />
<Separator/><br />
<br />
<Filename>xfce4-session-logout.desktop</Filename><br />
</Layout><br />
<br />
</Menu><br />
</nowiki>}}<br />
<br />
The {{ic|<MergeFile>}} tag includes the default Xfce menu in our file. This is important.<br />
<br />
The {{ic|<Exclude>}} tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude {{ic|firefox.desktop}} or any other application.<br />
<br />
The {{ic|<Layout>}} tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the aforementioned Xfce wiki page.<br />
<br />
===== Method 4 =====<br />
Alternatively a tool called [http://lxmed.sourceforge.net/ lxmed] can be used. Lxmed is a GUI tool written in Java for editing menu entires in LXDE, but it also works in Xfce4. Lxmed is available in the {{AUR|lxmed}} package from the [[AUR]].<br />
<br />
==== But what do you do with menu entries which do not show up in /usr/share/applications (e.g., apps installed via Wine)? ====<br />
I have found some shortcuts that show in the category “Other” in this directory:<br />
{{ic|~/.local/share/applications/wine/}}.<br />
<br />
====Panel autohide delay====<br />
Add this to {{ic|~/.gtkrc-2.0}}.<br />
style "xfce-panel-window-style"<br />
{<br />
# Time in miliseconds before the panel will unhide on an enter event<br />
XfcePanelWindow::popup-delay = 225<br />
<br />
# Time in miliseconds before the panel will hide on a leave event<br />
XfcePanelWindow::popdown-delay = 350<br />
}<br />
class "XfcePanelWindow" style "xfce-panel-window-style"<br />
<br />
====Panel at desktop level====<br />
<br />
If you want a panel at desktop level (i.e., other windows will stack over it) you need a little hack, ensure you have installed the '''wmctrl''' package.<br />
<br />
Create a script in {{ic|~/.config/xfce4/xfce4-fix-panel}} with this content and make it executable (you can use {{ic|chmod 755 xfce4-fix-panel}}).<br />
<br />
#!/bin/bash<br />
set -e<br />
<br />
function getPanelIdImpl() {<br />
# get panel id<br />
PANEL="`wmctrl -l | sed -n -e '/ xfce4-panel$/ s_ .*$__ p' | sed -n -e $1' p'`"<br />
}<br />
<br />
function getPanelId() {<br />
# eventually await the panel to appear<br />
getPanelIdImpl $1<br />
while [ x = x$PANEL ] ;do<br />
sleep 0.5s<br />
getPanelIdImpl $1<br />
done<br />
}<br />
<br />
function putPanelDown() {<br />
PANEL=""<br />
getPanelId $1<br />
wmctrl -i -r $PANEL -b add,below<br />
}<br />
<br />
# call the program with a list of panel numbers as arguments<br />
# for example, xfce4-fix-panel 1 2 3<br />
# for the first three panels<br />
for i in $* ;do<br />
putPanelDown $i<br />
done<br />
<br />
<br />
Once wrote the script, and tested it, you need to auto-execute it at each login. You can use the {{ic|Session and StartUp -> Application Autostart}} gui.<br />
<br />
This passage will put your panels at desktop level, but if your panel is sticking to a border the maximized windows will not stack over it. You can enable this behavior with the following command, fortunately you need to do this only once. (change the $ID with the panel number of interest)<br />
<br />
xfconf-query -c xfce4-panel -p /panels/panel-$ID/disable-struts -n -t bool -s true<br />
<br />
=== Desktop ===<br />
<br />
==== Use a transparent background for desktop icon titles ====<br />
To change the default white background of desktop icon titles to something more suitable, edit the {{ic|.gtkrc-2.0}} file in your home directory (or create the file if needed) and add the following:<br />
style "xfdesktop-icon-view" {<br />
XfdesktopIconView::label-alpha = 10<br />
base[NORMAL] = "#000000"<br />
base[SELECTED] = "#71B9FF"<br />
base[ACTIVE] = "#71FFAD"<br />
fg[NORMAL] = "#ffffff"<br />
fg[SELECTED] = "#71B9FF"<br />
fg[ACTIVE] = "#71FFAD" }<br />
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"<br />
<br />
==== Hide selected partitions on the desktop ====<br />
If you wish to prevent certain partitions or drives appearing on the desktop, you can create a udev rule, for example {{ic|/etc/udev/rules.d/10-local.rules}}:<br />
<br />
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"<br />
KERNEL=="sda2", ENV{UDISKS_IGNORE}="1"<br />
<br />
Would show all partitions with the exception of sda1 and sda2 on your desktop.<br />
<br />
==== Switch to old desktop right click menu without Thunar things ====<br />
xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0<br />
<br />
==== Adding the kill window shortcut ====<br />
<br />
Xfce does not support the ''kill window'' shortcut directly, but you can add one with a simple script. Ensure you have the '''xorg-xkill''' package installed.<br />
<br />
Create a script in {{ic|~/.config/xfce4/killwindow.sh}} with this content and make it executable (you can use {{ic|chmod 755 killwindow.sh}}).<br />
<br />
xkill -id "`xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p'`"<br />
<br />
Now associate a shortcut using {{ic|Settings -> Keyboard}} to that script.<br />
<br />
=== XFWM4 ===<br />
==== How to enable the compositor in Xfce ====<br />
Xfce comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on. It can be enabled in the Window Manager Tweaks and works on the fly. No additional settings are needed in your {{ic|/etc/xorg.conf}}. To enable and adjust settings, go to:<br />
<br />
Menu --> Settings --> Window Manager Tweaks<br />
<br />
==== Disable window roll-up ====<br />
xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false<br />
<br />
==== Disable/enable automatic resizing/tiling of windows at edge of screen ====<br />
XFWM4 has the ability to "tile" a window automatically when it is moved to the edge of the screen by resizing it to fill the top half of the screen. (The official XFCE website says this feature is disabled by default in XFCE 4.10, but it seems to be enabled by default on Arch Linux.) This behavior can be enabled or disabled in {{ic|Window Manager Tweaks --> Accessibility --> Automatically tile windows when moving toward the screen edge}}, or:<br />
<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s false # To disable<br />
xfconf-query -c xfwm4 -p /general/tile_on_move -s true # To enable<br />
<br />
=== Commands for the settings manager ===<br />
<br />
There is no official documentation for the commands executed. One must look at {{ic|.desktop}} files {{ic|/usr/share/applications/}} folder. For the people who like to know exactly what is happening, here is a handy list to save the effort:<br />
<br />
xfce4-accessibility-settings<br />
xfce4-power-manager-settings<br />
xfce4-settings-editor<br />
xfdesktop-settings<br />
xfce4-display-settings<br />
xfce4-keyboard-settings<br />
xfce4-mouse-settings<br />
xfce4-session-settings<br />
xfce4-settings-manager<br />
xfce4-appearance-settings<br />
xfwm4-settings<br />
xfwm4-tweaks-settings<br />
xfwm4-workspace-settings<br />
orage -p<br />
<br />
To review all the available setting manager commands run the following in a terminal:<br />
<br />
$ grep '^Exec=' /usr/share/applications/xfce*settings* | sed -e 's_^.*=_ _'<br />
<br />
===Session===<br />
====Customizing Startup Applications====<br />
This includes getting necessary environment variables into the GUI runtime.<br />
<br />
* Copy the file {{ic|/etc/xdg/xfce4/xinitrc}} to {{ic|~/.config/xfce4/}}<br />
* Edit this file. For example, you can add something like this somehwere in the middle:<br />
source $HOME/.bashrc<br />
# start rxvt-unicode server<br />
urxvtd -q -o -f<br />
<br />
====Switch between users====<br />
Xfce4 allows this behavior under the 'action buttons' menu item. Currently, both [[gdm]] and [[Lightdm#User_switching_under_xfce4|lightdm]] provide this functionality.<br />
<br />
==== Modify XML settings files directly ====<br />
It may be useful, especially when upgrading, to manually edit .xml files in the {{ic|~/.config/xfce4/xfconf/}} folder. For application keyboard shortcuts for example, the file is {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml}}. It is faster to copy and paste the XML keys that you want rather than using the GUI.<br />
<br />
===Removable Devices===<br />
If you want an icon appearing on your desktop and in thunar when you plug in external devices, make sure gvfs is installed:<br />
<br />
# pacman -S --needed gvfs<br />
<br />
You could also need to install gvfs-afc (read [https://bbs.archlinux.org/viewtopic.php?pid=889018 this discussion]):<br />
<br />
# pacman -S gvfs-afc<br />
<br />
It is also a good idea to install thunar-volman (included in the {{ic|xfce4-goodies}} group):<br />
<br />
# pacman -S thunar-volman<br />
<br />
Udisk and a udisk wrapper are recommended if you want to automount optical and external drives easily<br />
<br />
* [http://igurublog.wordpress.com/downloads/script-devmon/ devmon] - devmon ([https://aur.archlinux.org/packages.php?ID=45842 AUR]) is a configuration-less bash wrapper script for udisks which automounts optical discs and removable drives. It can also selectively autostart apps or execute commands after mounting, ignore specified devices and volume labels, and unmount removable drives.<br />
<br />
===How to add themes to XFCE===<br />
1. Go to [http://www.xfce-look.org www.xfce-look.org] and click "Themes" in the left navbar. Look around for a theme you want and click "Download".<br />
<br />
2. Go to the directory where you downloaded the tarball/file and extract it using Squeeze/Xarchiver/CLI.<br />
<br />
3. Move the extracted folder to {{ic|/usr/share/themes}} (for all users) or {{ic|~/.themes}} (for just you). Inside {{ic|/usr/share/themes/abc}}, there is a folder that you create called xfwm4 that will contain whatever files that is included with that theme.<br />
<br />
4. GTK theme is available here:<br />
Menu --> Settings --> Appearance<br />
You select your xfwm theme in:<br />
Menu --> Settings --> Window Manager<br />
<br />
=== Cursors ===<br />
Main article: [[X11 Cursors]]<br />
<br />
If you have alternative X cursor themes installed, Xfce can find them with:<br />
Menu --> Settings --> Mouse --> Theme<br />
<br />
=== Icons ===<br />
1. First find and download your desired icon pack. Recommended places to download icons from are [http://www.customize.org Customize.org], [http://opendesktop.org Opendesktop.org] and [http://xfce-look.org/ Xfce-look.org].<br />
<br />
2. Go to the directory where you downloaded the icon pack and extract it. Example {{ic|tar -xzf /home/user/downloads/icon-pack.tar.gz}}.<br />
<br />
3. Move the extracted folder containing the icons to {{ic|/usr/share/icons}} (if you want all users on the system to make use of the icons) or {{ic|~/.icons}} (if only you want to use the icons).<br />
<br />
Optional: run {{ic|gtk-update-icon-cache -f -t ~/.icons/<theme_name>}} to update icon cache<br />
<br />
4. Switch your icons by going to:<br />
Menu --> Settings --> Appearance --> Icons<br />
<br />
When you have icon theme problems, it is also recommended to install the {{Pkg|hicolor-icon-theme}} package if it was not already installed.<br />
<br />
=== Fonts ===<br />
<br />
If you find the standard fonts rather thick and or slightly out of focus open Settings>Appearence click on the Fonts tab and under Hinting: change to Full<br />
<br />
You could also try using a custom DPI setting.<br />
<br />
=== Sound ===<br />
<br />
==== Configuring xfce4-mixer ====<br />
<br />
{{Pkg|xfce4-mixer}} is the GUI mixer app / panel plugin made by the Xfce team. It is part of the xfce4 group, so you probably already have it installed. Xfce 4.6 uses {{Pkg|gstreamer}} as the backend to control volume, so first you have to make gstreamer cooperate with xfce4-mixer. One or more of the gstreamer plugin packages listed as optional dependencies to xfce4-mixer must be installed. Without one of these required plugins packages, the following error arises when clicking on the mixer panel item.<br />
<br />
GStreamer was unable to detect any sound devices. Some sound system specific GStreamer packages may be missing. It may also be a permissions problem.<br />
<br />
(It is probably not a permissions problem. It is no longer required to add audio users to the "audio" group.) Which plugins are needed depends on the hardware. Most people should be fine with {{Pkg|gstreamer0.10-base-plugins}} which can be [[pacman|installed]] from [[Official Repositories]]. <br />
<br />
If the xfce4-mixer panel item was already running before one of the plugins packages was installed, logout and login to see if it worked, or just remove the mixer plugin from the panel and add it again. If that does not work, you might need more or different gstreamer plugins. Try to [[pacman|install]] package {{pkg|gstreamer0.10-good-plugins}} or {{pkg|gstreamer0.10-bad-plugins}}.<br />
<br />
For further details, for example how to set the default sound card, see [[Advanced Linux Sound Architecture]]. Alternatively you can use [[PulseAudio]] together with {{Pkg|pavucontrol}}.<br />
<br />
==== How do I get xfce4-mixer and OSS4 to work together? ====<br />
<br />
If you tried the above section to get {{Pkg|xfce4-mixer}} to work and it does not work at all, then you may have to compile gstreamer0.10-good-plugins yourself. Download the PKGBUILD and other files needed from ABS or [http://projects.archlinux.org/svntogit/packages.git/tree/gstreamer0.10-good/repos here], edit the PKGBUILD, add --enable-oss. <br />
<br />
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \<br />
'''--enable-oss \'''<br />
--disable-static --enable-experimental \<br />
--disable-schemas-install \<br />
--disable-hal \<br />
--with-package-name="GStreamer Good Plugins (Archlinux)" \<br />
--with-package-origin="http://www.archlinux.org/"<br />
<br />
and then run makepkg -i. <br />
<br />
makepkg -i<br />
<br />
Still not working? Try this package in AUR {{AUR|gstreamer0.10-good-plugins-ossv4}}, modify the pkgver to the newest in the PKGBUILD, and it should work.<br />
<br />
Other LINKS: [http://www.4front-tech.com/forum/ OSS forum]<br />
<br />
==== Change volume with keyboard volume buttons ====<br />
<br />
Go to <br />
Settings --> Keyboard<br />
Click the "Application Shortcuts" tab and add click the "Add" button. Add the following by entering the command, then pressing the corresponding button at the next window:<br />
<br />
===== ALSA =====<br />
For the raise volume button:<br />
amixer set Master 5%+<br />
For the lower volume button:<br />
amixer set Master 5%-<br />
For the mute button:<br />
amixer set Master toggle<br />
<br />
You can also run these commands to set the above commands to the standard XF86Audio keys:<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+ unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%- unmute"<br />
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"<br />
<br />
If {{ic|amixer set Master toggle}} does not work, try the PCM channel ({{ic|amixer set PCM toggle}}) instead.<br />
<br />
The channel must have a "mute" option for the toggle command to work. To check whether or not your Master channel supports toggling mute, run {{ic|alsamixer}} in a terminal and look for the double M's (MM) under the Master channel. If they are not present, then it does not support the mute option. If, for example, you had to change the toggle button to use the PCM channel, make sure to also set the PCM channel as the Mixer Track under Xfce Mixer properties.<br />
<br />
===== OSS =====<br />
Use one of these scripts: http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS<br />
<br />
If using ossvol (recommended), add:<br />
ossvol -i 1<br />
for the volume up button<br />
ossvol -d 1<br />
for the volume down button<br />
ossvol -t<br />
for the mute/unmute button<br />
<br />
===== Xfce4-volumed =====<br />
<br />
[https://aur.archlinux.org/packages.php?ID=31693 xfce4-volumed] daemon from the [[AUR]] automatically maps volume keys of your keyboard to Xfce-mixer. Additionally you get OSD through Xfce4-notifyd when changing volume. Xfce4-volumed does not need any configuration and is started automatically with Xfce.<br />
<br />
{{accuracy|reason=There should be a short explanation of what this does and why it fixes the issue (bug?).}}<br />
<br />
If you use pulseaudio and xfce4-volumed unmute does not work, try this:<br />
<br />
$ xfconf-query -c xfce4-mixer -p /active-card -s `xfconf-query -c xfce4-mixer -p /sound-card`<br />
<br />
===== Volumeicon =====<br />
<br />
{{pkg|volumeicon}} is an alternative to xfce4-volumed in the community repo also handling keybindings and notifications through {{pkg|xfce4-notifyd}}.<br />
<br />
==== Adding startup/boot sound ====<br />
<br />
Arch does not have a built-in startup sound configuration tool, but there is a workaround by adding the following command to your Application Autostart settings:<br />
<br />
aplay /boot/startupsound.wav<br />
<br />
The file location and filename can be whatever you want, but naming it descriptively and putting it in /boot keeps things tidy.<br />
<br />
=== xdg-open integration (Preferred Applications) ===<br />
<br />
Most applications rely on [[xdg-open]] for opening a preferred application for a given file or URL.<br />
<br />
In order for xdg-open and xdg-settings to detect and integrate with the XFCE desktop environment correctly, you need to [[pacman|install]] the {{Pkg|xorg-xprop}} package.<br />
<br />
If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed.<br />
Installing the package and allowing ''xdg-open'' to detect that you are running XFCE makes it forward all calls to ''exo-open'' instead, which correctly uses all your preferred applications preferences.<br />
<br />
To make sure xdg-open integration is working correctly, ask ''xdg-settings'' for the default web browser and see what the result is:<br />
<br />
# xdg-settings get default-web-browser<br />
<br />
If it replies with:<br />
<br />
xdg-settings: unknown desktop environment<br />
<br />
it means that it has failed to detect XFCE as your desktop environment, which is likely due to a missing {{Pkg|xorg-xprop}} package.<br />
<br />
=== Screenshots ===<br />
<br />
==== Using print-screen key ====<br />
<br />
A simple way is to use a command-line screenshot utility:<br />
<br />
# pacman -S scrot<br />
<br />
Then go to:<br />
<br />
XFCE Menu --> Settings --> Keyboard >>> Application Shortcuts.<br />
<br />
Add the "scrot" command to use the "PrintScreen" key.<br />
<br />
All screenshots will be placed in your home folder with unique names (i.e. {{ic|2009-02-19-063052_1280x1024_scrot.png}}).<br />
<br />
====Screenshooter====<br />
<br />
There is also an a screenshot plugin for the Xfce panel, which can be used instead of scrot, that is available in extra:<br />
<br />
# pacman -S xfce4-screenshooter<br />
<br />
You can add a keyboard binding for it using the command<br />
<br />
xfce4-screenshooter -f<br />
<br />
instead of "scrot". You will get a dialog window after pressing "Print" where you can copy the image to the clipboard or save it.<br />
<br />
=== Change mount options ===<br />
<br />
A common problem when automounting USB sticks formatted with fat filesystem is the inability to properly show characters as umlauts, ñ, ß, etc. This may be solved changing the default iocharset to utf8, which is easily done adding a line to {{ic|/etc/xdg/xfce4/mount.rc}}:<br />
<br />
[vfat]<br />
uid=<auto><br />
shortname=winnt<br />
'''utf8=true'''<br />
# FreeBSD specific option<br />
longnames=true<br />
<br />
Note that when using utf-8, the system will distinct between upper- and lowercases, potentially corrupting your files. Be careful.<br />
<br />
It is also recommendable to mount vfat devices with the '''flush''' option, so that when copying to USB sticks data flushes more often, thus making thunar's progress bar to stays up until things are on the disk.<br />
<br />
[vfat]<br />
flush=true<br />
<br />
===Terminal tango color theme===<br />
Open with your favorite editor<br />
<br />
~/.config/Terminal/terminalrc<br />
<br />
And add(replace) this lines:<br />
<br />
ColorForeground=White<br />
ColorBackground=#323232323232<br />
ColorPalette1=#2e2e34343636<br />
ColorPalette2=#cccc00000000<br />
ColorPalette3=#4e4e9a9a0606<br />
ColorPalette4=#c4c4a0a00000<br />
ColorPalette5=#34346565a4a4<br />
ColorPalette6=#757550507b7b<br />
ColorPalette7=#060698989a9a<br />
ColorPalette8=#d3d3d7d7cfcf<br />
ColorPalette9=#555557575353<br />
ColorPalette10=#efef29292929<br />
ColorPalette11=#8a8ae2e23434<br />
ColorPalette12=#fcfce9e94f4f<br />
ColorPalette13=#72729f9fcfcf<br />
ColorPalette14=#adad7f7fa8a8<br />
ColorPalette15=#3434e2e2e2e2<br />
ColorPalette16=#eeeeeeeeecec<br />
<br />
=== Colour management ===<br />
xfce4-settings-manager does not yet have any colour management / calibration settings, nor is there any specific XFCE program to characterise your monitor.<br />
<br />
==== Loading a profile ====<br />
If you wish to '''load an icc profile''' (that you have previously created or downloaded) to calibrate your display on startup, you can download {{AUR|xcalib}} from [[AUR]], then open the XFCE4 Settings Manager, click Session and Startup icon, the Autostart tab, and add a new entry where the command is {{ic|/usr/bin/xcalib /path/to/your/profile.icc}}. You still need to tell your applications, which display profile should be used to have the displayed images colour managed.<br />
<br />
Another option is dispwin. Dispwin not only calibrates the display, but also sets the _ICC_PROFILE atom in X so that some applications can use a "system" display profile instead of requiring the user to set the display profile manually (GIMP, Inkscape, darktable, UFRaw, etc.).<br />
<br />
See [[ICC_Profiles#Loading_ICC_Profiles]] for more information.<br />
<br />
==== Creating a profile ====<br />
<br />
If you wish to '''create an icc profile''' for your display (ie. characterising/profiling, e.g. with the [[ColorHug]], or some other colorimeter, or a spectrophotometer, or "by eye"), the simplest option may be to install [https://aur.archlinux.org/packages.php?ID=25883 dispcalGUI] from [[AUR]]. <br />
<br />
Another option is {{ic|gnome-control-center}} (available in extra), which has a much simpler GUI, but less options and requires installing some Gnome dependencies. In order to start the calibration from the command line, first do {{ic|colormgr get-devices}} and look for the "Device ID" line of your monitor. If this is e.g. "xrandr-Lenovo Group Limited", you start calibration with the commabnd {{ic|gcm-calibrate --device "xrandr-Lenovo Group Limited"}}.<br />
{{Note|1=It seems like you need to run the full gnome-control-center because XFCE does not yet have a session component for colord: https://bugzilla.xfce.org/show_bug.cgi?id=8559}}<br />
<br />
See [[ICC Profiles]] for more information.<br />
<br />
=== XDG User Directories ===<br />
freedesktop.org specifies the "well known" user directories like the desktop folder and the music folder. The {{Pkg|xdg-user-dirs}} to manage them and it also handles localization (i.e. translation) of the filenames.<br />
# pacman -S xdg-user-dirs<br />
If you want to use the directories with your localized names, run the following command on your user:<br />
$ xdg-user-dirs-update<br />
If you want to revert to English, run the following:<br />
$ LC_ALL=C xdg-user-dirs-update<br />
It then creates localized (or English) versions of these directories in your home directory and sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config). The Xfce and other softwares complying the freedesktop.org knows that is where those types of files should go by default.<br />
<br />
In the case of the French:<br />
<br />
{{hc|~/.config/user-dirs.locale|<br />
fr_FR}}<br />
{{hc|~/.config/user-dirs.dirs|<nowiki><br />
XDG_DESKTOP_DIR="$HOME/Bureau"<br />
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"<br />
XDG_TEMPLATES_DIR="$HOME/Exemples"<br />
XDG_PUBLICSHARE_DIR="$HOME/Public"<br />
XDG_DOCUMENTS_DIR="$HOME/Documents"<br />
XDG_MUSIC_DIR="$HOME/Musiques"<br />
XDG_PICTURES_DIR="$HOME/Images"<br />
XDG_VIDEOS_DIR="$HOME/Vidéos"</nowiki>}}<br />
<br />
You can edit these files directly by using text editor.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Unable to open external windows partitions ===<br />
If you have external partitions like a fat32 drive connected via eSata, and launching them from the desktop results in a dialog telling you 'Authentication is required', you need to ensure polkit-gnome is installed and PolicyKit Authentication Agent is started by xfce4.<br />
pacman -S polkit-gnome<br />
Restart xfce4 and go:<br />
Applications Menu > Settings > Sessions and Startup<br />
Check that PolicyKit Authentication Agent is enabled under the Application Autostart tab.<br />
<br />
=== xfce4-power-manager is not working ===<br />
Check you have added dbus to the {{ic|DAEMONS}} array in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
=== Xfce4-xkb-plugin settings issue ===<br />
There is a bug in version ''0.5.4.1-1'' which causes xkb-plugin to ''lose keyboard, layout switching and compose key'' settings. As a workaround you may enable ''Use system defaults'' option in keyboard settings. To do so run<br />
xfce4-keyboard-settings<br />
Go to ''Layout'' tab and set the ''Use system defaults'' flag, then reconfigure xkb-plugin.<br />
<br />
=== Thunar does not display any thumbnail ===<br />
<br />
Thunar relies on '''Tumbler''' to generate thumbnails. You can install Tumbler by issuing<br />
<br />
pacman -S tumbler<br />
<br />
More details in [[Thunar#Thunar_Thumbnailers|Thunar's page]].<br />
<br />
=== Locales ignored with GDM ===<br />
Become superuser and add your locale to /var/lib/AccountsService/users/$USER:<br />
su -c "nano /var/lib/AccountsService/users/$USER"<br />
Replace hu_HU.UTF-8 with your own locale:<br />
[User]<br />
Language=hu_HU.UTF-8<br />
XSession=xfce<br />
You may also do it with sed. Note the backslash before .UTF-8:<br />
su -c "sed -i 's/Language=.*/Language=hu_HU\.UTF-8/' /var/lib/AccountsService/users/$USER"<br />
Restart GDM to take effect.<br />
<br />
=== Restore default settings ===<br />
If for any reason you need to revert back to the default settings, try renaming {{ic|~/.config/xfce4-session/}} and {{ic|~/.config/xfce4/}}<br />
<br />
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak<br />
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak<br />
<br />
Logout and login for changes to take effect.<br />
<br />
=== NVIDIA and xfce4-sensors-plugin ===<br />
To detect and use sensors of nvidia gpu you need to install {{AUR|libxnvctrl}} and then recompile {{Pkg|xfce4-sensors-plugin}} package.<br />
<br />
=== Session failure ===<br />
If the window manager does not load correctly (The mouse is a X and you cannot close windows) you maybe got an session error.<br />
To remove a corrupt session you can delete the session folder at the {{ic|.cache}} folder.<br />
# rm -r ~/.cache/sessions/<br />
The easy way to reload the session is to reboot the computer. You can also restart xfce.<br />
<br />
=== Clock/notification area no longer pushed to the right edge of the panel in Xfce 4.10 ===<br />
<br />
This is due to a change in the Window Buttons panel plugin which no longer expands to fill the available space.<br />
<br />
To emulate the old behavior, add a transparent separator between the window buttons and the clock/notification area, setting its expand property.<br />
<br />
=== Preferred Applications preferences have no effect ===<br />
<br />
If you have set your preferred applications with ''exo-preferred-applications'', but they do not seem to be taken into consideration, see [[Xfce#xdg-open_integration_.28Preferred_Applications.29]]<br />
<br />
==See also==<br />
* http://docs.xfce.org/ - The complete documentation.<br />
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.<br />
* [http://xfce.wikia.com/wiki/Frequently_Asked_Questions Xfce Wikia] - How to edit the auto generated menu with the menu editor<br />
* [http://wiki.xfce.org Xfce Wiki]</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224735ReadyMedia2012-09-23T14:10:37Z<p>Sambul13: /* Media Handling */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', check if your HD started spinning or try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224729ReadyMedia2012-09-23T14:00:50Z<p>Sambul13: /* Other aspects */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered beforehand to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224728ReadyMedia2012-09-23T13:59:27Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] without shell access as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered upfront to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224726ReadyMedia2012-09-23T13:50:50Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as ''nobody'' [https://wiki.archlinux.org/index.php/Users_and_Groups user] as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered upfront to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224722ReadyMedia2012-09-23T13:38:35Z<p>Sambul13: /* Global */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as '''nobody''' user as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Add ''minidlna'' to {{ic|rc.conf}} daemons list to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered upfront to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224149ReadyMedia2012-09-20T18:25:08Z<p>Sambul13: /* Media Handling */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as '''nobody''' user as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Be sure to add ''minidlna'' to {{ic|rc.conf}} to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered upfront to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media type (i.e. Movies), but won't other files in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224148ReadyMedia2012-09-20T18:22:30Z<p>Sambul13: /* Media Handling */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as '''nobody''' user as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Be sure to add ''minidlna'' to {{ic|rc.conf}} to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered upfront to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA is aimed for small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files after rescan. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media file type (i.e. Movies), but won't other files present in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224132ReadyMedia2012-09-20T14:22:57Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as '''nobody''' user as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Be sure to add ''minidlna'' to {{ic|rc.conf}} to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered upfront to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, VFAT (FAT32) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA targets small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media file type (i.e. Movies), but won't other files present in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13https://wiki.archlinux.org/index.php?title=ReadyMedia&diff=224131ReadyMedia2012-09-20T14:21:17Z<p>Sambul13: /* File System and Localization */</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[es:MiniDLNA]]<br />
[https://sourceforge.net/projects/minidlna MiniDLNA] is server software with the aim of being fully compliant with [http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance DLNA]/[http://en.wikipedia.org/wiki/Universal_Plug_and_Play UPnP] clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as totem and xbmc, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).<br />
<br />
MiniDLNA (ReadyDLNA) is a simple, lightweight alternative to [[MediaTomb]], but has fewer features. It does not have a web interface for administration and must be configured by editing a text file.<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|minidlna}} from the [[Official Repositories|official repositories]].<br />
<br />
== Configuration ==<br />
<br />
The MiniDLNA daemon can be run as either a global (config:{{ic|/etc/minidlna.conf}}) or per-user instance (config:user-defined), these are the necessary common settings:<br />
<br />
<pre>#network_interface=eth0 # Self-discovers if commented (at times necessary to set)<br />
media_dir=A,/home/user/Music # Mounted Media_Collection drive directories<br />
media_dir=P,/home/user/Pictures # Use A, P, and V to restrict media 'type' in directory<br />
media_dir=V,/home/user/Videos<br />
friendly_name=Media Server # Optional<br />
db_dir=/var/cache/minidlna # MiniDLNA Media_DB dir needs to be un-commented<br />
log_dir=/var/log # Log dir needs to be un-commented<br />
inotify=yes # 'no' for less resources, restart required for new media<br />
presentation_url=http://www.mylan/index.php # or use your device static IP http://192.168.0.14:8200/</pre><br />
<br />
=== Global ===<br />
<br />
MiniDLNA scans your ''Media_Collection'' at startup and creates or updates database ''Media_DB'' browsable via media players. Set database cache and logging dirs in config, so the db and album art cache won't be re-created on every restart. By default MiniDLNA runs as '''nobody''' user as set in ''/etc/conf.d/minidlna'', unless you set your own. That user needs rw permissions to cache and log directories you specified in conf. Create the required directories and {{ic|chown}} them to {{ic|nobody:nobody}}.<br />
<br />
# mkdir /var/{cache,log}/minidlna<br />
# chown nobody:nobody /var/{cache,log}/minidlna<br />
<br />
You can login as MiniDLNA user and create symbolic link in the default ''Media_DB'' directory to a mounted in the system external drive, just make sure to set MiniDLNA user ''rw'' permissions and other [http://linux.die.net/man/8/mount mount options] for the drive in [[fstab]] and/or [[udev]] automount rules if mounted after boot:<br />
<br />
# ln -s /media/MyDrive/Media_DB /var/cache/minidlna<br />
<br />
MiniDLNA includes an initscript to start it as a global [[Daemon|daemon]]. Be sure to add ''minidlna'' to {{ic|rc.conf}} to have it loaded at boot.<br />
<br />
=== Local ===<br />
<br />
Create the necessary files and directories locally and edit the configuration:<br />
<br />
# mkdir -p ~/.minidlna/cache<br />
# cd ~/.minidlna<br />
# cp /etc/minidlna.conf .<br />
# $EDITOR minidlna.conf<br />
<br />
Configure as you would globally above but these definitions need to be defined locally:<br />
<br />
db_dir=/home/$USER/.minidlna/cache<br />
log_dir=/home/$USER/.minidlna<br />
<br />
This is a local daemon script to start and stop MiniDLNA as a regular user:<br />
<br />
{{hc|minidlna-daemon|<pre>#!/bin/bash<br />
# Start and stop the MiniDLNA daemon<br />
<br />
cnf="/home/$USER/.minidlna/minidlna.conf"<br />
pid="/home/$USER/.minidlna/minidlna.pid"<br />
log="/home/$USER/.minidlna/minidlna.log"<br />
<br />
# Required program(s)<br />
req_progs=(minidlna)<br />
for p in ${req_progs[@]}; do<br />
hash "$p" 2>&- || \<br />
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }<br />
done<br />
<br />
dmn_strt () {<br />
minidlna -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
dmn_stop () {<br />
if [ "$(pgrep -x minidlna)" ]; then<br />
killall -9 minidlna && sleep 2 && \<br />
echo " Stopped MiniDLNA daemon"<br />
else<br />
echo " MiniDLNA is not running"<br />
fi<br />
}<br />
<br />
dmn_rscn () {<br />
minidlna -R -f "$cnf" -P "$pid" > $log 2>&1 &<br />
}<br />
<br />
help () {<br />
echo " ${0##*/} <start|stop|rescan> - start,stop,rescan the MiniDLNA daemon"<br />
}<br />
<br />
case $1 in<br />
start ) # Start daemon<br />
dmn_stop<br />
dmn_strt || { echo " Failure in starting daemon"; exit; }<br />
echo " Started MiniDLNA daemon" ;;<br />
stop ) # Stop daemon<br />
dmn_stop ;;<br />
rescan ) # Rescan for new files (new file detection only works when<br />
# minidlna is running)<br />
dmn_stop<br />
dmn_rscn ;;<br />
* ) # Display usage if no parameters given<br />
help<br />
esac</pre>}}<br />
<br />
==== Load daemon on Login ====<br />
<br />
A {{ic|.desktop}} file in {{ic|~/.config/autostart}} will do this:<br />
<br />
{{hc|~/.config/autostart/minidlna.desktop|<pre>[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=MiniDLNA<br />
Comment=Server to stream media over network<br />
Exec=/home/$USER/.scripts/minidlna-daemon start<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=true</pre>}}<br />
<br />
Make the file executable:<br />
<br />
# chmod +x ~/.config/autostart/minidlna.desktop<br />
<br />
==== Automatic Media_DB Update ====<br />
<br />
Kernel adds one [http://en.wikipedia.org/wiki/Inotify inotify] watch per each folder/subfolder in ''Media_Collection'' Directories set in {{ic|/etc/minidlna.conf}} to monitor changes thus allowing MiniDLNA to update ''Media_DB'' in real time. When MiniDLNA is run as a regular user, it does not have the ability to change the kernel's ''inotify'' limits. If default number of ''inotify'' watches is non-sufficient to have MiniDLNA monitor all your media folders, increase ''inotify'' watches through {{ic|sysctl}} (100000 should be enough for most uses):<br />
<br />
# sudo sysctl fs.inotify.max_user_watches=100000<br />
<br />
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}<br />
<br />
# Increase inotify max watchs per user for local minidlna<br />
fs.inotify.max_user_watches = 100000"<br />
<br />
''inotify'' performance may depend on device type. Some don't rescan media drives on a consistent basis or at all. If files are added/deleted to monitored media directories, they may not be noticed until the device DLNA client is restarted.<br />
<br />
Check ''inotify'' updates via MiniDLNA ''presentation_url'' by comparing files count. If it doesn't change, make sure the user running MiniDLNA has ''rw'' access to the DB folder. If the issue persists, copy or download new files first to a non-watched by ''inotify'' '''Downloads''' folder on the same drive, and then move them to appropriate media folders, since lengthy media files copying or downloading may confuse ''inotify''.<br />
<br />
You can also clean or rebuild MiniDLNA DB manually after stopping MiniDLNA daemon, or analyze its debug output (Ctrl+C to exit):<br />
<br />
/etc/rc.d/minidlna stop<br />
minidlna clean<br />
minidlna -R<br />
minidlna -d<br />
<br />
== Other aspects ==<br />
<br />
Other aspects and MiniDLNA limitations may need to be considered upfront to ensure satisfaction from its performance.<br />
<br />
=== Firewall ===<br />
<br />
If using a firewall the the ssdp (1900/udp) and trivnet1 (8200/tcp) ports will need to be opened. For example, this can be done with arno's iptables firewall by editing {{ic|firewall.conf}} and opening the ports by doing:<br />
<br />
OPEN_TCP="8200"<br />
OPEN_UDP="1900"<br />
<br />
=== File System and Localization ===<br />
<br />
When keeping MiniDLNA ''Media_DB'' on an external drive accessible in both Linux and Windows, choose proper [https://wiki.archlinux.org/index.php/File_Systems file system] for it. '''NTFS''' preserves in Windows its Linux defaults: ''rw'' access for ''root'' user and ''UTF8'' font ''encoding'' for file names, so media titles in your language are readable when browsing ''Media_DB'' in media players, since most support ''UTF8''. If you prefer '''Vfat''' (FAT32) for better USB drive compatibility with older players when hooked directly, or your ''Media_Collection'' drive is Vfat and has folder & file names in your local language, MiniDLNA can transcode them to ''UTF8'' charset while scanning folders to ''Media_DB''. Add your [http://en.wikipedia.org/wiki/Code_page codepage] and font ''encoding'' or ''transcoding'' [http://en.wikipedia.org/wiki/Character_encoding charset] to ''Media_Collection'' and ''Media_DB'' drives' mount options, i.g. ''codepage=cp866,iocharset=utf8'', and ''rw'' permissions for all users, since ''Vfat'' doesn't preserve Linux access permissions:<br />
<br />
{{bc|1=UUID=6140-75F7 /media/MyDrive/Media_DB vfat user,rw,async,noatime,umask=111,dmask=000,cp866,utf8=true 0 0}}<br />
<br />
Make sure the required ''codepage'' for your [[locale]] is available in the system and enabled (like ru_RU.CP866), i.e. was included in system config when ArchLinux release was compiled, or consider recompiling the release to add it: <br />
<br />
ls /usr/share/fonts/encodings<br />
<br />
MiniDLNA lists ''Movies'' and ''Photos'' by file name in its DB, and ''Music'' entries by [http://id3lib.sourceforge.net/id3/ ID3 tags] instead of file names. If Music collection wasn't tagged in UTF8 but in local encoding, MiniDLNA might not identify and transcode it correctly to UTF8 for display in media players, or the original tags ''codepage(s)'' may be absent in your system, so the tags won't be readable even when media file names are. In this case consider re-tagging your collection to ''UTF-16BE'' or ''UTF-8'' encoding with an ID3 Tag Converter.<br />
<br />
Picking the "right" ''file system'' for your ''Media_Collection'' is a trade-off: XFS and EXT4 show fast read/write for HDs and lower CPU load critical for small [http://archlinuxarm.org/platforms/armv5/pogoplug-series-4 Plug Computers] with attached storage, while NTFS is most compatible with Windows. As file fragmentation affects playback, store your Movies on a non-system drive formatted in XFS (prevents fragments), NTFS (fragment resistant and easy to defrag), or EXT4 (uses large file ''extents''), and [https://trac.transmissionbt.com/ticket/849 avoid] EXT3 or [http://en.wikipedia.org/wiki/File_Allocation_Table#Fragmentation less] resistant FAT32. For smaller Flash drives with seldom fragmented Music and Photo files, FAT32 (VFAT) and EXT4 show faster writes with less CPU load, but EXT4 affects memory wear due to journaling, and less compatible with media players. Proper block [http://lwn.net/Articles/428584/ alignment] and ''mount options'' (i.e. ''async,noatime''...) can greatly [http://linux-howto-guide.blogspot.ca/2009/10/increase-usb-flash-drive-write-speed.html accelerate] flash speed.<br />
<br />
=== Media Handling ===<br />
<br />
MiniDLNA targets small devices, so doesn't generate movie thumbnails to lower CPU load and DB built time. It uses either thumbs in the same folder with movie if any, or extracts them where present from media containers like MP4 or MKV with embedded Album Art tags, but not AVI. One can add thumbs (JPG 160x160 pxl or less) to media folders with a Thumbnail Maker, and miniDLNA will link them to media files. Larger thumbs will be resized and stored in ''Media_DB'' that slows scan. At one movie per folder, follow thumb naming rules in ''minidlna.conf''. For multiple show episodes per folder, each thumb name should match its episode name without ext. (''<file>.cover.jpg'' or ''<file>.jpg''). To handle ''MS Album Art'' thumb names with GUID, add * to the end ''"AlbumArt_{*".jpg'' . MiniDLNA will list on screen only chosen media file type (i.e. Movies), but won't other files present in the same folder.<br />
<br />
When viewing photos, progressive and/or lossless compression JPG may not be supported by your player via DLNA. Also resize photos to "suggested photo size" by the player's docs for problem free image slideshow. DLNA spec restricts image type to JPG or PNG, and max size to 4096 x 4096 pixels - and that's if the DLNA server implementation supports the LARGE format. The next size limit down (MEDIUM) is 1024 x 768, so resizing may help to show photos correctly.<br />
<br />
To decrease system load, MiniDLNA doesn't transcode on the fly unsupported media files into supported by your player formats. When building ''Media_DB'', it might not correctly identify whether certain formats are supported by your player, which may play via UPnP a broader formats choice. DLNA standard is quite limiting UPnP subset in media containers and codec ''profiles'' allowed. If you don't see on TV screen or can't play some media files listed in ''Media_DB'', try connecting to your media player via USB for their playback. MiniDLNA might not support choosing audio tracks, subtitles, disk chapters, list sorting, and other advanced playback features for your player model.</div>Sambul13