Alpine x305s vs iTunes

I recently purchased a new headunit for my car audio entertainment. The choice fell on an Alpine x305s model.
It belongs to the “media receiver” category: it can play music files from USB drives and iPods, but not CDs. It has no moving mechanic parts and therefore it’s less likely to break with intense use.

I mostly use it with a 32GB Sandisk USB Cruzer blade drive formatted as FAT32.

It works just fine and browsing the directories is really fast, even when loading thousands of files on the USB drive (the Kendwood headunit that I bought back in 2006 was much slower).

The headunit can read both MP3 and M4A/MP4/AAC-LC files. I copied my whole iTunes Library on the USB drive and tried to play it on the Alpine X305s. Unfortunately for many files I got the infamous “Unsupported file format” error.
I decided to examine these files to find out what they have in common and discover a possible common cause for the problem. It turned out that all these files had an encoding bitrate greater than 320Kbps. I searched the headunit manual and indeed the max supported bitrate for M4A files is 320Kbps.

Apparently at least half of the albums that you can buy on iTunes have a bitrate greater than 320Kbps.

If you are not tech-savvy you might just want to convert these files to MP3 using iTunes and be done with it.

If you are a true audiophile and would like to keep the files in MP4/M4A format then keep on reading.
I put together a simple bash script that you can use on MacOSX/Linux/BSD to find and convert m4a files with a bitrate greater than 320Kbps to 320Kbps.
I assume that you have ffmpeg installed on your machine. It’s available in macports, apt, yum.


#!/bin/bash
BASEDIR=$1
TEMPFILE=”$(mktemp /tmp/temp-XXXXXXX).m4a”

if ! [ -d “$BASEDIR” ]; then
echo Syntax: $0 /path
exit 1
fi

IFS=”

for i in $(find $BASEDIR -size +5M -type f -name ‘*.m4a’);do
IFS=” ”
BITRATE=$(ffmpeg -i “$i” 2>&1|grep Duration|grep bitrate|cut -d ‘ ‘ -f 8)
echo $i has bitrate $BITRATE
if [ “$BITRATE” -gt “320” ]; then
ffmpeg -v 5 -y -i “$i” -acodec libfaac -ac 2 -ab 320k \
-map_metadata 0 $TEMPFILE
mv $TEMPFILE “$i”
fi
#exit
done

I recommend working on a copy of your iTunes library and not the original files.
Depending on your installed version of ffmpeg, you might need to adjust the BITRATE= line to extract the value of the bitrate from “ffmpeg -i file.m4a” output.

After running the script against the m4a files on my USB thumb drive, I was able to play all the files on my x305s!

Share

Changing the URL of a mailing list in Mailman

Let’s say that you have just bought a new cool domain and you want to move your mailing-lists from @lists.foo.com to @lists.bar.com.
For newly created mailing-lists, it will be enough to update the value of DEFAULT_URL_HOST in /etc/mailman/mm_cfg.py.
The existing mailing-lists however will keep on using the old domain. Only new mailing-lists are affected by that setting.

In order to fix this, you just need to run:


su -s /bin/sh list
cd /usr/lib/mailman/
bin/withlist -l -r fix_url nameofml1
bin/withlist -l -r fix_url nameofml2
etc.

Repeat for every existing mailing-list. Replace “nameofml” with the name of the mailing list.
This will reset the URL of “nameofml” to the value specified by DEFAULT_URL_HOST in /etc/mailman/mm_cfg.py.

Share

Port forward on Windows 7 / Windows 2008

Recently, a friend of mine asked me for help with the following situation:

  • Wifi network: 192.168.0.*
  • Laptop computer running Windows: 192.168.0.10 (wireless)
  • Gaming console without a a wireless adapter

The console was too far from his Access Point and he couldn’t run cables thoughout his house. He needed to connect to the gaming console from any computer on the wifi network.

He didn’t want to buy additional hardware, like another Access Point, or a wireless adapter for the console.

The obvious solution was to connect the laptop to the console with a cable and do a port forward from the wireless interface of the laptop to the console.

  • Laptop wireless interface: 192.168.0.10
  • Laptop wired/ethernet interface: 192.168.1.10
  • Console wired/ethernet interface: 192.168.1.20

After setting up the IP addresses, the only thing left to do was to set up the port forward on Windows. This can be easily accomplished with the built-in portproxy:

Click on Start and select Run, type cmd.exe but do NOT hit the “Enter” key. Press CTRL+SHIFT+ENTER instead. This way cmd.exe will be run with Administrator privileges.

At the command prompt, enter the following command:

netsh interface portproxy add v4tov4 listenport=7142 connectaddress=192.168.1.20 connectport=7142 listenaddress=192.168.0.10 protocol=tcp

In this case, I only needed to forward port 7142. If you need to forward multiple ports just repeat the above command for each port.

After running this command I was able to connect to the console from the wifi network using 192.168.0.10:7142 as the destination IP address/port.

Caveat: portproxy only supports TCP! If you need to proxy udp ports as well, you might want to look into sudppipe.

Alternative solutions:

Share