On Wednesday 03 June 2009, Lucian Muresan wrote:
> Lucian Muresan wrote:
> 
> [...]
> >>> No, unfortunately none of those "ac3play" messages are written, really
> >>> strange...
> >> 
> >> So everything looks ok, but there is no sound :-( .
> >> There are 2 additional code paths (4 choices in total):
> >> 
> >> 1. Switching to professional transmission:
> >>     setting 'ac3SpdifPro = true' in audio-alsa.c, line 41.
> >> 2. Different open for AC3 with patch from Roland Praml found here:
> >>     http://www.vdr-portal.de/board/thread.php?postid=506499#post506499
> >>     Patch includes enforcing of spdifpro mode.
> >> 
> >> If you need help, please ask again.
> > 
> > Thanks for the two hints, will try the other 3 remaining code paths
> > tonight and report back.
> 
> Unfortunately, no luck with 'ac3SpdifPro = true', and that version of Roland 
> Praml's patch semms to be pretty old, it does no longer apply to current 
> softdevice. Do you have a newer one, by chance ;-) ?

Here is one, I did only a compile test.

-- 
Stefan Lucke
Index: audio-ac3pt.c
===================================================================
RCS file: /cvsroot/softdevice/softdevice/audio-ac3pt.c,v
retrieving revision 1.3
diff -U3 -r1.3 audio-ac3pt.c
--- audio-ac3pt.c       25 Dec 2007 13:21:46 -0000      1.3
+++ audio-ac3pt.c       4 Jun 2009 19:11:53 -0000
@@ -500,6 +500,7 @@
 unsigned int
 cAlsaAC3pt::SpdifInitAC3(snd_pcm_t **handle, char *device, bool spdifPro)
 {
+    char                      pcm_name[256];
     static snd_aes_iec958_t   spdif;
     unsigned int              rate = 48000;
     snd_pcm_info_t            *info;
@@ -509,22 +510,12 @@
     unsigned int              channels = 2;
     int                       err;//, c;
 
-  if ((err = snd_pcm_open(handle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0)
-  {
-    fprintf(stderr, "ac3play: sound open: %s\n", snd_strerror(err));
-    return 1;
-  }
-
   if (ac3Status)
     snd_pcm_status_free(ac3Status);
+  ac3Status = NULL;
 
   snd_pcm_info_alloca(&info);
 
-  if ((err = snd_pcm_info(*handle, info)) < 0) {
-    fprintf(stderr, "ac3play: sound info: %s\n", snd_strerror(err));
-    snd_pcm_close(*handle);
-    return 1;
-  }
   {
       snd_ctl_elem_value_t  *ctl;
       snd_ctl_t             *ctl_handle;
@@ -551,6 +542,31 @@
       spdif.status[3]  = (iec958_aes3_con_fs_rate);
     }
 
+
+    snprintf(pcm_name, sizeof (pcm_name),
+             "iec958:AES0=0x%.2x,AES1=0x%.2x,AES2=0x%.2x,AES3=0x%.2x,CARD=%1d",
+             spdif. status [0], spdif. status [1],
+             spdif. status [2], spdif. status [3],
+             0);
+
+    err = snd_pcm_open (handle, pcm_name, SND_PCM_STREAM_PLAYBACK, 0);
+    if (err >= 0) {
+      fprintf(stderr, "ac3play: Sucessfull opend (%s)\n", pcm_name);
+      goto __diga_end;
+    }
+
+    fprintf(stderr, "ac3play: Failed to open (%s) trying old way\n", pcm_name);
+    if ((err = snd_pcm_open(handle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
+      fprintf(stderr, "ac3play: sound open: %s\n", snd_strerror(err));
+      return 1;
+    }
+
+    if ((err = snd_pcm_info(*handle, info)) < 0) {
+      fprintf(stderr, "ac3play: sound info: %s\n", snd_strerror(err));
+      snd_pcm_close(*handle);
+      return 1;
+    }
+
     snd_ctl_elem_value_alloca(&ctl);
     snd_ctl_elem_value_set_interface(ctl, SND_CTL_ELEM_IFACE_PCM);
     snd_ctl_elem_value_set_device(ctl, snd_pcm_info_get_device(info));
@@ -572,9 +588,9 @@
       goto __diga_end;
     }
     snd_ctl_close(ctl_handle);
-    __diga_end:
-      ;
   }
+  __diga_end:
+    ;
   {
       snd_pcm_hw_params_t *params;
       snd_pcm_sw_params_t *swparams;
_______________________________________________
Softdevice-devel mailing list
Softdevice-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/softdevice-devel

Reply via email to