[mythtv-users] Squeezesoft prevents audio in .24

Jean-Yves Avenard jyavenard at gmail.com
Wed Nov 17 11:23:52 UTC 2010


On 17 November 2010 15:36, Gabe Rubin <gaberubin at gmail.com> wrote:

> Don't know what to say.  It worked.  I could not play from squeezesoft
> and myth simultaneously, but the two never seemed to conflict with
> each other.

Can you try this patch and see if it help having myth working while
another program is using the audio card?

Index: libs/libmyth/audiooutputalsa.cpp
===================================================================
--- libs/libmyth/audiooutputalsa.cpp	(revision 27227)
+++ libs/libmyth/audiooutputalsa.cpp	(working copy)
@@ -23,7 +23,7 @@
 #define CHANNELS_MAX 8

 #define OPEN_FLAGS (SND_PCM_NO_AUTO_RESAMPLE|SND_PCM_NO_AUTO_FORMAT|    \
-                    SND_PCM_NO_AUTO_CHANNELS)
+                    SND_PCM_NO_AUTO_CHANNELS|SND_PCM_NONBLOCK)

 #define FILTER_FLAGS ~(SND_PCM_NO_AUTO_FORMAT)

@@ -313,7 +313,7 @@
 {
     snd_pcm_format_t format;
     uint buffer_time, period_time;
-    int err;
+    int err = 0;
     QString real_device;

     if (pcm_handle != NULL)
@@ -335,7 +335,7 @@

     QByteArray dev_ba = real_device.toAscii();
     if ((err = snd_pcm_open(&pcm_handle, dev_ba.constData(),
-                            SND_PCM_STREAM_PLAYBACK,
OPEN_FLAGS&FILTER_FLAGS)) < 0)
+                            SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK)) < 0)
     {
         AERROR(QString("snd_pcm_open(%1)").arg(real_device));
         if (pcm_handle)
@@ -464,6 +464,10 @@

         switch (err)
         {
+            case -EAGAIN:
+                snd_pcm_wait(pcm_handle, 10);
+                break;
+
             case -EPIPE:
                  if (snd_pcm_state(pcm_handle) == SND_PCM_STATE_XRUN)
                  {


More information about the mythtv-users mailing list