...
1# Audio in containers on IEN
2
3## Requires:
4
5- Retail Device Manager
6- Audio
7
8## Usage Instructions:
9
10### Audio Client
11Create the following Dockerfile:
12
13```Dockerfile
14FROM alpine:latest
15
16RUN apk update && apk add --no-cache \
17 alsa-lib \
18 alsa-utils \
19 pulseaudio \
20 pulseaudio-alsa \
21 pulseaudio-utils
22
23COPY [AUDIO_FILE] /[AUDIO_FILE]
24```
25
26Build this image locally and upload the image to the IEN
27
28### IEN:
29
30Import client images into local container registry
31
32Label nodes you want Audio enabled on:
33
34- `kubectl label nodes <nodename> node.ncr.com/class=touchpoint`
35
36Apply the following manifest for an audio client pod.
37
38```yaml
39apiVersion: v1
40kind: Pod
41metadata:
42 name: audio-client
43spec:
44 containers:
45 -
46 # Uncomment one of these lines
47 command: ["paplay", "-p", "/[AUDIO_FILE]"] # This is a pulseaudio playback test
48 env:
49 - name: XDG_RUNTIME_DIR
50 value: /tmp/xdg_runtime
51 - name: PULSE_SERVER
52 value: /tmp/xdg_runtime/pa.socket
53 image: audio-client:latest
54 imagePullPolicy: IfNotPresent
55 name: audio-client
56 volumeMounts:
57 - mountPath: /tmp/runtime
58 name: xdg-runtime
59 readOnly: false
60 nodeSelector:
61 node.ncr.com/class: touchpoint
62 volumes:
63 - hostPath:
64 path: /tmp/runtime
65 type: Directory
66 name: xdg-runtime
67```
68
View as plain text