Martin Cooper's Linux Blog

All things Linux …

Category Archives: Ubuntu

Brother Drivers for a DCP 7055 on Xubuntu

Adding the Propitiatory Brother Drivers for a DCP 7055

Tested on Xubunto 11.04, this printer is a combined Printer/copier and scanner and the drivers cannot be found in the Ubuntu repos not at least in the 10.04 version of Xubuntu.

So we tried the brother Driver installer found here

http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/faq_prn.html#f00091

which seemed to work at first but did not install the correct driver for this Printer and it therefore failed to print. We then decided to start from scratch form here

http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html

and started with the Before the Installation link and in a Terminal running the following commands;

$ sudo apt-get install -y cups
[just in case it’s not installed]

$ sudo aa-complain cupsd

$ sudo mkdir /usr/share/cups/model
[don’t change this line it should say model at the end]

$ sudo ln -s /etc/init.d/cups /etc/init.d/lpd

$ sudo mkdir /var/spool/lpd

## if your using 64 bit ##
# $ sudo apt-get install -y ia32-libs

$ sudo apt-get install -y csh

$ sudo apt-get install -y sane-utils

$ sudo apt-get install -y psutils

The under Download on the above page we selected Printer Driver then the link for the name of the printer and downloaded the LPR driver and the cupswrapper driver. You need to select each in turn then right click the “I Accept” button and use “Save Link As” option to download the DEB. Both DEB’s are i386 so if you are using 64 bit you need to install them using a Terminal using the following;

$ sudo dpkg -i --force-all /home/user/Downloads/dcp7055lpr-2.1.0-1.i386.deb

and

$ sudo dpkg -i --force-all /home/user/Downloads/cupswrapperDCP7055-2.0.4-2.i386.deb

check the naming of the files as they may be change and also adjust the path to the directory your files are stored in.

If you are using a 32 bit system just double click on the files to install them.

Once the drivers are installed are installed you can use your Printing config option to add the printer, if the driver does not show in the list, try a reboot.

Next the scanning drivers.
Back at the above page under Download we now select Scanner Driver / Scan-Key-Tool link and search for the print model, in our case this leads us to the brscan4 driver and here you can download both 32 and 64 bit drivers and you need the brscan4 and scan-key-tool DEB’s which once downloaded can be installed by double clicking on them.

Notes:
You may find that the Package Manager complains that the DEB’s are faulty but it seems to be just because the package maintainer has not included his or her email address in the package. I just continued on and they installed ok.

Update for Ubuntu 12.04

You need to copy 3 files into the /usr/lib/sane directory as follows.
$ sudo cp /usr/lib64/sane/libsane-brother4.so.1 /usr/lib/sane

$ sudo cp /usr/lib64/sane/libsane-brother4.so /usr/lib/sane

$ sudo cp /usr/lib64/sane/libsane-brother4.so.1.0.7 /usr/lib/sane
You will also probably find that your scanner software will still not open the scanner hardware. I installed the xsane software;

$ sudo apt-get install -y xsane

then ran it as user from a Terminal;

$ xsane
with no result, so then I ran it as root with;

$ sudo xsane
and all was well.

I’m not sure why this should be the case but it seems to be a /dev access problem, my quick and dirty option was to open the launder [the XFCE launder] command is;

Exec=xsane
and changed it to
Exec gksudo xsane
When the launcher is clicked it then asks the user for the root/sudo password.

Another option is to run the program as root without the system asking for a password [be warned you do this at your own risk as it’s a security risk]

open the /etc/sudoers file with;

$ sudo visudo

add this line below these lines

# User privilege specification
root ALL=(ALL) ALL

username ALL=NOPASSWD: /usr/bin/xsane

then amend the launcher from;

exec=xsane

to

exec=sudo xsane

you need to substitute username for your own system name and the path and name of the program if different and you may need to reboot

tsMuxeR video conversion for Sony Bravia

Convert a video file to the .m2ts format to stream to the Sony Bravia Tv from a miniDNLA server using Handbrake and tsMuxeR. This gives you a much smaller file than the .mpg file which is the other option. If you wish to use .mpg then the only way I have managed to get this working is to use ffmpeg from the command line using.

$ ffmpeg -i input.m4v -target pal-dvd output.mpg

This will use various input file extensions just amend the input file.

tsMuxer is a Transport Stream muxer which will convert .mkv video formatted files created in Handbrake to .m2ts files suitable for playback on the Sony Bravia. First convert your video to a .mkv video file using Handbrake making sure you select the Audio codec as AC3 (ffmpeg) in the [Audio] Tab and the [Framerate:] as 25 (PAL Film/Video) or any other option you prefer except the (Same as source) option. Handbrake is available in both Debian and Ubuntu repositories, stMuxeR is available by download from here: http://www.videohelp.com/tools/tsMuxeR Download the Linux version [currently tsMuxeR_1.10.6.tar.gz] into your home directory. Then create a directory in /usr/lib by opening a Terminal and entering the following;

$ sudo mkdir /usr/lib/tsmuxer

move into the tsmuxer directory with;

$ cd /usr/lib/tsmuxer

now extract the archive you downloaded with;

$ sudo tar -xvzf ~/tsMuxeR_1.10.6.tar.gz

if you list the contents with

$ ls
you will have 4 files in the tsmuxer directory including

tsMuxeR
tsMuxerGUI

make sure they are both executable with;

$ sudo chmod +x tsMuxeR

and;

$ sudo chmod +x tsMuxerGUI

now add a shortcut to /usr/bin with;

$ sudo ln -s /usr/lib/tsmuxer/tsMuxerGUI /usr/bin/tsMuxerGUI

now you can run the program by typing tsMuxerGUI in a Terminal or create a menu launcher with tsMuxerGUI as the command.

Open the program and on the Input Tab select [add] to add the .mkv file you have transcoded with Handbrake, in the [General track options] section, select [Change fps:] 25 and [Change level:] 4.0. Then in the [Output] section select M2TS muxing and browse to an output folder if you wish to change the default. Now select the [Start muxing] button. The output file should now play on your TV.

Media Server for the Sony Bravia

I wanted a DLNA/UPnP server to allow me to view photos, listen to music and watch videos and PC recorded TV on my TV. The media is currently stored on my Linux server. I tried various options before finding miniDLNA here http://minidlna.sourceforge.net/ . The MiniDLNA server was extremely easy to set-up and worked out of the box and coped with my Sony Bravia KDL-40W5500 40in LCD which other servers software did not. The TV is connected to my local network via a network cable to a Home Plug.

The Home Plug is a DEVOLO dLAN 200 AVmini Starter Kit 2x Home Plug AV Adapters £79.99 from PC World in the UK

This TV supports images as .jpg, music as .mp3 and video as .mpg or .m2t/m2ts, I’ll blog post how to get the correct settings for the video files later. [ Edit see here tsmuxer-video-conversion-for-sony-bravia/ ]

First I downloaded both the static and src tar files from here http://sourceforge.net/projects/minidlna/files/minidlna/ [go for the latest currently 1.0.22] I wanted the pre-build version as there are a lot of unmet dependencies when I tried building it on Debian Squeeze and a frankly gave up. Download the 2 files [currently minidlna_1.0.22_src.tar.gz and minidlna_1.0.22_static.tar.gz]. Open the static version in your favourite archiver and extract the file minidlna located in /usr/sbin directory within the archive and minidnla.conf located in etc/ directory within the archive to your home directory. Now using your archiver program again to open the src version and extract the minidlna.init.d.script from the /linux/ directory within the archive to your home folder.

you should now have 3 files;

minidnla
minidnla.conf
minidlna.init.d.script

in your home directory

now open the minidlna.conf in your favourite text editor and change the following highlighted text to match the paths to your media, server name and paths to store the database & log files.

***** file extract *****

# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
# can prepend the type, followed by a comma, to the directory:
# + “A” for audio (eg. media_dir=A,/home/jmaggard/Music)
# + “V” for video (eg. media_dir=V,/home/jmaggard/Videos)
# + “P” for images (eg. media_dir=P,/home/jmaggard/Pictures)
media_dir=A,/home/martin/Musics
media_dir=V,/home/martin/Videos
media_dir=P,/home/martin/Photos

# set this if you want to customize the name that shows up on your clients
friendly_name=Angel

# set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
db_dir=/home/martin/.minidlna

# set this if you would like to specify the directory where you want MiniDLNA to store its log file
log_dir=/home/martin/Logs

***** End file extract *****

I left the rest of the config as it was.

Now we need to sore the config and program file and test they work so in a Terminal;

$ mv ~/minidnla.conf ~./minidnla.conf

this moves the file into your home directory as a hidden file by adding the dot at the from of it. I have a seperate partition for the system directory /opt so that I can store user added programs which I don’t want to get removed when I do an upgrade so I’m going to store the minidnla program there in it’s own directory

$ sudo mkdir /opt/minidnla

create the directory

$ sudo mv ~/minidnla /opt/minidnla/minidnla

move the program file into it.

$ sudo chmod +x /opt/minidnla/minidlna

make it executable

You could leave the program in your own home directory or move it into /usr/bin in which case amend the paths in the commands above.

Now we can run the program to see if it works with in my case;

$ /opt/minidlna/minidlna -f /home/martin/.minidlna.conf

so this is the path to the program, followed by -f telling it to look for a file then the path to your config file.

This should now start minidnla building it’s database and then serving up the results, depending on the number of files this may take a while but you can check out the log file for errors on progress.

The only problem I had was that one of the music directories had root permissions on it not my own so if you get error that’s the first thing to check. If all has gone well you should be able to see the results on the TV. If your TV does not see the server which on mine shows up under the name of the server I added in the minidnla.cof and has a Tux penguin icon then check out your Firewall on the PC server.

Next we want to be able to autostart the server if we ever restart our server and be able to start, stop or restart it with easy options. So now open the minidlna.init.d.script in your favorite text editor and amend the highlighted text shown below. Just 2 lines to amend the path to your minidnla program and the path to the monidnla.conf file.

***** file extract *****

# Short-Description: DLNA/UPnP-AV media server
### END INIT INFO

MINIDLNA=/opt/minidlna/minidlna
ARGS=’-f /home/martin/.minidlna.conf’

test -f $MINIDLNA || exit 0

. /lib/lsb/init-functions

case “$1” in

***** End file extract *****

now move it to /etc/init.d/ with

$ sudo cp /home/martin/minidlna.init.d.script /etc/init.d/minidlna

this changes it’s name to just minidnla and

$ sudo chmod +x /etc/init.d/minidlna

make it executable, now reboot the PC and the server should auto start.

$ sudo update-rc.d minidlna defaults

And update, now you can the use the following commands from a Terminal to control the server.

$ sudo /etc/init.d/minidlna stop

$ sudo /etc/init.d/minidlna start

$ sudo /etc/init.d/minidlna restart