Monday, March 26, 2012

Hitachi 26AX10BC chassis M1CLUX-H TV vertical foldover fix

This is a Hitachi CRT TV from 1995, model 26AX10BC with chassis M1CLUX-H. When first turned on, the top of the image is vertically stretched, upside down, and overlapping at the top of the screen. This means the vertical retrace does not finish before it's time to start displaying the next field. It's called vertical foldover. Here's a picture. (Sorry, it's just a blue screen, so you can't see how the overlapping part is upside down.)
After a few minutes, the problem area starts shrinking, and after about 10 minutes it's gone. However, it always comes back if the TV has been off for a while. This makes it seem like the problem goes away when some component warms up.

It's an easy fix. However, note that the internals can retain dangerous voltages even when the TV is off. They could maybe even kill you. Make sure you understand what you're getting yourself into. Read about the risks and how to stay safe, intelligently decide whether to do this yourself, and be very careful.

The back is pretty easy to remove. Many screws around the edge connect it to the plastic front, and three screws above the back connector panel connect it to the main board assembly. The TV can stand on just the plastic front, so the back can be removed while it is upright. I kept it near the edge of a workbench. This allowed access to the screw at the bottom, and when the back was removed it allowed access to the bottom of the main board. That position seems precarious, but the TV is not too close to tipping over. Make sure that the table is not close to tipping over. Also, when removing the back, make sure that it does not fall and strike the board at the back of the picture tube neck. If you need a service manual, the 27AX5BX manual will probably suffice.

Here is a the main board. It is on rails, and held to the front plastic with two screws at either side. If you unscrew those, you can slide the board out a bit for better access to the bottom. It's worth doing that, because working on the bottom is much easier then. You could even unplug cables and take the board out, but it's not necessary for access to the vertical deflection circuit.
The vertical deflection chip is attached to the C shaped heat sink that's just above where the red high voltage cable bends first after exiting the flyback transformer. Here is a closeup of the area:
You can easily see the brown ring on the top of C625 (47µF/16V) the closest electrolytic capacitor on the right inside the heat sink. That's electrolyte leakage and the capacitor is bad. Another suspect is C627 (100µF/35V on the schematic, with a 50V capacitor installed) the larger and darker capacitor to the left near the nut and bolt attaching the chip to the heat sink. There is a darker area on the circuit board below, like a puddle.

C627 is the pump-up capacitor for the LA7838 vertical deflection chip, and it is the main suspect. It is part of a charge pump. The chip first connects the capacitor to the power supply to charge it, and then it connects the capacitor in series with the power supply, to provide twice the power supply voltage. This higher voltage is used to quickly move the beam back to the top. A problem with the capacitor will mean less power is available for moving the beam back to the top. This will slow down the move, and the beam won't be able to reach the top before it's time to start displaying the next frame. C625 The small capacitor with the brown ring is a power supply filtering capacitor. It could contribute to the problem if the power supply dips when the vertical deflection chip uses a lot of current.

When I looked under the board, I saw a surprise. The trace between the pump-up capacitor and the chip was missing, and one of the capacitor leads was used to make the connection. This plus the different look of C627 made me wonder if this was a previous repair. Could the pump-up capacitor be good, and could the puddle-like mark on the board be from a failed previous pump-up capacitor?
The Yubright capacitor brand and the nature of the failure made me curious, so I tested the ESR of the pump-up capacitor. Although the capacitor still had most of its capacity, the ESR was ridiculously high, and so the capacitor was obviously bad. There was no need to test the small capacitor, because it was leaking badly. After I removed it, there were drops of electrolyte on it.

After cleaning the board and replacing C625 and C627, the TV worked properly. I chose to not replace more capacitors. Yes, it's probable that some other ones are degraded, but there are very many and it's not worth the effort. The real problem here is that a lot of electrolytic capacitors are located very close to heat sinks. Hitachi even used 85°C capacitors there!

Plex Media Server DTS transcoding fix

Plex Media Server 0.9.5.3 unnecessarily transcodes video when transcoding audio for LG clients which can't play DTS. This increases CPU utilization, and it can cause buffering pauses in video if the CPU isn't fast enough. The issue has been in the Plex forums in this thread and others.

This solves the problem. When "Plex Media Server.exe" runs another executable, the attempt is intercepted, and the command line is changed, as described by enachemc on the Plex forum. The command line change tells the transcoder that the device can accept H.264 video at up high profile, 1080p, and level 4.1.

The interception is done using Detours from Microsoft Research. I chose Detours 2.1 because I had problems with Detours 3.0. The code is compiled from PlexTranscodeDetour.c, creating PlexTranscodeDetour.dll. That DLL needs to be inserted into the "Plex Media Server.exe" process. I recommend insertion via withdll-silent.exe. It supports the same switches as the ordinary Detours withdll.exe, but doesn't open a console window. For example, if Plex Media Server is installed in "C:\Program Files\Plex\Plex Media Server" and these files are in "C:\Program Files\Plex\PlexTranscodeDetour", then you can change the Plex Media Server shortcut target to:
"C:\Program Files\Plex\PlexTranscodeDetour\withdll-silent.exe" "/d:C:\Program Files\Plex\PlexTranscodeDetour\PlexTranscodeDetour.dll" "C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe"

I am also including an unmodified withdll.exe, which produces diagnostic output to the console. You only need to try that if you have problems. Alternatively, you could maybe edit "Plex Media Server.exe" to include the DLL via setdll.exe. I don't know if that works.

I recommend using Microsoft compilers such as Visual C++ from Visual Studio Express 2010. Detours does not come with binaries, and if you want to compile it, you must use a Microsoft compiler. You can't even statically link with detours.lib from the GNU toolchain because the linker cannot resolve some of the symbols in detours.lib. If you want to use the GNU toolchain, you can use the instructions I posted earlier to create a detours.dll that you can use. I felt forced to use Visual Studio Express because I didn't think I was allowed to distribute the detours.dll that I created using those instructions.

You can download PlexTranscodeDetour from Dropbox. You are free to do whatever you want with my code here. Detours components are distributed according to the license from Microsoft Research. This code and program comes with absolutely no warranty. Use at your own risk.

Monday, March 12, 2012

Honda keys suck

The battery contacts are covered with grease which results in a bad connection. What at first seems like bad buttons on the module or a low battery is more likely that problem. The positive connection is made by the two contacts at the top of the right half touching the gold pad at the top of the left half. The negative connection uses four contacts in the centre of the left half which touch the battery. All of these are covered by the grease. You can easily see the four grease spots on the battery, and if you look at the full resolution photo, you'll also be able to see grease on the other contacts.

Unfortunately, to fix the problem you need to unscrew the small screw which holds the key halves together. The threads are coated with blue thread locking fluid. If that's Loctite, it's supposed to be possible to disassemble using normal tools. Unfortunately it's not very easy. You need a good screwdriver that fits well, a lot of downward force to prevent slipping, and strong turning force. Heating the screw with a soldering iron might help, and if done carefully, it doesn't seem to damage the plastic. I first got the screw to turn a bit, but it wouldn't go any further. What finally helped was spinning the screw back and forth a bit continuously while unscrewing.

This is a ridiculous design. Changing a battery shouldn't be that difficult. This deserves a recall.

If you want more information on the procedure, here's another guide. The only other tricky thing I encountered was separating the two key halves at the key ring end. They refused to simply pop apart, but wiggling from side to side (ie. rotation around the axis through the key ring hole) allowed the halves to separate. The battery is a CR1616. Some parts of the photo are blacked out because I don't know if any of those numbers are codes for remote unlock or the immobilizer.

Tuesday, February 14, 2012

Impressive iPod battery life

I just replaced the battery in my 30 GB 5th generation iPod. The decreased play time with the old battery wasn't a problem for me, but the increased internal resistance was. Combined with the higher internal resistance at low temperatures, it could cause a shutdown even if the battery was over half full and the temperature was well above freezing.

There are many choices, many different prices, and little information on what's actually good. After some research, I decided to buy a 580 mAh battery from richmondliu88 on eBay for $3.99.

It arrived in Canada in under 2 weeks. The battery was packed in plenty of bubble wrap, and it arrived with two blue plastic tools. The tools made it easy to open my iPod, and they weren't destroyed by the process. It was easier to open the iPod because of past openings, but nevertheless, it seemed like the tools were of above average quality.

I just measured the battery using Rockbox battery_bench. First, I charged it until current in the battery debug screen dropped to zero. For the test, I played Dark Side of the Moon in MP3 format, encoded with LAME using preset standard, with repeat all enabled and JPEG album art. I tested it using my typical listening conditions, with the EP-630 headphones, an inline volume control which raises resistance to 70Ω, the screen off, and hold on. I'm running the PP502x cache bug and ATA DMA test build, which is based on e362e34. The battery lasted an impressive 19 hours and 45 minutes.

Here are some photos of my battery. The same eBay item currently shows a different looking battery. Note the paper on the back, which needs to be peeled back to uncover a sticky area for attaching the battery to the iPod back. It's a nice touch, although it was unnecessary for me because the glue that was already present on the iPod back was very sticky and hard to remove.

 

Wednesday, January 25, 2012

In OS X, SDL only delivers messages to the first thread?

I was trying to get a Rockbox simulator working in OS X. After dealing with a bunch of other issues, I got an executable which displays a beachball cursor and doesn't respond to input.  I found a post that claimed events sent to the app are only dispatched to the main thread. Then I rearranged code so the main thread initializes the video and handles messages and input worked properly.

The SDL documentation claims SDL_WaitEvent() can only be called from "thread that set the video mode". This is apparently not a sufficient condition for OS X.

Tuesday, January 24, 2012

The Linux desktop still dissapoints

I used to use Linux as my main OS from 1995 to 1999. Back then, Windows was an unstable piece of garbage, and I liked Linux. In Linux I faced relatively few problems, and it was possible to solve those and have a good stable system.

Windows became good starting with Windows 2000. It was stable, it ran software that had no Linux equivalents, and it had a decently designed GUI. Windows continued to get better, and I'm now very happy with Windows 7.

Starting about a year ago, I tried out various Linux distributions including Mint 10, Mint Debian Edition, Debian Testing, Xubuntu and Ubuntu. Overall, I'm disappointed. The Linux desktop still can't compete with Windows.

I used to think that free software had great potential because the ability to reuse components and code makes software development much more efficient. Instead, I see countless alternatives for the same thing, and re-implementations which replace good software with works in progress. As a result, the Linux desktop doesn't improve very much and new problems appear constantly.

The best current example is Gnome. Version 2 was inferior to Windows in some ways, but it was good enough and usable. Then, it was dramatically changed, stripping out many features, and even removing the ability to use other software such as XScreenSaver and Compiz. Some parts of the Gnome 3 user experience are an improvement, but overall it is not an improvement because of what was removed. This resulted in Gnome forks, and maybe also Unity.

Here's a list of some other things I encountered in Linux:
  • Linux Mint is not upgradeable, or maybe it's upgradeable but a clean install is highly recommended
  • Linux Mint Debian Edition has been holding back updates for months, despite claiming to offer a "rolling distribution based on Debian Testing".
  • Writes to slow USB devices hang other file system accesses
  • Gnome 3 won't automount devices in Debian Wheezy
  • The suspend button suddenly stopped working in Xubuntu
  • Compiz crashes a few times at startup
  • Thunar won't warn when copying files into a destination with insufficient space
  • Thunar shows errors when unmounting removable devices
  • Debian Wheezy comes with ugly default configurations and horrible font rendering
  • The XScreenSaver screen unlock dialog locks up, requiring a kill -9 from another console. The dialog is also ugly and primitive.
  • Sometimes XScreenSaver locks the screen even when told not to
  • The Xfce applications menu is worse than Windows 95. It doesn't have editing functionality, and it silently ignores *.desktop files that are accepted by other parts of the system.
  • In Debian and Ubuntu, Audacious comes without the ffaudio plugin, so it doesn't support APE and some other formats.
  • Audacious changed the plugin API, so it can't use plugins written for an old version
  • Compiling things is a pain because of all the dependencies. For example, Audacious 3.2 requires very recent versions of libavcodec and huge numbers of other stuff
  • Several distributions choose and integrate Empathy as the IM client, even though it lacks important features.
  • Several distributions won't automatically disable the nouveau driver when installing the Nvidia driver, leading to a lockup
  • The Xfce desktop icons aren't managed by the file manager, leading to all sorts of inconsistencies
  • mintMenu has various bugs and bad design choices which make it harder to use
  • The Gnome 3 time setting dialog won't report time sync problems
  • Xfce doesn't seem to offer a way to change default PulseAudio devices
  • Many less popular packages are old or broken
  • Many things don't work in OpenJDK, which is the default, and Oracle Java locks up Firefox when Adblock Plus is enabled.
  • Shutdown and restart doesn't work from the Xubuntu login screen
  • Distributions may silently insert customizations into my Firefox profile even if I copy the profile from Windows.
  • Improper display of some partially transparent images in Firefox
  • Package setups which make it hard to uninstall applications which were installed by default
  • Default application setting screens which don't work
  • Ability to customize the same thing separately in two different places, resulting in a conflict
  • Limited drag and drop support and context menu support
  • Debian still prompts in the middle of the install process
  • A bunch of programs can automatically change desktop backgrounds, but none are as nice as what's built into Windows and OS X
  • Trash can't be disabled on a device
  • Mysterious Samba failures
  • The r8169 driver is broken in Linux Mint Debian Edition, requiring a manual install of the r8168 driver from Realtek, with some Makefile editing
  • In every distribution I tried, the fonts installed by default make many websites look terrible
  • Gnash is installed by default, even though it doesn't work very well and Flash is is used in many places on the web
  • In Thunar, the there's a very subtle difference in appearance between mounted and unmounted volumes. Unmounted volumes even have the eject icon.
  • When unmounting, Xfce notifications that data still needs to be written sometimes remain on the screen.
  • Ubuntu Software Centre shows some applications twice
  • I can't drag things to the Xfce Quicklauncher. Also, it crashes.
  • Xfce theming is not coordinated, so for example some themes make tray icons almost dissapear.
  • Samba sometimes fails to see or talk to shares which work from Windows. It even had problems talking to an older version of Samba.
  • KDE can't properly set GTK themes. They can be set manually, but KDE will overwrite the configuration file. GTK apps look very ugly in KDE without an appropriate theme.
  • Font kerning is sometimes crazy. For example, Tr can be too close together.
  • Font hinting is bad. Full hinting looks ugly in some popular fonts.
  • The KDE bouncing icon animation sometimes continues for far too long
  • I told Ark to extract to an smb:// path and it instead extracted elsewhere
  • Synaptic doesn't allow custom filters to be removed
  • Aptitude concludes a package conflicts with itself because it provides something it conflicts with. As a result, Aptitude wants to uninstall most things.
  • fsck.vfat is "unable to create unique name" unless certain options are given, and it may not fix all problems on the first run.

Thursday, January 19, 2012

Clutterbar fix for n3ON - v 1.0 skin for Winamp

n3ON is my favourite Winamp skin. I've used it for several years, and I'm not getting bored with it. I still feel it's attractive and even beautiful.

When I tried to use it with Audacious 3.1.2 in Linux, I got a white box to the left of the time display and visualization area. This is because n3ON does not provide an image for when the Clutterbar is hidden. The problem can be reproduced in Winamp by unchecking: Preferences -> Skins -> Classic Skins -> Classic Skin Options -> Always
show Winamp "Clutterbar" in main window. This part of the skin is documented on the Winamp wiki. (There it is called the CuttleBar.)

You can download a fixed n3ON skin.

I also created an alternate fix which keeps the same appearance even when the Clutterbar is hidden. It is not useful for Winamp, but it could be useful for other applications which can't show the Clutterbar. To use it, extract the .wsz (which is just a zip file) and replace TITLEBAR.bmp with the one from the alternate fix zip. You can then simply move the n3ON directory into the Skins directory.

n30N was created by deaddreamer, Wilhelm Steiner. He gave me permission to distribute this fix. Note that what I did is just a tiny bit of work; all the credit for this skin goes to him.

Wednesday, January 18, 2012

Don't try prelink in Debian

Prelink modifies executables and shared libraries on disk so they don't have to be modified every time they're loaded into memory. This should speed up program startup.

Unfortunately, I just tried it in Wheezy on amd64 and it's very broken. An attempt to do a prelink stops with an assertion failure. This could be avoided, if you figure out the what packages need to be excluded. In any case, you're left with an even more serious error: it can't undo many changes because it finds overlapping sections.

I'm disappointed that such a package is available in testing. The same package version can even be found in stable! If someone really wants to play with something this broken, they ought to have to get it from experimental.

Fortunately, this is easy to fix using debsums: simply find modified packages and reinstall them. I used: sudo debsums --changed --no-prelink | xargs dpkg --search | sed "s/:.*//" | sort | uniq | xargs sudo apt-get --reinstall install