Skip to content

Commit

Permalink
Enable basic audio support
Browse files Browse the repository at this point in the history
  • Loading branch information
fhunleth authored and mobileoverlord committed Oct 2, 2018
1 parent 41f1416 commit eeeb2e0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 36 deletions.
23 changes: 23 additions & 0 deletions README.md
Expand Up @@ -30,6 +30,7 @@ appropriate for your setup.
| Ethernet | Yes - via OTG USB port |
| WiFi | Supported on the Pi Zero W |
| Bluetooth | Not supported yet |
| Audio | HDMI/Stereo out |

## Using

Expand Down Expand Up @@ -79,6 +80,28 @@ The base image includes drivers for the onboard Raspberry Pi Zero W wifi module
(`brcmfmac` driver). Due to the USB port being placed in gadget mode, this
system does not support USB WiFi adapters.

## Audio

The Raspberry Pi has many options for audio output. This system supports the
HDMI and stereo audio jack output. The Linux ALSA drivers are used for audio
output.

To try it out, run:

```elixir
:os.cmd('espeak -ven+f5 -k5 -w /tmp/out.wav Hello')
:os.cmd('aplay -q /tmp/out.wav')
```

The general Raspberry Pi audio documentation mostly applies to Nerves. For
example, to force audio out the HDMI port, run:

```elixir
:os.cmd('amixer cset numid=3 2')
```

Change the last argument to `amixer` to `1` to output to the stereo output jack.

## Provisioning devices

This system supports storing provisioning information in a small key-value store
Expand Down
7 changes: 5 additions & 2 deletions config.txt
Expand Up @@ -5,6 +5,7 @@
#
# Useful links:
# https://www.raspberrypi.org/documentation/configuration/config-txt/README.md
# https://www.raspberrypi.org/documentation/configuration/device-tree.md
# https://github.com/raspberrypi/documentation/blob/master/configuration/device-tree.md

kernel=zImage
Expand All @@ -17,8 +18,10 @@ disable_splash=1
# configuration. See Target packages->Hardware handling->Firmware.
gpu_mem=192

# Enable I2C and SPI
dtparam=i2c_arm=on,spi=on
# Enable I2C, SPI, and audio
dtparam=i2c_arm=on
dtparam=spi=on
dtparam=audio=on

# Comment this in or modify to enable OneWire
# NOTE: check that the overlay that you specify is in the boot partition or
Expand Down
35 changes: 1 addition & 34 deletions linux-4.14.defconfig
Expand Up @@ -9,7 +9,6 @@ CONFIG_BLK_CGROUP=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_NAMESPACES=y
Expand Down Expand Up @@ -208,44 +207,12 @@ CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=y
CONFIG_SND=m
CONFIG_SND_HRTIMER=m
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_DUMMY=m
CONFIG_SND_ALOOP=m
CONFIG_SND_VIRMIDI=m
CONFIG_SND_MTPAV=m
CONFIG_SND_MPU401=m
CONFIG_SND_SOC=m
CONFIG_SND_BCM2835_SOC_I2S=m
CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m
CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m
CONFIG_SND_DIGIDAC1_SOUNDCARD=m
CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m
CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m
CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m
CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m
CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m
CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m
CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m
CONFIG_SND_PISOUND=m
CONFIG_SND_SOC_ADAU1701=m
CONFIG_SND_SOC_ADAU7002=m
CONFIG_SND_SOC_AK4554=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_WM8804_I2C=m
CONFIG_SND_SIMPLE_CARD=m
# CONFIG_HID_GENERIC is not set
CONFIG_USB_DWC2=y
Expand Down
10 changes: 10 additions & 0 deletions nerves_defconfig
Expand Up @@ -29,13 +29,23 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-0-w bcm2708-rpi-b-plus"
BR2_LINUX_KERNEL_EXT_KERNEL_WIRELESS_REGDB=y
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/busybox-1.22.config"
BR2_PACKAGE_ALSA_UTILS=y
# BR2_PACKAGE_ALSA_UTILS_ALSAMIXER is not set
BR2_PACKAGE_ALSA_UTILS_AMIXER=y
BR2_PACKAGE_ALSA_UTILS_APLAY=y
BR2_PACKAGE_ESPEAK=y
BR2_PACKAGE_E2FSPROGS=y
# BR2_PACKAGE_E2FSPROGS_FSCK is not set
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_KERNEL_4_14=y
BR2_PACKAGE_RPI_FIRMWARE_X=y
BR2_PACKAGE_RPI_WIFI_FIRMWARE=y
BR2_PACKAGE_RPI_USERLAND=y
# BR2_PACKAGE_ALSA_LIB_RAWMIDI is not set
# BR2_PACKAGE_ALSA_LIB_HWDEP is not set
# BR2_PACKAGE_ALSA_LIB_SEQ is not set
# BR2_PACKAGE_ALSA_LIB_ALISP is not set
# BR2_PACKAGE_ALSA_LIB_OLD_SYMBOLS is not set
BR2_PACKAGE_LIBMNL=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
Expand Down

0 comments on commit eeeb2e0

Please sign in to comment.