{"id":18451931,"url":"https://github.com/openairplay/goplay2","last_synced_at":"2025-04-06T03:11:11.865Z","repository":{"id":38393266,"uuid":"375135612","full_name":"openairplay/goplay2","owner":"openairplay","description":"Airplay 2 Receiver written in Go","archived":false,"fork":false,"pushed_at":"2023-04-21T05:50:13.000Z","size":15102,"stargazers_count":395,"open_issues_count":9,"forks_count":20,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-30T02:07:28.974Z","etag":null,"topics":["airplay","airplay-receiver","airplay2","apple","homepod-mini","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openairplay.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-08T20:24:35.000Z","updated_at":"2025-03-10T21:10:36.000Z","dependencies_parsed_at":"2024-11-06T07:42:28.234Z","dependency_job_id":null,"html_url":"https://github.com/openairplay/goplay2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openairplay%2Fgoplay2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openairplay%2Fgoplay2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openairplay%2Fgoplay2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openairplay%2Fgoplay2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openairplay","download_url":"https://codeload.github.com/openairplay/goplay2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airplay","airplay-receiver","airplay2","apple","homepod-mini","raspberry-pi"],"created_at":"2024-11-06T07:29:47.987Z","updated_at":"2025-04-06T03:11:11.843Z","avatar_url":"https://github.com/openairplay.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Go Play 2\n\nThis is a **working** Airplay 2 Speaker implementation largely inspired by [airplay2-receiver](https://github.com/openairplay/airplay2-receiver)\n\u003cbr\u003e\nThe goal is to have an *Opinionated* implementation, with only some features but working very well.\n\n## Features\n\n#### Can \n\n* Play AAC 44100Hz with Apple Music (buffered audio)\n* Play/Pause/Stop/Seek\n* Homekit pairing with iPhone Home App\n* Sync with HomePod mini\n* PTP supported \n* **Working** on a Rasbperry 1\n* Set Volume \n* Support PulseAudio (and can select sink)\n\n#### Nexts  \n\n* P1 - Improve multi-room support (audio sync)\n* P2 - Play ALAC\n* P3 - Supports Spotify (RTP over UDP, type 96) \n* P4 - NIC hardware timestamp (linux)\n\n#### Will not support\n\n* Windows build\n* Track information \n* Screen, Video, ... (other Airplay Features)\n* Airplay 1\n* NTP\n\n#### Multi Room accuracy \n\n* The accuracy is around 1ms of offset between clocks.\n* Need to sync during playing (add silence of skip frames) \n\n## How to build ( works on Linux and MacOsX)\n\n* Clone the repository\n````\ngit clone https://github.com/openairplay/goplay2.git\n```` \n* Build goplay2 \n\n```shell\ngo build  \n```\n\n### Dependencies \n\nYou need to have portaudio-dev, pulseaudio and lib-fdk-aac and go runtime installed to build this program\n\n#### Ubuntu 21.4 build\n\n````shell\nsudo apt install golang-go libfdk-aac-dev\n````\n\n#### Rasbpian (buster)\nfdk-aac is not provided by default, you have to change your source.list (as root or using sudo)\n\n````\necho \"deb http://www.deb-multimedia.org buster main non-free\" \u003e\u003e /etc/apt/sources.list\napt-get update -oAcquire::AllowInsecureRepositories=true\napt-get install deb-multimedia-keyring -y\napt-get install libfdk-aac-dev\n````\n\nYou also need to install go from https://golang.org/dl/ as version 1.16 is not supplied by buster (they only support 1.11)\n\n#### Mac os build \n\n* Having xcode properly installed (clang needed)\n\n````shell\nbrew install portaudio fdk-aac go \n````\n\n### Docker image\n\nYou can build and run the image to quickly test goplay, though this is experimental right now and comes with caveats.\n\n* Build the image\n\nThe following platforms are supported: linux/amd64, linux/arm64, linux/arm/v7.\nOther platforms should also build.\n\nYou need at least docker 19.06.\n\nTo build:\n```shell\ndocker buildx build -t you/goplay2 .\n```\n\nThis is a multi-architecture image.\nIf you have QEMU/Docker configured, you can target a different platform,\nor better, use buildctl and buildkit to produce a proper multi-architecture image.\n\n* Run the container\n\nThis image currently does not provide a way to run pulseaudio inside the container itself, and pulseaudio is expected \nto be available and running on the host for this to work.\n\nOn debian variants, this is typically as simple as:\n```\nsudo apt-get install pulseaudio\npulseaudio --start\n```\n\nTo then run the container\n```shell\nexport STATION_NAME=\"GoplaySpeaker\"\n\nmkdir -p \"$(pwd)/$STATION_NAME\"\n\ndocker run \\\n\t--rm \\\n\t--name goplay \\\n\t--volume \"$(pwd)/$STATION_NAME\":/opt/\"$STATION_NAME\" \\\n\t--volume /run/user/1000/pulse/native:/pulse \\\n\t--env PULSE_SERVER=/pulse \\\n\t--net host \\\n\t--cap-drop=ALL \\\n\t--cap-add=NET_BIND_SERVICE \\\n\t--read-only \\\n\tyou/goplay2 ./goplay2 -n \"$STATION_NAME\"\n```\n\nNote that mDNS by design will only work with networking mode \"host\" (recommended for beginners) or (mac/ip)vlan.\n\n#### Acknowledgments  \n\n## Run\n\n- goplay2 by default run only on the ipv4 interface (because [this issue](https://github.com/golang/go/issues/31024) on ipv6 parsing) \n\n#### Linux \n\n- goplay2 should not be run as root to use pulseaudio server\n- goplay2 need to have special privileges to open PTP port (319,320)\n\nto allow goplay2 to open port below 1024 you need to run \n\n````\nsetcap 'cap_net_bind_service=+ep' ./goplay2 \n````\n\nnb: should be re-run every time you build goplay2 \n\n#### Parameters \n\n`delay` (ms) is subtracted from the local \"clock\" \u003cbr\u003e\nEx: It takes around 60ms on my mac to launch the audio stream at the **Anchor Time** \n\n`i` (interface) used to listen (by default eth0)\n\n`n` (name) used as accessory name (Bonjour) \n\n`sink` (pulse audio sink name) to replace default sink\n\nExample : \n```shell\n./goplay2 -sink alsa_output -i en0 -n aiwa\n```\n\n\nBy [AlbanSeurat](https://github.com/AlbanSeurat)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenairplay%2Fgoplay2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenairplay%2Fgoplay2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenairplay%2Fgoplay2/lists"}