{"id":17968505,"url":"https://github.com/mildsunrise/jackpifm","last_synced_at":"2026-03-09T10:02:52.972Z","repository":{"id":15026922,"uuid":"17752689","full_name":"mildsunrise/jackpifm","owner":"mildsunrise","description":"📡 Turn your Raspberry Pi into an FM transmitter broadcasting live audio from JACK","archived":false,"fork":false,"pushed_at":"2020-01-26T18:27:23.000Z","size":5739,"stargazers_count":27,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T16:24:23.240Z","etag":null,"topics":["audio","hack","jack","radio","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mildsunrise.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}},"created_at":"2014-03-14T16:36:52.000Z","updated_at":"2024-10-01T21:13:38.000Z","dependencies_parsed_at":"2022-09-19T11:41:38.900Z","dependency_job_id":null,"html_url":"https://github.com/mildsunrise/jackpifm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mildsunrise/jackpifm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildsunrise%2Fjackpifm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildsunrise%2Fjackpifm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildsunrise%2Fjackpifm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildsunrise%2Fjackpifm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mildsunrise","download_url":"https://codeload.github.com/mildsunrise/jackpifm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mildsunrise%2Fjackpifm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30290937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["audio","hack","jack","radio","raspberry-pi"],"created_at":"2024-10-29T14:40:31.247Z","updated_at":"2026-03-09T10:02:52.939Z","avatar_url":"https://github.com/mildsunrise.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jackpifm v3\n\nThis is a little program that runs on your Raspberry Pi, reads live audio from [JACK][] and\nbroadcasts it over [FM][] through the GPIO pin 7 ([GPIO #4][gpio]). If you add\nan antenna (20cm of plain wire will do), the range increases from ~10cm to ~100 meters.\n\nThe program is able to broadcast both mono and stereo (plus [RDS][]).\nIt has various settings to customize resampling, latency and more, see below.\n\n\n## Quick start\n\nJust get the appropiate tools:\n\n    sudo apt-get install jackd2 libjack-jackd2-dev build-essential\n\nAnd then build!\n\n    make\n\nIf everything went well, execute with `sudo ./jackpifm`.\n\nBy default, `jackpifm` emits in 103.3MHz carrier frequency. You can change\nthis with the `-f` option. You can also pass a JACK port as an argument\nand `jackpifm` will connect to it, or you can connect ports manually, you\nknow.\n\n**Warning:** Don't start this program while sound is being played through\nthe builtin soundcard, or vice versa. This will render both unusable until\nthe next reboot.\n\nHave fun! It's still recommended to read the rest of this README.\n\n\n## Synchronization\n\nWith the new version, we use a ringbuffer and a PI controller to acommodate\ndesynchronization between JACK and the GPIO. We do this by changing the rate at which\nGPIO accepts frames.\n\nAfter firing `jackpifm` you'll see some errors; this is normal, the controller\nis still initailizing. After ~30 seconds, there should be no errors and the\npitch should move between a 0.03% range, far low to be perceived or even\nmeasured.\n\n### Latency\n\nWhen started, `jackpifm` will print a bunch of information, including the minimum\nand maximum latencies, and the targetted (typical) latency. Here \"latency\" is the\ntime passed between getting a sample in the JACK port, and emitting the FM wave.\n\nThe controller will keep the latency as close to the target latency as possible,\nand it's currently good at it (I see no more than a few milliseconds of deviation\nin my B+).\n\nHowever this is not a guarantee, and in some cases the latency can\nget out of control and reach the maximum or minimum, in which case\nthe controller will be resetted and you'll hear glitches.\n\n**Protip:** If you hear glitches or get error messages, try increasing `-b` to improve\nstability. On the other hand, if you want to force less latency changes, decrease it.\nSee also \"Resampling\" below.\n\n\n## Resampling\n\nIf `-r` is enabled, `jackpifm` will resample all sound from JACK into 152kHz before\nemitting it. This means a bit more load on the CPU and GPIO, and translates into\n**distorsion** in FM except when absolute silence is being emitted.\n\nIt also means lower latency but higher pitch changes.\n\nIt's required if you want to enable Stereo or RDS (see below).\n\n\n## Stereo\n\nIf you pass in the `--stereo` option, `jackpifm` will open two JACK ports,\n`left` and `right`, and modulate them together. An FM stereo radio should be able\nto separate both channels back, while on a mono radio you'll hear them mixed\n(average value) but at 90% of its value.\n\nIf you enable `--stereo` you may pass two ports (left and right) instead of one.\n\n**Note:** I haven't verified the feature works in this version.\n\n\n## RDS\n\n[RDS][] allows a radio station to embed a little bitstream into the emitted FM.\nThe stream contains data about station name, currently playing program, genre,\nand notifications.\n\nTo make `jackpifm` embed an already encoded RDS blob in the emission, pass\nthe blob file through the option `-R`. To emit the example RDS blob, you'd do:\n\n    ./jackpifm -r -R example.rds\n\nIf you want to generate your own blob, you can use [rds-utils][].\n\n**Note:** I haven't verified the feature works in this version.\n\n\n## Other options\n\nThere are other options not explained here, that allow you to disable the\npre-emphasis built-in filter, change the JACK client name, change resampling\nquality and more. Look at the help message and / or the code.\n\n\n## Emission details\n\nUnder the hood, `jackpifm` communicates with the GPIO controller, and sends commands\nto output HIGH and LOW voltages at the correct timing to approximate an FM wave.\n\nIt's a very rough approximation, and even though it does the job pretty well, keep\nin mind **you're disturbing higher frequencies** outside the FM range. Also\nemitting FM will probably be illegal in your country.\n\n**Warning:** FM only allows samples at the range [-1, +1]. Any sample exceeding\nthat range will be cropped, and a warning will be output.\n\nWhen it comes to range:\n\n\u003e When testing, the signal only started to break up after we went through several\n\u003e conference rooms with heavy walls, at least 50m away, and crouched behind a heavy\n\u003e metal cabinet.\n\nI still hear a subtle creak every second or so, which I believe to be associated to\nthe GPIO instruction buffer wrapping around and jumping to the start.\n\nIf you want to know more about how the emission is done, see [the original page][original].\n\n\n## History\n\nThis was originally published [here][original]. I took the code and simplified it,\nrewrote it in C, made it modular and consistent and added JACK support.\n\nWhy JACK? JACK makes it easy for applications to share sound in a real-time way. You can\neven use it [over a network][NetJack] too.\n\nSure, you can always use `avconv` and `netcat` to feed PCM to the original program.\nBut if you do, you'll get at least one-second latency, and the emission won't be\nstable at all.\n\nThis corrects some other bugs that arise with a real-time audio source.\n\n\n\n[JACK]: http://jackaudio.org \"JACK project homepage\"\n[FM]: http://en.wikipedia.org/wiki/Frequency_modulation \"Frequency Modulation\"\n[RDS]: http://en.wikipedia.org/wiki/Radio_Data_System \"Radio Data System\"\n[NetJack]: http://www.trac.jackaudio.org/wiki/WalkThrough/User/NetJack \"NetJack user guide\"\n[original]: http://www.icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter \"Original page\"\n[gpio]: http://elinux.org/RPi_Low-level_peripherals#General_Purpose_Input.2FOutput_.28GPIO.29\n[rds-utils]: https://github.com/mildsunrise/rds-utils\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmildsunrise%2Fjackpifm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmildsunrise%2Fjackpifm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmildsunrise%2Fjackpifm/lists"}