Site Tools


Sidebar

hardwarerelated:mp3player:sony_walkman_nwz-a826

What?

My notes on using the Sony NWZ-A826 walkman with linux, should apply to all NWZ-A8** models. I use debian but should work for all distros.

  • There are now other versions available: Sony NWZ-A826KB includes a bluetooth headphones, Sony NWZ-S738F also has a noise cancellation system
  • pros: cheaper than the ipod, bluetooth music streaming, sony allows mounting of the device as usual usb_storage device (quite different from ipods)
  • cons: “rootkit-issues”, no support for the ogg format, bluetooth only used for music-streaming - not to transfer files
  • What works from linux: storing audio/video/pictures onto the walkman, cd-ripping and encoding to mp3, stuffing cover-art into the mp3s, converting pictures to formats optimal for the walkman (thou most jpegs can be displayed as they are), encoding videos to be played on the walkman

the hardwarespecs

  • display: 2.4-inches, 320×240
  • usb 2.0 connection, akku loaded via usb
  • playback time: music approx. 36 hours / video approx. 10 hours
  • video playback AVC (H.264/AVC), MPEG-4
  • image playback JPEG
  • audio playback MP3, WMA, AAC-LC, Linear PCM
  • dimensions 50.2 x 93.6 x 9.3mm / weight 58g
  • bluetooth 2.0, supports profiles A2DP 1.0 (Advanced Audio Distribution Profile) and AVRCP 1.3 (A/V Remote Control Profile) for streaming of audio to Headphones, A/V equipment, In-vehicle equipment, Personal computers or Mobile phones and remote-controlling those devices

managing music/picture/video files

mounting

This has to be done to do file operations. Do not disconnect the walkman while it is mounted!

tail -f /var/log/messages &    # start watching the logs
# now onnect the walkman, it can be accessed with the usual linux usb-storage driver.
# if everyting goes well usb_storage gets loaded and you the A826 gets available as a new device.
# You should get an output like 'sda: sda1', saying you can access the A826 under /dev/sda1.
# If that doesnt happen try to manually load the driver:
modprobe usb_storage
# - if that still doesnt work check if usb-drivers are loaded and the A826 comes up as usb-device at all.
mkdir -p /mnt/walkman        # creates a mountpoint if not existant
mount /dev/sda1 /mnt/walkman # mounts the A826, use your device here.
storing/deleting/moving files

This is how music/pictures/videos are managed. Usual file-operations can be used. Store pictures under directory 'picture', music under 'music' etc.

cp -r /home/user/tinypics /mnt/walkman/pictures                   # copies pictures
rm -r /mnt/walkman/pictures/tinypics                              # deletes those
mv /mnt/walkman/pictures/tinypics /mnt/walkman/pictures/tinypics2 # move directory
cp -r /home/user/musicfiles /mnt/walkman/music                    # copies music

Notice: pictures can only be stored one directory depth. So pictures/dir1/pic1.jpg is ok while pictures/dir1/dir2/pic2.jpg is not accessable for viewing on the A826.

umounting

This is needed bevore unplugging the A826 to ensure all i/o operations have finished and the filesystem is clean.

umount /mnt/walkman

How to see album covers?

The A826 expects those inside the mp3-file as part of an ID3v2.3-tag. Add the cover-art to the mp3-file i.e. using easytag (apt-get install easytag). Start it and click Settings → Preferences → ID3 Tag Settings → select 'ID3v2.3' instead of the default 'ID3v2.4', hit 'OK'. On the left select the directory with mp3-files. Select your mp3-file in the middle-window, on the right select the 'Pictures'-tag, hit '+', select your cover-art. In the top-menu use File → Save File(s) to save, and your cover is saved in the usable manner. With Kid3 (apt-get install kid3-qt) its easy to add the same cover-art to more than one file in only one work-step.

How to encode videos for the walkman?

Install mencoder appropriately
apt-get install subversion-tools git-core
apt-get install libfaad-dev liba52-0.7.4 liba52-0.7.4-dev libdts-dev

# get the lame source, untar, configure && make && make install
# get x264 from git, install it.
# get faac, i.e. from audiocoding.com, install it
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
# get mplayer-source-snapshot from mplayerhq.hu (1.0rc2 didnt for for me)
tar xjf mplayer-checkout-snapshot.tar.bz2
cd ffmpeg
cp -r libav* ../mplayer-checkout-2008-09-05/
cd ../mplayer-checkout-2008-09-05/
./configure && make && sudo make install

# ffmpeg: ./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libtheora \
#   --enable-liba52 --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libfaad \
#   --enable-libfaac --enable-libxvid --enable-pthreads --enable-libx264 --enable-shared
Encoding w/ mencoder

Now you can reencode the video so it fits the walkman. Using the one-pass-method is faster but produces worse video quality - but thats probably not worth the time spend for the small screen of the walkman.

  • Destination: mp3 audio, video AVC (H.264/AVC), MPEG-4
# 1 pass enconding examples:

# quality quite ok
mencoder -ofps 25 -of lavf -lavfopts format=mp4 -af lavcresample=48000 -srate 48000 -vf-add harddup \
    -vf-add scale=320:240 -oac lavc -ovc lavc -lavcopts \
    aglobal=1:vglobal=1:vcodec=mpeg4:acodec=libfaac:abitrate=128:vbitrate=350 \
    -o evan_walkman1.mp4 evanescence__good_enough.divx

# options tuned for better quality, encoding takes more than twice the time of previous example
mencoder -ofps 25 -of lavf -lavfopts format=mp4 -af lavcresample=48000 -srate 48000 -vf-add harddup \
    -vf-add scale=320:240 -oac lavc -ovc lavc -lavcopts \
aglobal=1:vglobal=1:acodec=libfaac:abitrate=128:vcodec=mpeg4:vbitrate=350:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:precmp=2:cmp=2:subcmp=2:preme=2:turbo \
    -o evan_walkman6.mp4 evanescence__good_enough.divx

# some lavc-opts explained (see 'man mplayer'): 
  aglobal=1:vglobal=1:vcodec=mpeg4:acodec=libfaac : 
       all obligatory for us (extra headers, mpeg4 videocodec, AAC audiocodec)
  abitrate=128 :
       audiobitrate in kbps. No need to use a higher value than your input-video contains.
  vbitrate=350 :
       videobitrate, 250 is a good startingpoint. Higher results in better quality, higher
       than your input-video makes no sense.
  autoaspect :
       use this to retain your aspect-ratio. I dont want this, i prefer eggy heads and a
       completely used screen on the walkman.
  mbd=2 :
       Macroblock decision, better quality but slower
  mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:precmp=2:cmp=2:subcmp=2:preme=2:
       better quality but slower encoding
  turbo :
       (two pass only) Dramatically speeds up pass one using faster algorithms
encoding w/ ffmpeg
# havent tested this:
ffmpeg -i infile -b 567k -s 320x240 -vcodec mpeg4 -ab 220k -ar 44100 -ac 2 -acodec libfaac outfile.mp4

ffmpeg -y -i infile.avi -threads auto -vcodec libx264 -b 250k -maxrate 768k \
   -flags +loop  -cmp +chroma -partitions +parti4x4+partp4x4+parti8x8+partp8x8 -flags2 \
   +mixed_refs -level 13 -refs 3 -subq 7 -trellis 2 -me 6 -g 300 -s 320x240 -ab 128k -ar\
   44100 -ac 2 -acodec libfaac outfile.mp4

faq

Howto encode audio as mp3?

Use cdparanoia for ripping and lame for encoding as mp3.

How to simplify mounting/umounting?

Mounting can be done automatically with udev, read the udev-faq. As soon as usb-devices with special properties are plugged in scripts can be run, i.e. doing the mounting.

Firmware upgrade using linux?

Havent seen a chance yet to do this, also havent seen yet a need to upgrade the firmware (besides beeing able to store pictures in subdirectories would be nice).

How to squeeze picture-size down to a minimum?

Pictures on the walkman can be reencoded to 320×240 pixels. The files get smaller, of course information is lost and the pictures look bad when displayed on a bigger display. 'apt-get install imagemagick' installs imagemagick containing the needed convert-tool. This snippet converts all pictures not ending in _sony.jpg into the 320×240 solution and deletes the original file.

find . -name '*.jpg' ! -name '*_sony.jpg' -type f | \
     while read i; do convert "$i" -resize 320x240 "${i%.jpg}_sony.jpg" && rm "$i"; done
Why can only root write files onto the path where the walkman is mounted?

The walkmans filesystem is vfat which can not handle ownerships. You can use a special mount-option to make everything below the mountpoint owned by one single user and thus readable/writable by that user:

mount -o uid=chris /dev/sda1 /mnt/walkman
Thumb-pics for the videos?

Those must be placed in the video-directory and named file.jpg for a video named file.mp4. Format of the thumb-pics should be 160×120.

hardwarerelated/mp3player/sony_walkman_nwz-a826.txt · Last modified: 2024/03/03 11:52 by chris