pycousin / gnome-mplayer

Automatically exported from code.google.com/p/gnome-mplayer
GNU General Public License v2.0
0 stars 0 forks source link

Problem with play/pause and a LIRC remote. #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Play any media with gnome-mplayer.
2. Press the pause button in a LIRC remote.

What is the expected output? What do you see instead?
gnome-mplayer should be able to pause completely, but instead, playback
only freezes for half a second and then resumes.

What version of the product are you using? On what operating system?
I'm using version 0.6.2-0.6.3 in Ubuntu 8.04.1

Please provide any additional information below.
I am using a Creative RM 1500 remote, and my LIRC is configured by the
mythbuntu LIRC generator. The remote works flawlessly and can pause
correctly on regular Mplayer. 

It is possible to play/pause normally in gnome-mplayer with the LIRC remote
if the media is paused beforehand. However, the progressbar will remain
static and say "Paused" even if the media is playing, which in turn doesn't
let the progressbar hide in fullscreen and displays inaccurate progress.

Original issue reported on code.google.com by perfectska04 on 11 Jul 2008 at 12:04

GoogleCodeExporter commented 8 years ago
Can you run gnome-mplayer with the -v option from a terminal and then press the 
pause
button on the remote so I can see the message that mplayer emits, so that I can
capture that and put gnome-mplayer into the right state.

Original comment by kdeko...@gmail.com on 12 Jul 2008 at 1:47

GoogleCodeExporter commented 8 years ago
I ran gnome-mplayer with the -v option, but no messages came up whenever I 
pressed
the pause/play key. I did, however try 'gmplayer -v', since pause does work 
there,
and the messages "alsa-pause: pause supported by hardware" and "alsa-resume: 
resume
supported by hardware" came up. I hope this can help somehow, if not, feel free 
to
ask for more information.

Original comment by perfectska04 on 12 Jul 2008 at 2:22

GoogleCodeExporter commented 8 years ago
Please try SVN and see if this is fixed now.

Original comment by kdeko...@gmail.com on 13 Jul 2008 at 2:03

GoogleCodeExporter commented 8 years ago
I just tried the SVN from "svn checkout
http://gnome-mplayer.googlecode.com/svn/trunk/ gnome-mplayer-read-only"

It still only freezes for 1/2 a second when pressing pause, and resumes. The 
only way
to get it to do it properly is when the media is paused beforehand, as I 
mentioned
early, although then the player still believes itself to be paused even when 
it's
playing. Also, the behavior is only limited to the LIRC remote, since the 
keyboard's
media buttons work fine.

I ran gnome-mplayer -v with a random file and there is no mention of anything
happening whenever I press pause, but I will post it because maybe it can help 
you
somehow. Anyway, here it is:

GNOME MPlayer v0.6.3
vo = xv ao = alsa
Using match: type='signal',interface='com.gnome.mplayer'
Using match: type='signal',interface='org.gnome.SettingsDaemon'
Using match: type='signal',interface='org.gnome.SettingsDaemon.MediaKeys'
Proxy connections and Command connected

playlist detection = 0
playing - /media/Storage/Movies/Diving butterfly.avi
Spawn succeeded for filename /media/Storage/Movies/Diving butterfly.avi
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (Family: 15, Model: 3, Stepping: 3)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.

Playing /media/Storage/Movies/Diving butterfly.avi.

AVI file format detected.
ID_VIDEO_ID=0
[aviheader] Video stream found, -vid 0
ID_AUDIO_ID=1
[aviheader] Audio stream found, -aid 1
VIDEO:  [XVID]  640x336  12bpp  25.000 fps  767.1 kbps (93.6 kbyte/s)
Clip info:
 Software: VirtualDubMod 1.5.10.2 (build 2540/release)
ID_CLIP_INFO_NAME0=Software
ID_CLIP_INFO_VALUE0=VirtualDubMod 1.5.10.2 (build 2540/release)
ID_CLIP_INFO_N=1
ID_FILENAME=/media/Storage/Movies/Diving butterfly.avi
ID_DEMUXER=avi
ID_VIDEO_FORMAT=XVID
ID_VIDEO_BITRATE=767056
ID_VIDEO_WIDTH=640
ID_VIDEO_HEIGHT=336
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=126120
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_LENGTH=6434.84
xscreensaver_disable: Could not find XScreenSaver window.
[ass] auto-open
Opening video filter: [screenshot]
Opening video filter: [eq2]
Opening video filter: [scale]
Opening video filter: [softskip]
Opening video filter: [yadif]
[ass] Init
[ass] Updating font cache.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
ID_VIDEO_CODEC=ffodivx
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=mad
Starting playback...
VDec: vo config request - 640 x 336 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.90:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.9048
[swscaler @ 0x89357b0]SwScaler: using unscaled yuv420p -> yuv420p special 
converter
VO: [xv] 640x336 => 640x336 Planar YV12 
Resizing to 640 x 336 
[Mixer] No hardware mixing, inserting volume filter.

Original comment by perfectska04 on 13 Jul 2008 at 2:38

GoogleCodeExporter commented 8 years ago
Ok, please try grabbing SVN one more time. I made another change to it. Also if 
you
still have problems. Please post a report of the run with the --reallyverbose 
option.
I have added additional debug messages just for this case.

Original comment by kdeko...@gmail.com on 13 Jul 2008 at 9:17

GoogleCodeExporter commented 8 years ago
I tried downloading it again and it's still the same. Then I ran gnome-mplayer 
with
the '--reallyverbose' command, and noted down the differences between regular 
pause
and pause with the remote, they are as follows:

Regular pause:
"send command = pause

MPLAYER OUTPUT:   =====  PAUSE  =====
ID_PAUSED
MPLAYER OUTPUT: ID_PAUSED"

Pause with the LIRC remote:
"MPLAYER OUTPUT:   =====  PAUSE  =====
ID_PAUSED
MPLAYER OUTPUT: ID_PAUSED

send command = get_time_pos

send command = get_property stream_pos"

I noticed that the second one lacks the "send command = pause" line. Perhaps 
this is
what is causing this issue. Also, when it is already paused and I press play on 
the
remote, there is no output. If I press pause again, the following comes up and 
it
goes back to the original paused state: 
"MPLAYER OUTPUT:   =====  PAUSE  =====
ID_PAUSED
MPLAYER OUTPUT: ID_PAUSED"

Original comment by perfectska04 on 13 Jul 2008 at 9:40

GoogleCodeExporter commented 8 years ago
Also, if it helps, the Play/Pause button is configured in LIRC to send the 
following
option:

"config = pause
repeat = 0
delay = 0"

Original comment by perfectska04 on 13 Jul 2008 at 9:57

GoogleCodeExporter commented 8 years ago
I added another change to SVN, hopefully this will fix it. The problem is that
mplayer is changing state and the gui was not detecting it.

Original comment by kdeko...@gmail.com on 15 Jul 2008 at 3:48

GoogleCodeExporter commented 8 years ago
Nevermind it is still broken

Original comment by kdeko...@gmail.com on 15 Jul 2008 at 3:50

GoogleCodeExporter commented 8 years ago
Would it be possible to configure LIRC to pass the space key or p to 
gnome-mplayer
rather than sending 'pause' to mplayer. If you could do that it would solve the 
state
issue.

Original comment by kdeko...@gmail.com on 15 Jul 2008 at 3:58

GoogleCodeExporter commented 8 years ago
I changed the config from 'pause' to 'P' and 'Space', but Nothing changed. It 
worked
with Mplayer, but it still only paused and resumed after half a second in
gnome-mplayer. Also, for some reason, if I change "prog = mplayer" to "prog =
gnome-mplayer" the remote stops working completely.

I'm not really sure, but maybe there is a way for gnome-mplayer to accept LIRC
commands directly, instead of through MPlayer, it would ensure full LIRC
compatibility. Since although the bug specifies the pause button isn't working, 
there
are many other buttons that work in Mplayer, but do not in gnome-mplayer. 
However,
for the purposes my media center pc the skip/seek and stop buttons work 
correctly,
which is good, and only the pause/play button causes any real inconvenience.

Once again, thanks for looking into this issue. I'm sure there are many other 
people
who use linux in their media pc's and basic LIRC compatibility with 
gnome-mplayer
would be very much appreciated.

Original comment by perfectska04 on 15 Jul 2008 at 5:26

GoogleCodeExporter commented 8 years ago
Another option might be to somehow figure out how to have the buttons send 
commands
via dbus thru the command line.

dbus-send  --type=signal / com.gnome.mplayer.Pause

might solve it as well.

LIRC support is something that will have to be added in the future.

Original comment by kdeko...@gmail.com on 15 Jul 2008 at 5:41

GoogleCodeExporter commented 8 years ago
Thanks! "dbus-send  --type=signal / com.gnome.mplayer.Pause
" worked well as a workaround and fixes my issue. Maybe this bug can be changed 
to a
feature request for future LIRC support. 

Also, for now, maybe adding this to a gnome-mplayer FAQ would be useful for 
other
LIRC users, so here is what I did to fix it:

1. Install lirc and configure it either by hand or by mythbuntu's LIRC 
generator.

2. Delete or comment out the entry for 'play/pause' in your lircrc file for 
your play
button, or in ~/.lirc/mplayer and save. In my case, this is the result:
#begin
#    remote = Creative_RM-1500
#    prog = mplayer
#    button = Ok
#    config = pause
#    repeat = 0
#    delay = 0
#end

2. Open your .lircrc file and add the following and save:
begin
    remote = YOUR REMOTE GOES HERE
    prog = irexec
    button = YOUR PLAY/PAUSE BUTTON GOES HERE
    config = dbus-send  --type=signal / com.gnome.mplayer.Pause
    repeat = 0
    delay = 0
end

3. Add 'irexec' command to startup programs in "Sessions".

4. Start 'irexec' by pressing Alt+F2 and typing 'irexec'

5. Use gnome-mplayer! seek/skip work by default, and now play/pause is fixed.

Maybe you could also add other dbus parameters, to allow for further 
customization,
but for now thanks for your work!

Original comment by perfectska04 on 15 Jul 2008 at 6:05

GoogleCodeExporter commented 8 years ago
Excellent... I was looking into lirc support and while it does not seem that 
hard to
implement, I would have to add an additional thread to the application to 
process the
lirc events. So not sure I want to do that.

As for the dbus interface, it is already pretty complete, since I use the dbus
interface to control gnome-mplayer from gecko-mediaplayer.

Docs on the dbus interface can be found in the file

DOCS/tech/dbus.txt

In the tarball.. I guess a couple of enhancements could be done with Volume, 
maybe a
volumeup and volumendown, but those are pretty easy to implement if needed.

Original comment by kdeko...@gmail.com on 15 Jul 2008 at 6:14

GoogleCodeExporter commented 8 years ago
Marking as closed since modifying the lirc scripts seemed to fix it.

Original comment by kdeko...@gmail.com on 15 Jul 2008 at 6:15