How to enable usb gadget mode from menuconfig - usb

I am trying to enable a usb0 interface in my kernel using the rndis module. This resides under the gadget driver category in menuconfig. I am unable to figure out the correct and complete set of configurations in menuconfig to enable the rndis support. Since the gadget driver config is incomplete, I am currently facing an error when I try to modprobe g_ether on my target (linux 4.19.55 armv7l):
udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
How to fix this error so that usb0 comes up on my target

The UDC device issue was resolved by changing the mode of musb controller to dual from kernel menuconfig. After this the g_ether gets loaded successfully asn usb0 shows up on the target. Basically a UDC device like below needs to show up on the target before g-ether can be loaded.
root#:/sys/class/udc# ls
musb-hdrc.0.auto

Related

vulkan is not avaible in lxc / lxd container but opengl is

I am using ubuntu 18:04 with an lxc / lxd steam container. It works great, I followed this tutorial and did some changes to the network stuff.
https://blog.simos.info/running-steam-in-a-lxd-system-container/
Steam works for opengl games but not for vulkan games. Same for lutris.
Host side:
===========
VULKAN INFO
===========
Vulkan Instance Version: 1.1.70
Instance Extensions:
====================
Instance Extensions count = 16
Container side:
ubuntu#steam:~$ vulkaninfo
===========
VULKAN INFO
===========
Vulkan Instance Version: 1.1.70
ERROR: setupLoaderTermPhysDevs: Failed to detect any valid GPUs in the current config
ERROR: setupLoaderTrampPhysDevs: Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
/build/vulkan-UL09PJ/vulkan-1.1.70+dfsg1/demos/vulkaninfo.c:2700: failed with VK_ERROR_INITIALIZATION_FAILED
OpenGL works just fine, games run fast, so it must find my only gpu in the system. Do I have to separately enable vulkan for the container?
The host has no problems with the vulkan smoketest either:
user#host:~$ vulkan-smoketest
7223 presents in 5.00039 seconds (FPS: 1444.49)
That guide adds manually the necessary OpenGL shared libraries in the LXD container, and by doing so, does not add the Vulkan shared libraries.
LXD now supports the NVidia container runtime (provided by NVidia), therefore you can use it instead. Follow the more recent guide at https://blog.simos.info/running-x11-software-in-lxd-containers/
A reddit user named zakk wrote a solution in the comments of https://blog.simos.info/running-steam-in-a-lxd-system-container/.
After doing some traces, I noticed it is failing to open files in
/dev/dri The container has the wrong permissions; on the host those
files have an ACL set that lets the current user access them, the
container does not. So to fix: in the container run
sudo setfacl -m "u:ubuntu:rw-" /dev/dri/*
You have to execute the setfacl command every time you start lxc.

Applications not seeing NoMachine pulseaudio microphone source

I'm remoted into a Linux VM running CentOS 7 via NoMachine. NoMachine presents the client's microphone as a pulseaudio source. I can use Audacity to record from the pulseaudio source.
However, other applications - Chrome, Firefox, Slack, WebEx - don't see or don't recognize the pulseaudio source as a microphone.
test.webrtc.org says [ FAILED ] Failed to get access to local media due to error: NotFoundError.
pacmd list-sources shows:
2 source(s) available.
index: 1
name: <nx_voice_out.monitor>
driver: <module-null-sink.c>
* index: 2
name: <nx_audio_in.monitor>
driver: <module-null-sink.c>
How do I get applications to recognize the pulseaudio source as a microphone?
Got it working by remapping the source:
pacmd load-module module-remap-source master=nx_voice_out.monitor source_name=Microphone
I don't know why this works, since all I've done is to essentially rename the source. I've not remapped any properties of the original source. Perhaps applications do not like the .monitor in the name of the original source.
I also needed to unload the suspend on idle module:
pacmd unload-module module-suspend-on-idle
Otherwise pulseaudio sometimes suspends the remapped source and I'm unable to unsuspednd it.

org.bluez.LEAdvertisingManager1 interface disappeared in bluez 5.31

I've been working with bluez 5.30 for a few weeks getting a peripheral working using the DBus APIs. I ran into a bug registering descriptors which I tracked down to an issue in gatt-database.c. When I went to report the bug, I noticed 5.31 had been released, which corrected the issue, so I built and installed the new version.
However, in this new version the LEAdvertisingManager1 has disappeared from the adapter object. Downgrading back to 5.30 corrects the issue. I start bluetoothd with the -E option in both cases.
When I start bluetoothd from the command line with debugging on, I can see the device wishes to create the interface:
bluetoothd[1801]: src/advertising.c:btd_advertising_manager_new() LE Advertising Manager created for adapter: /org/bluez/hci0
The only clue appears to be this line:
bluetoothd[1801]: Failed to read advertising features: Unknown Command (0x01)
Which i tracked down to the call to read MGMT_OP_READ_ADV_FEATURES over hci, which returns 0x01, unknown command. This command was working fine in 5.30, so I'm curious if this is some configuration issue for the new features in 5.31.
Anyone have any tips for correcting this?

Kinect / Primesense (Xtion) ROS Ubuntu through Virtual Machine (VMware)

Since it took me quite some time to figure out how to get Xtion (Primesense) to work on VMware I thought to share it here with you. (with Kinect I have a problem to let ROS see the device even though VMware has successfully connected it).
roslaunch openni2_launch openni2.launch
Running the above command gave me the error:
Warning: USB events thread - failed to set priority. This might cause loss of data...
I either got a single frame or no frame when running "rviz" and Add --> Image --> Image topic --> /camera/rgb/image_raw
So how do I get video frames in Ubuntu from a Primesense device while using a Virtual Machine (VMware)?
My specs
Windows 7 running VMware 10.0.4 build-2249910
Ubuntu 12.04.5 Precise in VMware
ROS Hydro
The following question pointed me in the right direction: http://answers.ros.org/question/77651/asus-xtion-on-usb-30-ros-hydro-ubuntu-1210/?answer=143206#post-id-143206
In the answer of blizzardroi (not selected answer) he/she mentions that USBInterface should be 0. I reasoned that since my main Machine is Windows, I should set UsbInterface to 1, which indeed solved it.
Solution
Go to /etc/openni2/ (from system folder, not Home) and open PS1080.ini with administrator rights (e.g. sudo gedit PS1080.ini). Search for UsbInterface, remove the ; and change the value to 1. It should look like below:
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines)
UsbInterface=1
Additional
From previous experience it may also be related that your Windows system may need the kinect drivers as well. If the above not works, try to install the following:
(Kinect SDK) https://www.microsoft.com/en-us/download/details.aspx?id=34808
(OpenNI2 Windows) http://structure.io/openni
p.s. Don't forget your drivers for Ubuntu (replace hydro with your ROS version)
sudo apt-get install ros-hydro-openni*
Important
It doesn't solve the error below, but rviz returns video, which means that we can read the data the Primesense device publishes!
Warning: USB events thread - failed to set priority. This might cause loss of data...
Got the same warning from opennni (issued at start by a binary located at Tools/PSLinkConsole) with another sensor.
Solved by starting process as sudo - my guess: to set priority to USB event threads you need root access. :)

Debian Camera isn't working

I have never before worked in Debian environment. I have some problem with camera, I was looking for answers but find nothing.
I am working in virtualbox, the camera is plugged through virtualbox. I am using is my laptop webcam, Lenovo EasyCamera. When I lauch program, for example cheese, I get this message :
jakub#debian:~$ cheese
OpenGL Warning: crPixelCopy3D: simply crMemcpy'ing from srcPtr to dstPtr
(cheese:3368): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a GtkToggleButton, but as a GtkBin subclass a GtkToggleButton can only contain one widget at a time; it already contains a widget of type GtkLabel
libv4l2: error turning on stream: Brak miejsca na urzÄ…dzeniu
** (cheese:3368): WARNING **: Error starting streaming on device '/dev/video0'.
** (cheese:3368): WARNING **: Could not negotiate format
When cheese is working, the diode from the cam is on, so camera is working, but why Debian cannot show me the image.
I hope you will know what to do. I appreciate your help.
It appears to be the same as this issue:
libv4l2: error turning on stream: No space left on device
You probably need to enable USB 2.0 in your virtual machine and pass the device into your guest OS using a high-speed USB host controller (EHCI).
You may need the VirtualBox Extension Pack, I remember it being required for USB 2.0 in the past. I can't find any current information about that, though, perhaps EHCI support is now included already.