Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Why is Java stdin/stdout failing with gplay on ubuntu?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to change gplay's volume level programmatically in a Java app. The video plays fine; I see gplay's menu; I get my first "Playing" prompt, and I write a "v" for "[v]Volume" but I never see the volume prompt "Set volume." I get all of the data I expect from BufferedReader, but BufferedWriter does not seem to be working. Everything works as expected when I run gplay from the console. Can anyone see what I'm doing wrong?

Thank you.

 
Marshal
Posts: 74371
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you know the flush calls are actually being invoked?
 
Bartender
Posts: 732
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing in the code you have posted will create a prompt with the text "Set volume". Where is this done?
 
Jim Brennan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Campbell Ritchie: I don't know that the flush calls are actually being invoked.

Fred Kleinschmidt: It is part of the gplay interface. Here is the edited output of an interactive session with gplay where I am setting the volume:

> gplay demoVideo.mp4

FSL_PLAYER_01.00_LINUX build on Jul 19 2015 04:44:35
[p]Play
[s]Stop
[e]Seek
[a]Pause when playing, play when paused
[v]Volume
...
[x]eXit
[Playing ][Vol=01][00:00:00/00:02:39][fps:0]
[Playing ][Vol=01][00:00:02/00:02:39][fps:36]
v
Set volume[0-10]: 10
[Playing ][Vol=10][00:00:11/00:02:39][fps:31]
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What output does that debugging line produce:

?
 
Jim Brennan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Internal gplay status; nothing insightful. Things like "INFO: --> maximum bitrate: 256000" (bitrate will vary slightly)

BTW, thanks to all of you that are looking at this issue! If the Java code looks correct, then my guess is that the trouble is more than likely with how gplay is handling I/O.
 
Dave Tolls
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, so you see all the stuff up to but not including the volume setting.

That's what I needed confirming.

Now look at the gplay output you posted:

[Playing ][Vol=01][00:00:00/00:02:39][fps:0]
[Playing ][Vol=01][00:00:02/00:02:39][fps:36]
v
Set volume[0-10]: 10

The [Playing] lines are lines. They end in a newline, so readLine picks them up.
But look at "Set volume". No new line. So readLine can't pick it up.

You might need to use something other than readLine to pick that up.
 
Jim Brennan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dave Tolls: Brilliant! That was staring me in the face the whole time and I kept looking past it... thank you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic