Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 2020 14:54:14 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Aryeh Friedman <aryeh.friedman@gmail.com>
Cc:        freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
Subject:   Re: Min. ports needed for headless AWT/Swing
Message-ID:  <1075431299.4.1593608054346@localhost>
In-Reply-To: <CAGBxaXnKjm6720UFprpOG5EdLSMvgA35P3G2RTS1QbSbcrFiHg@mail.gmail.com>
References:  <CAGBxaXnf=Q0Df403nRpsCVudiN56KD=rKxGtbjQAHePVoDnEFA@mail.gmail.com> <417840b4-1acc-ac20-2127-0754bce1fd68@gmx.net> <CAGBxaXkpFimZFOX8WpkZvip9T%2BTnUt6sxg9jv2YsMzU2vjfBBw@mail.gmail.com> <310397709.40.1593597140363@localhost> <CAGBxaXniZBM_Cr-SLvx_YxQ5O3w=pp6gzkEkvuY3Rc6otsb2ew@mail.gmail.com> <745314036.25.1593604704120@localhost> <CAGBxaXkigh6hG66uobhnhO7DqQs3_Pn5xSDn2sL_MEAotZ--qg@mail.gmail.com> <1960743780.71.1593606645185@localhost> <CAGBxaXnKjm6720UFprpOG5EdLSMvgA35P3G2RTS1QbSbcrFiHg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
 
Van: Aryeh Friedman <aryeh.friedman@gmail.com>
Datum: woensdag, 1 juli 2020 14:36
Aan: Ronald Klop <ronald-lists@klop.ws>
CC: freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
Onderwerp: Re: Min. ports needed for headless AWT/Swing
> 
>  
>  
> On Wed, Jul 1, 2020 at 8:30 AM Ronald Klop <ronald-lists@klop.ws> wrote:
>>  
>> Van: Aryeh Friedman <aryeh.friedman@gmail.com>
>> Datum: woensdag, 1 juli 2020 14:03
>> Aan: Ronald Klop <ronald-lists@klop.ws>
>> CC: freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
>> Onderwerp: Re: Min. ports needed for headless AWT/Swing
>> >
>> > 
>> > 
>> > On Wed, Jul 1, 2020 at 7:58 AM Ronald Klop <ronald-lists@klop.ws> wrote:
>> >>
>> >> 
>> >> Van: Aryeh Friedman <aryeh.friedman@gmail.com>
>> >> Datum: woensdag, 1 juli 2020 13:33
>> >> Aan: Ronald Klop <ronald-lists@klop.ws>
>> >> CC: freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
>> >> Onderwerp: Re: Min. ports needed for headless AWT/Swing
>> >>>
>> >>> 
>> >>> 
>> >>> On Wed, Jul 1, 2020 at 5:52 AM Ronald Klop <ronald-lists@klop.ws> wrote:
>> >>>>
>> >>>> Van: Aryeh Friedman <aryeh.friedman@gmail.com>
>> >>>> Datum: maandag, 29 juni 2020 20:59
>> >>>> Aan: Michael Osipov <1983-01-06@gmx.net>
>> >>>> CC: freebsd-java@freebsd.org
>> >>>> Onderwerp: Re: Min. ports needed for headless AWT/Swing
>> >>>>>
>> >>>>> On Mon, Jun 29, 2020 at 2:28 PM Michael Osipov <1983-01-06@gmx.net> wrote:
>> >>>>>
>> >>>>> > Am 2020-06-29 um 17:43 schrieb Aryeh Friedman:
>> >>>>> > > I have a java application that works fine with setenv DISPLAY :0.0 on my
>> >>>>> > > desktop FreeBSD 12.1 (amd64) [with Xfce4] but when I attempt to run the
>> >>>>> > > same app on a VM that has the minimum ports needed to install OpenJDK 8
>> >>>>> > and
>> >>>>> > > Tomcat I get an exception saying that it can't connect to the X server
>> >>>>> > even
>> >>>>> > > though I did setenv DISPLAY desktop:0.0 (and xhost + on the desktop).
>> >>>>> > > Note it is the same user on both machines (NIS/NFS password DB/home dirs)
>> >>>>> > > doing the running on both machines but is a different user then the one
>> >>>>> > > logged in at the console (I do all my development in a separate account)
>> >>>>> >
>> >>>>> > Are you look for "-Djava.awt.headless=true"?
>> >>>>> >
>> >>>>>
>> >>>>> Since this is a screen capture/recording program (which I am the developer)
>> >>>>> I need to be able to capture the console (running X) that I am currently
>> >>>>> on.   So the question is what is the minimum set of ports/packages I need
>> >>>>> to install on the VM to make it see and X server?   It should be noted the
>> >>>>> program has no GUI but does use java.awt.Robot#createScreenCapture (using
>> >>>>> the full screen resolution as it's bounds) individual frames of the longer
>> >>>>> video.
>> >>>>>
>> >>>>> Here is the specific exception I am attempting to fix:
>> >>>>> On desktop (192.168.11.20)
>> >>>>> % xhost +
>> >>>>>
>> >>>>> On VM (192.168.11.4):
>> >>>>> % setenv DISPLAY 192.168.11.20:0.0
>> >>>>> % java
>> >>>>> -javaagent:/usr/local/share/java/classes/jacocoagent.jar=destfile=/usr/home/aryeh/fnwe-scap-1a1.C036/jacoco.exec,jmx=true,excludes=thistest/*:test/*
>> >>>>> -cp
>> >>>>> /usr/home/aryeh/fnwe-scap-1a1.C036/scrap/www/WEB-INF/lib/fnwe-scap-1a1.jar:/usr/local/share/java/classes/thisTest.jar:/usr/local/share/java/classes/pcCommon.jar:/usr/local/share/java/classes/pcUtil.jar
>> >>>>> test.TestMain
>> >>>>>
>> >>>>> Result of the jvm invocation on the VM (not it works no problem su(do)'ing
>> >>>>> to another account on the desktop if I do setenv DISPLAY :0.0):
>> >>>>>
>> >>>>> Caused by: java.awt.AWTError: Can't connect to X11 window server using
>> >>>>> '192.168.11.20:0.0' as the value of the DISPLAY variable.
>> >>>>> at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>> >>>>> at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
>> >>>>> at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
>> >>>>> at java.security.AccessController.doPrivileged(Native Method)
>> >>>>> at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
>> >>>>> at java.lang.Class.forName0(Native Method)
>> >>>>> at java.lang.Class.forName(Class.java:264)
>> >>>>> at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
>> >>>>> at
>> >>>>> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
>> >>>>> at test.scap.TestVideoFrame.testCaptureFrame(TestVideoFrame.java:76)
>> >>>>>
>> >>>>> _______________________________________________
>> >>>>> > freebsd-java@freebsd.org mailing list
>> >>>>> > https://lists.freebsd.org/mailman/listinfo/freebsd-java
>> >>>>> > To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
>> >>>>> >
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>> >>>>> _______________________________________________
>> >>>>> freebsd-java@freebsd.org mailing list
>> >>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-java
>> >>>>> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> Hi,
>> >>>>
>> >>>> Can you start any other X application on the VM using the DISPLAY setting? Like /usr/ports/x11/xeyes. Than you know if it is something with X instead of something with Java. I guess it is something with X.
>> >>>> I guess your desktop is not listening for external connections to the X server or your routing between the VM and the desktop does not work.
>> >>>> Or start a X server in the VM and use DISPLAY=:0.0 again.
>> >>>
>> >>> 
>> >>> Don't have any X components installed except for the ones required by "make/make install" on openjdk8.   The reason for this post in the first place was to figure out the minimum set of ports needed to get a working DISPLAY variable in the first place.
>> >>>
>> >>>
>> >>> --
>> >>> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>> >>
>> >> I'm 99% sure you don't need any additional ports to get a working DISPLAY variable.
>> >>
>> >> It will probably help to start your X server with "-listen tcp". But I don't have enough information to be sure about that and how to configure that in your setup.
>> >
>> > 
>> > I think that might work if in fact there was an X server on the VM:
>> > 
>> > root@dnixon:~ # X -listen-tcp
>> > X: Command not found.
>> > root@dnixon:~ # ls /usr/local/bin/X*
>> > ls: No match.
>> > root@dnixon:~ # ls /usr/local/bin/x*
>> > /usr/local/bin/x265 /usr/local/bin/xicclu /usr/local/bin/xmlcatalog /usr/local/bin/xslt-config
>> > /usr/local/bin/xaegis /usr/local/bin/xjc /usr/local/bin/xmlcatmgr /usr/local/bin/xsltproc
>> > /usr/local/bin/xft-config /usr/local/bin/xkbcomp /usr/local/bin/xmllint /usr/local/bin/xsubpp
>> > /usr/local/bin/xgettext /usr/local/bin/xml2-config /usr/local/bin/xmlwf /usr/local/bin/xxd
>> > root@dnixon:~ # ls /usr/local/sbin/x*
>> > ls: No match.
>> > root@dnixon:~ # ls /usr/local/sbin/X*
>> > ls: No match.
>> > root@dnixon:~ # java -version
>> > openjdk version "1.8.0_252"
>> > OpenJDK Runtime Environment (build 1.8.0_252-b09)
>> > OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
>> >
>> >
>> > --
>> > Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>> 
>> In an earlier message you talked about "setenv DISPLAY 192.168.11.20:0.0". That is the IP address of your desktop. So the X server must be running on your desktop.
>> 
>> You want the VM to screencapture the screen of the desktop? Or do you want the VM to screencapture the screen of the VM?> 
>  
> On the desktop... finally got it to capture the screeen on the desktop via what I tried above but now have a second problem with is the audio capture is there anyway to make the following Java snippet work with a remote mic (works fine on the desktop with a local mic on dsp2.0)?
>  
>                 fmt=new AudioFormat(160000,8,2,true,true);
>                 mic=AudioSystem.getTargetDataLine(fmt);
>                 mic.open(fmt);
>                 mic.start();
> --
> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org

Good that it is solved. Would you mind sharing what the solution was?
From owner-freebsd-java@freebsd.org  Wed Jul  1 12:56:20 2020
Return-Path: <owner-freebsd-java@freebsd.org>
Delivered-To: freebsd-java@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id C091D34F375;
 Wed,  1 Jul 2020 12:56:20 +0000 (UTC)
 (envelope-from ronald-lists@klop.ws)
Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl
 [194.109.157.24])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 49xh782dmMz4Qh4;
 Wed,  1 Jul 2020 12:56:20 +0000 (UTC)
 (envelope-from ronald-lists@klop.ws)
Date: Wed, 1 Jul 2020 14:56:17 +0200 (CEST)
From: Ronald Klop <ronald-lists@klop.ws>
To: Aryeh Friedman <aryeh.friedman@gmail.com>
Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org>,
 freebsd-java@freebsd.org
Message-ID: <2139766963.7.1593608177098@localhost>
In-Reply-To: <CAGBxaXm6+pSv3_F2kPsDqZe1ixY348=dg8TPstCA9F04yr3qXQ@mail.gmail.com>
References: <CAGBxaXm6+pSv3_F2kPsDqZe1ixY348=dg8TPstCA9F04yr3qXQ@mail.gmail.com>
Subject: Re: Allowing remote java app to access local sound system
MIME-Version: 1.0
X-Mailer: Realworks (515.242.8cc03ac0514)
Importance: Normal
X-Priority: 3 (Normal)
X-Rspamd-Queue-Id: 49xh782dmMz4Qh4
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none;
 spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates
 194.109.157.24 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws
X-Spamd-Result: default: False [-2.80 / 15.00]; ARC_NA(0.00)[];
 NEURAL_HAM_MEDIUM(-0.95)[-0.946]; FROM_HAS_DN(0.00)[];
 RCPT_COUNT_THREE(0.00)[3];
 R_SPF_ALLOW(-0.20)[+ip4:194.109.157.0/24:c];
 NEURAL_HAM_LONG(-0.97)[-0.971]; TAGGED_RCPT(0.00)[];
 MIME_GOOD(-0.10)[multipart/alternative,text/plain];
 DMARC_NA(0.00)[klop.ws]; TO_DN_SOME(0.00)[];
 TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.09)[-1.086];
 HAS_X_PRIO_THREE(0.00)[3];
 RCVD_IN_DNSWL_NONE(0.00)[194.109.157.24:from];
 FREEMAIL_TO(0.00)[gmail.com]; RCVD_COUNT_ZERO(0.00)[0];
 FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[];
 MIME_TRACE(0.00)[0:+,1:+,2:~];
 ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL];
 MID_RHS_NOT_FQDN(0.50)[];
 RWL_MAILSPIKE_VERYGOOD(0.00)[194.109.157.24:from]
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.33
X-BeenThere: freebsd-java@freebsd.org
X-Mailman-Version: 2.1.33
Precedence: list
List-Id: Porting Java to FreeBSD <freebsd-java.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-java>,
 <mailto:freebsd-java-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-java/>;
List-Post: <mailto:freebsd-java@freebsd.org>
List-Help: <mailto:freebsd-java-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-java>,
 <mailto:freebsd-java-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Jul 2020 12:56:20 -0000

 
Van: Aryeh Friedman <aryeh.friedman@gmail.com>
Datum: woensdag, 1 juli 2020 14:43
Aan: FreeBSD Mailing List <freebsd-questions@freebsd.org>, freebsd-java@freebsd.org
Onderwerp: Allowing remote java app to access local sound system
> 
> I have a (java) app that works fine on a remote host and displays it's GUI
> by setting the DISPLAY environment variable.   The app also requires a
> working microphone (and other audio output devices). Is there any way to
> make it use the microphone/audio output on my local machine?   Note I
> suspect I would need to do this transparently to Java.  I am pretty sure
> Java has no idea how to do this on its own.
> 
> -- 
> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
> 
> 
> 

Maybe something like https://www.freshports.org/audio/nas might help.

Regards,
Ronald.
 
From owner-freebsd-java@freebsd.org  Wed Jul  1 12:57:00 2020
Return-Path: <owner-freebsd-java@freebsd.org>
Delivered-To: freebsd-java@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38C2B34F814
 for <freebsd-java@mailman.nyi.freebsd.org>;
 Wed,  1 Jul 2020 12:57:00 +0000 (UTC)
 (envelope-from aryeh.friedman@gmail.com)
Received: from mail-il1-x130.google.com (mail-il1-x130.google.com
 [IPv6:2607:f8b0:4864:20::130])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 49xh7v41grz4Qvw
 for <freebsd-java@freebsd.org>; Wed,  1 Jul 2020 12:56:59 +0000 (UTC)
 (envelope-from aryeh.friedman@gmail.com)
Received: by mail-il1-x130.google.com with SMTP id x9so20960895ila.3
 for <freebsd-java@freebsd.org>; Wed, 01 Jul 2020 05:56:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=M1T9QWx5BlNYpzwxpIYxEveFiRhIB2gkRPXz9G+g27E=;
 b=twa8TqqYplepClfO13zSI1p7z8jfAiPe/Llm5Eeq/ArA9EPc143aG9HZ2bSWCFmfs4
 ho217NI3lLGD0IYNUlrXnHhZxHUl/uCIQFx/NxPHTD55Vj/EE+7B76tgiTokdxJZ7hXE
 7h1M/53Qhz/1T4WS6G8yv5+KoMDDbOYs4u6tfNC3jAeD4cqfKkNlUtAnLjxnpt6kDRtS
 w7EwcO3J/PnuQY8rGunmIdjtc4016DuKhaMnr0uUjYLyefR2m1xKjd77JD0adtAADEKx
 TB2nPaTn5xD4IoWvRvWopYfQXusgJgFebLK19onxtzFCS1zFwI+iyOimVvxi7aop/5xt
 czHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=M1T9QWx5BlNYpzwxpIYxEveFiRhIB2gkRPXz9G+g27E=;
 b=HBfbrNosLIpVGt/Af8W7AZz021bGp4dKc0p42zESIeTxv3g6Bkg8H2FOHt3S0a5fUW
 gkCPVD8AUwpExh86t2g+0KAsKZk11/mcP4TRLRh/G6tTdhTA5m6y9KmTQ9wIuBtXlxt9
 pt6EY14lPOlwomd0txodRj/bPDYOazWpdtDko5MX8x1TDIgxZ/ZqOki1E5DHklrJmEfE
 BFgofVQOzy6PXHX5pg07lagiqpwgxJ8/rsx2u159jqTw3bJQZMsOkvxnswYjzwI9E+L8
 ovI8RU8AKuZOikNPuRwzBcjbKQgvErchYD02u73E2CAblv0xeZvAJ/26glLaLZC97u21
 zOrg==
X-Gm-Message-State: AOAM532YKLM73Mm564bwaZj/BwrfEbJA/Nw36GuDo8GI100ey+nZaWkn
 mhapL5Mvlk6HpOPBZ1cuYWFgRGLmwclefAzeSYFDE4YF
X-Google-Smtp-Source: ABdhPJyQHmfIvgUqnln7c5Jvp+HzqBrmjZy4Ba1Su0+qazThVr2yrl/bIS9QIijIPovsS7r3p1ufu9kdMdA88bOT33c=
X-Received: by 2002:a92:4913:: with SMTP id w19mr7116306ila.185.1593608218475; 
 Wed, 01 Jul 2020 05:56:58 -0700 (PDT)
MIME-Version: 1.0
References: <CAGBxaXnf=Q0Df403nRpsCVudiN56KD=rKxGtbjQAHePVoDnEFA@mail.gmail.com>
 <417840b4-1acc-ac20-2127-0754bce1fd68@gmx.net>
 <CAGBxaXkpFimZFOX8WpkZvip9T+TnUt6sxg9jv2YsMzU2vjfBBw@mail.gmail.com>
 <310397709.40.1593597140363@localhost>
 <CAGBxaXniZBM_Cr-SLvx_YxQ5O3w=pp6gzkEkvuY3Rc6otsb2ew@mail.gmail.com>
 <745314036.25.1593604704120@localhost>
 <CAGBxaXkigh6hG66uobhnhO7DqQs3_Pn5xSDn2sL_MEAotZ--qg@mail.gmail.com>
 <1960743780.71.1593606645185@localhost>
 <CAGBxaXnKjm6720UFprpOG5EdLSMvgA35P3G2RTS1QbSbcrFiHg@mail.gmail.com>
 <1075431299.4.1593608054346@localhost>
In-Reply-To: <1075431299.4.1593608054346@localhost>
From: Aryeh Friedman <aryeh.friedman@gmail.com>
Date: Wed, 1 Jul 2020 08:56:47 -0400
Message-ID: <CAGBxaXko_YhR_3O7sdqbO7GLrTN_RpVrJDLqwR_xpT_8zG5JLg@mail.gmail.com>
Subject: Re: Min. ports needed for headless AWT/Swing
To: Ronald Klop <ronald-lists@klop.ws>
Cc: freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
X-Rspamd-Queue-Id: 49xh7v41grz4Qvw
X-Spamd-Bar: ---
Authentication-Results: mx1.freebsd.org;
 dkim=pass header.d=gmail.com header.s=20161025 header.b=twa8TqqY;
 dmarc=pass (policy=none) header.from=gmail.com;
 spf=pass (mx1.freebsd.org: domain of aryehfriedman@gmail.com designates
 2607:f8b0:4864:20::130 as permitted sender)
 smtp.mailfrom=aryehfriedman@gmail.com
X-Spamd-Result: default: False [-3.49 / 15.00]; ARC_NA(0.00)[];
 NEURAL_HAM_MEDIUM(-0.97)[-0.970];
 R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[];
 RCPT_COUNT_THREE(0.00)[3];
 R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c];
 FREEMAIL_FROM(0.00)[gmail.com];
 MIME_GOOD(-0.10)[multipart/alternative,text/plain];
 PREVIOUSLY_DELIVERED(0.00)[freebsd-java@freebsd.org];
 NEURAL_HAM_LONG(-0.99)[-0.994]; RCVD_COUNT_TWO(0.00)[2];
 DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_SOME(0.00)[];
 TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+];
 DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
 RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::130:from];
 NEURAL_HAM_SHORT(-0.53)[-0.531]; FROM_EQ_ENVFROM(0.00)[];
 MIME_TRACE(0.00)[0:+,1:+,2:~];
 FREEMAIL_ENVFROM(0.00)[gmail.com];
 ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
 TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[];
 FREEMAIL_CC(0.00)[freebsd.org,gmx.net]
Content-Type: text/plain; charset="UTF-8"
X-Content-Filtered-By: Mailman/MimeDel 2.1.33
X-BeenThere: freebsd-java@freebsd.org
X-Mailman-Version: 2.1.33
Precedence: list
List-Id: Porting Java to FreeBSD <freebsd-java.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-java>,
 <mailto:freebsd-java-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-java/>;
List-Post: <mailto:freebsd-java@freebsd.org>
List-Help: <mailto:freebsd-java-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-java>,
 <mailto:freebsd-java-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Jul 2020 12:57:00 -0000

On Wed, Jul 1, 2020 at 8:54 AM Ronald Klop <ronald-lists@klop.ws> wrote:

>
>
> *Van:* Aryeh Friedman <aryeh.friedman@gmail.com>
> *Datum:* woensdag, 1 juli 2020 14:36
> *Aan:* Ronald Klop <ronald-lists@klop.ws>
> *CC:* freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
> *Onderwerp:* Re: Min. ports needed for headless AWT/Swing
>
>
>
> On Wed, Jul 1, 2020 at 8:30 AM Ronald Klop <ronald-lists@klop.ws> wrote:
>
>>
>> Van: Aryeh Friedman <aryeh.friedman@gmail.com>
>> Datum: woensdag, 1 juli 2020 14:03
>> Aan: Ronald Klop <ronald-lists@klop.ws>
>> CC: freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
>> Onderwerp: Re: Min. ports needed for headless AWT/Swing
>> >
>> >
>> >
>> > On Wed, Jul 1, 2020 at 7:58 AM Ronald Klop <ronald-lists@klop.ws>
>> wrote:
>> >>
>> >>
>> >> Van: Aryeh Friedman <aryeh.friedman@gmail.com>
>> >> Datum: woensdag, 1 juli 2020 13:33
>> >> Aan: Ronald Klop <ronald-lists@klop.ws>
>> >> CC: freebsd-java@freebsd.org, Michael Osipov <1983-01-06@gmx.net>
>> >> Onderwerp: Re: Min. ports needed for headless AWT/Swing
>> >>>
>> >>>
>> >>>
>> >>> On Wed, Jul 1, 2020 at 5:52 AM Ronald Klop <ronald-lists@klop.ws>
>> wrote:
>> >>>>
>> >>>> Van: Aryeh Friedman <aryeh.friedman@gmail.com>
>> >>>> Datum: maandag, 29 juni 2020 20:59
>> >>>> Aan: Michael Osipov <1983-01-06@gmx.net>
>> >>>> CC: freebsd-java@freebsd.org
>> >>>> Onderwerp: Re: Min. ports needed for headless AWT/Swing
>> >>>>>
>> >>>>> On Mon, Jun 29, 2020 at 2:28 PM Michael Osipov <1983-01-06@gmx.net>
>> wrote:
>> >>>>>
>> >>>>> > Am 2020-06-29 um 17:43 schrieb Aryeh Friedman:
>> >>>>> > > I have a java application that works fine with setenv DISPLAY
>> :0.0 on my
>> >>>>> > > desktop FreeBSD 12.1 (amd64) [with Xfce4] but when I attempt to
>> run the
>> >>>>> > > same app on a VM that has the minimum ports needed to install
>> OpenJDK 8
>> >>>>> > and
>> >>>>> > > Tomcat I get an exception saying that it can't connect to the X
>> server
>> >>>>> > even
>> >>>>> > > though I did setenv DISPLAY desktop:0.0 (and xhost + on the
>> desktop).
>> >>>>> > > Note it is the same user on both machines (NIS/NFS password
>> DB/home dirs)
>> >>>>> > > doing the running on both machines but is a different user then
>> the one
>> >>>>> > > logged in at the console (I do all my development in a separate
>> account)
>> >>>>> >
>> >>>>> > Are you look for "-Djava.awt.headless=true"?
>> >>>>> >
>> >>>>>
>> >>>>> Since this is a screen capture/recording program (which I am the
>> developer)
>> >>>>> I need to be able to capture the console (running X) that I am
>> currently
>> >>>>> on.   So the question is what is the minimum set of ports/packages
>> I need
>> >>>>> to install on the VM to make it see and X server?   It should be
>> noted the
>> >>>>> program has no GUI but does use java.awt.Robot#createScreenCapture
>> (using
>> >>>>> the full screen resolution as it's bounds) individual frames of the
>> longer
>> >>>>> video.
>> >>>>>
>> >>>>> Here is the specific exception I am attempting to fix:
>> >>>>> On desktop (192.168.11.20)
>> >>>>> % xhost +
>> >>>>>
>> >>>>> On VM (192.168.11.4):
>> >>>>> % setenv DISPLAY 192.168.11.20:0.0
>> >>>>> % java
>> >>>>>
>> -javaagent:/usr/local/share/java/classes/jacocoagent.jar=destfile=/usr/home/aryeh/fnwe-scap-1a1.C036/jacoco.exec,jmx=true,excludes=thistest/*:test/*
>> >>>>> -cp
>> >>>>>
>> /usr/home/aryeh/fnwe-scap-1a1.C036/scrap/www/WEB-INF/lib/fnwe-scap-1a1.jar:/usr/local/share/java/classes/thisTest.jar:/usr/local/share/java/classes/pcCommon.jar:/usr/local/share/java/classes/pcUtil.jar
>> >>>>> test.TestMain
>> >>>>>
>> >>>>> Result of the jvm invocation on the VM (not it works no problem
>> su(do)'ing
>> >>>>> to another account on the desktop if I do setenv DISPLAY :0.0):
>> >>>>>
>> >>>>> Caused by: java.awt.AWTError: Can't connect to X11 window server
>> using
>> >>>>> '192.168.11.20:0.0' as the value of the DISPLAY variable.
>> >>>>> at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>> >>>>> at
>> sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
>> >>>>> at
>> sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
>> >>>>> at java.security.AccessController.doPrivileged(Native Method)
>> >>>>> at
>> sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
>> >>>>> at java.lang.Class.forName0(Native Method)
>> >>>>> at java.lang.Class.forName(Class.java:264)
>> >>>>> at
>> java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
>> >>>>> at
>> >>>>>
>> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
>> >>>>> at test.scap.TestVideoFrame.testCaptureFrame(TestVideoFrame.java:76)
>> >>>>>
>> >>>>> _______________________________________________
>> >>>>> > freebsd-java@freebsd.org mailing list
>> >>>>> > https://lists.freebsd.org/mailman/listinfo/freebsd-java
>> >>>>> > To unsubscribe, send any mail to "
>> freebsd-java-unsubscribe@freebsd.org"
>> >>>>> >
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>> >>>>> _______________________________________________
>> >>>>> freebsd-java@freebsd.org mailing list
>> >>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-java
>> >>>>> To unsubscribe, send any mail to "
>> freebsd-java-unsubscribe@freebsd.org"
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> Hi,
>> >>>>
>> >>>> Can you start any other X application on the VM using the DISPLAY
>> setting? Like /usr/ports/x11/xeyes. Than you know if it is something with X
>> instead of something with Java. I guess it is something with X.
>> >>>> I guess your desktop is not listening for external connections to
>> the X server or your routing between the VM and the desktop does not work.
>> >>>> Or start a X server in the VM and use DISPLAY=:0.0 again.
>> >>>
>> >>>
>> >>> Don't have any X components installed except for the ones required by
>> "make/make install" on openjdk8.   The reason for this post in the first
>> place was to figure out the minimum set of ports needed to get a working
>> DISPLAY variable in the first place.
>> >>>
>> >>>
>> >>> --
>> >>> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>> >>
>> >> I'm 99% sure you don't need any additional ports to get a working
>> DISPLAY variable.
>> >>
>> >> It will probably help to start your X server with "-listen tcp". But I
>> don't have enough information to be sure about that and how to configure
>> that in your setup.
>> >
>> >
>> > I think that might work if in fact there was an X server on the VM:
>> >
>> > root@dnixon:~ # X -listen-tcp
>> > X: Command not found.
>> > root@dnixon:~ # ls /usr/local/bin/X*
>> > ls: No match.
>> > root@dnixon:~ # ls /usr/local/bin/x*
>> > /usr/local/bin/x265 /usr/local/bin/xicclu /usr/local/bin/xmlcatalog
>> /usr/local/bin/xslt-config
>> > /usr/local/bin/xaegis /usr/local/bin/xjc /usr/local/bin/xmlcatmgr
>> /usr/local/bin/xsltproc
>> > /usr/local/bin/xft-config /usr/local/bin/xkbcomp /usr/local/bin/xmllint
>> /usr/local/bin/xsubpp
>> > /usr/local/bin/xgettext /usr/local/bin/xml2-config /usr/local/bin/xmlwf
>> /usr/local/bin/xxd
>> > root@dnixon:~ # ls /usr/local/sbin/x*
>> > ls: No match.
>> > root@dnixon:~ # ls /usr/local/sbin/X*
>> > ls: No match.
>> > root@dnixon:~ # java -version
>> > openjdk version "1.8.0_252"
>> > OpenJDK Runtime Environment (build 1.8.0_252-b09)
>> > OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
>> >
>> >
>> > --
>> > Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>>
>> In an earlier message you talked about "setenv DISPLAY 192.168.11.20:0.0".
>> That is the IP address of your desktop. So the X server must be running on
>> your desktop.
>>
>> You want the VM to screencapture the screen of the desktop? Or do you
>> want the VM to screencapture the screen of the VM?
>
>
> On the desktop... finally got it to capture the screeen on the desktop via
> what I tried above but now have a second problem with is the audio capture
> is there anyway to make the following Java snippet work with a remote mic
> (works fine on the desktop with a local mic on dsp2.0)?
>
>                 fmt=new AudioFormat(160000,8,2,true,true);
>                 mic=AudioSystem.getTargetDataLine(fmt);
>                 mic.open(fmt);
>                 mic.start();
> --
> Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
>
>
> Good that it is solved. Would you mind sharing what the solution was?
>

Adding -- -listen tcp to my call to startx on the desktop (I was confused
about which machine was the server and which was the client since the
relationship is reverse of the normal order.... i.e. the server is the
local machine and the client is the remote one not the other way around for
X)


-- 
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1075431299.4.1593608054346>