Thursday, July 23, 2015

blender odds and ends (250Mb)

In Arch, Blender is a 60Mb download and roughly a 250Mb installation. Several associated dependencies install with it, most of which are likely to already be installed.

3 button mouse

The number one undocumented hassle for installing Blender. Users can opt for 3 button mouse emulation in Blender (Preferences ->Input Tab), but: 3 button emulation leads to overlap problems between X's management of mouse events and Blender's management of mouse events. For example, Blender's 3 button emulation of object rotation is "Alt+LMB". But in X, "Alt+LMB" are the strokes to grab an active window and move it around the desktop. What happens when a Blender user selects "Alt+LMB" while in "3-button emulation"? The entire window moves instead of the object inside Blender's window.

Solution: X mouse strokes can be altered by creating a "SectionLayout" file, and putting it in /etc/X11/xorg.conf.d/. Time consuming, considering no such extra files or time are needed if a person has a $10 (Logitech M110, Ebay) 3 button mouse. Additionally, if you have a 2 button mouse with a scroll wheel, the scroll wheel typically is a disguised 3rd button which can (in addition to being rolled) be pressed directly down until clicked. Clicking and holding the wheel down, while moving the mouse around, is how to rotate around an object inside Blender.

numpad

Also in Preferences -> Input Tab, is numpad emulation. On a laptop, this is necessary: there's obviously no numpad on standard laptops. As users might expect, numpad emulation allows using the number keys across the top of the keyboard instead of a numpad.

selection/deselection - extrusion

There are tens of YouTube video tutorials about extrusion, apparently a basic Blender feature. However, four of the seven steps for extrusion were not mentioned in any of the videos. Accordingly, for the first several hair-pulling days I attempted to extrude, the result would invariably be new, unattached duplicate boxes, NOT a connected extrusion from the current box.

The unexplained step, discovered only inadvertently (auggh) is that start-up boxes are, by default, already selected. So de-select ("A") the start-up box and then select a side, or however many one wishes, to extrude. When something is selected in Blender it changes from grey to gold:

  1. TAB to select "Edit" Mode
  2. Be in "Solid" view, not wireframe view
  3. Be in Face View, not Vertices View
  4. Use "A" to deselect/select all. Select faces by flying around the cube (MMB), and selecting the faces one wishes (Shift - LMB).
  5. Press "X", "Y", or "Z", to obtain the respective axis of the extrusion. Or, if one wishes to freehand it; "G"
  6. Press "E". You can also express it as E, then "2", or any other number. This will extrude that many grid squares along the selected axis.
  7. Move the mouse (no buttons), which will pull the extrusion. L click once it the shape is satisfactory.

floor plans

Links: Render DXF to 3-D
Floor plans are a common use of Blender for those not doing animations. Users can take standard .dxf line-art files and import them, and extrude them into complete floor plans with some additional work. Additionally textures can be downloaded and added to one's textures library to .

Friday, July 17, 2015

[solved] vlc playback odds and ends

Links:

audio playback gaps

Several forums describe buffering issues with VLC audio. For me, it was during playback of files on my HDD. For example, in the previous post, I described using VLC with .m3u files to play with WAV ordering prior to burning a CD (assuming anyone still uses CD's). Playing M3U's which contain nothing but WAV's through VLC would trigger the audio gaps.

The symptom is a one second gap in playback, a simultaneous spike in CPU use, and generation of a two-line error. Subbing in some variables for actual numbers:
[0000x7f5d030f7df8] core input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 2232 ms)
[0000x7f5d030f7df8] core input error: ES_OUT_RESET_PCR called
Apparently a Program Clock Reference is called too late and, in response, VLC increases the delay for the Presentation Time Stamp delay. PCR and PTR are supposed to be related to MPEG playback, but this error appears in audio-only playback of WAV's, for example.

Most of the solution for me was found here, except for 1) which value to change, 2) increase or decrease and, 3) how much.


Since each setting has a pop-up, I read them. It appeared the item to change was "File Caching". On a guess, I adjusted the delay to near the pts_delay value noted in the error message above. Once set at 2000ms, I did not experience cut-outs during file playback.

the orange cone

Some don't like the cone at all; I dislike it during audio-only playback. It sits conspicuously where album art would go. I noted how to get rid of it in a previous post, but it bears repetition. During playback, to disable the orange cone when there is no album art: Tools, Preferences, Select All (Bottom), Interface, Main interface, Qt, unselect "Display background cone or art".

Thursday, July 16, 2015

podcasts, audio cds, wine

Links: Overview of burning options :: Tutorial for Linux burning :: Mixed Data-Audio :: More TOC information

I download 60 minute podcasts and burn them to CD's to play when driving. The problem with a long CD is having to listen to, say, the first 20 minutes to skip to minute 21. MP3 players overcome this, but I don't like MP3 players in traffic: I need to look down at the time stamp. Instead, I break the hour podcast into 12 x 5 minute tracks and burn them to a CD. I can keep my eyes on the road and just twist the knob a couple of times to the track I want, without looking down. Below is my process (about 15 minutes long) for processing a podcast onto a CD. There's also some information related to one-time software installation.

Note: processing audio is not hugely resource-intensive on any system built in the last 15 years. Therefore, no "system requirements" or "rendering" time estimates are included here, unlike posts for video processing.

Steps

  1. Convert podcast into a .wav (audio CD format: 44Khz, 2chan, 16bit little endian)
  2. Set levels and so on
  3. Pick 11 break points and insert a second of silence at each
  4. Save each of the 12 segments using a numbering convention, eg "chunk01", "chunk02", etc
  5. Double-check the folder contains all 12 segments
  6. (optional, time permitting) Provide meta-information to display during CD playback (requires creation of a .toc file)
  7. Burn the segments to a CD as 12 tracks.

1. Convert to WAV (1 min)

Sometimes a podcast will be in a video format, sometimes just an MP3, etc. The line below will convert any format, since it nulls the video.
$ ffmpeg -i podcast.avi -vn -ar 44100 -ac 2 podcast.wav

2. Set levels (2 min)

You can always "normalize" the audio, something useful if you have several WAV's. That would be something like...
$ normalize-audio -m *.wav
For a single large WAV that I'm going to divide into sections, I'll need an audio editor, so I just set the level manually when I open the WAV in the editor.

  wine installation sidebar
If you (like me) prefer some outdated Windows audio editor from the 90's that's like an old glove, installing Wine is necessary to use the app. Wine however requires 32-bit libraries. Therefore, in addition to the 500Mb of extra multilib crap, you risk occasional 32-bit multilib conflicts with your modern x86_64 installation. Accepting that, in Arch, add the "multilib" Arch repository and let pacman do the heavy lifting. Enable the "multilib" repo inside pacman.conf, so pacman can locate and add the libraries.
# nano /etc/pacman.conf
[multilib]
Include = /etc/pacman.d/mirrorlist
# pacman -Syu
# pacman -S wine winetricks lib32-alsa-lib lib32-ncurses
$ wine [path to some old app]
If some of the application sound controls don't work, open $ winecfg and check sound settings for the correct card, and so on.

3. Select, mark divisions (5 min)

With the WAV open in a sound editor, I can place 1 second breaks at the end of a sentence (or other pause in speech), about 5 minutes apart. The one hour podcast is thus divided into 12 segments, with 1 second silence pauses I can see on the timeline. Time permitting, if there are any commercials or unwanted portions of the podcast, I can trim them away at this point.

4. Save the segments (5 min)

Moving from silence divider to silence divider, I save each segment of the WAV as a smaller WAV, labeling each sequentially; "chunk01.wav","chunk02.wav", etc. Burning software will follow my numbering convention, re-assembling the segments, in numbered order, as tracks onto a CD.

5. Double check folder

Verify all 11 or 12 tracks (WAVs) are in the folder and are sequentially named.

6. (optional) provide track information, pre-listen

CD's have about 70-80 minutes available, given 700Mb. If you've trimmed a lot of the podcast, you might add additional tracks to the folder, change the order of play around, etc. Maybe you have time to listen to how the entire CD will ultimately sound, once burned. To do this, make a playlist using a text m3u or pls file and play the playlist using your media player. In this post, I reference simple .m3u files (see bottom of page), but I've used the more complex .pls format in other situations. Additionally, you may want to create a .toc text file for meta information during CD burning. An example of a .toc is
also at the bottom of the page.

7. Burn to CD (2 min)

  burning software sidebar
Because I added one second to each segment when dividing the WAV (see 4 above), I don't want to pad the tracks with additional silence when burning them -- too much silence between tracks. Avoiding padding means using DAO (Disk at Once) burning rather than TAO (Track at Once) burning. Secondly, in Arch, pacman cannot resolve both wodim (cdrkit) and cdrecord (cdrtools), because their libraries conflict. Pick one, in other words. I'm used to cdrecord, but Arch instructions only describe burning in terms of wodim and genisoimage (DVD), so I went with cdrkit. Cdrdao is the most important for my way of burning anyway, and that's a separate package.
# pacman -S cdrkit cdrdao


Installation completed, burning is available. Burn speeds may be tweaked up or down according to impatience or errors, but generally:

1) Burning without a Table of Contents, say from a folder in which WAV's are in numeric order:
$ wodim -v speed=1 dev=/dev/sr0 -dao *.wav
If you want to run a test on whether it burns OK first, insert the "-dummy" option in the line. For pads between tracks add the "-pad" option. Other options on the wodim man page.

2) Burning with a Table of Contents (.toc file) can utilize individualized track names and folder locations while burning, and can include track meta-information to display during playback. The application for this type of burning is cdrdao, but note that cdrdao actually requires a TOC file to burn:
$ cdrdao write --device /dev/sr0 --speed 6 --eject --driver generic-mmc-raw [tocfilename].toc

Other Audio Notes

BPM information: The Mixxx application (pacman -S mixxx) in the Arch repositories will calculate Beats Per Minute.

VLC note: During playback, to disable the orange cone when there is no album art: Tools, Preferences, Select All (Bottom), Interface, Main interface, Qt, unselect "Display background cone or art".

.m3u

This file type is good for doing a test of the CD before we burn it. Inside the m3u, we can move the track order around until it sounds the way we prefer. Below is a minimal example with two tracks -- you can expand the number of tracks using as many WAV's as desired, for example you may want to make a 4 hour playlist for a party. However, a CD cannot contain more than 70-80 minutes of audio, unless you have a stereo that plays MP3 format (a different post), so keep a general idea of your minute total if you ultimately intend to burn it.
$ cat sample.m3u
#EXTM3U

#EXTINF:-1,July 15 Podcast - Part 1 (4:08)
chunk01.wav

#EXTINF:-1,Musical Interlude (3:00)
/home/foo/tracks/sunnyday.wav

.toc

Links: TOC metadata explanation :: More TOC information :: Script for simple TOC production
The TOC is critical during DAO burning, so it's worth reading a couple of posts on them (see links above). A user may wish to modify the TOC from an existing audio CD, produce a TOC from scratch, etc. To examine a TOC from an existing audio CD:
$ cdrdao read-cd --device 0,1,0 --driver generic-mmc-raw somename.toc
These TOC files are easily manipulated with any text editor. Use two forward slashes ("//") to add comments inside the file. I make very simple TOC's, but there are many tweaks available for those who have the time to invest: get into those three links above.

Here's a truncated view of a TOC I made for a divided podcast burn. The actual TOC for the burn is obviously longer since it has more tracks, but you'll get the picture:
$ cat sample.toc
CD_DA

//Track 01
TRACK AUDIO
CD_TEXT {
LANGUAGE 0 {
TITLE "Part 1: 2014-09-24 Speech"
PERFORMER "Matteo Renzi"}
}
FILE "chunk01.wav" 0

//Track 02
TRACK AUDIO
CD_TEXT {
LANGUAGE 0 {
TITLE "Part 2: 2014-09-24 Speech"
PERFORMER "Matteo Renzi"}
}
FILE "chunk02.wav" 0
The information will be displayed for each track. Also, the tracks are only 5 minutes each: when driving, I can spin the knob between tracks without looking down. When stopped, I can glance down to see the actual title of the portion. Have fun and be safe!