Wednesday, October 2, 2024

Give a Man a Fish, and He Eats for a Day. Give a Man a Singing Fish, and He'll Hate You the Rest of His Life

In this post, I will detail how I customized a Big Mouth Billy Bass animatronic fish to sing any song of my choosing.

Github Link for the lazy 

Video for instant gratification

My Annoying Life Story that Details Why I Decided to Do This in the First Place

Ever since my brother moved into his new house, I had planned to give him a classic Big Mouth Billy Bass audio-animatronic singing fish as a housewarming gift.

Billy Bass in an original box as I remember from the aughties

Alas, these have become rather scarce since they first surfaced in 1998. So, I cast my line to myriad online classified marketplaces and patiently waited for a nibble. At last, in the waning days of February, 2021, I got a bite on Kijiji (local classified ads). I purchased the fish after the seller assured me that it worked, and brought it home.
Billy Bass that I bought

I had landed what appeared to be a fine specimen. This project would ultimately teach me far more about Big Mouth Billy Bass singing fish than I ever thought I would want to know, and the first thing I would learn is the difference between ‘new-era’ Billy Bass fish and ‘legacy’ fish. The manufacturer modified their design several times throughout the years in efforts to cut costs. The most significant mechanical alteration was to reduce the number of motors from 3 to 2. This means that newer Billy Bass fish are unable to move their heads and tap their tails at the same time: the same motor controls both motions by switching its direction. The fish I’d caught was a second edition of Big Mouth Billy Bass Sings for the Holidays, manufactured in 2000. This means that it was one of the fish with 3 motors, and thus a superior range of motion. 

Alas, when I brought it home, I found that I had been misled. When I plugged it in (using the decidedly non-stock AC/DC adapter) and pressed the button, I was subjected to an arthritic performance that could be traced to a failed gear.

The gear is split and does not grip the motor shaft.

No matter, I thought, this will be straightforward to repair. At this point, I ventured into the very active genre of Big Mouth Billy Bass repair videos on YouTube. From these fine internet people, I learned how to properly fillet one of these singing fish to replace the cracked plastic gears. I tried 3D printing a gear, but the printer I have access to is not able to print at the required precision, so I wound up ordering two bags of gears from Amazon. Incidentally, please let me know if you live in Winnipeg, MB and are interested in ordering small plastic gears, I’ll be happy to share! 

Teach the Fish to Sing

Once the motion was repaired, I needed to set about changing the songs that the fish sang and danced to. This particular fish, being a Yule-themed variant, sang Appalachian-inspired versions of ‘Up on the Housetop’ and ‘Jingle Bells’. Neither of these arrangements synchronized particularly well with the fish motions, nor were they nice to listen to.

At this point, I knew I was going beyond merely repairing a broken tchotchke, and entering the fun company of Boston Dynamics and Disney Imagineers: I was going to program my own dancing robot.

Literature Review

At this point, I consulted the internet to review the existing Billy Bass conversion projects, and there are many of them! The most common deficiency that I observed was that many people would simply rip out the control board and try and control everything using commercial motor control boards (e.g. Arduino Shields or Raspi hats). I felt that this would be wasteful, and I may be able to control the motors using the existing transistor control circuitry. 

Here are a few notable works:

Animate a Billy Bass Mouth With Any Audio Source

I hacked a singing fish.

MBed Cookbook: Big Mouth Billy Bass This resource proved the most useful because it shows the pinout for the logic board (which I verified matched my specimen), and a useful software model.

Design

Being an audio-animatronics project, this design includes both hardware and software components.

Hardware

I selected a Raspberry Pi as the controller for several reasons:

  1. I had one handy, this would save money since I would not be buying any new hardware.
  2. It has a built-in card reader for storing audio files, and a built-in network stack to make it easier to add extra functionality later on.
  3. I could program it using Python. This would allow me to model the control software on my PC without needing to build the hardware first. I also wanted an excuse to practice Python :)
  4. It has sufficient processing power to play back high quality audio in real time, and allow for future feature expansion. In fact, it’s probably overkill.

I broke out the Billy Bass control board as described in the MBed article, and tested that the Python script on the raspberry pi could control the motors. This worked quite well. The audio on the other hand, took a little more doing. My original plan was to use the audio output from the Raspberry Pi to drive the same audio pin that the original Billy bass controller had driven. However, I discovered that the speaker driver in the Billy Bass enclosure expected a biased input signal, while the audio output from the raspberry pi produces a line-level differential signal. Therefore I decided to create a custom amplifier circuit from discrete components to drive the speaker using the line-level audio signal from the Raspberry Pi.

The Raspberry Pi audio signal cannot directly drive Billy's speaker


 

System Diagram

Software

Each song that Billy knows comes in two pieces:
  1. The audio file that is played: this is encoded as a wav file
  2. The set of motions that billy does along with the audio: this is encoded as a JSON file with a .mtn file extension.

The billy.py control script runs two threads: one plays back the audio file, and the second parses the .mtn file and schedules the motions to occur in time to the music. I also created a program to help author the motion files that Billy would process. This authoring program has been tested on a Windows PC, and includes an emulator to let the user make sure the motion files synchronize properly with the music.You can use the authoring program to generate different motion files for each of Billy's motors, then stitch them all together.

 

Authoring a motion file



billy.py

record-motion.py emulator.py

OS

Raspian OS on Raspberry Pi 1 (Armv6)

Any

Any

Purpose

Detect existing .mtn/.wav file pairs as they are added

When push-button is pressed, play back an audio file and animate Billy according to the matching .mtn file

Allow user to create .mtn files while a song plays back

Emulate the AP processor so the user can see if the timings for their AP file are correct

Playing the audio file was simple enough. Since I used a Raspberry Pi with Python, I thought that I could simply select a Python library for playing back audio files, and call it. This was easier said than done: I went through several audio libraries trying to find one that would work on both Windows and armv6 Linux. In the end, I wound up using different libraries for the emulator and the fish software (`playsound` on the Raspberry Pi and `playwav` on Windows). 

I presented the fish to my brother, and it was a big hit!

Look at him sing!

The software and appropriate instructions are available on Github.

 

 

 

 

 

 

 

 

 

 

 

 

 

Sunday, September 8, 2024

Waking up a Lumia 800

Long time, no post...

Normally I wouldn't bother to write up something this specific, but a like-minded person on Reddit wanted some help with this issue, so here goes. Out of respect for your time, I'll start with observed symptoms, then describe the fix that worked. The meandering details of all the things that didn't work will come after.

Symptoms

The observed behaviour was that my phone would not power on. Plugging it in to charge would have no effect, other than the phone vibrating periodically. In my case, it was every 8-ish seconds. Occasionally the carrier logo would flash, as if it was trying to boot, but that was all the activity I could see on the screen.

⚠ Safety First ⚠:If your device has been discharged for more than a few weeks, the battery health may have seriously deteriorated. The Lumia 800 does not use any adhesive to close off any of its components, so you can disassemble it yourself by following the instructions in this video. Double check that the battery is not puffy before continuing. If it is puffy, bring it to a facility equipped to dispose of batteries (for example, a big-box retailer such as Best Buy or MediaMarkt) instead of putting it in your household garbage.

What Worked

In my case, I was able to fully restore the phone to working order by doing 2 things: trickle-charging the battery, and re-flashing the Windows Phone 7 system image. I suspect that the trickle charging was unnecessary, but I mention it here for completeness.
 
⚠ Note ⚠: This process re-installs a fresh system image, so any data on your device will be lost.

Pre-requisites:

  1. I used a PC with Windows 10; I have no reason to think that Windows 11 wouldn't work. I experimented with some different software, so I used a fresh installation on a spare SSD that I had, rather than corrupting my daily Windows installation with potential malware.
  2. Download the Nokia Care Suite (https://windowsphoneonline.com/WinPhoneOnline/Tools/CareSuiteForStore-5.6.134.1513.exe)
  3. Download a firmware from from https://lumiafirmware.com/ I used the RM-801 as my phone had a little ‘801’ note under the SIM tray.from https://lumiafirmware.com/ I used the RM-801 as my phone had a little ‘801’ note under the SIM tray.

    I selected this firmware:


    Download all the files:
     

Procedure

Follow the following steps to re-flash  your Lumia 800. Do not connect your device to your computer yet.
  1. Install the Care Suite software. Open it, and launch 'Product Support Tool for Store'.
  2. Select File > Preferences > Data Package, and note where the application searches for data packages (that is, system images for Nokia devices). The default in my installation was
    • C:\ProgramData\Nokia\Packages\Products
  3. Create a directory in the data packages directory called RM-801, then copy all the files you downloaded in step 3 of the 'pre-requisites' section here. On my system, the files were copied to:
    • C:\ProgramData\Nokia\Packages\Products\RM-801 
  4. Now, click File > Open Product > RM-801
    • If you don't see the RM-801 device, click 'Update List' to refresh, and the application should detect the data packages that you copied over in step 3.
  5. Click Start and follow the on-screen instructions. You will be prompted to connect your device to your computer. Make sure you hold down the volume-up switch.
  6. Patiently wait while the image flashes to your device
  7. If your device has been discharged for a long time, it may take up to 30 minutes to 'wake up' the battery. Do not leave your phone unattended while this happens, and make sure it does not get hot to the touch (somewhat warm is to be expected). If you are particularly paranoid, you can leave the phone partially disassembled, so you can observe if the battery becomes inflated.
  8. Once your device boots into the Windows Phone 7 OS, proceed with setting it up. You can browse https://lumiafirmware.com for additional firmwares and utilities.

Meandering Details of Things that Didn't Work 

I began my search by reading XDA forum posts, and started with this one.

 
That post had some useful tips about using the Chimera tool to reset the modem, so I started down that road. Getting the vibe that the Chimera tool was kind of 'underground' (and brought along with it a LOT of device drivers), I elected to create a Windows 10 virtual machine that I could easily erase, and that I could use to keep my fresh Windows 11 installation squeaky clean. unfortunately, Chimera does not run nicely in virtual machines, so I would need to perform a fresh installation of Windows 10 on a clean SSD.

Once I had done that, I loaded Chimera up and... discovered that there are no longer trial versions of the software (so I would need to pay at least €120 for a license, even to run on a single device) and that even if I were to purchase a license, it would probably not work. Props to chimeratool for being honest about this.
 
 
The next option was to consider that the battery itself was defective. Seeing that batteries could be had for less than €10 on electronic-bay, I ordered one to test with and set about disassembling my device as shown in the linked video above. (watch out for videos that recommend unnecessarily destroying thing like the charge port cover!!) Swapping the battery yielded.... the exact same symptoms.

Finally, I set off down the path you see above. I do not recall how I wound up on the helpful windowsphoneonline website, but I am happy to recommend it here.
 
Thanks for joining me for this unnecessary adventure!

Post-script: What do I do with my recently-restored Lumia 800?

I find it quite helpful as a night-time podcast device, particularly to take on trips. It fits under my pillow, which muffles the somewhat loud speaker enough to avoid disturbing my wife sleeping beside me. I loaded it up with some podcasts and rain sounds via the Zune software (also available from windowphoneonline). Other than that, it's fun to swipe through the innovative Windows Phone 7 Metro UI and look at the ghosts of all the apps that don't work anymore, even as apps like Akruto Sync try to keep them relevant.