This document would give a guide for playbacking flac or music file on Intel Edison with external usb DAC. Please understand that, I would not give all commend because i wrote this guide after my task done.
I would use Burson Conductor as a target device, it adept with c-media cm6631a usb receiver chip.
Requirement
HW requirement:
- Intel Edison mini breakout board
- otg usb micro b male to type B (usually dac with type b input)
- dc power core (7~15v)
- optional : wifi i-PEX connect line
SW requirement:
- Linux operation (Ubuntu or Debian is better for operation consistence.)
- other SW would be found in apt-get.
Before-guide
In this guide, if start from “#”, it mean comment on your host. If it start with “$”, it mean commend on intel edison. I would suggest operating on linux. because we finally would compiler kernel for wifi driver support.
Flash ubilinux, debian w/ Wheezy for Edison
I prefer Debian than Yocto
- get image from http://www.emutexlabs.com/ubilinux
- #mkdir download
- #cd download
- #tar -zxvf ubilinux-edison-141030.tar.gz
- install the flash tool first
# apt-get install dfu-util - flash image
# cd toFlash
# sudo ./flashall.sh - after flash done, please wait reboot twice.
- maybe you need do some configure on Intel Edison.
# sudo screen /dev/ttyUSB0 115200 - log on into edison with
- user : edison
- password: edison
- strongly suggest follow sparkfun’s reference site to add/modify the default user.
- sudo, ssh, etc.
Setup wifi
after flash ubilinux, wifi would be work now. we would let it connect to wifi ap first, to make sure the device is workable.
- reference site: http://ubuntuforums.org/showthread.php?t=202834
- get hex_string
$wpa_passphrase - got the psk and remember your psk value for later usage.
- $vim /etc/network/interfaces
- commend auto usb0 with “#”
- uncomment wlan0, the line start should not have “#”
- fill your ssid and psk to profile field.
- in my case, I use eap wifi auth, here is a sample
auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid
wpa-ap-scan 2
wpa-eap PEAP
wpa-key-mgmt WPA-EAP
wpa-anonymous-identity
wpa-identity
wpa-password
wpa-phase2 auth=MSCHAPV2 - $ifup wlan0
- if wifi cant work, try iwconfig to check the quality and signal strength
- $iwconfig
- some like as Link Quality=70/70 Signal level=-36 dBm
Install MPD for a client-server playback server.
Compile new version MPD
this is for new features (maybe new bugs...)
- the version in ubilinux is old, but we could install it to configure some variable.
$apt-get install mpd - now we should compile it by yourself
- remove mpd first
$apt-get remove mpd - apt-get install some necessary packages
$sudo apt-get install build-essential libglib2.0-dev git vim - add the source repository
$ sudo vim /etc/apt/sources.list - remove “#” from deb-src or add it!
$ sudo apt-get update - use apt-build to update necessary packages.
$ sudo apt-get build-dep mpd - compiler mpd from source code tarball
$ wget -O - http://www.musicpd.org/download/mpd/stable/mpd-0.19.7.tar.gz | tar -zxf -
$ cd mpd-0.19.7
$ make clean
$ ./configure - you would need to install some build tools here. check the missing dependent package and install them.
$ make
$ sudo make install
$ whereis mpd - base on last command, do a software link for it.
$ sudo ln -s /usr/local/bin/mpd /usr/bin/mpd
configure config
- after compile and install, we need some configure let it work for our purpose.
$sudo aplay -lcard - 1: Audio [USB2.0 High-Speed True HD Audio], device 0: USB Audio [USB Audio]
- make sure following path exist, and check some values that we care.
$ sudo vim /etc/mpd.conf
music_directory "/home//music"
playlist_directory "/home//.mpd/playlists"
#bind_to_address
port "6600"
audio_output {
type "alsa"
name "Burson Conductor" # any you like
device "hw:1,0" #value in aplay -l
auto_resample "no"
auto_format "no"
auto_channels "no"
}
mixer_type "disabled"
replaygain "off"
$ sudo service mod restart - Done!
but no sound output here. because default configure of Intel ‘s kernel have not build in snd-usb-audio module. we should follow next step.
Build your own kernel
remember back to your linux work station.
- reference site: https://communities.intel.com/docs/DOC-23159
- now we can build the new kernel for audio support
# mkdir edison
# cd edison
# wget -O - http://downloadmirror.intel.com/24389/eng/edison-src-rel1-maint-rel1-ww42-14.tgz#_ga=1.225557722.1979370645.1410536481 | tar -zxf -
# wget -O - https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.17.tar.bz2 | tar -jxf -
# cd ./linux-3.10.17
# patch -p1 < ../edison-src/device-software/meta-edison/recipes-kernel/linux/files/upstream_to_edison.patch
# cp ../edison-src/device-software/meta-edison/recipes-kernel/linux/files/defconfig .config
# cp drivers/tty/serial/mfd_trace.h include/trace/ - add usb sound support
# make menuconfig - mark module M at device driver -> Sound card support -> Advenced Linux Sound Architecture -> USB sound devices -> USB Audio / MIDI driver
- add for wifi module boardcom 4334x
- # cp -rf ../edison-src/broadcom_cws/
- Now build it
# make -j16 -p broadcom_cws/wlan/driver_bcm43x/ deb-pkg - Wait it compil done, you would get three debs at parent folder “edison”
linux-headers-3.10.17-poky-edison_3.10.17-poky-edison-1_i386.deb
linux-image-3.10.17-poky-edison_3.10.17-poky-edison-1_i386.deb
linux-libc-dev_3.10.17-poky-edison-1_i386.deb - now copy file into your Intel edison, if you have already set up ssh on edison, you can use scp to transfer file.
- # scp *.deb xx.xx.xx.xx:/home/
/ - change to your edison command line
- maybe you want to backup /boot before next step.
- $ cp -R /boot/* /home/
/boot_backup - $ dpkg -i *.deb
$ mv /boot/vmlinuz-3.10.17-poky-edison /boot/vmlinuz
$ reboot - after here, you should have a snd-usb-audio workable kernel on Edison or got a brick!!!
- if fail, go to “toFlash”, try again…
Configure ALSA
- now you should install some alsa packages.
- $ apt-get install alsa-utils
- $ sudo su
- $ alsactrl init
- aplay -Dhw:1,0 any.mp3
- If you got music from dac, done.
forgive me, I would not write the mpd client now, maybe later.

沒有留言:
張貼留言