Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Dec 2017 19:55:12 +0800
From:      blubee blubeeme <gurenchan@gmail.com>
To:        Sid <sid@bsdmail.com>
Cc:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: OSS Audio
Message-ID:  <CALM2mEk3q_KZ3PwUkdJ-jzoBiSyb=0iM0nox=LoUFk5KhkAu%2BQ@mail.gmail.com>
In-Reply-To: <CALM2mEm6X_c-F1wG%2BNm0HfxrrC5cqzjoYKMTfOO=dSF310uGvw@mail.gmail.com>
References:  <trinity-9188e0c6-ebfd-489f-8879-486fa8275181-1513949492108@3c-app-mailcom-lxa03> <CALM2mEm6X_c-F1wG%2BNm0HfxrrC5cqzjoYKMTfOO=dSF310uGvw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 25, 2017 at 12:16 PM, blubee blubeeme <gurenchan@gmail.com>
wrote:

>
>
> On Fri, Dec 22, 2017 at 9:31 PM, Sid <sid@bsdmail.com> wrote:
>
>> OSS soundcard.h for FreeBSD stable and current
>> https://svn.freebsd.org/base/stable/11/sys/sys/
>> https://svn.freebsd.org/base/head/sys/sys/
>>
>> blubee blubeeme; Mon Dec 11 17:03:10 UTC 2017
>> > I'm taking a look at soundcard.h in /usr/include/sys/soundcard.h in
>> FreeBSD
>> > vs the soundcard.h in the offical OSS 4.01
>> > https://sourceforge.net/p/opensound/git/ci/master/tree/inclu
>> de/soundcard.h
>>
>> > It seems like there's been a lot of changes between FreeBSD 3.8ish
>> version
>> > and the 4.0 version.
>>
>> > I was grepping around to see if any other files included this
>> soundcard.h
>> > header and if updating to the latest would break any other programs.
>>
>
> I've been looking into this for a bit now and these ioctl seems missing or
> returning strange values.
>
> SNDCTL_DSP_COOKEDMODE
> SNDCTL_MIDIINFO
> SNDCTL_MIX_ENUMINFO
> SNDCTL_MIX_EXTINFO
> SNDCTL_CARDINFO
> SNDCTL_GETLABEL
> SNDCTL_SETLABEL
> SNDCTL_GETSONG
> SNDCTL_SETNAME
> SNDCTL_DSP_GET_CHNORDER
>
> oss_digital_control and it's related data structures seems to be missing,
> that needed for digital sources.
>     SNDCTL_DSP_READCTL
>     SNDCTL_DSP_WRITECTL
>
> The might be implemented in other places if so, where?
>
> I was trying to find some more info about the above functions and came
across this wiki page: https://wiki.freebsd.org/RyanBeasley/ioctlref

It already documents some of the reasons why the specific ioctls weren't
implemented and their progress.
Is there any updated information on this?

There's a huge chunk of code to test digital audio that can't be tested
because of [oss_digital_control] is missing,
code sample below:
----------------------------
#ifdef SHOW_STATUS
      time_t t;
      oss_digital_control c;

      c.valid = VAL_CBITIN | VAL_ISTATUS;

      if (ioctl (fd, SNDCTL_DSP_READCTL, &c) == -1)
{
  perror ("SNDCTL_DSP_READCTL");
  exit (-1);
}

      time (&t);
      printf ("\n%s\n", ctime (&t));

      if (c.valid & VAL_ISTATUS)
{
  switch (c.in_locked)
    {
    case LOCK_NOT_INDICATED:
      printf ("Receiver locked: Status unknown\n");
      break;
    case LOCK_UNLOCKED:
      printf ("receiver locked: *** NOT LOCKED ***\n");
      break;
    case LOCK_LOCKED:
      printf ("receiver locked: Locked OK\n");
      break;
    }

  switch (c.in_quality)
    {
    case IN_QUAL_NOT_INDICATED:
      printf ("Signal quality: Unknown\n");
      break;
    case IN_QUAL_POOR:
      printf ("Signal quality: *** POOR ***\n");
      break;
    case IN_QUAL_GOOD:
      printf ("Signal quality: Good\n");
      break;
    }

  switch (c.in_vbit)
    {
    case VBIT_NOT_INDICATED:
      printf ("V-bit: Unknown\n");
      break;
    case VBIT_ON:
      printf ("V-bit: On (not valid audio)\n");
      break;
    case VBIT_OFF:
      printf ("V-bit: Off (valid audio signal)\n");
      break;
    }

  switch (c.in_data)
    {
    case IND_UNKNOWN:
      printf ("Audio/data: Unknown\n");
      break;
    case IND_AUDIO:
      printf ("Audio/data: Audio\n");
      break;
    case IND_DATA:
      printf ("Audio/data: Data\n");
      break;
    }

  printf ("Errors: ");
  if (c.in_errors & INERR_CRC)
    printf ("CRC ");
  if (c.in_errors & INERR_QCODE_CRC)
    printf ("QCODE_CRC ");
  if (c.in_errors & INERR_PARITY)
    printf ("PARITY ");
  if (c.in_errors & INERR_BIPHASE)
    printf ("BIPHASE ");
  printf ("\n");
}
      else
printf ("No input status information available\n");

      if (c.valid & VAL_CBITIN && c.in_locked != LOCK_UNLOCKED)
{
  printf ("\n");
  printf ("Control bits: ");
  for (i = 0; i < 24; i++)
    printf ("%02x ", c.cbitin[i]);
  printf ("\n");

  if (c.cbitin[0] & 0x01)
    decode_pro_mode (c.cbitin);
  else
    decode_consumer_mode (c.cbitin);
}
      else
printf ("No incoming control bit information available\n");
#endif

----------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALM2mEk3q_KZ3PwUkdJ-jzoBiSyb=0iM0nox=LoUFk5KhkAu%2BQ>