All Projects → oandrew → Ipod Gadget

oandrew / Ipod Gadget

Licence: mit
iPod usb gadget for audio playback

Programming Languages

c
50402 projects - #5 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Ipod Gadget

Ksm
A fast, hackable and simple x64 VT-x hypervisor for Windows and Linux. Builtin userspace sandbox and introspection engine.
Stars: ✭ 673 (+615.96%)
Mutual labels:  kernel, reverse-engineering
Android Usb Gadget
Convert your Android phone to any USB device you like! USB Gadget Tool allows you to create and activate USB device roles, like a mouse or a keyboard. 🛠🛡📱
Stars: ✭ 118 (+25.53%)
Mutual labels:  usb, kernel
Android Lkms
Android Loadable Kernel Modules - mostly used for reversing and debugging on controlled systems/emulators
Stars: ✭ 164 (+74.47%)
Mutual labels:  kernel, reverse-engineering
Ksdumper
Dumping processes using the power of kernel space !
Stars: ✭ 454 (+382.98%)
Mutual labels:  kernel, reverse-engineering
Helenos
A portable microkernel-based multiserver operating system written from scratch.
Stars: ✭ 553 (+488.3%)
Mutual labels:  usb, kernel
Anticheat Testing Framework
Framework to test any Anti-Cheat
Stars: ✭ 481 (+411.7%)
Mutual labels:  kernel, reverse-engineering
xone
Linux kernel driver for Xbox One and Xbox Series X|S accessories
Stars: ✭ 636 (+576.6%)
Mutual labels:  kernel, usb
The holy book of x86
A simple guide to x86 architecture, assembly, memory management, paging, segmentation, SMM, BIOS....
Stars: ✭ 577 (+513.83%)
Mutual labels:  kernel, reverse-engineering
Wnfun
WNF Utilities 4 Newbies (WNFUN)
Stars: ✭ 63 (-32.98%)
Mutual labels:  kernel, reverse-engineering
Mimiker
Simple unix-like operating system for education and research purposes
Stars: ✭ 85 (-9.57%)
Mutual labels:  kernel
Cutter
Free and Open Source Reverse Engineering Platform powered by rizin
Stars: ✭ 10,073 (+10615.96%)
Mutual labels:  reverse-engineering
Pentesting toolkit
🏴‍☠️ Tools for pentesting, CTFs & wargames. 🏴‍☠️
Stars: ✭ 1,268 (+1248.94%)
Mutual labels:  reverse-engineering
Theseus
A modern experimental OS written from scratch in Rust to explore novel OS structure, state management techniques, and how to maximally leverage the power of language by shifting OS responsibilities into the compiler.
Stars: ✭ 1,273 (+1254.26%)
Mutual labels:  kernel
Reactos
A free Windows-compatible Operating System
Stars: ✭ 10,216 (+10768.09%)
Mutual labels:  kernel
R2m2
radare2 + miasm2 = ♥
Stars: ✭ 86 (-8.51%)
Mutual labels:  reverse-engineering
Kindd
A kindful dd, written in qt-quick.
Stars: ✭ 93 (-1.06%)
Mutual labels:  usb
Skiboot
OPAL boot and runtime firmware for POWER
Stars: ✭ 85 (-9.57%)
Mutual labels:  kernel
Samsung Trustzone Research
Reverse-engineering tools and exploits for Samsung's implementation of TrustZone
Stars: ✭ 85 (-9.57%)
Mutual labels:  reverse-engineering
Fundamentos Engenharia Reversa
Livro: Fundamentos de Engenharia Reversa
Stars: ✭ 93 (-1.06%)
Mutual labels:  reverse-engineering
Ktf
Kernel Test Framework
Stars: ✭ 93 (-1.06%)
Mutual labels:  kernel

ipod-gadget

Join the chat at https://gitter.im/ipod-gadget/Lobby

ipod-gadget simulates an iPod USB device to stream digital audio to iPod compatible devices/docks. It speaks iAP(iPod Accessory Protocol) and starts an audio streaming session.

Tested on Raspberry Pi Zero, Beaglebone Black and Nexus 5(mainline linux kernel) with Onkyo HT-R391 receiver as the host device (more host devices need to be tested). Should work on any device that runs Linux 4.x (compiled with usb gadget configfs) and has a USB port that supports peripheral mode.

implementation

It consists of two parts - linux kernel module and client app (golang).

kernel module

The kernel module takes care of the USB device gadget side. An iPod, when plugged in a dock, presents a USB configuration with 2 interfaces:

  1. UAC1(USB Audio Class 1) - standart usb audio streaming interface.
  2. HID - bidirectional transport for iAP packets.

The kernel module creates a new ALSA audio card "iPodUSB" for audio playback and iap0 char device for iAP communications.

The gadget driver is activated when the character device iap0 is opened and deregistered when it's closed.

client app

The client app speaks to the host device over iAP by reading/writing packets from/to /dev/iap0 character device. It handles the authentication and activates the audio streaming so that ALSA device can be used for playback.

build and run

kernel modules

git clone https://github.com/oandrew/ipod-gadget.git
cd ipod-gadget/gadget

make
# or cross compiling
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- KERNEL_PATH=/home/andrew/pi-linux 

#load the module
modprobe libcomposite
insmod g_ipod_audio.ko
insmod g_ipod_hid.ko
insmod g_ipod_gadget.ko [swap_configs=0] [product_id=0x1297]

#optional params
swap_config: swap USB configurations. 
Might be useful when the dock sees only the Mass Storage configuation.

product_id: override the usb product id.
See doc/apple-usb.ids for the list of ids

Check the messages from dmesg and verify that the device /dev/iap0 is available.

client app

Follow the instructions here: https://github.com/oandrew/ipod

./ipod -d serve -w /tmp/ipod.trace /dev/iap0

Now you can open a different terminal and test the playback!

speaker-test -D plughw:CARD=iPodUSB,DEV=0 -c 2 -r 44100

Let me know if you have any issues.

Attach the trace file (e.g. /tmp/ipod.trace above) to the issue.

NOTE: currently it works only if the host device doesn't authenticate the iPod (typically only iPod authenticates the host device which is fine).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].