Giter Club home page Giter Club logo

keene-usb-audio's Introduction

11.12.2012
since kernel 3.4 v4l supports the keene FM transmitter. OpenWrt 12.09 comes with 3.3.8 so i use this neat tool. in germany the device is sold under the brand of "p-line"

v0.2 18/01/2011

Keene Electronics sell a little USB FM Transmitter, the audio part of which works out of the box with linux, but the applet supplied to do the radio stuff only works with Windows. See:
http://www.keene.co.uk/electronics/multi.php?mycode=USBFMT#
(Supposedly the Windows program works under linux using wine/winetricks but I could never get it to work, plus my audio server runs headless.)

Good review here:
http://www.reghardware.com/2010/09/27/review_gadget_keene_usb_fm_transmitter/

Using Snoop USB for Windows XP, usbsnoop2libusb.pl, and some code somebody wrote for the OWL electricity monitor, I reverse engineered most of the key functions, and this program attempts to control the FM transmitter side of the device.

Compiling:

You need libusb and libusb-dev (in Debian apt-get install libusb libusb-dev),

gcc -o keene keene.c -lusb

Usage:

When you plug the device in, it presents as a composite device, one is the audio device, the other a HID device, which controls the radio elements. On one of my PC's the alsa control is set to 0 after the device is plugged in, set this to 70-80, if the audio is distorted try reducing this.

The program currently accepts one argument which is the FM transmitter frequency without a decimal point, e.g. 98.80 is 9880, execute the program like:

./keene 9880

When excuted the program will attempt to set the frequency as set, it will set the tx gain to full, kick the device into stereo, and set it to use European FM, as such the frequencies available are 87.50 - 108.00 (8750 - 10800). The increments available are 0.05, if you call 8881 for example it will round to 88.80.

The udev directory contains an example rule that changes the perms on the device to be writable by group 'dialout', change this group to one you are member of if you wish to use the device as none root. Also the udev rule will execute the binary, if you change the path in the rule.

The USB ID of my device is 046d:0a0e, if yours is different then you'll need to change the source, and the udev rule.

In the binaries sub-directory you should find pre-compiled binaries for arm and x86, these were compiled on Debian Squeeze systems.

NOTE: This is very rough and ready. Use at your own risk. As you can see my C skillz are virtually non-existent, please be kind.

TODO: 
Allow configuration of other parameters, such as tx gain, deemphasis, FM band.
Document what the two control registers do.
Could this be integrated into a more generic linux FM tools.

ACKNOWLEDGEMENT:
Thanks to Anonymous Graham in the comments here, for giving me the basis for this code. 
http://automation.binarysage.net/?p=765&cpage=3#comments

Thanks to te author of usbsnoop2libusb.pl, that provided much help in figuring out the format of the urb messages: http://iki.fi/lindi/usb/usbsnoop2libusb.pl

Thanks to Keene for supplying some information about the device, I will try and use it improve the tx gain control, which wasn't fully clear from the Snoop USB logs.

LICENSE:
No specific license, please feel free to do what you want with it. If you improve it please let me know
as I like to learn.

keene-usb-audio's People

Contributors

kenchy avatar seidler2547 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.