22 August 2020

663. Giving a zoom + on-campus lecture (on linux, win and mac)

Preamble:

The uni admins aren't making it easy for us. 

I can handle doing everything on-campus, giving good, or occasionally very good, lectures using the white board and making it dynamic by actually engaging with the target, the students. I can often get them to share my excitement over the amazing stuff we're discussing (especially MO theory -- it's my favourite topic, and my favourite lecture). 

I can handle doing everything online if necessary, optimising my lectures to work through zoom or, even better, do away with lectures completely and rely on pre-recorded videos that take advantage of the video format, and use them to flip the class. We can then meet up on zoom to discuss the topics.

But what we're being asked to do is to focus on on-campus teaching, while making sure that everything is being streamed live online to avoid students from showing up to class when infectious.

Note that in our lecture halls we don't have computers. We're expected to bring our own, and we use single projectors. We also don't get any help from IT. Nothing is ever recorded here.

This is incredibly primitive and unprofessional compared to how things were done back in Australia.

What I will show here:

A few approaches to making a lecture work OK for both on-campus and online students simultaneously, and easily. The solutions assume that there's no competency, interest or support from IT.

1. The Basic
The easiest approach is to start zoom on your laptop, share a set of slides and stream it. You need to think about audio though, and there are a number of wireless solutions.

We've been told to use bluetooth headsets, but bluetooth has poor audio. Using 2.4 GHz wireless headsets, like my old logitech G930, gives better audio, but then you can't hear the local audience properly. 

My preferred solution is to use a Samson XPD2: 
http://www.samsontech.com/samson/products/wireless-systems/xpd-series/xpd2lav/

It's not a headset -- sound won't come out of it, but you can crank up the sound on your computer (or even use external speakers -- I have a very old HP USB speakers that are just about loud enough for a lecture hall (https://support.hp.com/ca-en/document/c02574017)

You can obviously switch input to webcam/document cam etc., but it's pretty basic.

If you have a document camera you can use this just like a webcam. Or you use e.g. https://gitlab.com/docphees/doccam to manage your document camera, and then use the window as input to zoom through share screen.

2. With a bit of Flair

This is a somewhat technical solution on linux, but I think it's easier on win/mac. What we can do is to set up a virtual webcam. The contents of the virtual webcam will be supplied by obs-studio

We then use obs-studio -- in studio mode no less -- to switch between different types of views.

virtual webcam: If you're on linux you need to install v4l2loopback (either as the dkms in the deb repo, or by a very simple compile), and if you're on linux you need the v4lsink. If you're on win/mac you can simply install the virtual camera plug-in for obs-studio.

On linux you need to create a virtual webcam:
sudo modprobe v4l2loopback video_nr=10 card_label="OBS Video Source" exclusive_caps=1

In obs-studio you then choose Tools/V4L2 Video Output and choose /dev/video10

obs-studio
Once that's up and running, set up at least two scenes in obs-studio, and pick studio mode.

I've set up one scene with a lion and a styracosaurus on a webcam, with the background chromakeyed out* over a molecular simulations video, and another one showing the guardian website, but one could've been the window with your slides, and another could be a document camera.


I've then set up ctrl+shift+alt+5 to switch between them:


You can even have different audio input depending on the scene. Useful if you're using wired microphones and moving between different stations in your lecture hall.

In zoom: now all you need to do is to pick the virtual webcam device as your input in zoom. There is a CPU overhead to using obs-studio, so expect the laptop to keep the fan on throughout the lecture.

*The chromakey background is the blue cover of an Office Depot notebook :)

21 August 2020

662. Mini-post: Getting a bluetooth headset to work on linux -- B350-XT

 I have a BlueParrot  B350-XT which is causing issues on linux. It pairs fine, and shows up as a sound device, but it won't actually play sound or record sound.


Looking at dmesg -T, I see

[Tue Aug 18 01:25:33 2020] Bluetooth: hci0: BCM: chip id 63
[Tue Aug 18 01:25:33 2020] Bluetooth: hci0: BCM: features 0x07
[Tue Aug 18 01:25:33 2020] Bluetooth: hci0: BCM20702A
[Tue Aug 18 01:25:33 2020] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[Tue Aug 18 01:25:33 2020] bluetooth hci0: firmware: failed to load brcm/BCM20702A1-050d-065a.hcd (-2)
[Tue Aug 18 01:25:33 2020] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-050d-065a.hcd failed with error -2
[Tue Aug 18 01:25:33 2020] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-050d-065a.hcd not found


To solve this, unplug/turn off your headset. REMOVE/FORGET the device  so that you can re-pair it.


Download the hcd file to ~/Downloads, then
me@niobium:/lib$ sudo mkdir /lib/firmware/brcm
me@niobium:/lib$ sudo cp ~/Downloads/BCM20702A1-050d-065a.hcd /lib/firmware/brcm/

Now try again. 
Output from dmesg -T:
[Tue Aug 18 01:33:59 2020] Bluetooth: hci0: BCM: chip id 63
[Tue Aug 18 01:33:59 2020] Bluetooth: hci0: BCM: features 0x07
[Tue Aug 18 01:33:59 2020] Bluetooth: hci0: BCM20702A
[Tue Aug 18 01:33:59 2020] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[Tue Aug 18 01:33:59 2020] bluetooth hci0: firmware: direct-loading firmware brcm/BCM20702A1-050d-065a.hcd
[Tue Aug 18 01:33:59 2020] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1482
[Tue Aug 18 01:33:59 2020] Bluetooth: hci0: Broadcom Bluetooth Device


09 July 2020

661. Teaching during the pandemic, part 4: making simple video lectures

This post is a bit different from the previous ones -- it simply shows what I've been doing for some time to create supporting videos for my students.


I record my voice using Audacity, and I use KDENLive to make the videos. I make slides using google docs.

Once you've got used to this you can make a bunch of short videos (aim at 6 minutes or so) in a single day.

Here's my work flow:

1. Create a script for the audio. 
I basically write down everything I'm going to say before I've made my slides. I then make the slides to match the script.

I use gedit to write my script.

2. Create the slides to match the audio
I use google slides:


I export each slide as a png:
3. Record the audio in audacity
Use a good microphone! I'm using a Blue Yeti, which is great.

NOTE: each audio file should correspond to a single slide, or part of a slide. Not the other way around. It makes step 4 easier, and helps if you need to redo the audio for a section.

Export the audio in a suitable format (e.g. flac)
4. Fire up KDENLive

Import your clips.

Add your audio to the Audio channel

Then add the png files to the video channel. Stretch the duration of each image file to match the duration of the audio.


Once you're done, render the video:

That's all!


Now you can combine the teaching posts to create something that works for you. Here are the links again:
* Mobile phone lavalier mic: http://verahill.blogspot.com/2020/07/658-teaching-during-pandemic-part-1-how.html
* Recording (several) cameras and syncing: http://verahill.blogspot.com/2020/07/659-teaching-during-pandemic-part-2.html
* Dealing with audio: http://verahill.blogspot.com/2020/07/660-teaching-in-pandemic-part-3-what.html