Friday, September 30, 2016

Setting VLC to tune channel 3 NTSC

I wanted knoppix 7.6 to tune channel 3 on my bt848 card on /dev/video0 but it wouldn't tune properly.

So I tried everything I could think of.

but I looked at the parameter list after clicking on advanced options and it needed a space before :v4l2-tuner-frequency=61250

61250 khz = 61.25 mhz for channel 3 which will tune my analog cable box DTA.

so this line doesn't work:

:v4l2-standard=NTSC:v4l2-tuner-frequency=61250 DOESN'T WORK

and this line does work:

:v4l2-standard=NTSC :v4l2-tuner-frequency=61250 WORKS

so you just have to manually add the space and it works.

Thursday, September 29, 2016

Ubuntu sound is problematic with my analog tv cards

I thought I'd try ubuntu 16.04 on a system that I'd been using with knoppix and I am getting extremely frustrated.

I launch tvtime or vlc and I just can't get the sound working at all from my brooktree 848 capture cards. I actually have two bt848 installed in this system.

I installed pavucontrol and I can see that there's some audio flickering on the meter but I just can't hear it.

With knoppix, everything just works with regards to the audio, and now I am so totally baffled.

I think I better do something else for awhile...I can see why people use windows.

There's video from /dev/video0 and /dev/video1 but just no sound.

Monday, September 26, 2016

Built-in editor for microcontroller kit

I'm having a great deal of fun trying to figure out the ins and outs of the Thames and Kosmos microcontroller kit.

I wrote my first program(s) using the built-in editor and I have to say that it's a little bit restrictive. For instance, you have to double click on an instruction (or drag it into the program pane) to add it to the program.

Once you've put it in, you can't edit it in any way except to delete it. No copy/paste, or changing a numeric constant.

So to enter an instruction like Delay = 250, first you have to set the constant to 250, then double click on the Delay instruction.

I did notice that all of the sample programs have the suffix .k and they are all text files. One should be able to edit a text file and load it into the editor. It seems that labels have no indentation, and regular instruction have a TAB at the beginning of the line.

The initial program upon first launching the editor software had the line Delay 250, but I could only enter the instruction Delay = 250, so that must have been loaded from a text file.

Saturday, September 24, 2016

Thames and Kosmos Microcontroller kit

My latest toy is a Thames and Kosmos Microcontroller kit. This is great fun. I think it's discontinued and I got this second hand. It only seems to be missing one of the transistors but I don't think that's a show stopper.

So far I've put it together and hooked up the first test. You have to assemble the pieces into the case, pressing the little clips into place, and placing the potentiometer, the microphone, the piezo and hooking up the power connections.

There's a lot of connections to be made in the diagram for the first test and I missed a couple. I actually missed a critical one and the test wouldn't run as it didn't have the pins connected pins on the microcontroller between 5v and start.

Then I got some of the LEDs installed backwards, and finally I realized how you can tell polarity: there's a small flat spot on the side of the LED. It's subtle but if you look closely it's there.

Once everything is hooked up properly, the LEDs will light in sequence, the first LED's brightness will be controlled by a light sensor, and the rate of the LED sequence is controlled by the same light sensor (bright makes it slow, dark makes it fast) and if you press on a clip switch, the piezo will beep and freeze the light sequence. Pretty cool.

Thankfully, there's a 9v barrel plug so I don't have to use batteries but it's left to you to find an appropriate power supply (after about a half hour I located something that would work in all of my electronic stuff).

Great fun, so far I'm having a blast.

Friday, September 23, 2016

I wish VLC would allow "fit to window" stretching

I hate black borders around video. I'd rather have the image stretched to fill the window. Instead, VLC and tvtime want to enforce aspect ratios. It'd be nice if there was an option to "relax" this aspect ratio enforcement.

I don't mind a little image distortion here and there, I've gotten used to the 4:3 to 16:9 stretching on my TV.

VLC command line for bringing up the analog TV card

I thought I'd figure out how to get VLC started and playing from my analog TV brooktree 848 card.

The command line that works for me is:

vlc v4l2:///dev/video0 --v4l2-standard NTSC --live-caching 0 &

I like the ampersand at the end to run it in the background and keep the terminal window active.


https://wiki.videolan.org/Documentation:Modules/v4l2/


http://askubuntu.com/questions/527482/is-it-really-possible-to-set-up-vlc-to-stream-tv-from-tv-tuner-card-encore-enlt


I had to do this because it was too complicated for family members (who will go nameless) to bring up the dialogs and to do it manually.

It's amazing how just the smallest complexity can stump people.

When we had to switch to Digital Television Converter Boxes, the additional complexity of having a DTV box that broadcasts on channel 3 would completely baffle an unnamed family member. And the DTV box that has its own volume control in addition to the TVs own volume control.

They liked it when there was no complexity: you turn it on and it works. They weren't keen on having two remotes either: one remote for the TV, and one for the DTV box.

I was really glad when we found a TV (I think it was a Funai) that when plugged in would come up on channel 3 ready to go, so we could hide the TV remote.

It's the same reason why people like automatic transmissions: they just put their foot on the gas and the car goes. They don't want the trouble of having to switch gears themselves and the learning curve that goes with that.

Friday, September 16, 2016

I've grown to really like subtitles

I have grown accustomed to watching movies with subtitles always turned on. I think it takes some of the cognitive load off from having to listen closely to the dialogue. In some movies the characters talk softly and you can't understand what they're saying half of the time.

I get upset when I get a dvd that doesn't have subtitles in English. It'd be neat to have the movies subtitled on movies shown on in-flight entertainment. Often they'll have sustitles in foreign languages but not English. I don't care if the movie is already in English, give me English subtitles too!

Thursday, September 15, 2016

Logitech revue is a nice doorstop

So I got this neat looking Logitech revue, and plugging it in and going through the initial setup, it just waits at the "Downloading update" screen forever.

It says to wait 10-15 minutes, but I waited for about 5 hours and I don't think it's going to do anything.

If I hit CTRL+ALT+DEL it reboots but it just gets hung up again at "Downloading update."


I guess that's the wave of the future, where products get orphaned and disowned by their creators after a couple of years.


So it's about as good as a doorstop. A really nice looking shiny gloss black doorstop.

I suppose that I could reuse the K700 keyboard as it's got the logitech unifying symbol on it.

edit:

I found another Logitech Revue and it apparently had already been set up previously and it had no problem running. All I really wanted to do was to see well how the web browser worked. It's a bit slow, but that's to be expected. I'd say it's about on par with the built-in browser in an LG smart TV. It'll play youtube in the browser but it takes a bit of time to get it playing.

I downloaded an mp4 video and the built-in media player would play it well.

A real shame to abandon such a cute little device.

Wednesday, September 14, 2016

Trying to get knoppix to play audio over the hdmi

So I got this core i3 system and I wanted to play audio over the hdmi.

Knoppix is awesome but I had a hard time figuring out how to set the default audio device.

alsamixer doesn't seem to have facilities for setting the default audio output.

aplay -l gives me this output:

knoppix@Microknoppix:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0


and then editing the file /usr/share/alsa/alsa.conf

defaults.pcm.card 0
defaults.pcm.device 3

I set the defaults.pcm.device to 3 so that it will play over HDMI 0

alsactl init

seems to read the alsa.conf file to get things working, and youtube plays over the hdmi with iceweasel.

----
edit:
I like to run knoppix on a flash drive with a persistent image and after changing the default.pcm.device to 3, I took the flash drive and booted it on another system. Then I got no sound on the other system which was totally baffling. Then I remembered that I had changed the default.pcm.device and resetting it back to 0, the sound came back. On that particular system, there is no device #3.

Sunday, September 11, 2016

Ridiculously different power plugs

One of the things that I absolutely hate are devices that have some non-standard power plug jack. I've got this chumby one that takes 5 volts but it has the weirdest little power plug. I wish manufacturers would just use regular plugs that you can easily get a replacement ac adapter for.

There are reasons for using a strange plug, like people plugging in 12V power supplies to a 5V input, but I always check before I would do that. A little labeling goes a long way.

At least you could give me the inner and outer diameters of the plug on the label, for instance.

I did find a plug that would sort of work, but it isn't the right outer diameter so it loses proper connection with the slightest bump.

Some of the worst offenders in this regard are older LCD monitors. Why, why, why use such funny power plugs on the 12V adapter bricks. Can't we just standardize things? I was really glad when they went away from using power bricks to just integrating the power supply on the monitor and using the regular 3 plug AC cord.

And don't get me started on external cd/dvd rom drives. They often use a keyed plug but if there's a different way to wire 4 or 5 pins, they will use all possible permutations. Some of the power bricks have labels that say what pins are what voltage, but the drives don't have such corresponding information. So if you mix up your AC adapters...

Wednesday, September 7, 2016

Future cars may be a lot slower

I was thinking that autonomous vehicles would be a lot safer if they drove slower through the city, minimizing the risk of accidents.

http://www.treehugger.com/cars/praise-slow-car.html

And there's a new movement for 20 is plenty. Every day I read about bicyclists and pedestrians being killed, just so that cars can get to their destinations a little faster. You shouldn't have to die for riding your bike around the city.


http://www.treehugger.com/urban-design/more-reasons-why-twenty-plenty-or-30-enough-metric-types.html

Tuesday, September 6, 2016

Primitive User Interfaces

I was having quite a bit of fun fiddling with the MX-909 and its microprocessor. The primitive user interface of entering commands and parameters with a keypad reminded me of something I was reading about recently, the Apollo Guidance computer.

The pilots would type a two digit verb and then type some parameters.

https://en.wikipedia.org/wiki/Apollo_Guidance_Computer

I like this replica of the DSKY.



What a far cry from a mouse and GUI, but it got the job done.

Can you imagine what it was like having errors show up on this computer during the mission? And all you've got is a bunch of lights and numbers to look at on the display.

http://www.doneyles.com/LM/Tales.html

and there's a javascript AGC simulator Moonjs at http://svtsim.com/moonjs/agc.html

Saturday, September 3, 2016

Triple monitor cards

I was looking at the frys ad today and saw that they have a GT710 that will support 3 monitors simultaneously.

I have systems and video cards that have 3 different outputs but only 2 crtcs which means that they only will output to 2 monitors simultaneously.

The Optiplex 760 has displayport, VGA, and I chucked a low profile ADD2-N card in there for a DVI output, but the integrated video will only support 2 of 3.

That third output just taunts me...

I've got another video card around here that has 3 heads, but it'll only do 2 outputs as well.

There ought to be a law that says if you've got 3 heads, that they all work...



From this review:
http://www.pcadvisor.co.uk/review/graphics-cards/evga-geforce-gt-710-review-3639185/

"The EVGA GT 710 gives you one each of VGA, HDMI and DVI-D outputs. The card can output on all three ports simultaneously for multi-monitor setups, although sadly there’s no DisplayPort available."

Friday, September 2, 2016

Adding a mode to xrandr

I was trying to use an HP w19b with my old dell inspiron laptop e1505 with a vga output. But for some reason knoppix can't seem to bring up a resolution greater than 1024x768.

So after some searching I found this page:

http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

The top res for the HP w19b is 1440x900 so

cvt 1440 900

gives me:

# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync

xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
xrandr --addmode VGA-1 1440x900_60.00
xrandr --output VGA-1 --mode 1440x900_60.00


what's kind of cool is that once I add the mode, it will show up in the ARandR gui tool as well.

xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA-1 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.00*
800x600 60.32 56.25
848x480 60.00
640x480 59.94
TV-1 disconnected (normal left inverted right x axis y axis)
1440x900_60.00 (0x1aa) 106.500MHz
h: width 1440 start 1528 end 1672 total 1904 skew 0 clock 55.93KHz
v: height 900 start 903 end 909 total 934 clock 59.89Hz



Just for fun, I thought I'd make some "nonstandard modes" just to see if they'd work.

I tried cvt 1200 900 and that worked, and cvt 480 900 and that worked too. 480x900 makes pixels 3x wide as high for a 1440x900 monitor. Looks trippy.

cvt 480 900
# 480x900 59.62 Hz (CVT) hsync: 55.69 kHz; pclk: 34.75 MHz
Modeline "480x900_60.00" 34.75 480 504 552 624 900 903 913 934 -hsync +vsync
xrandr --newmode "480x900_60.00" 34.75 480 504 552 624 900 903 913 934 -hsync +vsync
xrandr --addmode VGA-1 480x900_60.00
xrandr --output VGA-1 -mode 480x900_600.00


and I have this Haier 24 inch tv that only reports that it goes up to 1680x1050 in VGA mode. After making a cvt 1920 1080 mode is the first time I've been able to put 1920x1080 on the vga with it.

Thursday, September 1, 2016

Playing with the Maxitronix MX-909 CPU

Investigating the Maxitronix MX-909 CPU.

The Maxitronix CPU is quite interesting. It looks like a "simplified" processor that runs an interpreted machine language.

It has 6 registers, A through F, each a single byte.

Line numbers are used for addresses.

There's a limit of 64 instructions (or lines) in a program.
So you get to enter instructions from line 00 to line 3F.

There's 32 keys in the keyboard, arranged in 2 groups of 16 keys (4 keys by 4 keys).


The opcodes are:

MOV move data
IN read data from input port - 4 bits
OUT write data to output port - 8 bits
CMP compare data
JMP jump to an address
JC/JNC jump carry/no carry
JZ/JNZ jump zero/non zero
SEC/CLC set/clear carry
ROR/ROL rotate
INC/DEC increment/decrement
ADD
SUB
OR
AND
XOR
NOT
TM1/TM2 TM1=delay by param*10ms TM2=delay by param*1sec
HEX makes a data table entry of a single byte
BON/BOFF BON sets up a buzzer at a specific frequency on output pin 8, BOFF turns it off, used with TM1/TM2 to make a specific duration
STP stop
NOP no op

I count 28 different instructions.


The addressing modes are pretty simple too:

for the move instruction:

MOV reg,#n8 (the n8 means an 8 bit number), reg is A-F
MOV reg,reg
MOV A,@reg read from memory (indirection by register)

Interestingly, you can move from memory to the A register with register indirection (read from memory), but you can't store to memory.


so a sample program would be

00 MOV c,#80
01 MOV a,c
02 INC a
03 JMP 02

For some reason, they call registers "mem" in the manual, which seems a bit confusing, as I would normally interpret mem to mean memory.

It does look very much like machine language programming, and essentially it is.

It's pretty clever.

The debugger leaves something to be desired.
Once you put the CPU into debug mode, you choose a register to watch (b-f) or 0 (will show you the zero and carry flags in the digits displayed).

So you get a display that shows you the current contents of A and another register of your choosing.

for example:

line A reg B-F reg
00 A 00 C 00

and pressing RUN gets:

01 A 00 C 80

and pressing RUN again gets:

02 A 80 C 80



You can single step through by pressing RUN, but here's the annoying thing: you can't change the register displayed. So once you've chosen to show register B, you get register B until you've exited the program.


STACKED INSTRUCTIONS:

There's some advanced stuff here too like what they call "stacked instructions" in the manual.

If you have multiple identical immediate MOVs in a row, only the first one will be executed.

So if you have

20 MOV C,#20
21 MOV C,#21
22 MOV C,#22
23 MOV C,#23

and you execute a JMP 21, only the first MOV C will be executed, and the following ones will not be executed. So JMP 21 will give you the value #21H in register C by the time the program counter hits 24.

The BON instruction can be "stacked" too.

10 BON #01H
11 BON #03H
12 BON #05H

has the same behavior. Here JMP 11 will execute BON #03H and will skip any sequential following BON instructions.

So what happens when the CPU hits an empty instruction? Execution stops and you get ILL on the screen.

Data entry of programs is fairly straightforward, but there are some interface annoyances. For instance, once you lock in a specific opcode, you have to enter the parameters fully before you're allowed to go back and change the opcode. So if you choose MOV _,#__ as your opcode, you have to provide the register and the immediate value before you can do anything else. You should be able to press left arrow and change it immediately but you're not allowed to do that.

Another is that you have to press the down arrow to "lock in" the instruction even after you've entered all the parameters. Failure to do so makes the instruction disappear when you type ESC to change the cpu mode from Program to Debug.

There's no saving or loading your creations so when the power is off, your program disappears. It's only intended for small programs anyway, so this isn't a huge drawback.

It'd be really neat to have a full dot matrix LCD with being able to PRINT things to the display, but the focus is on interfacing with external components in the kit, like the LEDs and the 7 segment display.


If you want to see a sample of the manual, here's a sample (and shows project #470 and #484).

http://www.elenco.com/admin_data/pdffiles/MX909.pdf

Man finds himself the only passenger on the plane

http://www.wsbtv.com/news/national/hot-topics/atlanta-man-boards-flight-discovers-i-am-the-only-person-on-this-plane/357705663#

http://www.usatoday.com/story/travel/flights/todayinthesky/2016/06/24/delta-flier-only-passenger-160-seat-md-90/86327662/

Sounds like an episode of the Twilight Zone. Or maybe the rapture happened and he got left behind.