chenyunecjtu / coreavc-for-linux

Automatically exported from code.google.com/p/coreavc-for-linux
GNU General Public License v2.0
0 stars 1 forks source link

Mythtv: On h264 channels decoded with coreavc-for-linux, spdif AC3 sound may not always work. #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Enable passthrough on mygthtv with driver ALSA:iec958:{ AES0 0x02 } ...
2. Tune on various h264 channels.
3.

What is the expected output? What do you see instead?
Expected AC3 sound to be functional.
At the fist tunning, sound is mute. Later after some channel switching AC3 
sound begins to work.

What version of the product are you using? On what operating system?

mythtv with coreavc for  linux

Please provide any additional information below.

Original issue reported on code.google.com by ppinc...@gmail.com on 6 Jun 2008 at 8:41

GoogleCodeExporter commented 8 years ago
CoreAVC only parses the video from the stream.  If the audio is not working, 
that
would seem to have something to do with the transport, but is not really in my
domain, nor is it likely to have anything to do with coreavc.  On my system, 
pass
through works fine with CoreAVC.

I really have no idea how to debug this further.

Original comment by alannis...@gmail.com on 7 Jun 2008 at 2:32

GoogleCodeExporter commented 8 years ago
Maybe you're right....maybe is not coreavc related...but is definitely related 
to
h264    transport.

You are lucky Alan, coz you have none of above symptoms...looks like a second 
poster
has exactly the same problems:
http://groups.google.com/group/coreavc-for-linux/browse_thread/thread/337b2f4ca0
6574e1?hl=en

Original comment by ppinc...@gmail.com on 12 Jun 2008 at 12:19

GoogleCodeExporter commented 8 years ago
fuser shows that dshowserver opens the snd card - there is therefore a race 
(even
with dmix) as to whether mythfrontend or dshowserver gets it first.. Can we stop
dshowserver from doing this?

Original comment by foobum on 4 Oct 2008 at 1:15

GoogleCodeExporter commented 8 years ago
I've been seeing the same issue lately.  I am looking into it now.

Original comment by alannis...@gmail.com on 8 Oct 2008 at 6:26

GoogleCodeExporter commented 8 years ago
The issue turns out to not be in dshowserver but in myth itself.
Basically the call to dsshowserver in avformatdecoder.cpp doesn't close open
filehandles.  Myth internally opens the sound-card, calls dshowserver, closes 
the
sound card then reopens it (which fails if the close happens after the 
dshowserver call)

The fix is to close all open filehandles before calling dshowserver.  I can't 
test it
at the moment, but this one-line patch should resolve the issue:
{{{
Index: libs/libmythtv/avformatdecoder.cpp
===================================================================
--- libs/libmythtv/avformatdecoder.cpp.orig 2008-10-08 13:09:22.000000000 -0700
+++ libs/libmythtv/avformatdecoder.cpp  2008-10-08 13:05:42.000000000 -0700
@@ -331,7 +331,7 @@
             //Create read/write semaphores in locked state
             ds_mpi->sem_wr = sem_open(sem1, O_CREAT, 0644, 0);
             ds_mpi->sem_rd = sem_open(sem2, O_CREAT, 0644, 0);
-            system(cmd);
+            myth_system(cmd);
             ret = sem_twait(ds_mpi->sem_rd, 10);
             shm_unlink(shm);
             sem_unlink(sem1);
}}}

Original comment by alannis...@gmail.com on 8 Oct 2008 at 8:10

GoogleCodeExporter commented 8 years ago
The change appears to work for me.  I've committed it now.

Original comment by alannis...@gmail.com on 9 Oct 2008 at 1:47