summaryrefslogtreecommitdiffstats
path: root/docs/3. Usage.md
blob: b5ec13610cb4b9ce456e9e13c39e31a4c9fe4b87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Using AVIRT
===================================

## Introduction

## Table of Contents
1. [Load/Unload AVIRT](#un-load-avirt)
2. [Configuring AVIRT](#configuring-avirt)

<a name="un-load-avirt"/>

## Loading and Unloading AVIRT

To run, we must load the kernel modules using the `loadDrivers.sh` script, which contains sample module parameters to AVIRT:
```sh
$ ./loadDrivers.sh
```
To unload the drivers use:
```sh
$ ./unload.sh
```

<a name="configure-avirt" />

## Configuring AVIRT

AVIRT is configured using configfs.
### Note: 
A sample script for the following is supplied inside the ```scripts``` folder.

First, verify the kernel supports the use of configfs.
```sh
fgrep configfs /proc/filesystems
```

the expected output is:
```
nodev	configfs
```

Once confirmed, we can mount the configfs at the conventional point:
```sh
#Check configfs is mounted on the system
mkdir -p /config
mount -t configfs none /config
```

Finally, we can configure AVIRT:

```sh
# Set up each of the cards channels
mkdir /config/avirt/streams/playback_media
echo "2">/config/avirt/streams/playback_media/channels

mkdir /config/avirt/streams/playback_navigation
echo "1">/config/avirt/streams/playback_navigation/channels

mkdir /config/avirt/streams/playback_emergency
echo "1">/config/avirt/streams/playback_emergency/channels

mkdir /config/avirt/streams/capture_voice
echo "1">/config/avirt/streams/capture_voice/channels

# Finally, seal the card, and initiate configuration
echo "1">/config/avirt/streams/sealed
```

### Note:
A simplified helper library, libavirt, is available [here](https://github.com/fiberdyne/libavirt).
Please refer to the readme in libavirt for further details.