MIT License

项目介绍

oandrew/ipod-gadget 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 MIT License 许可证,目前获得 258 个 Star、42 次 Fork。

仓库全名
oandrew/ipod-gadget
开源许可证
MIT License
Star 数
258
Fork 数
42
未关闭 Issue
14

README 摘要

ipod-gadget 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

ipod-gadget 用什么语言开发?

主要使用 C 编写,采用 MIT License 许可证,目前有 258 个 Star。

ipod-gadget 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 ipod-gadget 的源码?

可以直接克隆仓库:git clone https://github.com/oandrew/ipod-gadget.git,默认分支为 master;安装与运行步骤见仓库 README。

ipod-gadget 最近还在维护吗?

仓库最近一次更新为 2025年8月15日,当前有 14 个未关闭 Issue;Star 数为 258,可作为社区活跃度的参考。

关于

iPod usb gadget for audio playback. Client app: https://github.com/oandrew/ipod

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
363
价值分
168
活跃状态
活跃

语言占比

C
Makefile

贡献者

README

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).

评论

暂无评论