{"repo":"mill1000/raspdif","free":true,"listed":false,"github":"https://github.com/mill1000/raspdif","clone":"git clone https://github.com/mill1000/raspdif.git","description":"Raspberry Pi S/PDIF digital audio without a HAT.","language":"C","stars":84,"topics":["audio","raspberry-pi"],"license":"MIT","category":"media-processing","readme_excerpt":"raspdif - Raspberry Pi S/PDIF S/PDIF audio output on Raspberry Pi without a HAT. raspdif accepts 16 or 24 bit PCM samples from stdin, a file, or a FIFO (named pipe). Samples are encoded and transmitted as S/PDIF data on GPIO21 (Pin 40 on J8). For older boards without a 40-pin header, see here. Table Of Contents - Building - Arguments - ALSA Configuration - Manual Usage - Signal Levels - Alternate GPIO - TOSLINK Optical Output Building Prerequisites Raspberry Pi 1, 2, 3 or 4. The Raspberry Pi 5 has a different SOC architecture and is not currently supported. clang - Tested against clang version 3.8.1-24+rpi1 and clang version 11.0.1-2+rpi1 . 32-bit Raspberry Pi OS (64-bit support is experimental). Install necessary packages Just run make. No configuration right now. Install to default location ( /usr/local/bin ) ALSA Configuration ALSA can be configured to use raspdif in a seamless manner. Any application that supports ALSA will output via raspdif. It also allows access to other ALSA plugins like softvol . First, a PCM device is defined that outputs raw samples to a FIFO. This example configuration can be used in either /etc/asound.conf for system wide configuration or /.asoundrc for user configuration. A raspdif device should now be visible with aplay -L . Next, create a raspdif service that monitors the FIFO. This minimal systemd service does a decent job. Copy raspdif.service to /etc/systemd/system and run the following. Playback is now as simple as aplay some wav file.wav ","default_branch":null,"files":null,"tree":[],"storefront":"/r/mill1000","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mill1000/raspdif/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}