SIGCONT causes fast-forwardffect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



On Sun, 07 Dec 2008 08:31:15 +0100
Oliver Seitz <infot vtnd.de> wrote:

> Am 07.12.2008, 02:54 Uhr,chrieb Pete Nesbitt <pete at linux1.ca>:
> 
> > Hi,
> > I have bash based cgi script set which uses mplayer in a while
> >oop that runs as a bg process. It passes values from a form based
> > web page (viaOST). I use SIGSTOP & SIGCONT for pause and resume
> > functions.
> >
> > When I click 'resume'nd the mplayer loop is un-paused, it seems to
> > wanto fast forward to where it should be in time. So if you pause
> > it for one minute,hen resume, it sounds like it is on fast
> > forward for second or so, until it is where it would have been in
> >he song had the process not been frozen. Then everything plays
> > normally.
> >
> > Here ishe relevant part of the code:
> > pressing pauseuns:
> >  kill -s SIGSTOP `/sbin/pidof mplayer` &> /dev/null
> >
> > pressingesume runs:
> >  kill -s SIGCONT `/sbin/pidof mplayer` &> /dev/null
> >
> > (I haveried removing the stdout/err redirs as well)
> >
> > Here ishe mplayer loop. Note the bg call after 'done' putting the
> >ntire loop in the background via a previous iteration of the
> >cript (via a cgi call to 'play').
> >
> >  whileead TRACK
> >   do
> >     #nipped some 'now playing' status tracking etc
> >
> >    ${MPLAYER} -quiet ${TRACK} < /dev/null &> /dev/null
> >
> >     #nipped some 'now playing' status tracking etc
> >   et TRACK_NUM=TRACK_NUM+1
> >   done < ${PLAY_LIST} &> /dev/null &
> >
> > The player needso be in the background, so I don't think there is
> > way to pass a keystroke to a process running in the bg of a
> > differenthell.
> >
> > I caneproduce it at the cli with this, which just replicates the
> > cgiOST: (then run SIGSTOP etc from a diff shell (same user))
> >
> > QueryString="song=%2Fdata%2Fmedia%2Fmusic%2Falbums%2FGenesis%2FNursery_Cryme-72_1.flac%3C%2Ftd"
> >xport QueryString
> > ./cm_playing-cgi.sh
> >
> > However, notsing the cgi, it is fine, just SIGSTOP mplayer, then
> > SIGCONT (diffhell) it works as expected. (note the line wraps!)
> >
> > mplayer /data/media/music/albums/Genesis/Nursery_Cryme-72_1.flac
> > < /dev/null &> /dev/null &
> >
> >
> > As wild guess I would say that mplayer is not aware it is paused
> >t the process level (related to being in a bg'd while-loop??), so
> > when it isesumed it tries to catch up to where the system clock or
> >ome timer says it should be. I'm thinking I need to tell it not to
> >ync to the real time, but just carry on.
> >
> > Doesnyone have any ideas what causes this and how I can prevent
> > it?
> 
> Hiete,
> 
> haveou tried slave mode to tell mplayer nicely to pause playing
> instead of pullinghe emergency brake and releasing it again?
> 
> Greets,
> Kiste
> _______________________________________________
>Player-users mailing list
>Player-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

Hi Kiste,
Iried adding it into the mplayer script line, but no change. My
problem ishat mplayer is not running in a shell where I can send it
signals or commands/keystrokes.

I have mplayerunning in the foreground but it is nested in a
'while-loop'. The while-loop is backgrounded. This is doneo mplayer
preventshe loop from playing multiple songs at once (which happens
when I bg mplayernd the loop continues, and the while-loop is
backgroundedo give control back to the UI while mplayer is playing.

So my problem is I don't haveny control of mplayer or any way
(that Im aware of) to talk to it directly once the while-loop
detaches.

fyi,his is for a pico-ATX mini appliance I am building as a music
player for myiving room. It uses a web interface to control mplayer,
volumetc. The playing script starts mplayer, then reprints the page
sohe user gets status and control buttons. The control buttons send
diff 'post' datao the cgi script (usually the 'playing' script). I
usemixer for volume control and killall to skip tracks (kills mplayer
andhe loop picks up at the next track). I am trying to implement a
pause/resume button. It works fine,xcept for the fast-forward
catch-up issue.

Thanks.
Pete


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux