Thursday, November 29, 2018

Why some USB WD 4TB and above don't work on windows 2000

I have a hard time letting go of my old systems. I don't hook it up to the internet anymore but I keep my old windows 2000 system running since it's all set up the way I like it and it runs sweetly in 1GB.

Anyway, I digress, I would try some USB WD 4TB drives on this system and some would work and others wouldn't work at all.

I finally found the answer.

It has to do with old style DOS partition tables and 512 byte sector sizes.

See, an old style DOS partition table would hold a 32 bit value for the number of sectors, that being 2^32 or 4G sectors.

Now the old hard drives had 512 byte sectors so the max partition size would be 2^32 * 512 bytes = 2.1 TB or 2TB.

If we had a 4096 byte sector, the max partition size would be 2^32 * 4096 bytes = 17592186044416 or 16TB.


I had one drive that didn't work under windows 2000 and plugging it into a linux box, "fdisk -l" told me that it had 512 logical but 4096 physical. So it's actually 4096 byte sectors but it's pretending to be a 512 byte sector for compatibility.

So how to get it to do the 4096 byte sectors? Use the WD Quick Formatter utility:


How to format external drives using WD Quick Formatter in Windows ...

https://support.wdc.com/knowledgebase/answer.aspx?ID=3868

If you format the drive in "XP Compatible" mode it will put the drive into a 4096 byte sector size.


After running the utility and plugging it into a linux box, fdisk tells me that this is a 4096/4096 drive.


Doing this to a 10TB drive WD from bestbuy's black friday sale...

Disk /dev/sdc: 9.1 TiB, 10000831348736 bytes, 2441609216 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xd841c1a1

Device Boot Start End Sectors Size Id Type
/dev/sdc1 256 2441609215 2441608960 9.1T 7 HPFS/NTFS/exFAT


One mystery solved that has bothered me for a while.

Monday, November 26, 2018

Extending a short pencil with a piece of paper

Here's an idea: You take a piece of paper and use it to make a short pencil longer.

Just take a small piece of paper and wrap it tightly around a pencil, then use a piece of tape to fasten the roll so it doesn't unroll.




Ta da! Instant longer pencil.





And you can do lots of variations.



You can even do things like join two short pencils with a paper roll cylinder.

Experiment!

Making labels for the stove

One of the things I always seem to mess up is which burner goes with which switch. Is it the front burner or the back burner? I don't know why I always seem to get it wrong. So I made some P-touch labels to help me out.

I just use the arrow tip from the Wingdings font (using the Character Map accessory to find the right character to paste) and then make a solid box in the P-touch editor for the long part of the arrow.

Now I don't have to think so hard, I can see which burner goes with which switch at a glance.

Thursday, November 22, 2018

Solar charging up my Logitech K750 keyboard without the sun

I've got one of these Logitech K750 keyboard with solar panels on it, but I really don't have sunlight in my computer room.

I take one of my desk lamps and move it very close to the top of the keyboard's solar panels. That seems to work pretty well since it has one an LED bulb. You probably wouldn't want to get it too close to an incandescent bulb because of the heat.

I also tried it with my solar ikea "sunnan" desk lamp to charge up the module. It also works with my solar keychain light.

Sure it's a bit inefficient but what do you do in the winter when the sun isn't shining?

https://www.quora.com/Can-you-charge-a-solar-cell-by-using-a-light-bulb-or-LED

Friday, November 16, 2018

Got a Ptouch PT-18R - does it have Factory Mode? Yes.

I got a Ptouch PT-18R which is a pretty neat little unit. It's very compact which is nice. It's not that much bigger than the print cartridge, and it has an auto-cutter and USB PC interface.



Unfortunately, I didn't get the rechargeable battery or the charging dock with it, but I don't really need it anyway since I run it off an AC adapter.

It doesn't turn itself on when you print from the computer so you have to make sure to turn it on.

And it has "Factory Check Mode".

Power up with CODE+R to reset the settings, turn it off, the power up with CODE+K and you should be in factory check mode.

1 HEAD C / volt X ACSENS O
2 Country Set
3 Display check
H pattern
checkerboard
checkerboard inverted
solid black
LCD adjust from -4 to +4 with up/down arrow keys
4 Cassette pins
5 Cut
6 Key
7 Print 1
8 Print 2
9 Motor
0 ACSENS X AD CHECK START
E Encoder (num keys to exit) (1zx to exit to FACTORY CHECK)
U USB ID DSP (usb id display) (ESC to exit)
H H-C Len 158 (???) (ESC to exit)
V Version Info MAIN 1.01 CHAR SET .77 BOOT .77 (ESC to exit)


It's interesting that ESC or Backspace doesn't always exit from some option, from the Encoder I have to type 1ZX (that's 1 (number one) Z X) to get back to FACTORY CHECK. The state machine navigation is a bit inconsistent.

My 4k TV doesn't support resolutions between 1920x1080 and 3840x2160

My Vizio d50u-d1 will do 4k but doesn't seem to like anything in between 1920x1080 and 3840x2160 displaying NO SIGNAL.


I wish it'd do

1.33x = 2560x1440 or
1.5x = 2880x1620 or
1.66x = 3200x1800

but it doesn't like those resolutions at all.

I thought I'd also try an interlaced signal at 3840x2160 that would allow 24hz to go to 48 hz.

$ ./cvt 3840 2160 48 -i -r -x

# 3840x2160 @ 48.00 Hz Interlaced Reduced Blank (CVT)
# field rate 48.00 Hz; hsync: 53.06 kHz; pclk: 212.25 MHz
Modeline "3840x2160_48.00i_rb" 212.25 3840 3888 3920 4000 2160 2163 2168 2185 Interlace +HSync -Vsync

$ xrandr --newmode "3840x2160_48.00i_rb" 212.25 3840 3888 3920 4000 2160 2163 2168 2185 Interlace +HSync -Vsync
$ xrandr --addmode HDMI-1 "3840x2160_48.00i_rb"
$ xrandr --output HDMI-1 --mode "3840x2160_48.00i_rb"

Sadly, "NO SIGNAL" was the result.

Oh well, it can do 25hz at 3840x2160 rock solid on my integrated intel graphics 2500 so I'm still happy. I sit in front of that 50" 4k screen and I feel like Tiny Elvis. Man, that thing is huge!

Tuesday, November 13, 2018

Dune BD Prime 3.0 works well with USB wireless keyboard

I got this cool Dune BD Prime 3.0 combo blu-ray disc and media player without a remote but I got it to work with a USB wireless keyboard.

Here's a list of what I could get to work:

while the player is running:

vol +/- and mute buttons work

ff, rew work

arrow keys and enter

A B C D =f9 f10 f11 f12

select = insert or f4

number keys = track number (type them quickly for a two digit number)

end = return to menu

A = audio sync
D = subtitle on/off (doesn't work unless you first activate subtitles)

menu key on keyboard works to bring up menu (the context menu key next to the right control key)

f5,f6 = angle
f3 = goto time

scroll lock = deinterlace settings

double hit of delete key acts as though you reloaded the disc

ESC = drop out of menu

f1 = info

pause = pause

music button = audio track


I wish every media player would work with a usb keyboard.

It'd also be great if they could add a few more keystrokes to make it more functional and ergonomic, like greater than and less than could do 2x/4x/8x forward/reverse play, s could cycle through available subtitles, spacebar could be play/pause, etc. Just a few additional keystrokes would make a huge difference in usability.

Monday, November 12, 2018

Trying out 4096x2160 resolution

I thought I'd run a "sudo get-edid | parse-edid" and see what my 4k tv actually says:

Note that it says maximum pixel clock is 300mhz since I'm connecting to one of the HDMI ports that maxes out at 4k@30hz.

sudo get-edid -b 5 | parse-edid
5
This is read-edid version 3.0.2. Prepare for some fun.
Attempting to use i2c interface
Only trying 5 as per your request.
256-byte EDID successfully retrieved from i2c bus 5
Looks like i2c was successful. Have a good day.
Checksum Correct

Section "Monitor"
Identifier "D50u-D1"
ModelName "D50u-D1"
VendorName "VIZ"
# Monitor Manufactured week 0 of 2015
# EDID version 1.3
# Digital Display
DisplaySize 1100 620
Gamma 2.20
Option "DPMS" "true"
Horizsync 15-80
VertRefresh 25-76
# Maximum pixel clock is 300MHz
#Not giving standard mode: 1920x1080, 60Hz

#Extension block found. Parsing...
#WARNING: I may have missed a mode (CEA mode 93)
#WARNING: I may have missed a mode (CEA mode 98)
#WARNING: I may have missed a mode (CEA mode 95)
#WARNING: I may have missed a mode (CEA mode 100)
Modeline "Mode 11" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 0" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync
Modeline "Mode 1" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 2" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
Modeline "Mode 3" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
Modeline "Mode 4" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
Modeline "Mode 5" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline "Mode 6" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline "Mode 7" 74.250 1920 2008 2052 2200 1080 1082 1087 1125 +hsync +vsync interlace
Modeline "Mode 8" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 9" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
Modeline "Mode 10" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 12" 74.25 1280 1390 1430 1650 720 725 730 750 +hsync +vsync
Option "PreferredMode" "Mode 11"
EndSection


and I wondered what the CEA modes meant:

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

has a nice table that says that mode 100 is 4096x2160@24 for CEA mode 98.

So let's see if we can set that up.

I downloaded cvt.zip from riscosports.co.uk and compiled it with:

gcc cvt.c -o cvt -lm

and then used it to get a modeline for 4096x2160@24

./cvt

Description: This program generates video timing descriptions using formulas
from the VESA "CVT" (Coordinated Video Timing) v1.1 specification, based
itself on the earlier VESA "GTF" (Generalized Timing Formula) v1.0
specification.

usage: ./cvt x y refresh [-v|--verbose]
[-r|--reduced-blank] [-i|--interlaced]
[-f|--fbmode] [-s]|--romode] [-x|-xf86mode]

x : the desired horizontal resolution (required)
y : the desired vertical resolution (required)
refresh : the desired refresh rate (required)
-v|--verbose : enable verbose printouts (traces each step of the computation)
-r|--reduced-blank : use "Reduced Blanking" timings
-i|--interlaced : generate an Interlaced video mode
-f|--fbmode : output an fbset(8)-style mode description
-s|--romode : output an riscos-style mode description (this is the default
if no mode description is requested)
-x|-xf86mode : output an XFree86-style mode description


./cvt 4096 2160 24 -r -x

# 4096x2160 @ 24.00 Hz Reduced Blank (CVT)
# field rate 23.98 Hz; hsync: 52.40 kHz; pclk: 223.00 MHz
Modeline "4096x2160_24.00_rb" 223.00 4096 4144 4176 4256 2160 2163 2173 2185 +HSync -Vsync


xrandr --newmode "4096x2160_24.00_rb" 223.00 4096 4144 4176 4256 2160 2163 2173 2185 +HSync -Vsync
xrandr --addmode HDMI-1 "4096x2160_24.00_rb"
xrandr --output HDMI-1 --mode "4096x2160_24.00_rb"

and it works, the only thing I notice is that there is one vertical pixel line that seems a little weird in the middle, repeating a couple of pixels otherwise it looks great.. The native resolution of the TV is 3840x2160 so I would expect a few lines to be dropped.


Here's a bunch of reduced blank cvt modelines for different hz values so I don't have to fire up cvt again if I want to do a little experimenting.



4k split screen clone test

Ok, so I can make a double tall scrolling screen, let's see if we can get a side by side clone view going.

I go into ccsm and make an output region that's 1920x2160 for the upper left quadrant, a 1920x2160 for the lower left quadrant, and a 1920x2160 for the upper right quadrant, then just use the compiz clone to clone the lower left quadrant into the upper right quadrant. Just Shift+WIN (super) click and drag on the lower left quad and drag up to the upper right.

I open my browser window and resize to fit and voila, I can see the upper left quad and lower left quad at the same time. Scrolling the webpage with the scroll wheel updates the clone as you'd expect.

The video drivers and compiz don't refresh the screen properly and it flickers sometimes, and there's some weird double/triple buffer jitter effects. It would be awesome if this were seamless.

It also helps to have a "regular" 1920x1080 monitor as your primary monitor on the left when you're messing around with additional screens.



So now you can view a double tall webpage in a "two page view".




A screenshot of the entire screen shows my regular 1920x1080 monitor area on the left, the left side 1920x4320 region and the upper right 1920x2160 region that is cloned from the lower half.



Panning a double high 4k screen with xrandr

I wanted to see if I could make a double high 4k screen and pan up and down.


xrandr --output HDMI-1 --panning 3840x4320+1920+0 --fb $((1920+3840))x$((2160*2))

I've got a 1920x1080 regular HD monitor on the left and a 4k monitor on the right.

The screen size gives me 3840x4320 (double high 3840x2160) with an offset of +1920+0 to position it to the right of the 1920x1080 monitor.

Then we set the size of the framebuffer to 5760x4320 using bash to do a little math for us, but putting a math expression in between a dollar sign and double parenthesis $(( )).

After I execute this, xrandr reports these stats, I guess I could go up to a maximum 8192x8192 framebuffer size.

xrandr
Screen 0: minimum 320 x 200, current 5760 x 4320, maximum 8192 x 8192
VGA-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 521mm x 293mm
1920x1080 60.00*+
...
HDMI-1 connected 3840x4320+1920+0 (normal left inverted right x axis y axis) 1096mm x 616mm panning 3840x4320+1920+0
1920x1080 60.00 59.94 24.00 23.98
1920x1080i 60.00 59.94
3840x2160_24.00_rb 24.00*
...

It's interesting to see the output lines in ccsm, they get updated to reflect the new size when detect outputs is checked.



https://sfxpt.wordpress.com/2011/02/02/panning-using-xrandr/

Saturday, November 10, 2018

Splitting the 4k tv into sections

So I was using a firefox web browser on ubuntu 18.04 displaying on the 4k tv and it seems that most webpages don't use all of the screen real estate, tending to have a narrow band in the middle.

I wish that I could divide the monitor into 2 or 3 columns with a long web page. It should theoretically be possible to "reconfigure" a regular 3840x2160 monitor into 2 strips of 1920x2160 so that it could "pretend" to be a really tall 1920x4320 monitor, displaying the 2 strips side by side instead of vertically. That would be a neat trick.


Unfortunately, I've only figured out how to divide the monitor space into "regions" with compiz.

It's still pretty cool though.

You instal compizconfig-settings-manager and launch it with ccsm.

Click on General Options and go to Display Settings tab.

Then uncheck Detect Outputs and then modify the output lines.

I've got two monitors, one HD and one 4k monitor.

The first line is the left HD monitor, 1920x1080+0+0.

The second line is a vertical strip on the 4k monitor, 1920x2160+1920+0.
The third line is a 1920x1080 size block on the upper right side of the 4k monitor, 1920x1080+3840+0
The fourth line is a 1920x1080 size block on the lower right side of the 4k monitor, 1920x1080+3840+1080.




https://askubuntu.com/questions/1001444/virtual-split-screen-on-ubuntu



I also discovered the "Clone Output" compiz plugin which is pretty cool, I just install with "sudo apt install compiz-plugins-extra" and then run ccsm to enable the "Desktop/Clone Output" plugin, then use Shift+super+Button1 to activate (Shift+windows key) and click on the screen to clone and drag it to another screen. It works pretty well, resizing the window to fit the size of the other screen.

http://forum.compiz.org/viewtopic.php?t=123&f=114




Now if I could just make a super tall 1920x4320 virtual monitor and "clone" the top and bottom halves to the left and right halves of a 3840x2160 monitor.

Thursday, November 8, 2018

Got a 4k tv but my integrated video can't make a 4k signal...or can it?

Well, I finally got a 4k tv, but now I've realized that no piece of computer equipment that I have will make a 4k resolution signal...

Or so I thought...

I read this page about going to 3840x2160 resolution with cvt and reduced blanking and thought I'd give the modeline a go:



https://superuser.com/questions/1323967/how-can-i-set-display-resolution-to-3840x2160-with-intel-graphics-3000/1323969#1323969

Also I found some interesting stuff at: https://medium.com/@ValdikSS/how-to-use-high-resolutions-with-older-hardware-58577d91b1f8



Using the modeline from 3840x2160 24 reduced blanking and it works!!!

xrandr --newmode "3840x2160_24.00_rb" 209.75 3840 3888 3920 4000 2160 2163 2168 2185 +HSync -Vsync
xrandr --addmode HDMI-1 "3840x2160_24.00_rb"


I can play youtube at 1440p, 2160p seems to tax my system too much, and it looks beautiful!

Xrandr says that it's an HDMI port but it's a DVI port on the back of the computer and I'm using a DVI to HDMI cable.


lspci says I have

00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)

Ubuntu 18.04 says that I have a Intel® Core™ i3-3220 CPU @ 3.30GHz × 4 and my graphics are Intel® Ivybridge Desktop.

According to intel's website the i3-3220 has Intel® HD Graphics 2500.

I don't know exactly what the maximum pixel clock is for the HD Graphics 2500, but according to https://www.x.org/docs/intel/IVB/IHD_OS_Vol3_Part4.pdf Ivy Bridge it's limited to 225 mhz which is just above the 209.75 dot clock in the 3840x2160_24.00_rb modeline. I'll bet I could get 25 fps instead of 24 to fit just under 225 mhz. For now, it's totally stable so I'm really happy.

Wednesday, November 7, 2018

VBA subtleties

So I'm fiddling with VBA under an old version of Excel and I want to use the file system object.

First you have to "create" an fso with:


set fso = createobject("Scripting.FileSystemObject")


Once you do this you can start using ths filesystemobject.

We can get a folder reference like this:

set myfol = fso.GetFolder("TESTFOLDER")


and I've created a folder called TESTFOLDER that we can access in the same directory where I've put my excel file.

And let's try passing a folder variable to a subroutine.

sub test_passing_folder(afolder)
debug.print afolder
end sub


and we can call it with


ThisWorkbook.test_passing_folder(myfol)

and we get a result like:

G:\TESTFOLDER


printed to the immediate window.

but what is the actual type? Is it a folder or a string? Let's print the typename too.


sub test_passing_folder(afolder)
debug.print afolder, typename(afolder)
end sub


and lets call it with parentheses around myfol.

set myfol = fso.GetFolder("TESTFOLDER")
thisworkbook.test_passing_folder(myfol)

and we get this:

G:\TESTFOLDER String


but why is it a string?

because I put the subroutine call in parentheses which converted it into a string.

Now let's try calling it without parentheses:


set myfol = fso.GetFolder("TESTFOLDER")
test_passing_folder myfol

and we get

G:\TESTFOLDER Folder

I'm so used to calling functions in other languages where you wrap the parameters in parentheses that I naturally put them in, but in this case, it converts the folder into a string.

Here's a quick test that you can type into the VBA immediate window:

set fso=createoject("scripting.filesystemobject")
debug.print typename(fso)
FileSystemObject

ThisWorkbook.test_passing_folder fso.GetFolder("TESTFOLDER")
G:\TESTFOLDER Folder

? typename(fso.getfolder("TESTFOLDER"))
Folder
? typename((fso.getfolder("TESTFOLDER")))
String



Why does it convert it to a string? I think because the parentheses trigger a default conversion to Folder.Path. If you go to the Object Browser in VBA and find the Folder type and choose Path it will say in the description that Path is the default member of the Scripting.Folder object.


The other thing that I've got to remember is to use "SET" when dealing with objects.

fso=createobject("scripting.filesystem")

doesn't work.

You have to use the set keyword.

set fso=createobject("scripting.filesystem")