~ubuntu-branches/ubuntu/vivid/oss4/vivid

« back to all changes in this revision

Viewing changes to tutorials/sndkit/sblive/testgen.c

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis, Samuel Thibault, Romain Beauxis, Sebastien NOEL
  • Date: 2011-06-14 10:06:56 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110614100656-cx4oc7u426zn812z
Tags: 4.2-build2004-1
[ Samuel Thibault ]
* debian/control: Add liboss4-salsa2, liboss4-salsa-dev and
  liboss4-salsa-asound2 packages, equivalent to (and will replace) those from
  the oss-libsalsa package (Closes: #589127).
* debian/patches/liboss4-salsa.patch: New patch to rename libsalsa into
  liboss4-salsa to avoid conflicts in the archive for no good reason.
* debian/rules: Make in libOSSlib and libsalsa.
* debian/liboss4-salsa-dev.install, debian/liboss4-salsa2.install,
  debian/liboss4-salsa-asound2.links, debian/liboss4-salsa-dev.links:
  Install liboss4-salsa libraries like was done in the oss-libsalsa package.
* include-alsa: Add a copy of ALSA 1.0.5 headers: Cf ALSA_1.0.* symbols in
  libsalsa, this is the roughly supported version.
* debian/copyright: Update for new include-alsa files.
* alsa.pc: New file for compatibility with libasound-dev.
* debian/control:
  - Add Vcs-Browser and Vcs-Svn fields.
  - Use linux-any instead of the list of Linux archs (Closes: #604679).
  - Make dkms dependency linux-any only.
* debian/patches/hurd_iot.patch: New patch to fix soundcard.h usage in
  libsalsa on hurd-i386.
* debian/patches/libsalsa_fixes.patch: New patch to fix some printf usages
  and ioctl declaration in libsalsa.
* debian/patches/no_EBADE.patch: New patch to cope with hurd-i386 not having
  EBADE.
* debian/patches/CFLAGS.patch: New patch to make oss4 take debian/rules
  CFLAGS into account.
* debian/patches/snd_asoundlib_version.patch: New patch to add
  snd_asoundlib_version().
* debian/patches/generic_srccconf.patch: New patch to fix source
  configuration on unknown archs.

[ Romain Beauxis ]
* Fixed README.Debian to only mention dkms' modules.
* Switch to dpkg-source 3.0 (quilt) format
* Added DM-Upload-Allowed: yes

[ Sebastien NOEL ]
* New upstream release (Closes: #595298, #619272).
* Fix typo in initscript (Closes: #627149).
* debian/control: adjust linux-headers dependencies (Closes: #628879).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
 
 
4
#define N 64
 
5
 
 
6
static void
 
7
gen_inputtest (void)
 
8
{
 
9
  int i;
 
10
 
 
11
  printf ("// Input test program\n");
 
12
  printf ("#include \"vu.mac\"\n");
 
13
  printf (".gpr VUTMP\n");
 
14
  printf (".gpr TMP\n");
 
15
 
 
16
  for (i = 0; i < N; i += 2)
 
17
    {
 
18
      printf (".input I%d_L     %d\n", i, i);
 
19
      printf (".input I%d_R     %d\n", i, i + 1);
 
20
    }
 
21
 
 
22
  for (i = 0; i < N; i += 2)
 
23
    {
 
24
      if (!(i % 16))
 
25
        printf (".parm G%x              0               group\n", i);
 
26
      printf (".parm IVU%d      0               stereopeak\n", i);
 
27
    }
 
28
 
 
29
  for (i = 0; i < N; i += 2)
 
30
    {
 
31
      printf ("ACC3(TMP, I%d_L, 0, 0)\n", i);
 
32
      printf ("VU(IVU%d_L, TMP)\n", i);
 
33
      printf ("ACC3(TMP, I%d_R, 0, 0)\n", i);
 
34
      printf ("VU(IVU%d_R, TMP)\n", i);
 
35
    }
 
36
 
 
37
}
 
38
 
 
39
static void
 
40
gen_outputtest (void)
 
41
{
 
42
  int i;
 
43
 
 
44
  printf ("// Output test program\n");
 
45
  printf ("#include \"vu.mac\"\n");
 
46
  printf (".parm VU 0 stereopeak\n");
 
47
  printf (".gpr VUTMP\n");
 
48
  printf (".gpr TMP\n");
 
49
  printf (".gpr TMP_L\n");
 
50
  printf (".gpr TMP_R\n");
 
51
  printf (".send TEST_L 0\n");
 
52
  printf (".send TEST_R 1\n");
 
53
 
 
54
  for (i = 0; i < N; i += 2)
 
55
    {
 
56
      printf (".output O%d_L    %d\n", i, i);
 
57
      printf (".output O%d_R    %d\n", i, i + 1);
 
58
    }
 
59
 
 
60
  for (i = 0; i < N; i += 2)
 
61
    {
 
62
      if (!(i % 16))
 
63
        printf (".parm G%x              0               group\n", i);
 
64
      printf (".parm OUT%d      0               stereo\n", i);
 
65
    }
 
66
 
 
67
  printf ("ACC3(TMP_L, TEST_L, 0, 0)\n");
 
68
  printf ("ACC3(TMP_R, TEST_R, 0, 0)\n");
 
69
  printf ("VU(VU_L, TMP_L)\n");
 
70
  printf ("VU(VU_R, TMP_R)\n");
 
71
 
 
72
  for (i = 0; i < N; i += 2)
 
73
    {
 
74
      printf ("MACS(O%d_L, 0, TMP_L, OUT%d_L)\n", i, i);
 
75
      printf ("MACS(O%d_R, 0, TMP_R, OUT%d_R)\n", i, i);
 
76
    }
 
77
 
 
78
}
 
79
 
 
80
int
 
81
main (int argc, char *argv[])
 
82
{
 
83
  if (argc < 2)
 
84
    exit (-1);
 
85
 
 
86
  if (strcmp (argv[1], "in") == 0)
 
87
    gen_inputtest ();
 
88
 
 
89
  if (strcmp (argv[1], "out") == 0)
 
90
    gen_outputtest ();
 
91
  exit (0);
 
92
}