Running minidlna on Ubuntu

I have a dumb TV. It’s still quite nice, just no streaming anything to it. I am in the process of picking a device to do the streaming and want to have a folder on my Ubuntu PC that holds the media.

I installed a service called minidlna which is supposed to allow streaming of media. However, it didn’t like the permissions on my chosen folder.
The path is /media/jw/DRIVE2/general.

I had a few problems setting it up:


jw@FooPC:~$ sudo service minidlna restart
* Restarting DLNA/UPnP-AV media server minidlna
[2014/07/23 21:03:30] minidlna.c:594: error: Media directory "/media/jw/drive2/general" not accessible [Permission denied]

I first pointed it to a folder in my home folder and it liked that just fine, but not the 2nd drive that holds the media.

So I tried setting the user as me in the conf file and in the default file. But eventually I had to set the user as “root” to make it work.

HOW TO SET IT UP
The service is controlled by 2 files:
/etc/default/minidlna (sets WHO the service runs as)
/etc/minidlna.conf (sets WHICH FOLDERS to use AND who is using the service)

Here is how to set up the folder locations in the minidlna.conf file
(I didn’t find the A,P,V part very useful, but show an example of how it is used.)

# Specify the user name or uid to run as.
user=root
.
.
# If you want to restrict a media_dir to a specific content type, you can
# prepend the directory name with a letter representing the type (A, P or V),
# followed by a comma, as so:
# * "A" for audio (eg. media_dir=A,/var/lib/minidlna/music)
# * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
# * "V" for video (eg. media_dir=V,/var/lib/minidlna/videos)
media_dir=/media/jw/DRIVE2/general
media_dir=V,/media/jw/DRIVE3/MOVIES
media_dir=/media/jw/DRIVE3/Tonys
media_dir=/media/jw/DRIVE3/TOONS

Now we set up the minidlna file:


sudo gedit /etc/default/minidlna

# User and group the daemon should run as
USER="root"
#GROUP="minidlna"

I restarted the service and this time there was no error about permissions.


sudo service minidlna restart

I’m probably going to get a WD TV Live box and see if that can see the media share. I’ll update as I go.

UPDATE:
I did get the WD TV Live box and love it. I’m able to stream movies and pics from my computer to the big screen, and it comes with apps like Netflix.

Update 2019:
Got the newer Roku Ultra for ease of use, and future-proofing with 4K.

Slow USB in Ubuntu

I have been plagued with USB file transfer slowness in Ubuntu since version 10-something. It would manifest as a long delay between short bursts of file transfer.

After reading several forum postings, I never really saw a solution that worked. One suggested adding “pci=acpi” in a startup file, but that didn’t seem to do anything for me. Another suggested that the graphic card and the USB were having a bus conflict of some kind. Then I thought, perhaps the common issue here really is the computer rather than the OS.

Solution: I changed BIOS to disable “legacy” support for USB. Tonight I transferred from two different USB devices and each went through with no delays. The speed wasn’t phenomenal, but the stop-start thing didn’t manifest at all. I’ll still have to try some very large files, but some 100MB files went through fine.

UPDATE: Just transferred some 2GB files from a video camera and there were no pauses at all, and about 9.5MB/sec. I think the BIOS setting is really the root of this issue, though it may have a software component to it.

Shrink PDF file size in Linux

The problem:
I scanned a single document using Simple Scan, and it came out as a PNG (it defaults to JPG, but I changed to PNG to avoid pixelization).
I then converted at the command-line to PDF format (convert file.png file.pdf).

The resulting file was over 13MB, still too much for many email systems.

[Yes, I figured out since then that I could save it directly from Simple Scan to PDF simply by changing the extension. I still got a smaller file with the following method, which is also useful for PDFs that someone may give me.]

Someone suggested the following commands to shrink the file (from a terminal window):
pdf2ps file.pdf foo.ps
ps2pdf foo.ps file2.pdf

This worked really well, and reduced the PDF file size by more than 10x!

First taste of Linux Mint

Years ago I had tried to reinstall XP on my laptop, but it rejected the key that came with it. I could have called MS, but was torqued that they would force me to call in just to get their OS to work as it should have. Instead, I downloaded and installed the free Kubuntu (the KDE flavor of Ubuntu Linux). It worked like a charm and was working well in short order. It worked well for more than five years.

Last night, after reading quite a bit about Linux Mint, I figured it was time for an upgrade. I downloaded the DVD ISO and did the install. Or rather, I attempted to do the install. This was the first red flag. After 15 minutes or so, an error popped up “So sorry, but the installer crashed. You can submit a bug to…” I powered it off and tried again. This time it seemed to be working fine for about 20-25 minutes (it’s an older laptop). But right towards the end, it gave a different error about not being able to install the boot loader.

Seriously? After I just had it erase and recreate partitions, it wasn’t able to install a boot loader by itself? And the options it gave were:
1. Try again or try another partition (both of which failed again)
2. Continue without a boot loader (and not be able to boot up, thus rendering the last install useless.
3. Quit.
I even tried going into terminal and telling grub to install to /dev/sda but got yet another error.

So here I am looking at a blank screen after rebooting the laptop. I’m sure there are a dozen forums where I can scrape and scrounge for information about how to get Grub working, but why should I need to go that route? (I even did that for a while, being an incurable geek.) Making your OS boot is one of the most basic needed things of the entire install. If they can’t get that right, why should I bother with the rest? This would certainly leave a new user completely stymied, so if they want Mint to be popular, they need to work out the bugs. Maybe I’ll try Debian Linux.