Configure and build the kernel

See How to install NetBSD on the Linksys NSLU2 (Slug) without a serial port, using NFS and telnet for more instructions on building and installing kernels/NetBSD on the NSLU2.

Create the kernel configuration file:

$ echo 'include "arch/evbarm/conf/NSLU2"' >NSLU2_AUDIO
$ echo 'uaudio* at uhub? port ? configuration ?' >>NSLU2_AUDIO 
$ echo 'audio* at uaudio?' >>NSLU2_AUDIO 
$ echo 'config netbsd-aud-npe0 root on npe0 type nfs' >>NSLU2_AUDIO
$ echo 'config netbsd-aud-sd0 root on sd0a type ffs' >>NSLU2_AUDIO
$ echo 'config netbsd-aud-sd1 root on sd1a type ffs' >>NSLU2_AUDIO

Build as described in the above link, except change the final build command line to:

$ ./ -u -U -m evbarm -a armeb -V KERNEL_SETS=NSLU2_AUDIO release

Boot the kernel

Use tftp to load the kernel as described in the link above. You should see the following lines (or something similar) in your dmesg or console output. The order of the lines may be slightly different. You may not see anything about "uhub3" unless you have an external hub.

uhub0 at usb1: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1    
uhub0: 2 ports with 2 removable, self powered                                   
uhub1 at usb2: vendor 0x1033 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1    
uhub1: 5 ports with 5 removable, self powered                                   
uhub2 at usb0: vendor 0x1033 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1    
uhub2: 3 ports with 3 removable, self powered                                   
ehci0: handing over full speed device on port 1 to ohci0                        
uaudio0 at uhub2 port 1 configuration 1 interface 0: C-Media INC. USB Sound Device, rev 1.10/0.10, addr 2                                                       
uaudio0: audio rev 1.00                                                         
audio0 at uaudio0: full duplex, independent                                     
uhub3 at uhub1 port 2: vendor 0x0409 product 0x005a, class 9/0, rev 2.00/1.00, addr 2

Note in particular the line that says "ehci0: handing over full speed device on port 1 to ohci0." The NetBSD USB ehci driver can not handle isochronous devices (required for audio), but the ohci driver can. Unfortunately, it also appears that NetBSD can not handle an attached hub with the ohci driver, so you can't plug the USB audio device into a hub - it must be plugged directly into one of the two USB ports on the back of the device.

Add the device entry in /dev

As root, enter the following:

# cd /dev
# ./MAKEDEV audio

You should now be able to play music to /dev/audio. If you want to play mp3 files, I recommend using madplay, which can be added using packages.

Add a comment