[GnomeMeeting-devel-list] Problems in the ALSA plugin



Hi,

I wanted to play a .wav on my soundcard using pwlib; I then encountered
the following two problems:

1) when the program gets the list of available ALSA devices, then tries
to play the .wav, it can open the device, but it doesn't play correctly
(essai: pcm.c:5946: snd_pcm_mmap_commit: Assertion `frames <=
snd_pcm_mmap_avail(pcm)' failed.); I don't know if it's a bug, but it
looks like it.

2) when it doesn't get the list of devices first, but directly opens the
device (it already knows the device name), it cannot open the device:
the plugin didn't realize it hadn't setup the list of devices-names, and
returned NULL. This I think this one is a bug.

The sources of my test program are attached, with instructions on what
to comment, and how to compile.

Snark
/*
  compiles with "g++ essai.cc -o essai -lpt" under Debian
  (relies on /usr/share/sounds/login.wav, and having the same soundcard as me)
*/

#include <ptlib.h>

class Application: public PProcess
{
  PCLASSINFO(Application, PProcess);

public:
  Application ();
  ~Application ();

  virtual void Main ();
};

PCREATE_PROCESS(Application);

Application::Application ()
{
  printf ("Starting\n");
}

Application::~Application ()
{
  printf ("Stopping\n");
}

void Application::Main ()
{
  PString driverName = "ALSA";
  PString deviceName = "Ensoniq AudioPCI";

  /* remove this comment's end: */
  PStringList deviceList = PSoundChannel::GetDeviceNames (driverName, PSoundChannel::Player);
  for (PINDEX i = 0; i < deviceList.GetSize (); i++)
    printf ("<" + *(PString *)deviceList.GetAt (i) + ">\n");
  /* */

  PSoundChannel *sound = PSoundChannel::CreateOpenedChannel (driverName, deviceName, PSoundChannel::Player);

  if (sound == NULL) 
    {
      printf ("Null!\n");
      return;
    }

  if (sound->PlayFile ("/usr/share/sounds/login.wav", TRUE))
    printf ("Ok\n");
  else
    printf ("Bad\n");
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]