summaryrefslogtreecommitdiff
path: root/cmd/osstest/help.c
blob: 4d29f76ab3a0f300ade8fad39a9fb33aad1e20b8 (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
/*
 *
 * This file is part of Open Sound System.
 *
 * Copyright (C) 4Front Technologies 1996-2008.
 *
 * This this source file is released under GPL v2 license (no other versions).
 * See the COPYING file included in the main directory of this source
 * distribution for the license terms and conditions.
 *
 */

#include <stdio.h>
#include <errno.h>

void
describe_error (int err)
{
  switch (err)
    {
    case ENODEV:
      fprintf (stderr, "The device file was found in /dev but\n"
	       "OSS is not loaded. You need to load it by executing\n"
	       "the soundon command.\n");
      break;

    case ENXIO:
      fprintf (stderr, "There are no sound devices available.\n"
	       "The most likely reason is that the device you have\n"
	       "is malfunctioning or it's not supported by OSS.\n"
	       "It's also possible that you are trying to use the wrong "
	       "device file.\n"
	       "Please fill the problem report at\n"
	       "http://www.opensound.com/support.cgi\n");
      break;

    case ENOSPC:
      fprintf (stderr, "Your system cannot allocate memory for the device\n"
	       "buffers. Reboot your machine and try again.\n");
      break;

    case ENOENT:
      fprintf (stderr, "The device file is missing from /dev.\n"
	       "Perhaps you have not installed and started Open Sound System yet\n");
      break;


    case EBUSY:
      fprintf (stderr, "The device is busy. There is some other application\n"
	       "using it.\n");

      break;
    default:;
    }
}