Sunday 26 July 2015

pcDuino v3B no audio from some programs - by Ross Devitt

After using sudo board-config.sh to update my pcDuino v3B various things stopped working and I have written about some of them in the previous posts.  One ting I did not check before the upgrade though, was whether I had sound in my browser and things like smplayer and vlc.  XBMC worked and for my original purpose that was all I was interested in.

But the more I got involved in this magic little computer, the more I wanted to try other things.  And during that process I discovered the ONLY thing that had sound was XBMC.  So I did a little snooping.  And found a simple solution - for me at least.

Now at the time i didn't write down everything I did.  It was after midnight and I was exhausted.  But I know I did: 

sudo apt-get install pavucontrol 

I can;t remember if that installed all the other pulse audio stuff or if i had to also do:

 sudo apt-get install pulseaudio

But if you have this problem, try the first.  If it still doesn;t allow you to set up audio, try the second as well.

After I did this i could adjust sound settings from the volume icon on the panel.  Then I had ausio output in everything inclusing YouTube videos!

Cheers,

RossD

Saturday 25 July 2015

PCDUINO v3B XBMC won;t play mpg and mpeg videos - by Ross Devitt

The longer I play with the PCDUINO v3B, the more things I find that are wrong with it.  but so far,with the exception of that problem creating a bootable, usable 32GB micro SD card, the other problems seem to have solutions.

One annoying thing that I discovered when I got my 1 Terror Bite portable USB 3.0 hard drives drives working in the pcDuino 3B was that while mp4 files played great, I have a heap of old mpg and mpeg videos that would not work.  Generally as XBMC was working through a playlist as soon as it encountered an mpeg or mpg extension, it simply shut down and dropped to the desktop.

I can't guarantee this solution this will fix it for everyone, but it worked for me.

Open a terminal and type:

sudo apt-get install mplayer2


Then hit enter and wait.  You might have to hit enter again if it asks you for a Y/n choice.

Next do:

sudo apt-get install libavcodec-extra-53 

And hit enter again.

It was that simple.  As soon as I opened XBMC again it played all my mp4 and mpg and mpeg videos.  I haven't checked to see if avi files are still playing.  I must admit i was so excited I forgot.

Anyway, just another tip for pcDuino v3B users.  Hope it helps.

Cheers,

RossD.

pcDuino How to use pcDuino with a 1TB USB hard drive - by Ross Devitt

The pcDuino is a great device and can make a fantastic entertainment centre, but it has one major failing.  Although it is just the richt size to fit in an enclosure with a USB hard drive, it needs a uSB hub in the only USB port to run things like a mouse and keyboard or the wireless dongle for a wireless all in one keyboard like the Logitech k400.

This means that you can only run a USB hard drive if you install a powered USB hub.  And that means you need to have access to power for that hub.  I searched for a simple way to use power from the SATA drive connector to power a USB hub, and I searched for a simple adapter from the on board SATA to USB female.  Neither seems possible.

But there is a solution and it is relatively easy.

By following the instructions here:  http://learn.linksprite.com/pcduino/usb-development/turn-usb-otg-port-into-an-extra-usb-host-pcduino3/  very carefully, you can use the OTG port as an extra USB port for connecting the USB hub and wireless dongle.

And here is the great news!   Once that was enabled, I could run up a 1 Terabyte portable USB drive (NOT the desktop type) and access all my movies and music etc on it.  It plays 1.5GB 1080p videos without hesitation in XBMC.  And it allows me to select and play content from thumb drives connected to the USB hub in the OTG port just as easily.

This means that if I want to I can now have a 1TB USB drive attached to the bottom of the pcDuino case and use it as a complete self containeed Multimedia Centre.  Stacking that combo on top of my PowerBank should make the thing completely portable. 

It also means I might be able to install the OS to a partioned portable hard drive with a bit of work.  Al lI need is the right kernel and I might be able to get Elementary or Lubuuntu running completely on a nice big drive.

But those are experiments still in the plannign stage.  For now at least I have decent functionality.

Cheers - RossD

pcDuino3 - using 32GB SD Card as main drive - by Ross Devitt

The pcDuino3B has 1GB Flash memory and 4GB RAM.  With the pcDuino's version of lubuntu installed there's about 1.5GB of free spance for the home partition for user files.  This rapidly shrinks as it fills up with cacheed stuff, especially if you run a browser.

Luckily it is easy to write a shell script to clear the cache regularly and I am playing around with ways to do this at boot.  In the mean time it is a nuisance that such a great and versatile little computer is hamstrung by this lack of usable space.

Ok, first the good news!  According to these instructions on the Linksprite website it is possible to expand the usefuless of the pcDuino3 by cloning the OS to a 32GB micro SD card.

http://learn.linksprite.com/pcduino/quick-start/pcduino3/use-32gb-sd-card-with-pcduino3/

Now the bad news.

It is bullshit.  It might work for some people, but it doesn't work.

UPDATE - 

I'll put any updates here close to the top of the post so they can be found easily.  
I have jsut tried a third method to create a bootable 32GB microSD.  I used a utility called unetbootin, which usually works with almost anything.  It found the pcDuino .img file, and it even wrote it to the card.  But no way was it interested in booting.

Ok, back to the original post:
 
By following the steps exactly as written, I managed to end up with a 32GB microSD card with a dead partiton table.  It would not show up on any computer.  So I tried a 16GB card and ended up with a dead microSD card.  After that I wondered if I had a couple of dud cards, so I bought a brand new Sandisk Ultra microSD card and tried that.

Sure enough after carefully following the steps exactly I had another dead card.  Luckily Gparted on my Linux computer enabled me to rebuild the cards, Testing each one as I finished to make sure I could write a file to it and delete the file again.

Tried the board-config.sh thing again and managed to get one card that went through the motions of booting, but locked in a loop that asked for a sh file it expected to find on a USB disk. However reading the file told me it would overwrite the on-board nand and that is not somethign I wasnte to do accidentally.

I found another site that offered a more traditional way to burn a bootable 32GB micro SD using the following method.

sudo dd if=/home/user/file.img of=/dev/sdX bs=1M
    
     FIRST - UNMOUNT sdb1
    
     umount /dev/sdb1
    
     THEN - write the image
    
Wonderful!  I now had about 8MB of my 32GB disk used.  But still not bootable.

A bit of googling suggests this is a pretty common problem and nobody has devised a solution to it yet.  My guess is that there is somethign missing from the instructions at Linksprite.com.

My advice - forget about trying to use a 32GB card if it doesn;t work the first time and if you are worried aboout destroying partitions on the microSD cards.




However all is not lost.  Although I was not able to fix the lack of storage, I was able to delete some cache files and fix one other problem - which will be addressed in the following post.

And I am still trying to find a solution to the bootable 32GB micro SD problem.  If I could only find the thing as an iso instead of an img file.

Cheers,  RossD.


Friday 24 July 2015

pcDuino ethernet not working - by Ross Devitt

There's problem on the pcDuino v3B that occurs if you update or upgrade the Ubuntu operating system.  WiFi networking still works, but the wired ethernet (eth0) is disabled..   It seems to be a Ubuntu problem, not a pcDuino problem as it has only been happening to people since recent Ubuntu updates and it seems to have happened to various distros.

I believe there is a way to correct it by editing a system file, but I'm not sure I have the patience at the moment to go looking for it.  So here's a quick fix that worked for me. 

Create a file in your Desktop folder and call it something like  Start-Ethernet   and copy the following 2 lines into it.

!#/bin/bash
sudo killall -9 NetworkManager

Then make the file executable (you can do this by right clicking the file in File Manager then choosing Properties > Permissions and click in the check box for Make Executable)

Then when you click the file on the desktop, it will stop your network, then restart it.  Instead of teh WiFi symbol on the right end of the panel, you will see two arrows, one up - one down.  This is the icon to show Wired Ethernet is connected.

It is probably not the correct way to fix the problem, but it is simple, and it works.

When you reboot the pcDuino though, you will be back to Wireless Networking.  Simply click the file again and wait until it swaps over to Wired Ethernet.

Obviously, if you don;t have a network cable plugged in you can ignore this.  But if you don;t have a WiFi router and have to rely on cables, this might just help you.

Thursday 23 July 2015

what to do when PCDUINO will not shut down after lubuntu upgrade - by Ross Devitt

Ok, I came across an annoying problem with the PCDUINO after I ran sudo apt-get upgrade.  The shutdown icon on the right end of the panel no longer works.  It simply flashes the shutdown dialog on the screen for one second and if you can read it quickly enough it says you cannot shutdown while another user is logged in.

Now, on Linux, there is always another user logged in.  If you run the command   who   in a terminal you will see user  root logged in at ttys0 and tty1.  This is normal and necessary.  You will also see user ubuntu logged in at tty7.  This is you unless you created a new user account.

What is happening is due to the way some linux distros work with user policy and it is annoying but ridiculously simple to fix on our little PCDUINO because in lubuntu any files in the desktop folder are displayed 'on the desktop.

1 - open your desktop folder
2 - create a new text document called  SHUTDOWN
3 - open the text document
4 - In the text document type ecactly what is in the two lines below (nothing else) the 0 is a number ZERO

!#/bin/bash
sudo shutdown -h 0

5 - save the file then make it executable.  You could do this from the command line, but the easiest way is to open the desktop folder with File manager, then right click your file called SHUTDOWN   and open the Permissions tab.  At the bottom you will see a check box that says 'Make this file executable'.  Click the box to put a tick in it, and you now have a little program that will shut down your computer.

The file SHUTDOWN  will show on your desktop.  Simply click it and the PCDUINO will close down neatly and normally.  To start it again, just unplug the USB power cable from the power adapter or from your power bank and plug it in again.

Reboot from the icon is also dead, so you can follow the directions above and make another file called REBOOT in the Desktop folder.
Don't forget to save your new file and make it executable.

Just make the contents  below:

!#/bin/bash
sudo reboot


Again, this REBOOT file will show on your desktop.  Simply click on it and you can reboot your system.

I name the files in CAPITALS so I can find them easily and not click them accidentally.

There are more complicated ways to solve this problem by editing system files, but this is simple, quick and effective.

Cheers,

RossD


Wednesday 22 July 2015

PC DUINO and LINUX as a Multimedia Centre - by Ross Devitt

After some disappointing experiences with Western Digital TV Live and Kaiser Baas Smart Media Player I have been using an old laptop to play my movies and videos.  The Kaiser Baas wasn't too bad, but Google Android should really have no place in communications or entertainment.

Don;t get me wrong.  Android is not the problem. As an operating system it is brilliant, powerful and flexible.  But after creating it, Google has turned it into a real mess.  Now, by rooting our devices and installing various open source non Google Android clones it is possible to dump the pre-installed garbage like 'hangouts' and Play Services, and get a fast lean Android that works better than any other phone or tablet alternative.  However, this is not as simple as it sounds.

Luckily I don't have a smart Android powered TV, so I am not locked into the painful user experience.  Unfortunately the WD TV Live seems to be powered by some sort of proprietary system and the ser Baas Kaiser Baas just bogs down under the load imposed by Android.  Of course the whole World Wide Web experience has been bogged down by Google.  Computers and networks have become faster and faster and because of Google the web has become slower and slower.  How ridiculous!

So back to multimedia.  There is a smart little microcomputer board called the Raspberry Pi that started a whole revolution in the education and hobby market.  And inspired by that are computers built on tiny boards.  One of these is the PCDUINO.  I got my hands on this magic little device recently and I have been experimenting with it.

One of my goals for some time has been to have something like an Android tablet running Linux.  The PCDUINO board is 120mm x 65mm x 20mm in size.  And it comfortably drives a 48 inch LED TV playing videos for hours on end without overheating.

And it goes one better.  One add on that is available for it is a 7 inch capacitive touch screen.  That makes it into a complete and very usable micro computer.

Of course a bare circuit board is just asking for trouble.  But about $7 adds a compact little protective case with holes to plug in all the relevant peripherals.


As if that's not enough, this little computer outputs via HDMI and has a 3.5mm audio jack as well.  So you can choose to drive your TV or monitor built in speakers through the HDMI cable, or if as I do, you prefer the thump and rumble of your stereo system, simply output the video via HDMI and plug the speaker system into the jack.

This Computer comes with Lubuntu configured for the Allwinner A20 chip and the ARM Cortex A7 CPU chip.  It uses a Mali 400 Dual Core GPU, which plays 720p video beautifully and so far has handled sending my 4k HD video seamlessly to the 48 inch LED TV.  You can easily replace the UBUNTU Linux with Android should you wish.

SDRAM is 1GB and there's 4GB of Flash Memory built in.  On my PCDUINO 2.5GB was still available after system use.  I added a spare 32GB micro SD card to give me some on board flexibility for storing stuff.
The one full sized USB port seems a bit lonely at first, but connecting a hub soon makes it a useful tool.

I have two ports in my hub taken up by Wifi adapters for my mouse and keyboard, but I will change to an all in one device when I can.  The hub is still handling two 32GB USB sticks for video and music without problems.

The only thing I could whinge about I suppose is the performance of YouTube video, but that is mostly a function of Google interfering with the web again and there;s not a lot we can do about that.  Once you download the video it plays perfectly.

The power is supplied by a micro USB port on the underside of the board at the end where the network socket and HDMI out socket live.  Further around the board is another micro USB port but this is mostly for debugging and diagnostics.

There is an IR receiver for using a remote or other IR device.  There's a SATA hard drive connecter and next to it the pins for powering the SATA disk.  A whole lot of space is dedicated to pins that allow connection of a lot of different peripherals.  The PCDUINO is based on and compatible with the ARDUINO and seamlessly conneects to all the 'shields' available for it.  DC motor controllers, sensors, GPS receivers and so many more tools for experimenting and designing.

Having HDMI out opens up some other possibilities.  One of which is to be able to use a 10 inch touch screen instead of the 7 inch one that uses a heap of connectors and a ribbon cable. This would be a lot less messy, especially when mated to a short flat HDMI cable.

I'm looking forward to exploring the capabilities of this little computer further.  For now i can also say that the version of XBMC Media Player that is installed on it does NOT play mpg videos.  It played every other video I threw at it but every mpg made it shut down.

Luckily all I had to do was open a terminal and run:  sudo apt-get install libavcodec-extra-53
the follow it up by typing:  avconv -i filename.mpg -c:v mpeg2video -q:v 2 -c:a libmp3lame outputfilename.mp4

Obviously replacing filename and outputfilename with the actual file names.  One warning though.  Rename the files so you don't have spaces!!  Command line stuff hates spaces.

Surprisingly the conversion was remarkably quick.  I think it was done in about the same time as it takes on my full desktop computer.

I'll add more about the PCDUINO as I explore it.  For now I am happily using it as an entertainment centre.   I have successfully powered it for several hours off my portable 'powerbank' that I use to recharge my phones and tablets, so that is another job.  Record just how long it will play full screen video while still running WiFi and stuff.

As far as futher expansion, This is the best screen option I have seen so far.
10" universal LCD with HDMI interface and capacitive multi-touch.
It has the advantage over other HDMI screens of being powered by 5VDC.  


 http://www.chalk-elec.com/?page_id=1280#!/10-universal-LCD-with-HDMI-interface-and-capacitive-multi-touch/p/42545413/category=3094861


Display specifications:
  • Display: 10” full-color a-Si TFT with IPS technology
  • Integrated touch-panel: capacitive multi-touch with up to 10 fingers
  • Native resolution: 1366x768 pixels
  • Aspect ratio: 16:9
  • Display colors: 16 millions (8-bits per color)
  • Panel dimensions: 269mm (H) x 172mm (V)
  • Weight: 245 grams
  • Input voltage: 5V DC
  • Low power consumption: 2.5W (typ)
  • High brightness: 450 cd/m2 (nits)
  • Contrast ratio: 800:1
  • Viewing angle: 89 deg (all directions)

Features:
  • fully integrated solution - no external boards and cables
  • slim design (<9 mm thickness including electronic and connectors)
  • easy installation – just connect and it will work
  • mini HDMI input accepts any resolution up to 1920x1080 (FullHD) and scale down to native LCD resolution
  • slim-profile power connector (OD=2.6mm, ID=0.65mm, positive central pin)
  • mini USB connector for touchscreen with support for driver-less single touch, or multi-touch with additional driver (Windows USB HID standard)
  • can be powered through the same mini USB connector
  • firmware can be updated through standard USB cable
  • audio engine provides decoding of HDMI stream audio and outputs it to standard 2.5mm connector
  • LCD brightness can be controlled by optional ambient light sensor, manually, or from your program with USB HID commands
  • internal LVDS scaler allows to get HDMI signal with any resolution from virtually any HDMI source, like RaspberryPi, Beagleboard/Pandaboard/, Beaglebone Black, Hackberry, Odroid, Cubox, mk802 and others Android stick clones, Gooseberry, Nitrogen/Sabre, OLinuXino-A13, normal PC/notebook, video players, etc.



Saturday 4 July 2015

Elementary OS FREYA and video desktop wallpaper


Ok, I'll admit it, I like messing with stuff.  So when someone assured me video wallpaper would not work with Elementary because it uses its own window manager, I had to find out.   And it does work.  The picture above and those following are screen shots from a 4k (very high definition) mp4 running ;in an oval porthole through' (the easiest way to describe how it looks) one of my normal wallpapers.

Running a full movie at 4k definition is probably not the best thing to do as you will chew up between 20 and 30% of a low end AMD cpu processing.  But it works well and the performance hit is just a little lag occasionally when loading a new firefox page or some other cpu intensive task.  Anyway it is quaint.



I also made a .desktop script so I could drag it to docky and run the script that creates the video wallpaper.  One neat trich here is that clicking the icon in Docky once starts the wallpaper, and clicking it in Docky again stops it.  Which turns out to be rather handy.

The tools you will need are.

(1)    Shantz xwinwrap
available here:   http://tech.shantanugoel.com/resources/downloads/shantz-xwinwrap.zip

You can read about xwinwrap here:   http://tech.shantanugoel.com/2008/09/03/shantz-xwinwrap.html

(2)    Mplayer
Download and install mplayer from your normal repository

(3)    A video you like.   RENAME the video file with NO SPACES.
So if it is called my fave video.mp4,  rename it to my-fave-video.mp4   (you get the drift.  unix scripts don;t like spaces)
 I created a folder for my video wallpapers and the script should (repeat - SHOULD) just cycle through any videos in that folder.   It does on mine.  If it doesn;t check that there are indeed no spaces in the file names.

UPDATE - I managed to kill the cycling through the videos thing.  I may have changed settings in mplayer.  I'll have to look into it.  But for now it will repeat the first video it finds in the folder.
If I work out what I changed I'll try to remember to update this.

Ok, down to work.  You need to install xwinwrap.  After you install it, open a terminal and type the command  xwinwrap.  If you get a list of things you can tell it to do, it is installed.  Move to the next step.

If you haven't already got it, install mplayer.

1 -  Create a folder to use for your wallpapers.  Give it a suitable name.
2 -  Create a new blank text document.   Give it a suitable name with NO SPACES.

Create a blank text file in your video wallpaper folder.  Give it a suitable name.name

Copy everything between the rows of start (but not the stars themselves) into the file and save it.
The following script is not mine.  Someone else did the work to make it. 
****************
!#/bin/bash
if ps -e | grep xwinwrap
 then
  killall xwinwrap
  sleep 1
  exit
 fi
# first number is width
xwinwrap -ni -o 1.0 -fs -s -st -sp -b -nf -g 1355x800+0+0 -sh circle -- mplayer -wid WID -nosound *.mp4


fi
sleep 1
exit
******************

The final step here is to save the file and then make it executable.  I am too lazy to use chmod, so I simply open the folder in Dolphin and right click the file, go to Properties and choose Make Executable.  You will need to do whatever you normally do.  If you get stuck just google how to do it from the command line.

A little note here.  If you delete "-sh circle" from the script you will end up with full screen wallpaper without the oval port hole.  If you change the  first two numbers in "1355x800+0+0" you will change the oval or circle.  If you change the last number you will change the horizontal position and the third number should change the vertical position.   Just so you can play around. 

Ok, so now if you were to run that file from inside the folder you should get a video wallpaper. But then you have to open your system monitor and stop mplayer manually when you want it to stop.

So I made a .desktop file that I dragged to Docky.  It should work fine on plank too. 
Make another file in the wallpapers folder and copy the following between the stars as you did before.

****************
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/home/YOUR USER NAME/Your-Folder-You-Made-for-Wallpaper/NAME-Of-The-File-You-Made
GenericName[en_US]=
GenericName=
Icon=avidemux
MimeType=
Name[en_US]=
Name=
Path=/home/YOUR USER NAME/Your-Folder-You-Made-for-Wallpaper
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
*****************




CHANGE the two lines in BOLD to whatever paths and file names you need.
Save the file with a name like   start-wallpaper.desktop     or something.  
Drag the   .desktop   file to Docky.  I think you can also drag it to Plank if that is your dock.

In Dolphin I right click on the .desktop file and give it a pretty icon to make it easier to find.

That's it really.  To start my video wallpaper I click the icon in Docky.  To turn it off and release memory I simply click it again.  It is that simple.

Thanks to Shantanu Goel  for creating xwinwrap.  And thanks for the person who created the script I use to make xwinwrap run easily.

In my video wallpaper folder I have another folder with a library of videos I like.  I simply drag videos out of the library to run them and back in again when I want to change them.  Dead Easy !!

Friday 3 July 2015

Transferring files to Elementary OS Freya by Bluetooth


Recently I had to move a heap of files from my phone's camera to my computer running Elementary OS Freya.  I was about to turn the phone off and remove the Micro SD card as usual when I realised that every computer I have has Bluetooth.  So I paired the computer and phone and sent the pictures that way.  And got a message on the phone saying the attempted transfer failed.

So I did a little snooping.  There waas no obvious setting in 'Bluetooth' in system settings, but some reading led me to a Gnome utility.  In Unity, there is a 'personal file sharing' option in the Dash.  But not in Elementary. 

In Applications, you can find an item called 'Bluetooth Transfers' that allows you to select a file to transfer from your Elementary OS computer to another device via Bluetooth.  But there's no obvious way to transfer a file from the other device to your computer, nor to set it up to accept transfers from other devices.'

Likewise choosing 'Bluetooth' in system settings allows you to transfer files to another device but I can see no obvious way to accept files from elsewhere.

Luckily though the actual program that does the leg work is there. 

Open a terminal and type in the command:    gnome-file-share-properties
This will open a window that allows you to set up to receive Bluetooth transfers. 

Towards the bottom of the window under 'receive Files over Bluetooth', tick the following.
(*)  Receive files in Downloads folcer over Bluetooth
(*)  Notify about received files

Between these two options is another where you can choose the type if devices you will accept files from.  It has a drop down menu.  I changed mine to 'Always' but the default is 'Only for set up devices'.

That's all there is to it really.  Close the window after you do these steps and pair with your bluetooth deice as you normally would, then send files as you wish.