fbpx

ipod-gadget: iPod usb gadget for audio playback

ipod-gadget: iPod usb gadget for audio playback

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

ipod-gadget simulates an iPod USB system to stream digital audio to iPod appropriate gadgets/docks.
It speaks iAP(iPod Accessory Protocol) and begins an audio streaming session.

Tested on Raspberry Pi Zero, Beaglebone Black and Nexus 5(mainline linux kernel) with Onkyo HT-R391 receiver because the host system (extra host gadgets must be examined).
Should work on any system that runs Linux 4.x (compiled with usb gadget configfs) and has a USB port that helps peripheral mode.

It consists of two components – linux kernel module and shopper app (golang).

The kernel module takes care of the USB system gadget aspect.
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 brand new ALSA audio card "iPodUSB" for audio playback and iap0 char system for iAP communications.

The gadget driver is activated when the character system iap0 is opened and deregistered when it is closed.

The shopper app speaks to the host system over iAP by studying/writing packets from/to /dev/iap0 character system.
It handles the authentication and prompts the audio streaming in order that ALSA system can be utilized for playback.

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=/house/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]

#elective params
swap_config: swap USB configurations. 
Might be helpful when the dock sees solely the Mass Storage configuation.

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

Check the messages from dmesg and confirm that the system /dev/iap0 is offered.

Follow the directions right here: https://github.com/oandrew/ipod

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

Now you’ll be able to open a distinct terminal and take a look at the playback!

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

Let me know if in case you have any points.

Attach the hint file (e.g. /tmp/ipod.hint above) to the problem.

NOTE: at present it really works provided that the host system would not authenticate the iPod (sometimes solely iPod authenticates the host system which is okay).

HI-FI News

by way of Lobsters https://lobste.rs/

March 22, 2024 at 09:59PM

Select your currency