How am I supposed to use the -audiodev option in QEMU? - qemu

There is a thread Fwd: How am I supposed to use the -audiodev option?, but unfortunately it does not contain an answer. I use QEMU on Windows, and when I run my image in QEMU qemu-system-arm.exe , I get:
dsound: Could not initialize DirectSound
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
sdl: SDL_OpenAudioDevice for playback failed
sdl: Reason: WASAPI can't find requested audio endpoint: Element not found.
sdl: SDL_OpenAudioDevice for playback failed
sdl: Reason: WASAPI can't find requested audio endpoint: Element not found.
audio: Failed to create voice `lm4549.out'
So, I want to disable audio completely, and get rid of those messages.
So, I add this (found via https://unix.stackexchange.com/questions/564844/disable-sound-when-using-spice-with-kvm-libvirt) to my command line:
-audiodev id=none,driver=none
This then results with:
audio: Device lm4549: audiodev default parameter is deprecated, please specify audiodev=none
As recommended in that thread, I tried:
C:\bin\qemu\qemu-system-arm.exe -audio-help
Environment variable based configuration deprecated.
Please use the new -audiodev option.
Equivalent -audiodev to your current environment variables:
(Since you didn't specify QEMU_AUDIO_DRV, I'll list all possibilities)
-audiodev id=dsound,driver=dsound
-audiodev id=sdl,driver=sdl
-audiodev id=none,driver=none
Ok, I then try this instead of the above:
audiodev=none
... and I get:
qemu-system-arm.exe: audiodev=none: drive with bus=0, unit=0 (index=0) exists
Ok, I try this:
-audiodev=none
... and I get:
qemu-system-arm.exe: -audiodev=none: invalid option
So ... how do I set audio device to none in QEMU?

Related

golang chromedp ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value

I'm getting ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value while fetching amazon using chromedp. Tried with different user-agents but nothing works.
github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 github.com/chromedp/chromedp v0.8.4
Google Chrome 104.0.5112.79
What is wrong
Google Chrome 104.0.5112.79 has such policies (see browser_protocol.pdl#L6178-L6184):
Allow
BlockFromInsecureToMorePrivate
WarnFromInsecureToMorePrivate
PreflightBlock
PreflightWarn
And github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 supports the same list of polices (see cdproto).
So the error looks impossible.
What to do next
The last change to PrivateNetworkRequestPolicy is 97.0.4665.1_9.7.3 which adds two new values:
PreflightBlock
PreflightWarn
Please double check the version of the chromedp/cdproto package and the version of the browser.
Now that Chrome 105 has been released, please upgrade to this version. Maybe it will address the issue.
It will be helpful if you can enable the debug log to record what is the invalid value. Enable the debug log like this:
ctx, cancel := chromedp.NewContext(ctx, chromedp.WithDebugf(log.Printf))
updating chromedp to the latest version fixed the issue.
Refer: https://github.com/chromedp/chromedp/issues/797
go list -m github.com/chromedp/cdproto
github.com/chromedp/cdproto v0.0.0-20221126224343-3a0787b8dd28

how to enable hybrid mode in graphhopper for traffic data

how to enable hybrid mode for graphhopper 0.9 version. in the config file, what all we need to enable/disable/change
my intention is to use traffic data using the link
graphhopper-traffic-data-integration
i am not able make it work, when i feed the data using curl, i get below error
{
"message" : "Not found"
}
i tried changing the prepare.ch.weightings=hybrid but i get error
now web. JAVA_OPTS=-Xmx1000m -Xms1000m -server
Exception in thread "main" java.lang.IllegalArgumentException: weighting null not supported
at com.graphhopper.GraphHopper.createWeighting(GraphHopper.java:908)
at com.graphhopper.GraphHopper.initCHAlgoFactoryDecorator(GraphHopper.java:798)
at com.graphhopper.GraphHopper.load(GraphHopper.java:738)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:617)
at com.graphhopper.http.GraphHopperModule$3.start(GraphHopperModule.java:182)
at com.graphhopper.http.GHServer.start(GHServer.java:118)
at com.graphhopper.http.GHServer.start(GHServer.java:62)
at com.graphhopper.http.GHServer.main(GHServer.java:57)
If using the hybrid mode you can disable the speed mode:
prepare.ch.weightings=no
and set the default fastest weighting for hybrid:
prepare.lm.weightings=fastest
See the documentation

Is there a way to write a |RtmpSampleAccess command to a NetStream in data generation mode?

I'm streaming data from a server and passing it into a net stream in data generation mode. I'm successfully wrapping H264 and PCMU to be played back through NetStream, however I need to be able to capture this output from the video display it's on and store it in an image. When using an RTMP server, I'd configure it to send an RtmpSampleAccess command, with true,true for audio and video access allowed. When using RTMFP I'd do the same, send() a RtmpSampleAccess true,true from the peer to allow access.
I believe I need to send in an FLV tag for a script data object to represent the RtmpSampleAccess command, however I can't find any information on what the format of that tag needs to be. I've tried using the OSMF FLVTagScriptDataObject with the objects set to the following combinations:
["|RtmpSampleAccess", true, true];
["|RtmpSampleAccess", [true, true]];
And various attempts at guessing the naming for object parameters (though looking at the protocol docs, I'm not sure there is one).
Could someone out there help me here, would be much appreciated.
Where you put your Netstream into Data Generation mode you add a second Play command. The second one simply plays "a blank" and for some reason this overrides the security error.
ns.play(null);
ns.play(""); //works to avoid all security errors
ns.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
Then to draw just setup a button to run the draw_VideoFrame function when clicked, or try real-time drawing with something like below (using enterFrame):
vid_Obj.addEventListener(Event.ENTER_FRAME, draw_VideoFrame);
and then create a function like this example.
function draw_VideoFrame (e:Event) : void
{
vid_BMD.draw( vid_Obj ); //draw into a BitMapData variable
}

Chrome Extension, messaging: getting port status

I am trying to get a port's status in an application (not a content script). When I do :
this.port = chrome.runtime.connect("okcbadfdlhldjgkbafhnkcpofabckgde");
I get a valid port object but I can't find anyway to determine if the port can be used at all (I don't even get a disconnect event if the extension can't be reached).
The only way I figured out to have the connectivity state is to actually trap an exception when performing a this.port.postMessage.
Is there a better way ?
https://developer.chrome.com/extensions/runtime#method-connect
Update
Running Version 48.0.2564.97 (64-bit) on Linux Ubuntu
No cross-extension messaging, just application to/from extension
Extension source code but note I have since moved on to implement another strategy for the extension because of the issue raised in this question.
Your extension uses a background-script that provides listener function for the chrome.runtime.onMessageExternal event. This event is used to listen for incoming messages, send from external webpage-scripts (or other extensions) by calling the chrome.runtime.sendMessage method.
Since your extension does not provide a listener function for the chrome.runtime.onConnectExternal event, chrome.runtime.connect cannot work for your extension.
As far as knowing the connection status is concerned, in this case a simple try-catch block would do enough to know whether the extension supports port or not. If it does, you need to view the manifest corresponding to this extension - to see if a particular host is allowed to send messages or not.
I was able to send message to your extension (see the enclosed figure) by adding the following lines of code in the background-script. In addition to this, I also added the matches string for the host - www.example.org in the manifest.
chrome.runtime.onMessageExternal.addListener(
function(request, _sender, sendResponse) {
console.log(request);
...
}
);

Retrieving selenium logs and screenshots from grid back in Intern

There are two parts to my question in regards to Intern workflow in case of exception:
1- Per Selenium Desired Capabilities specifications, RemoteWebDriver captures screentshots on exceptions by default (unless it is disabled by setting webdriever.remote.quiteExceptions.) Is it possible to retrieve these screenshots in Intern?
2- I have set up a Selenium Grid with multiple platforms/browsers and can execute Intern tests on the grid successfully. However I am trying to gather the logs back in my Intern environment so that I don’t have to sign on to each machine on the grid to see the logs. I am particularly interested in server, driver, and browser logs based upon selenium logging guide. I tried adding the following Intern configurations using the Selenium Desired Capabilities guide but wasn't able to get any logs:
capabilities: {
'selenium-version': '2.39.0',
'driver': 'ALL',
'webdriver.log.driver':'INFO',
'webdriver.chrome.logfile': 'C:\\intern\\logs \\chromedriver.log',
'webdriver.firefox.logfile':'C:\\intern \\logs\\firefox.log'
To get a screenshot yourself you can call remote.takeScreenshot().then(function (base64Png) {}), but there is no way that I am aware of to retrieve the automatically generated screenshots—there appears to be nothing in the WebDriver JsonWireProtocol to do so.
To retrieve logs, you can call remote.log(typeOfLog).then(function (logs) {}). See the JsonWireProtocol on log for more information on what you get back.
There is a way to capture automatically generated screenshots. Using a custom reporter (https://github.com/theintern/intern/wiki/Using-and-Writing-Reporters#custom-reporters) I was able to save a screen shot and log browser console logs into a file.
As mentioned in the link above, when the '/test/fail' topic callback is called, it passes in a test object. If the webdriver had failed internally, this object will have a 'test.error.cause.value.screen' variable present in it. This is the variable that stores the webdriver generated screenshot. So the following is what I did:
if (test.error.cause.value.screen) {
//Store this variable into a file using node's fs library
}
If you look at the error object, you will also get to see more error information that the webdriver has logged.
Regarding the browser logs, #C Snover has hit the nail on that one. But that information is only available inside the remote object. This object is available when the '/session/start' topic callback is called. So what I did is I created a map that mapped the session ID from the remote object to the remote object itself. And luckily, the test object has the session ID in it too. So, I retrieved the remote object from my map using test.sessionId as the key to the map and logged the browser logs too. So in short this is what I did:
'/session/start': function (remote) {
sessions[remote.sessionId] = { remote: remote };
},
'/test/fail': function (test) {
var remote = sessions[test.sessionId].remote;
remote._wd.log('browser', function (err, logs) {
//Store the logs array into a file using node's fs library
});
}