03 August 2013

490. WACOM CTH-470 -- Bamboo Pen and Touch on Debian

This drawing tablet works out of the box on my system. I am using a custom 3.8.5-ck kernel, but as far as I know it should work on debian wheezy and above.

Anyway, plug it in and you're up and running. If you use your fingers it'll work like a regular touchpad (i.e. movement is relative to the previous location) whereas if you use the stylus the movement is absolute. You can use the GNOME 3 wacom app to change the setting:


 If you want to annotate a pdf during a presentation you can use e.g. Xournal:
Set to One page, hit F11 for presentation mode, and zoom in using CTRL +.
 To make the yellow eraser tip work for erasing, go to Options and select Eraser Tip.


 You can now draw

You can compare my hand-writing on paper vs using the tablet. Neither is particularly flattering for someone in their mid-thirties...

You can then erase
Note how there are no tool boxes in the images above. You can set the fullscreen view by editing the ~/.xournal/config file -- first generate the file by hitting Options/Save Preferences. Next, edit it and change the interface_fullscreen variable.

I like
interface_fullscreen=drawarea pen_toolbar
which looks like this:

Finally, to disable touch input during a presentation do this:

First get your device name
xsetwacom --list devices
Wacom Bamboo 16FG 4x5 Pen stylus id: 10 type: STYLUS Wacom Bamboo 16FG 4x5 Finger touch id: 11 type: TOUCH Wacom Bamboo 16FG 4x5 Pen eraser id: 15 type: ERASER Wacom Bamboo 16FG 4x5 Finger pad id: 16 type: PAD

 sudo vim /usr/bin/toggle_touch
#!/bin/bash ## Get the "Device name" or ID number ## for touch from 'xsetwacom list dev' DEVICE="Wacom Bamboo 16FG 4x5 Finger touch" TOUCH_STATE=`xsetwacom get "$DEVICE" touch` if [ "$TOUCH_STATE" == "on" ] then echo "Touch is ON, turning OFF." xsetwacom set "$DEVICE" touch off else echo "Touch is OFF, turning ON." xsetwacom set "$DEVICE" touch on fi
sudo chmod +x /usr/bin/toggle_touch

You can the do
me@niobium:~$ toggle_touch 
Touch is ON, turning OFF.
me@niobium:~$ toggle_touch 
Touch is OFF, turning ON

All I need to figure out now is how to get Xournal to interpret my presenter button in a way that makes it forward one slide per press, instead of half a slide.

489. Briefly: dvb-fe-tda10048-1.0.fw on debian

I have a Leadtek DTV 1000 S tv card. While it does work out of the box with e.g. me-tv, there's a fair bit of annoying stuff happening, such as failure to lock channels a couple of times per evening.

The first step is to put the following your /etc/modules:
options saa7134 tuner=48 card=175

If you check dmesg after boot you'll, however, notice the following as well:
[ 8.729961] tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)... [ 8.775721] tda10048_firmware_upload: Upload failed. (file not found?)
and this is how you fix that:
mkdir ~/tmp/tda10048 -p
cd ~/tmp/tda10048
wget http://steventoth.net/linux/hvr1700/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
unzip HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip 
dd if=Driver85/hcw85bda.sys of=dvb-fe-tda10048-1.0.fw bs=1 skip=667744 count=24878
sudo cp dvb-fe-tda10048-1.0.fw /lib/firmware/

If you unload and reload your saa7134 and saa7134_dvb modules and the firmware should load. At the very least it will on the next boot:
[ 8.929850] tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)... [ 8.967595] tda10048_firmware_upload: firmware read 24878 bytes. [ 8.967604] tda10048_firmware_upload: firmware uploading

02 August 2013

488. Screencasting on debian wheezy

Update II: An alternative to gnome-screencast + audacity is kazam, which is present in the jessie and sid repos, but NOT in the wheezy repos.

Update:
If you want to draw in a pdf presentation, Xournal is looking pretty good. You can turn off the toolbars as shown here:  http://sourceforge.net/p/xournal/feature-requests/75/

Original post:
It would be nice if we could use the gnome screencasting tool for this, but it doesn't record audio by default. While you can make it do so, there are issues with getting it to stop recording audio. In the end you end up with a continuously growing file even though you've stopped recording.

I had little luck with Istanbul. While it sort of worked, I had issues getting it to stop recording (clicking on the button in the gnome tray produced nothing) a lot of the time.

I also had little luck with recordmydesktop. While it recorded fine, and eventually stopped when asked to, it didn't record sound. You can probably sort that out without too much effort, but yesterday I had to quickly whip together a couple of screencasts for a class I'm teaching, and playing with sound can be an easy way of wasting an afternoon.

In my case I had to narrate a couple of .ps slides I'd prepared with latex.

I went for something less elegant, but which was quick and easy to get started with: gnome screencasting + audacity. I'm in no way the first person to use this, but here's what I did:

0. First install audacity, ffmpeg etc.
I suggest install the newer version of ffmpeg already from the beginning. See step six below to see how to get the newer version via the deb-multimedia repos.

1. Start audacity. Presuming you have your microphone configured and everything, you should be ready to hit record (you might want to set audacity to record mono rather than stereo to save space). Don't do anything at this point though.

2. Open you pdf or ps presentation in evince in another workspace and put it in presentation mode (F5 in evince)

3. Ready? Hit the record button in audacity and switch workspaces. Hit Alt+Ctrl+Shift +R to start recording the screen actions

Your mouse movements will be recorded, so you can point at things as you are talking.

I find it a lot easier to edit sound files than video, so I'd rather have audacity run a bit longer than the video and edit it afterwards.

4. Once you are done, stop the screen recording with Alt+Shift+Ctrl+R, switch back to Audacity and stop the recording. Re-touch your audio in audacity (e.g. trim the beginning and end to match the video), and go to file/export to save it as e.g. wav.


5. Combine sound and video
Merge your screencast (which is in webm format) with your audio:
ffmpeg -i example.wav -i example.webm merged.webm

It takes a while. You can run this in parallel, e.g.
ffmpeg -threads 8 -i example.wav -i example.webm merged.webm

At any rate, you now have a .webm file with sound and video -- this is a format that's handled by html 5, so it should be ok.

If you want to edit the video before merging with audio you can also use OpenShot to e.g. split off the end of the video. I never had much luck with pitivi.

If you know exactly where to cut you can do it very easily with ffmpeg:
ffmpeg -i example.webm -vcodec copy -acodec copy -ss 00:00:00 -t 00:11:39 example_chop.webm

Also, without confirming it, I think the newer versions of ffmpeg automatically run as multi-threaded, whereas the older ones just launch a single thread. Experiment and find out.

6. To make an flv file
To do this successfully I had to use ffmpeg version (1.0.7) in the deb-multimedia repository -- the ffmpeg version (0.8.6) in the wheezy repos is too old. You can use the newer one by adding this to your /etc/apt/sources.list,
deb http://www.deb-multimedia.org wheezy main non-free
followed by running
sudo apt-get update
sudo apt-get install deb-multimedia-keyring
sudo apt-get upgrade && sudo apt-get install ffmpeg

Finally, convert to flv using
ffmpeg -i merged.webm -vcodec libx264 example.flv