Author Topic: Installing the MiniDLNA media streaming server in Ubuntu  (Read 54360 times)

0 Members and 1 Guest are viewing this topic.

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Installing the MiniDLNA media streaming server in Ubuntu
« on: December 20, 2011, 01:03:56 am »
This tutorial is now outdated - Thanks to input from Mad Penguin, there is now a better way of installing/configuring the MiniDLNA media streaming server.

Those starting the tutorial from scratch, please use the new tutorial here:
http://linuxforums.org.uk/index.php?topic=9822.msg70397#msg70397

Those that have already completed the tutorial in this posting .. see here:
http://linuxforums.org.uk/index.php?topic=9822.msg70396#msg70396



If you are running Ubuntu 11.10, you can skip the section about adding the PPA .. 11.10 has minidlna in the default repositories, earlier versions of Ubuntu don't.



If your Ubuntu box doesn't have a static IP address .. give it one now .. and remember it, you'll need it later.

Theoretically this should work without a static IP, but if you decide NOT to give your Ubuntu box a static IP .. when you get to the section about editing the /etc/minidlna.conf file, comment out this line -

presentation_url=http://172.16.0.2:48200/
so it reads
#presentation_url=http://172.16.0.2:48200/



Adding the PPA repository

For Ubuntu 11.04 (Natty), open a terminal and enter:
Code: [Select]
sudo add-apt-repository ppa:nathan-renniewaldock/ppa

Quote
Ubuntu 9.10 (Karmic), 10.04 (Lucid), and 10.10 (Maverick) users can use this PPA:
Code: [Select]
sudo add-apt-repository ppa:stedy6/stedy-minidna

And the rest of the instructions *should* be the same, but I haven't tested them with anything other than Natty and Oneiric


Now update the package list with:
Code: [Select]
sudo apt-get update



This section is for ALL Ubuntu versions (9.10 --> 11.10)  ..

Install the minidlna package with:
Code: [Select]
sudo apt-get install minidlna gstreamer0.10-ffmpeg



This section is for 11.04 (Natty) users ..

We're now going to disable the PPA as it contains a lot of other packages which may cause issues at your next system update.

Open a terminal and enter:
Code: [Select]
sudo software-properties-gtk

When the "Software Sources" window opens .. select the Other Software tab, and UNtick the lines -

http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu natty main
and
http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu natty main (Source Code)

Click the "Close" button.

Back in the terminal run:
Code: [Select]
sudo apt-get update

(9.10 --> 10.10 users don't *need* to disable the PPA, as it only contains minidlna .. but you can if you wish)



This section is for ALL Ubuntu versions

Configuring the MiniDLNA Server

Open the /etc/minidlna.conf file for editing:
Code: [Select]
sudo gedit /etc/minidlna.conf

At this point it would probably be easiest to show you MY /etc/minidlna.conf file contents.

It will share your -

Music
Pictures
Videos


directories.

(click to show/hide)

You may need to change the eth0 to YOUR network interface.

You will need to change the mark entries to YOUR username.

You will need to change the 172.16.0.2 IP address to the static IP of your Ubuntu box.
(or comment this line out altogether if your Ubuntu box is getting its IP via DHCP)

SAVE the file and exit gedit.



Test the MiniDLNA server

Reboot, and see if there is a device listed on your Xbox or Network TV called Ubuntu MiniDLNA Server

if there is .. you're done

if there isn't .. and there wasn't on either of mine (Natty and Oneiric) .. read on



This section is for 11.10 Oneiric ONLY (with minidlna installed from the default repos)

Open a terminal, and run:
Code: [Select]
sudo killall minidlna
then
Code: [Select]
minidlna
then
Code: [Select]
minidlna -R

Now check the Xbox, or Network TV (you may have to restart the Xbox or TV)

If there is a device listed called Ubuntu MiniDLNA Server ..

Back in the terminal enter:
Code: [Select]
sudo update-rc.d -f minidlna remove

Now create an entry in Startup Applications with these settings -

Name: MiniDLNA Server
Command: minidlna
Comment: Media Streaming Server

SAVE it .. make sure it's ticked .. REBOOT .. done.



This section is for ALL OTHER versions of Ubuntu (9.10 --> 11.04) with minidlna installed from a PPA

Open a terminal, and run:
Code: [Select]
sudo killall minidlna
then
Code: [Select]
sudo chmod 777 /var/cache/minidlna/files.db
then
Code: [Select]
minidlna
then
Code: [Select]
minidlna -R

Now check the Xbox, or Network TV (you may have to restart the Xbox or TV)

If there is a device listed called Ubuntu MiniDLNA Server ..

Back in the terminal enter:
Code: [Select]
sudo update-rc.d -f minidlna remove

Now create an entry in Startup Applications with these settings -

Name: MiniDLNA Server
Command: minidlna
Comment: Media Streaming Server

SAVE it .. make sure it's ticked .. REBOOT .. done.
« Last Edit: December 21, 2011, 12:17:44 am by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline galaxytdm

  • Ubuntu 11.04
  • Sr. Member
  • ****
  • Posts: 330
  • Karma: 7
  • Gender: Male
  • Something Something dark side
    • View Profile
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #1 on: December 20, 2011, 03:13:21 am »
Excellent tutorial there Mark, haven't tried the xbox yet but it's working well with my Samsung LC580D TV
If you need help ask a professional, then act upon their advice.
Anything less and you're just wasting peoples time.

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #2 on: December 20, 2011, 03:18:22 am »
Glad to hear it worked for you .. it took me a while to work out how to get the damn thing to autostart, bit of a hack really, but it works :)

Works perfectly on my Xbox 360's  ;D

If I manage to work out why the init.d script is failing (requiring the startup hack) I'll post more info.
(seems to be a permission issue .. I'm guessing it's really designed for servers or NAS boxes, etc. where you'd set up a user called minidlna, and share all the media from that account)

BTW, thanks for quoting your TV make/model .. it will may help others searching the interweb :)
« Last Edit: December 20, 2011, 03:51:07 am by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1419
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #3 on: December 20, 2011, 03:43:48 pm »
Ok, I've just set this up on my new Samsung HT-D5550 .. works but there are some things to tweak. I had to change the owner and group in /etc/default/minidlna to be "me" so it could read my files .. then I had to set the db_dir=/var/cache/minidlna and chown it to "me".

On registering the box with "DivX" it seems to play previously ripped .avi files no problem, and plays "some" mp3's depending on the format .. won't play .ogg's tho' which is a pain as my main collection is mostly .ogg.

Code: [Select]
pacpl --delete -t MP3 *.ogg
For example doesn't produce playable MP3's on either Samsung or XBox 306.
If you follow it however with;
Code: [Select]
lame -t MP3 <file>.mpg <file>-1.mp3
That does yield a playable file.

.. Still working on it ..  :o

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #4 on: December 20, 2011, 03:51:59 pm »
@ Mad Penguin

Which version of Ubuntu you running it on ?

Did the edit to /etc/default/minidlna mean that it starts with it's own scripts now ?

For .ogg have you got all the dependencies installed .. when I tried building from source, they were listed as -

zlib
libexif
libjpeg
libid3tag
libogg
libFLAC
libvorbis
ffmpeg
libuuid
SQLite3

Haven't tried an .ogg yet though.



Further info that *might* help ? .. when I tried building minidlna from source (on 11.10) it was refusing to build, telling me things like libogg were missing, even though they were clearly installed (libogg0).

apt-cache search told me that libogg was also in the libogg-dev package

So I installed libogg-dev it recognized it as installed and built.

there were actually quite a few from the above list that it said were missing (even though they were installed), so I had to install the -dev packages as well.

It MAY be a good idea to download the source and attempt make and see what it says is missing ??
http://sourceforge.net/projects/minidlna/
there's also a webmin module:
http://sourceforge.net/projects/minidlnawebmin/
« Last Edit: December 20, 2011, 04:19:07 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1419
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #5 on: December 20, 2011, 04:18:41 pm »
apt-get build-dep minidlna

 :)

Offline Mad Penguin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1419
  • Karma: 10018
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #6 on: December 20, 2011, 04:20:10 pm »
I believe the issue is that neither Samsung nor XBox support the Open Source .ogg format .. but if someone can prove me wrong it'll save me a lot of time re-ripping CD's ...  :)

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #7 on: December 20, 2011, 04:25:56 pm »
Code: [Select]
apt-get build-dep minidlna
Heh .. OK, quicker way :)

I *think* I read somewhere that rygel can transcode .ogg on the fly .. could that be of use ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Tramlink

  • Hero Member
  • *****
  • Posts: 875
  • Karma: 12
  • Gender: Male
  • Is the mist clearing
    • View Profile
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #8 on: December 20, 2011, 04:58:25 pm »
OK set up TV Phillips 6000 series OK TV can see computer office2:userone.  I can not access the folder music, video or pictures these folders are not seen by the TV.  The only folders seen by the TV are Bit Defender  and libreoffice.

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #9 on: December 20, 2011, 05:42:55 pm »
Gimme a bit .. thanks to input from Mad Penguin, there's a better way of getting it running.

I'm about to type them up :)
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Tramlink

  • Hero Member
  • *****
  • Posts: 875
  • Karma: 12
  • Gender: Male
  • Is the mist clearing
    • View Profile
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #10 on: December 20, 2011, 05:48:10 pm »
OK will call back later........

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #11 on: December 20, 2011, 06:40:31 pm »
This posting is ONLY for users that followed the instructions at the top of this topic. .. it will put the MiniDLNA installation back to the way it was *meant* to be installed, and fix the permission issue that prompted the startup hack in the original tutorial.



You have 2 options ..

Option 1 - is to COMPLETELY uninstall minidlna with:
Code: [Select]
sudo killall minidlna
then:
Code: [Select]
sudo atp-get remove --purge minidlna

Then delete the MiniDLNA Server entry you created in Startup Applications

Then to start again from scratch with the new tutorial in the next posting:
http://linuxforums.org.uk/index.php?topic=9822.msg70397#msg70397



Option 2 - is to follow these instructions to "fix" the current installation ..

1) Delete the MiniDLNA Server entry you created in Startup Applications

2) Stop minidlna with:
Code: [Select]
sudo killall minidlna

3) Add the rd.d startup scripts (that we removed) back:
Code: [Select]
sudo update-rc.d minidlna defaults

4) Open /etc/default/minidlna for editing:
Code: [Select]
sudo gedit /etc/default/minidlna

and make it read:-

(click to show/hide)

obviously you need to change the -
USER="mark"
GROUP="mark"
lines yo YOUR username.

SAVE the file and exit gedit.

5) Open /etc/minidlna.conf for editing:
Code: [Select]
sudo gedit /etc/minidlna.conf

and make it read -

(click to show/hide)

You may have to change the:-
network_interface=eth0
to YOUR network interface.

You will have to change the:-
media_dir=A,/home/mark/Music
media_dir=P,/home/mark/Pictures
media_dir=V,/home/mark/Videos
to YOUR username

You will want to change the:-
presentation_url=http://172.16.0.2:48200/
to YOUR Ununtu box's IP address
(or if Ubuntu is getting its IP via DHCP, comment out this line by putting an # at the beginning of the line)

SAVE the file, and exit gedit.

6) Create a directory (if it doesn't already exist) at /var/cache/minidlna
Code: [Select]
sudo mkdir -v /var/cache/minidlna
(if you're running anything other than 11.10 this command *may* fail with an "already exists" warning, but that's OK, just carry on).

7) Stop the minidlna service:
Code: [Select]
sudo service minidlna stop

8.) Recreate the database (where it *should* be:
Code: [Select]
minidlna -R
give this a while to complete.

9) Recursively change owner:group of the /var/cache/minidlna directory, and its contents:
Code: [Select]
sudo chown -R mark:mark /var/cache/minidlna
in the above command you'll need to change BOTH instances of mark to YOUR username.

10) REBOOT.

when your system comes back up, check the Ubuntu MiniDLNA Server is listed and that the shared files are "seen" on your Xbox and/or Network TV.
« Last Edit: May 30, 2012, 03:09:47 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #12 on: December 21, 2011, 12:09:25 am »
Below is a modified version of the instructions at the top of this topic .. it sets up the MiniDLNA media server the way it was meant to be set up, rather than using the startup hack that was in the original instructions.



If you are running Ubuntu 11.10, you can skip the section about adding the PPA .. 11.10 has minidlna in the default repositories, earlier versions of Ubuntu don't.



If your Ubuntu box doesn't have a static IP address .. give it one now .. and remember it, you'll need it later.

Theoretically this should work without a static IP, but if you decide NOT to give your Ubuntu box a static IP .. when you get to the section about editing the /etc/minidlna.conf file, comment out this line -

presentation_url=http://172.16.0.2:48200/
so it reads:-
#presentation_url=http://172.16.0.2:48200/



Adding the PPA repository

For Ubuntu 11.04 (Natty), open a terminal and enter:
Code: [Select]
sudo add-apt-repository ppa:nathan-renniewaldock/ppa

Quote
Ubuntu 9.10 (Karmic), 10.04 (Lucid), and 10.10 (Maverick) users can use this PPA:
Code: [Select]
sudo add-apt-repository ppa:stedy6/stedy-minidna


Now update the package list with:
Code: [Select]
sudo apt-get update



This section is for ALL Ubuntu versions (9.10 --> 11.10)  ..

Install the minidlna package with:
Code: [Select]
sudo apt-get install minidlna gstreamer0.10-ffmpeg

and make sure all the dependencies are installed with:
Code: [Select]
sudo apt-get build-dep minidlna



This section is for 11.04 (Natty) users ..

We're now going to disable the PPA as it contains a lot of other packages which may cause issues at your next system update.

Open a terminal and enter:
Code: [Select]
sudo software-properties-gtk

When the "Software Sources" window opens .. select the Other Software tab, and UNtick the lines -

http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu natty main
and
http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu natty main (Source Code)

Click the "Close" button, and close Synaptic.

Back in the terminal run:
Code: [Select]
sudo apt-get update

(9.10 --> 10.10 users don't *need* to disable the PPA, as it only contains minidlna .. but you can if you wish)



This section is for ALL Ubuntu versions (9.10 --> 11.10)  ..

Configuring the MiniDLNA Server

Open the /etc/minidlna.conf file for editing:
Code: [Select]
sudo gedit /etc/minidlna.conf

At this point it would probably be easiest to show you MY /etc/minidlna.conf file contents.

It will share your -

Music
Pictures
Videos


directories.

(click to show/hide)

You may have to change the:-
network_interface=eth0
to YOUR network interface.

You will have to change the:-
media_dir=A,/home/mark/Music
media_dir=P,/home/mark/Pictures
media_dir=V,/home/mark/Videos
to YOUR username

You will want to change the:-
presentation_url=http://172.16.0.2:48200/
to YOUR Ununtu box's IP address
(or if Ubuntu is getting its IP via DHCP, comment out this line by putting an # at the beginning of the line)

SAVE the file, and exit gedit.

Open /etc/default/minidlna for editing:
Code: [Select]
sudo gedit /etc/default/minidlna

and make it read:-

(click to show/hide)

obviously you need to change the -
USER="mark"
GROUP="mark"
lines to YOUR username.

SAVE the file and exit gedit.

Create a directory (if it doesn't already exist) at /var/cache/minidlna
Code: [Select]
sudo mkdir -v /var/cache/minidlna
(if you're running anything other than 11.10 this command *may* fail with an "already exists" warning, but that's OK, just carry on).

Stop the minidlna service (if it's running):
Code: [Select]
sudo service minidlna stop
(this command may fail if the minidlna service is not running, but that's OK, just carry on).

Recreate the database (where it's *supposed* to be):
Code: [Select]
minidlna -R
give this a short while to complete.

Recursively change owner:group of the /var/cache/minidlna directory, and its contents:
Code: [Select]
sudo chown -R mark:mark /var/cache/minidlna
in the above command you'll need to change BOTH instances of mark to YOUR username.

Now REBOOT and go test the Xbox, or Network TV (you may have to restart the Xbox or TV) .. there should be a device listed as Ubuntu MiniDLNA Server, and you should be able to access any supported media files you put in the:-

~/Music
~/Pictures
~/Videos

directories on the Ubuntu box.
« Last Edit: March 24, 2012, 08:47:12 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline Tramlink

  • Hero Member
  • *****
  • Posts: 875
  • Karma: 12
  • Gender: Male
  • Is the mist clearing
    • View Profile
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #13 on: December 21, 2011, 07:45:17 pm »
working fine on my Philips 6000 series TV.

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17275
  • Karma: 436
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Installing the MiniDLNA media streaming server in Ubuntu
« Reply #14 on: December 21, 2011, 09:02:35 pm »
Thanks for that .. it's bound to help someone "Googling" for a similar solution :)
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal