MP3/MPlayer plugin 0.9.11 (development)

Message ID 4218268A.10001@syphir.sytes.net
State New
Headers

Commit Message

C.Y.M Feb. 20, 2005, 5:56 a.m. UTC
  Stefan Huelswitt wrote:
> Hi,
> a new release of the MP3/MPlayer plugin is available from my
> homepage. Main feature of this release is the inclusion of the
> background/cover image patch.
> 
> <http://www.muempf.de/down/vdr-mp3-0.9.11.tar.gz>
> 
> NEWS:
> 
> 20.02.2005: Version 0.9.11 development (vdr 1.2.6/1.3.21)
> - Now using propper readdir() to scan directory contents rather than the
>   external find & sort tools.
> - Added cover image display during MP3 replay. See the README on how this has
>   to be configured. If you was using the old image patch, be aware that there
>   are now new commandline options and that the layout of the cache directory
>   has changed. Initial patch made by Eloy, currently maintained by Tobias Grimm
>   for ctvdr-debian package.
> 

I have created a patch to the default image_convert.sh script to support both 
ntsc and pal by setting an initial FORMAT variable in the script.

Best Regards,

N.B. Some of the resolutions *may* still need adjustment.  Please let me know. I 
am especially interested in NTSC displays. Thanks.
  

Comments

C.Y.M Feb. 20, 2005, 4:24 p.m. UTC | #1
C.Y.M wrote:
> Stefan Huelswitt wrote:
> 
>> Hi,
>> a new release of the MP3/MPlayer plugin is available from my
>> homepage. Main feature of this release is the inclusion of the
>> background/cover image patch.
>>
>> <http://www.muempf.de/down/vdr-mp3-0.9.11.tar.gz>
>>
>> NEWS:
>>
>> 20.02.2005: Version 0.9.11 development (vdr 1.2.6/1.3.21)
>> - Now using propper readdir() to scan directory contents rather than the
>>   external find & sort tools.
>> - Added cover image display during MP3 replay. See the README on how 
>> this has
>>   to be configured. If you was using the old image patch, be aware 
>> that there
>>   are now new commandline options and that the layout of the cache 
>> directory
>>   has changed. Initial patch made by Eloy, currently maintained by 
>> Tobias Grimm
>>   for ctvdr-debian package.
>>
> 
> I have created a patch to the default image_convert.sh script to support 
> both ntsc and pal by setting an initial FORMAT variable in the script.
> 
> Best Regards,
> 
> N.B. Some of the resolutions *may* still need adjustment.  Please let me 
> know. I am especially interested in NTSC displays. Thanks.
> 
> 

There is a small problem with the image_convert.sh script.  If an image exists 
but it is not yet in cache, VDR will throw up a threading error while the image 
is converted.  Perhaps we can use an "echo ... |at now" for the conversion so 
vdr is not held up while the processing is taking place?

Best Regards,
  
Stefan Huelswitt Feb. 20, 2005, 5:28 p.m. UTC | #2
On 20 Feb 2005 "C.Y.M" <syphir@syphir.sytes.net> wrote:
> 
> There is a small problem with the image_convert.sh script.  If an image exists 
> but it is not yet in cache, VDR will throw up a threading error while the image 
> is converted.  Perhaps we can use an "echo ... |at now" for the conversion so 
> vdr is not held up while the processing is taking place?

I don't understand what you mean.

The conversion is already done asynchronous.

Anyway, a log would be helpfull...

Regards.
  
C.Y.M Feb. 20, 2005, 6:36 p.m. UTC | #3
Stefan Huelswitt wrote:
> On 20 Feb 2005 "C.Y.M" <syphir@syphir.sytes.net> wrote:
> 
>>There is a small problem with the image_convert.sh script.  If an image exists 
>>but it is not yet in cache, VDR will throw up a threading error while the image 
>>is converted.  Perhaps we can use an "echo ... |at now" for the conversion so 
>>vdr is not held up while the processing is taking place?
> 
> 
> I don't understand what you mean.
> 
> The conversion is already done asynchronous.
> 
> Anyway, a log would be helpfull...
> 

Here is an example of the error in the syslog:

Feb 20 10:28:06 sid vdr[7544]: mp3: player thread started (pid=7544)
Feb 20 10:28:08 sid vdr[4248]: error reading '/dev/input/event2'
Feb 20 10:28:11 sid vdr[7545]: ERROR: thread 81926 won't end (waited 3 seconds) 
- canceling it...
Feb 20 10:28:22 sid vdr[7544]: mp3: player thread ended (pid=7544)

How to reproduce:

Put an image file in a directory with a matching mp3 file.  This error occurs 
the first time the image is converted to a mpg file.  Once the cache file 
exists, the error does not happen any more.

I would also like to add that everything *appears* to work correctly from a 
users standpoint.  The only problem is the error in the syslog (but VDR does not 
actually shutdown).

Best Regards,
  
Stefan Huelswitt Feb. 20, 2005, 7:27 p.m. UTC | #4
On 20 Feb 2005 "C.Y.M" <syphir@syphir.sytes.net> wrote:
> Here is an example of the error in the syslog:
> 
> Feb 20 10:28:06 sid vdr[7544]: mp3: player thread started (pid=7544)
> Feb 20 10:28:08 sid vdr[4248]: error reading '/dev/input/event2'
> Feb 20 10:28:11 sid vdr[7545]: ERROR: thread 81926 won't end (waited 3 seconds) 
> - canceling it...
> Feb 20 10:28:22 sid vdr[7544]: mp3: player thread ended (pid=7544)
> 
> How to reproduce:
> 
> Put an image file in a directory with a matching mp3 file.  This error occurs 
> the first time the image is converted to a mpg file.  Once the cache file 
> exists, the error does not happen any more.

Well as usual: I can't reproduce this here.

One interesting thing: what process is vdr[7545] and which thread
is 81926?
The conversion isn't made asynchronous with threads but with
fork(). So possibly this is not related.

Regards.
  
C.Y.M Feb. 20, 2005, 7:41 p.m. UTC | #5
Stefan Huelswitt wrote:
> On 20 Feb 2005 "C.Y.M" <syphir@syphir.sytes.net> wrote:
> 
>>Here is an example of the error in the syslog:
>>
>>Feb 20 10:28:06 sid vdr[7544]: mp3: player thread started (pid=7544)
>>Feb 20 10:28:08 sid vdr[4248]: error reading '/dev/input/event2'
>>Feb 20 10:28:11 sid vdr[7545]: ERROR: thread 81926 won't end (waited 3 seconds) 
>>- canceling it...
>>Feb 20 10:28:22 sid vdr[7544]: mp3: player thread ended (pid=7544)
>>
>>How to reproduce:
>>
>>Put an image file in a directory with a matching mp3 file.  This error occurs 
>>the first time the image is converted to a mpg file.  Once the cache file 
>>exists, the error does not happen any more.
> 
> 
> Well as usual: I can't reproduce this here.

Hmm, make sure you dont have a default background image defined either...

> 
> One interesting thing: what process is vdr[7545] and which thread
> is 81926?

I would assume that 7545 is the thread that is calling the image_convert.sh 
script.  But, I have no idea what 81926 is.. What I was thinking is that if a 
thread gets stuck waiting for a process to finish, that it affects all the other 
threads (since this is not multithreaded).

> The conversion isn't made asynchronous with threads but with
> fork(). So possibly this is not related.
> 

I can reproduce it every time though..

What I was thinking is something like this for a fix:

if [ $FORMAT = "pal" ]; then
echo " \
pnmscale $S $TMP | \
   pnmpad -black -width 704 -height 576 | \
   ppmntsc --pal | \
   ppmtoy4m -v 0 -n 1 -r -F 25:1 | \
   mpeg2enc -f 7 -T 90 -F 3 -np -a 2 -v 0 -o "$MPG" \
"| at now
fi
  
C.Y.M Feb. 20, 2005, 8:03 p.m. UTC | #6
C.Y.M wrote:
> What I was thinking is something like this for a fix:
> 
> if [ $FORMAT = "pal" ]; then
> echo " \
> pnmscale $S $TMP | \
>   pnmpad -black -width 704 -height 576 | \
>   ppmntsc --pal | \
>   ppmtoy4m -v 0 -n 1 -r -F 25:1 | \
>   mpeg2enc -f 7 -T 90 -F 3 -np -a 2 -v 0 -o "$MPG" \
> "| at now
> fi
> 

Sorry, this method did not solve the problem..

Best Regards,
C.Y.M.
  
Stefan Huelswitt Feb. 20, 2005, 8:37 p.m. UTC | #7
On 20 Feb 2005 "C.Y.M" <syphir@syphir.sytes.net> wrote:
> Stefan Huelswitt wrote:
>> 
>> One interesting thing: what process is vdr[7545] and which thread
>> is 81926?
> 
> I would assume that 7545 is the thread that is calling the image_convert.sh 
> script.  But, I have no idea what 81926 is.. What I was thinking is that if a 
> thread gets stuck waiting for a process to finish, that it affects all the other 
> threads (since this is not multithreaded).
> 
>> The conversion isn't made asynchronous with threads but with
>> fork(). So possibly this is not related.
>> 

As I said before, the conversion is not a thread, so the message
cannot be directly related to this.

You have to find out which VDR thread causes the message.

Inside the MP3 plugin there is only one place with a Cancel(3)
and this is in the non-blocking file reader in libsndfile
decoder, while there are more than 10 place with a Cancel(3) in
vdr 1.3.21.

Regards.
  

Patch

--- image_convert.sh.example	2005-02-19 21:50:10.000000000 -0800
+++ image_convert.sh	2005-02-19 21:49:46.000000000 -0800
@@ -3,10 +3,22 @@ 
 # requires: ...topnm, pnmscale, pnmcomp, ppmntsc, ppmtoy4m, mpeg2enc
 #
 
+# Set format to "ntsc" or "pal" 
+FORMAT=ntsc
+
+if [ $FORMAT = "ntsc" ]; then
 # target image width (taking into account visible screen area)
-TW=632
+TW=600
 # target image height 
+TH=420
+fi
+
+if [ $FORMAT = "pal" ]; then
+# target image width (taking into account visible screen area)
+TW=632
+# target image height
 TH=512
+fi
 
 TMP=/tmp/image_convert.$$.pnm
 IMG=$1
@@ -53,11 +65,23 @@ 
 #
 # now run the conversion
 #
+
+if [ $FORMAT = "ntsc" ]; then
+pnmscale $S $TMP | \
+  pnmpad -black -width 704 -height 480 | \
+  ppmntsc | \
+  ppmtoy4m -v 0 -n 1 -r -F 30000:1001 | \
+  mpeg2enc -f 7 -T 90 -F 4 -nn -a 2 -v 0 -o "$MPG"
+fi
+
+if [ $FORMAT = "pal" ]; then
 pnmscale $S $TMP | \
   pnmpad -black -width 704 -height 576 | \
   ppmntsc --pal | \
   ppmtoy4m -v 0 -n 1 -r -F 25:1 | \
   mpeg2enc -f 7 -T 90 -F 3 -np -a 2 -v 0 -o "$MPG"
+fi
+
 #
 # cleanup
 #