Trying to use Beast on FreeBSD - Device not async capable

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: cesium, dev, kodachi, hannu

Trying to use Beast on FreeBSD - Device not async capable

Postby mixx941 » Fri Apr 21, 2006 8:09 am

Hi everyone. This is my first time trying 4Front's OSS driver, but I really want to get back into producing music and I run FreeBSD exclusively now so this is my option for MIDI.

Everytime I start up Beast and try to playback, I get the following:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Device not async capable

There is another thread from a couple months ago that has the same error, but no solution. Searching Google only turns this up from one of the developers of Beast:

and that'll only occour if the following code during /dev/dsp initialization
failed to execute:

/* to get usable low-latency behaviour with OSS, we
* make the device blocking, choose small fragments
* and read() the first fragment once available.
*/
d_long = fcntl (fd, F_GETFL);


I'm not a developer so I have no idea how that ties into OSS, but thought I'd include that.

Here's my /dev/sndstat.

Thanks

-Mark

OSS/FreeBSD 3.99.4a (C) 4Front Technologies 1996-2006

License serial number: E00000008
**** UNREGISTERED VERSION ****

Drivers: ALL
License will expire after: 06/2006


*** Unregistered version ***

Build: 200603120005
Kernel: FreeBSD 6.1-RC #11: Fri Apr 21 01:49:10 CDT 2006
mixx941@amd64.localhost:/usr/obj/usr/src/sys/AMD643000


Card config:
Sound Blaster Audigy at 0x9400 irq 16

Audio devices:
0: SB Audigy2 (DUPLEX)
1: SB Audigy2 playback 1 (front)
2: SB Audigy2 playback 2 (surround)
3: SB Audigy2 playback 3 (center/lfe)
4: SB Audigy2 playback 4 (rear)
5: SB Audigy2 playback 5
6: SB Audigy2 playback 6
7: SB Audigy2 raw S/PDIF (output only)
8: SB Audigy2 5.1 output device

Synth devices:

Midi devices:
0: Audigy UART

Mixers:
0: SB Audigy2 (STAC9721)

History:
dsp0: OUT
dsp0: OUT
dsp0: OUT
dsp0: OUT
dsp0: OUT
mixx941
New Member
 
Posts: 7
Joined: Fri Apr 21, 2006 7:49 am

Re: Trying to use Beast on FreeBSD - Device not async capabl

Postby dev » Fri Apr 21, 2006 6:01 pm

mixx941 wrote:Hi everyone. This is my first time trying 4Front's OSS driver, but I really want to get back into producing music and I run FreeBSD exclusively now so this is my option for MIDI.

Everytime I start up Beast and try to playback, I get the following:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Device not async capable

There is another thread from a couple months ago that has the same error, but no solution. Searching Google only turns this up from one of the developers of Beast:

and that'll only occour if the following code during /dev/dsp initialization
failed to execute:

/* to get usable low-latency behaviour with OSS, we
* make the device blocking, choose small fragments
* and read() the first fragment once available.
*/
d_long = fcntl (fd, F_GETFL);




They have totally misunderstood nonblocking!. You should edit that piece of code out and recompile beast and see if that helps.



best regards
Dev Mazumdar
dev
Developer
 
Posts: 578
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby mixx941 » Fri Apr 21, 2006 9:27 pm

Thanks for your response. I tried a couple different things since I'm not really sure.

Here is that section of original code:

Code: Select all
static BseErrorType
oss_device_setup (OSSHandle *oss,
                  guint      req_queue_length)
{
  BsePcmHandle *handle = &oss->handle;
  gint fd = oss->fd;
  glong d_long;
  gint d_int;

   /* to get usable low-latency behaviour with OSS, we
   * make the device blocking, choose small fragments
   * and read() the first fragment once available.
   */
  d_long = fcntl (fd, F_GETFL);
  d_long &= ~O_NONBLOCK;
  if (fcntl (fd, F_SETFL, d_long))
    return BSE_ERROR_DEVICE_ASYNC;

  d_int = 0;
  if (ioctl (fd, SNDCTL_DSP_GETFMTS, &d_int) < 0)
    return BSE_ERROR_DEVICE_FORMAT;
  if ((d_int & AFMT_S16_HE) != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  d_int = AFMT_S16_HE;
  if (ioctl (fd, SNDCTL_DSP_SETFMT, &d_int) < 0 ||
      d_int != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  guint bytes_per_value = 2;

  d_int = handle->n_channels - 1;
  if (ioctl (fd, SNDCTL_DSP_STEREO, &d_int) < 0)
    return BSE_ERROR_DEVICE_CHANNELS;
  if (handle->n_channels != d_int + 1)
    return BSE_ERROR_DEVICE_CHANNELS;
  oss->frame_size = handle->n_channels * bytes_per_value;

  d_int = handle->mix_freq;
  if (ioctl (fd, SNDCTL_DSP_SPEED, &d_int) < 0)
    return BSE_ERROR_DEVICE_FREQUENCY;
  handle->mix_freq = d_int;
  if (MAX (d_int, handle->mix_freq) - MIN (d_int, handle->mix_freq) > handle->mix_freq / 100)
    return BSE_ERROR_DEVICE_FREQUENCY;

LATER IN THE FILE:

  glong d_long = fcntl (oss->fd, F_GETFL);
  DEBUG ("OSS: retriggering device (blocking=%u, r=%d, w=%d)...", (int) !(d_long & O_NONBLOCK), handle->readable, handle->writable);



I tried a couple different combinations, but this following one produces:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Failed to configure device buffer

Code: Select all
static BseErrorType
oss_device_setup (OSSHandle *oss,
                  guint      req_queue_length)
{
  BsePcmHandle *handle = &oss->handle;
  gint fd = oss->fd;
//  glong d_long;
  gint d_int;

  /* to get usable low-latency behaviour with OSS, we
   * make the device blocking, choose small fragments
   * and read() the first fragment once available.
   */
/*  d_long = fcntl (fd, F_GETFL);
  d_long &= ~O_NONBLOCK; */
//  if (fcntl (fd, F_SETFL, d_long))
  //  return BSE_ERROR_DEVICE_ASYNC;

  d_int = 0;
  if (ioctl (fd, SNDCTL_DSP_GETFMTS, &d_int) < 0)
    return BSE_ERROR_DEVICE_FORMAT;
  if ((d_int & AFMT_S16_HE) != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  d_int = AFMT_S16_HE;
  if (ioctl (fd, SNDCTL_DSP_SETFMT, &d_int) < 0 ||
      d_int != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  guint bytes_per_value = 2;

  d_int = handle->n_channels - 1;
  if (ioctl (fd, SNDCTL_DSP_STEREO, &d_int) < 0)
    return BSE_ERROR_DEVICE_CHANNELS;
  if (handle->n_channels != d_int + 1)
    return BSE_ERROR_DEVICE_CHANNELS;
  oss->frame_size = handle->n_channels * bytes_per_value;

  d_int = handle->mix_freq;
  if (ioctl (fd, SNDCTL_DSP_SPEED, &d_int) < 0)
    return BSE_ERROR_DEVICE_FREQUENCY;
  handle->mix_freq = d_int;
  if (MAX (d_int, handle->mix_freq) - MIN (d_int, handle->mix_freq) > handle->mix_freq / 100)
    return BSE_ERROR_DEVICE_FREQUENCY;

LATER IN THE FILE:

//  glong d_long = fcntl (oss->fd, F_GETFL);
//  DEBUG ("OSS: retriggering device (blocking=%u, r=%d, w=%d)...", (int) !(d_long & O_NONBLOCK), handle->readable, handle->writable);


Sorry for posting so much not really related to your drivers...just trying to find a solution. :) If you can think of anything for me to tell the Beast people, I can try to get in touch with them, but I'm lost as to what to say right now.

Thanks

-Mark
mixx941
New Member
 
Posts: 7
Joined: Fri Apr 21, 2006 7:49 am

Postby dev » Sat Apr 22, 2006 4:50 am

mixx941 wrote:Thanks for your response. I tried a couple different things since I'm not really sure.

Here is that section of original code:

Code: Select all
static BseErrorType
oss_device_setup (OSSHandle *oss,
                  guint      req_queue_length)
{
  BsePcmHandle *handle = &oss->handle;
  gint fd = oss->fd;
  glong d_long;
  gint d_int;

   /* to get usable low-latency behaviour with OSS, we
   * make the device blocking, choose small fragments
   * and read() the first fragment once available.
   */
  d_long = fcntl (fd, F_GETFL);
  d_long &= ~O_NONBLOCK;
  if (fcntl (fd, F_SETFL, d_long))
    return BSE_ERROR_DEVICE_ASYNC;

  d_int = 0;
  if (ioctl (fd, SNDCTL_DSP_GETFMTS, &d_int) < 0)
    return BSE_ERROR_DEVICE_FORMAT;
  if ((d_int & AFMT_S16_HE) != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  d_int = AFMT_S16_HE;
  if (ioctl (fd, SNDCTL_DSP_SETFMT, &d_int) < 0 ||
      d_int != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  guint bytes_per_value = 2;

  d_int = handle->n_channels - 1;
  if (ioctl (fd, SNDCTL_DSP_STEREO, &d_int) < 0)
    return BSE_ERROR_DEVICE_CHANNELS;
  if (handle->n_channels != d_int + 1)
    return BSE_ERROR_DEVICE_CHANNELS;
  oss->frame_size = handle->n_channels * bytes_per_value;

  d_int = handle->mix_freq;
  if (ioctl (fd, SNDCTL_DSP_SPEED, &d_int) < 0)
    return BSE_ERROR_DEVICE_FREQUENCY;
  handle->mix_freq = d_int;
  if (MAX (d_int, handle->mix_freq) - MIN (d_int, handle->mix_freq) > handle->mix_freq / 100)
    return BSE_ERROR_DEVICE_FREQUENCY;

LATER IN THE FILE:

  glong d_long = fcntl (oss->fd, F_GETFL);
  DEBUG ("OSS: retriggering device (blocking=%u, r=%d, w=%d)...", (int) !(d_long & O_NONBLOCK), handle->readable, handle->writable);



I tried a couple different combinations, but this following one produces:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Failed to configure device buffer

Code: Select all
static BseErrorType
oss_device_setup (OSSHandle *oss,
                  guint      req_queue_length)
{
  BsePcmHandle *handle = &oss->handle;
  gint fd = oss->fd;
//  glong d_long;
  gint d_int;

  /* to get usable low-latency behaviour with OSS, we
   * make the device blocking, choose small fragments
   * and read() the first fragment once available.
   */
/*  d_long = fcntl (fd, F_GETFL);
  d_long &= ~O_NONBLOCK; */
//  if (fcntl (fd, F_SETFL, d_long))
  //  return BSE_ERROR_DEVICE_ASYNC;

  d_int = 0;
  if (ioctl (fd, SNDCTL_DSP_GETFMTS, &d_int) < 0)
    return BSE_ERROR_DEVICE_FORMAT;
  if ((d_int & AFMT_S16_HE) != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  d_int = AFMT_S16_HE;
  if (ioctl (fd, SNDCTL_DSP_SETFMT, &d_int) < 0 ||
      d_int != AFMT_S16_HE)
    return BSE_ERROR_DEVICE_FORMAT;
  guint bytes_per_value = 2;

  d_int = handle->n_channels - 1;
  if (ioctl (fd, SNDCTL_DSP_STEREO, &d_int) < 0)
    return BSE_ERROR_DEVICE_CHANNELS;
  if (handle->n_channels != d_int + 1)
    return BSE_ERROR_DEVICE_CHANNELS;
  oss->frame_size = handle->n_channels * bytes_per_value;

  d_int = handle->mix_freq;
  if (ioctl (fd, SNDCTL_DSP_SPEED, &d_int) < 0)
    return BSE_ERROR_DEVICE_FREQUENCY;
  handle->mix_freq = d_int;
  if (MAX (d_int, handle->mix_freq) - MIN (d_int, handle->mix_freq) > handle->mix_freq / 100)
    return BSE_ERROR_DEVICE_FREQUENCY;

LATER IN THE FILE:

//  glong d_long = fcntl (oss->fd, F_GETFL);
//  DEBUG ("OSS: retriggering device (blocking=%u, r=%d, w=%d)...", (int) !(d_long & O_NONBLOCK), handle->readable, handle->writable);


Sorry for posting so much not really related to your drivers...just trying to find a solution. :) If you can think of anything for me to tell the Beast people, I can try to get in touch with them, but I'm lost as to what to say right now.

Thanks

-Mark


Hi Mark,


See where the device is openend because your error is:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened


Also are you sure that OSS is running?. Run soundoff and soundon just to make sure. Also check that /dev/dsp is linked to /dev/dsp0 (or to the appropriate device in cat /dev/sndstat)


best regards
Dev Mazumdar
dev
Developer
 
Posts: 578
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby mixx941 » Sat Apr 22, 2006 6:19 am

Yeah, it's definitely running and Beast is seeing it. If I try to tell Beast to playback while listening to something else in another program, I get:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Device or resource busy

Note that last line there. If I stop playing a song in XMMS and try to output with Beast, it's back to the second error:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Failed to configure device buffer

That's another question I had, about why I cannot play two things at once like I can with the drivers included with FreeBSD, but I'll leave that for another thread since this one is complicated as it is.

Anyway, I think maybe my code modification broke something further? I'm not sure which is worse, "Failed to configure device buffer" or "Device not async capable". Also, when running Beast, I am now using the following command line arguments to be sure it's using the proper devices, but I think it already was using the right ones:

--bse-pcm-driver oss=/dev/dsp,rw --bse-midi-driver oss=/dev/midi,rw

...and /dev/dsp is linked to /dev/dsp0

Thanks again!

-Mark
mixx941
New Member
 
Posts: 7
Joined: Fri Apr 21, 2006 7:49 am

Postby dev » Sat Apr 22, 2006 5:20 pm

mixx941 wrote:Yeah, it's definitely running and Beast is seeing it. If I try to tell Beast to playback while listening to something else in another program, I get:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Device or resource busy

Note that last line there. If I stop playing a song in XMMS and try to output with Beast, it's back to the second error:

beast:BSE-Error:0: No Audio
beast:BSE-Error:1: No available audio device was found.
beast:BSE-Error:2: No available audio device could be found and opened successfully. Sorry, no fallback selection can be made for audio devices, giving up.
beast:BSE-Error:3: Failed to open PCM devices: Failed to configure device buffer

That's another question I had, about why I cannot play two things at once like I can with the drivers included with FreeBSD, but I'll leave that for another thread since this one is complicated as it is.

Anyway, I think maybe my code modification broke something further? I'm not sure which is worse, "Failed to configure device buffer" or "Device not async capable". Also, when running Beast, I am now using the following command line arguments to be sure it's using the proper devices, but I think it already was using the right ones:

--bse-pcm-driver oss=/dev/dsp,rw --bse-midi-driver oss=/dev/midi,rw

...and /dev/dsp is linked to /dev/dsp0

Thanks again!

-Mark



OK then the problem is that you are trying to use the same device in two different apps and so you need to tell XMMS to use one device and beast to use another device (in xmms configure it to use one of the virtual devices and tell beast to use another virtual device).

I don't know how beast works so this is my best guess.

best regards
Dev Mazumdar
dev
Developer
 
Posts: 578
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby mixx941 » Sat Apr 22, 2006 8:21 pm

What about when absolutely nothing else is running audio wise and the errors are:

beast:BSE-Error:3: Failed to open PCM devices: Failed to configure device buffer (with my code change)

or

beast:BSE-Error:3: Failed to open PCM devices: Device not async capable (with an untouched install via their sources)

All prior attempts have been with nothing running, but I just tried with something else playing to show that Beast is trying the proper devices.

Thanks

-Mark
mixx941
New Member
 
Posts: 7
Joined: Fri Apr 21, 2006 7:49 am


Return to BSD

Who is online

Users browsing this forum: No registered users and 1 guest

cron