Notice: This page contains information for the legacy Phidget21 Library. Phidget21 does not support VINT Phidgets, and will not support any new Phidgets. Phidget21 will be maintained until 2020. We recommend that new projects be developed against the Phidget22 Library.

Click on the 2phidget22.jpg button in the menu bar to go to the Phidget22 version of this page.


3401 User Guide

From Phidgets Legacy Support
Revision as of 14:36, 9 May 2018 by Mparadis (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Go to this device's product page

Getting Started

The USB to Audio adapter provides sound capabilities to the PhidgetSBC. The audio adapter offers two integrated channels - one for speakers or headphones, and one for a microphone. The Audio Adapter plugs into any of the PhidgetSBC USB ports. The USB to Audio Adapter is not a Phidget device and is not controlled using Phidgets APIs.

Using this product requires a working knowledge of Linux.

3401 0 Connecting The Hardware.jpg

Connect the Sound Adapter to the PhidgetSBC

1. Log onto the SBC via SSH.

PhidgetSBC (1070):
Your SBC may be running an older version of firmware that does not support the USB Audio Adapter, requiring you to update your SBC firmware to the latest version - update to the full version.
PhidgetSBC2 (1072) or PhidgetSBC3 (1073):
You must install libasound2, and optionally mpg123: apt-get install libasound2 mpg123 Make sure to set “Include full Debian Package Repository” to true on the System->Packages web interface page and save changes first, or the packages won’t be available.

2. Plug the Audio Adapter into an open USB port on the SBC. The SBC should automatically recognize the converter.

Type dmesg | tail –n 5 on the SBC to view the last 5 lines of the kernel’s message buffer. You should see something similar to the lines below (this is output from a PhidgetSBC2):

usb 1-1.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-1.1: Product: USB Headphone Set
input: USB Headphone Set as /devices/platform/s3c2410-ohci/usb1/1-1/1-1.1/1-1.1:1.3/
usbcore: registered new interface driver snd-usb-audio

This tells you that the USB to Audio adapter was properly recognized.

Playing an MP3 File

1. Plug a set of headphones, or computer speakers into the green jack on the back of the audio device.

3401 0 Speakers.jpg

2. Included with the Phidget SBC is an mpeg audio playback program mpg123. To play an mp3 file, simple type:

mpg123 –g 100 filename.mp3

This file can be located either in your home director, or on a USB storage device. The -g 100 option tells mpg123 to turn the gain on the audio device to 100%.

3. The program can also be used to play streaming audio. If you SBC is connected to the internet through your home network, you can type a command like:

mpg123 -g 100 -@

The -@ option tells mpg123 that the file is actually a playlist, not a sound file.

4. Your SBC should start playing music from the radio stream.

Using a Microphone

3401 0 Mic.jpg

1. Plug a set of headphones, or computer speakers into the green jack on the back of the audio adapter.

2. Plug a microphone into the yellow jack on the back of the audio adapter.

3. You can test the input of the audio adapter by typing (1070 only):

cat /dev/audio > /dev/audio

The /dev/audio device can be used for both input, as well as playback. This command reads the input, and sends it right back to the output.

4. Speak into the microphone, you should be able to hear your voice on your headphones or speakers.