Linux 5.10
lore.kernel.org
lore.kernel.org
In order to make the switch, I push one button on the USB switch, and then select the next input on my monitor (four button presses using the monitor's OSD). There's a great little tool called ddcutil [1] that allows you to send commands to your monitor via the i2c bus embedded in your HDMI/DisplayPort connection, so I tried to write a script to do the monitor input swap on either a key binding or after detecting the appropriate USB event.
It almost worked. My monitor only listens to the i2c bus of the selected input, so I need to run this script on both my desktop and laptop rather than just on the desktop. But apparently there was a bug in the way my (TB3) dock handled forwarding of the DP i2c data to the docking host. And by bug, I mean write forwarding was just not implemented in the kernel driver. So ddcutil would work on my laptop with a direct HDMI connection, but not when it was connected via the dock.
Anyway, long story short:
5.10 fixes this [2], so I'm particularly excited about this release.
[0] https://www.amazon.com/Cable-Matters-Sharing-Computers-Perip...
Only issue I have with it is that it doesn't run as a Windows service - so you have to manually switch the monitor the first time so you can login and start display-switch. I see someone else has opened an issue in the github repo, so hopefully it gets resolved.
So I got a USB switch and that worked well for a while with multiple monitors (Dell) that you could assign shortcut keys to the buttons to switch inputs with 2 presses.
Now I have a curved Dell and it has a built-in USB switch that works really well that you can assign to inputs. It's a bit slow, switching USB takes as long as it does to switch video inputs, but it appears to be rock solid.
The other features, side-by-side and PiP are kind of a joke.
High-end KVMs get around this with virtual usb devices. Instead of switching the actual USB devices between computers A and B, they instead create a separate virtual USB device for each computer that always stays connected to each computer and is never switched. When you push the button on the KVM, you are not actually switching between computers, the KVM reads the USB input from the device and then recreates it on the appropriate virtual usb output device.
These KVMs are pretty costly. There are some complicated DIY solutions involving arduinos, but a software "KVM" (really just the KM, no V) like https://github.com/debauchee/barrier in most situations works just as well, and if the computers are connected via wired ethernet, is rock-solid and adds no perceptible latency.
For keyboard/mouse I use Barrier ( https://github.com/debauchee/barrier ) which works great for sharing keyboard/mouse between my laptop and desktop.
The USB switch electrically disconnects and reconnects any attached USB devices, moving them between a USB port on my desktop and a USB port on my docking station. I have a keyboard and a Logitech receiver connected to this switch. The advantage of doing it this way is that it works on any operating system without any additional software. Things that might not make it through a HID emulation layer (e.g. scroll sensitivity, firmware updates, RGB LED control(?), etc.) just work the way they would if the peripherals were connected directly (because they are connected directly). You could also add other USB devices to the switch if you wanted, like an audio interface, drawing tablet, thumbdrive, etc. (although you'd want to be careful about unmounting any drives).
The video source is set by the monitor. Doing this via the monitor's OSD menu works, and also doesn't require any software, but is annoying. So the small bit of optional software that I've added is a script that waits for the keyboard to disappear (which happens after I press the button on the USB switch), and then tells the monitor to change input. It saves me four button presses when it works, but I can still perform the switch manually if it doesn't.
The no-software approach allows this setup to work even if a friend shows up with a TB3 laptop without any special software and wants to work at my desk.
Wonder if it will work with my desktop and raspberry pi.
Is that even doable? It's the type of setup I want.
In any case, my desktop is old and doesn't speak Thunderbolt. I'm not sure whether I can bolt it on with a PCIe card, but even if I could, configuring an nvidia card to reroute output from its own ports to a Thunderbolt add-on card sounds... not fun. And then you'd have to deal with the fact that the longest passive cable that the TB3 spec allows for is like, 2 feet long, and I have a standing desk...
It's certainly an interesting idea, and pulling it off would be an impressive technical feat.
To work around it I have to use a second hdmi cable directly connected. It defeats the purpose of having the single dock cable that I was hoping for when I bought it. :-/
Good news though. Maybe when 21.04 (Hirsute Hippo :) comes out I can finally get rid of the second cable.
[1] https://gitlab.freedesktop.org/drm/intel/-/issues/37
You might try anyway. Believe I use the thunderbolt connection for my monitor, the second direct hdmi connection is used only for sending ddc commands. In other words, both inputs seem to be listened to with my Dell monitor.
Your monitor must listen to DDC commands from inactive inputs. I think mine doesn't, because this whole problem came about when I realized that my desktop could ask the monitor to switch to the other input, but couldn't ask it to switch back.
Apparently a lot of computer monitors only listen to DDC commands coming from the selected input, while TVs almost always listen to them from all inputs, because they often need to do things like "switch to Roku input when the Roku asks, even if some other set-top box is driving the display."
If my monitor could do this, I could just run the input switching script entirely on my desktop (based on whether the keyboard has just appeared or just disappeared), and I wouldn't have to send DDC commands via the dock at all.
If anyone's interested, my script is here: https://github.com/liskin/dotfiles/blob/home/bin/liskin-brig... Lets me interactively adjust the brightness using a very simple gui: https://twitter.com/Liskni_si/status/1320698852970778627
I'm happy with the ddccontrol based switching with 2 computers (linux desktop + mbp), but I want to add an additional computer (mbp) to the mix, so my workflow won't work anymore.
Does anyone know of dual head DP KVM switches that work reliability? Googling shows a few options, but the they are old posts and things may have changed. Single head (1 DP monitor + MST) works for the linux desktop but Apple does not support MST on macbooks it seems like[1][2] (I can't even find an official page on apple.com with relevant details).
I have tried [3] but it is quite buggy with displays blanking out once every few minutes even with higher quality, DP 1.2 compliant cables (cable length < 1.2m).
[1] https://www.dell.com/community/Monitors/P2720DC-use-MST-func...
[2] https://old.reddit.com/r/MacOS/comments/gliki5/in_2020_why_d...
[3] https://www.amazon.com/gp/product/B089LY4S63/ref=ppx_yo_dt_b... (select the 2 monitor x 4 computers DP model)
I always wondered if such things are unique features of Linux or available on Windows and Mac as well.
Windows should have something similar.
Traditionally processes have reaped dead children by waiting on them, the problem with this is it's a synchronous operation that blocks a thread per child.
The only historical non-blocking solution was to listen for signals. Signals are great and all, except that the kernel will sometimes (unavoidably) merge multiple signals together, preventing you from getting a list of dead children. This is problematic if you want to know exactly which children died.
Linux 5.3 introduced a third system to listen for dead children, pidfd. It's a file descriptor which you can pass to epoll to know when a specific child dies. This is great, but it didn't yet support O_NONBLOCK, which meant that to use it in asynchronous (rust) code we need to create an extra thread which just sits around listening for it.
Linux 5.10 brings the ability to make this fd non blocking, so we can integrate this seamlessly into async event loops. Here's some code of mine that does that: https://github.com/gmorenz/async-transpiled-xv6-shell/blob/m...
Thanks to Christian Brauner, Josh Triplett, and Oleg Nesterov: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
as a c2rust contributor, this made me smile :) thx friend!
Wouldn't the wait syscall wait for any child?
Not sure why this would not work for the OP or miss some process terminations due to merged SIGCHLD signals? I guess using pidfd may be more straightforward, but I don't think this was some unsolved problem previously.
Of course if I want to deploy code like this in any serious way I'll have to implement another solution than non blocking pidfds...
That said, if your child process has genuine potential to acting adversarially, I don't believe even pidfds would be enough; you'll need to make sure it doesn't spawn e.g. a child process to break away.
However, I would guess that's not your actual use case? Rather, I'd assume you're trying to prevent against accidents. If you're in this boat like I'm assuming, I'd suggest thinking over whether the scenario you proposed is actually plausible. The only real-world instances I've seen a process playing "games" with file descriptors it did not previously open itself are (a) closing FDs after a fork, and (b) user code in a shell, doing something like exec 2>&3 or whatever. I assume you're worried about the latter given the former isn't relevant. In that case, you could work around it via dup2() after you fork(), by duping into a random high FD that nobody would be likely to mess with (like a random high number plus its own PID). This should solve it for practical purposes.
Not that you shouldn't use pidfds necessarily, but I'm just throwing these out there because I've been in this situation before and these might help you solve your problem on other systems that don't support that.
and what is the state of embracing more and more modern methods in the spirit of computer-aided software engineering? (not the BS 1990s hype of CASE, but genuine, meaningful, modern, and research-backed CASE).
(Credit where credit is due: git is one such example, but we need more such tools, shouldn't just stop at modernizing just the version control).
Seriously, the kernel averages about 200-250 new contributors every release (i.e. every 2 1/2 months). We are not starved for new contributors at the moment at all, do you think we are somehow not attracting new developers compared to other open source projects?
I’m not sure that _this_ is the (a?) problem, but if someone were purely sourcing CNCF / Linux foundation / press releases they might think the project is heading for a day when the old guard keels over and we’re left high and dry.
I was mainly referring to something I read many years ago (regarding new kernel devs), e.g., this from 2013 [0]. However, from your response, looks like that's not a problem.
[0] https://www.zdnet.com/article/graying-linux-developers-look-...
Linux 5.10 LTS is likely the kernel to be used by Debian 11, Mageia 8, and others. For the likes of Fedora 34 and Ubuntu 21.04 we are more likely to see Linux 5.11 at play.
So may be another half a year or so for Debian. ( And hopefully soon after that for Synology NAS if you are interested in BTRFS )
[1] https://www.phoronix.com/scan.php?page=news_item&px=Linux-5....
It's never easy to know ahead of time, but my hope is that Linux 5.10 will give us Slackware 15.
I have Bluetooth 4.1 built into my WiFi card, over the last year the only issue I have had was manually having to switch to HSP mode on my headphones to use the Mic. Switching from A2DP to HSP was easy, just click Audio in the settings menu in the upper right corner in Gnome.
Besides that, Bluetooth mice and headphones &keyboards just work.
That said, the replacement process is pretty fiddly...Dell likes using lots of very small screws made of very soft metal.
I've also found that Gnome's bluetooth handling varies from barely acceptable to confusingly horrible. KDE's bluetooth handling has been way more reliable for me across multiple machines and distros. So the problem may very well be in userspace.
I don't really use BT for anything, so I can't comment on its quality. WiFi has been completely fine, though. Either way, I believe both the WiFi and BT hardware are soldered in on this model.
(from https://wiki.archlinux.org/index.php/Bluetooth_headset#Switc...)
That discusses audio flowing in both directions.
> Each A2DP service, of possibly many, is designed to uni-directionally transfer an audio stream in up to 2 channel stereo, either to or from the Bluetooth host.
This matches what I has heard: Bluetooth devices with A2DP profile can either receive or send high-quality audio, but not both at the same time.
I don't know if there are Bluetooth headsets that have separate A2DP devices for input and output sound, I have never heard about them, but I would be very interested in knowing of their existence.
Also from the article:
> These systems often also implement Headset (HSP) or Hands-Free (HFP) profiles for telephone calls, which may be used separately.
This is the common case for Bluetooth headsets, the Bluetooth manager switches profile when the microphone is needed, but that greatly reduces audio quality.
When I am using the headphones, and IF an application requests microphone, THEN I do want this switch to happen automatically. After the Microphone is not needed anymore, I want it to switch back to the HQ A2DP.
Am I missing something here?
But how else would my mic work? If it stays on A2DP, then there is no Mic input, so I used to have to manually switch it to HSP. With the solution I linked above, this is not manual.
So... I am not sure it does support it, TBH. I have a Bose QuietComfort 35 (II), and on linux I definitely have the low quality HSP+ mic (other thatn the quality, works well) and for listening only, A2DP is working too.
On Android though, calls are _MUCH_ higher quality with the mic on. (still somewhat different than from output-only, but less degradation than under my desktop linux)
I agree with you. Bluetooth works, but just barely, and it feels like it's getting worse.
Somewhere between 5.8 and 5.9 reconnecting became incredibly flaky for me (XPS 9300). Headphones will pair and connect fine the first time, but then completely fail to reconnect properly if I turn them off or walk out of range.
Sometimes I can connect to them again, but they don't get registered in pulseaudio, even after killing and restarting it.
Sometimes they will connect, then immediately disconnect again 5 seconds later (rinse and repeat until removed and repaired)
Sometimes they fail to connect entirely.
I end up consistently removing the device, restarting the bluetooth service, and then repairing fresh. In which case they work until the next disconnect.
---
It's hardly the end of the world, and it's a little amazing that my biggest complaint about linux desktop these days is flaky bluetooth, but it's certainly annoying.
It used to work fine, and then at some point I stopped being able to disconnect and reconnect the same device without power cycling the computer.
I've also wondered if a lot of the bluetooth problems on Linux are actually caused by the desktop manager.
Most of the problems I've personally experienced have seemingly been tied to using old versions of Gnome on Ubuntu. In fact, Gnome in general has always been rough for me on bluetooth; the bluetooth connection app still needs some love, but I've noticed it being more reliable with recent versions. I particularly noticed this when I was running a newer version of Gnome on Fedora 31, but then running an older version of Gnome on Ubuntu 18.04 (for work). The older version of Gnome's bluetooth was considerably worse.
For about the past year, however, I've been using Fedora / KDE on desktop and OpenSUSE / KDE on my laptop. This has been by far the best bluetooth experience I've had on Linux. Thank you to whoever wrote the KDE bluetooth code, because it is consistent and reliable.
So I don't think it is totally a kernel problem. YMMV depending on what cards/adapters you're using (I'm using a mix of Intel and some USB sticks from a fly-by-night vendor).
Saying that it's hard to get through is an understatement.
I can say I can let this pass if the maintainer was really an overworked volunteer who shared his work on Linux with his day job, but not if the guy works for the biggest electronics company in the world.
I believe Linux core devs need to put stricter criteria on system maintainers if they are working on company's payroll.
Nintendo switch controller support sounds interesting!
At this point it makes more sense to just put linux on the switch and use it as a tablet and play the games on my desktop since that's already hooked up to the living room display anyway.
https://nh-server.github.io/switch-guide/extras/blocking_upd...
I have been successfully using the DKMS-based driver with my Pro Controller for some time already. But it's always nice to get rid of a moving part in the stack.
I’ve seen hints that this has been fixed in 5.10, but wasn’t able to find any official source. Anyone that knows more about this?
https://www.gamingonlinux.com/2020/10/collabora-expect-their...
Eventually Linux and NT will converge until the language runtimes will run on both and apps will run on both. Which works better will be largely a question of linker flags.
https://www.reddit.com/r/linux_gaming/comments/jtz08q/collab...
https://www.phoronix.com/scan.php?page=news_item&px=Syscall-...
Trackpad support on my XPS13 is acceptable now but not macOS standard IMHO. Crucially though I notice it improving over time.
Both of these are userland rather than kernel concerns though aren’t they?
I have an old VGA hooked up as an additional display just because i can, but i have to set `amdgpu.dc=0` to make it work.
I've used a bunch of distributions, even rolled my own when I was a teenager. Kernel version back then was around 2.6, and a new release didn't change anything for me as a mostly desktop user.
Is it different for many professionals? Are there people waiting for a new release, are there big problems to be solved or "Linux is ready" and it's mostly maintenance nowadays?
I managed to on 5.10-rc6? Had to upgrade to the "shortlived" version of the driver, but that went smoothly.
io_uring looks like it will be a big deal, it will probably be a while before it really hits mainstream, but I was waiting on 5.10 before trying it out.
The whole tracing story in Linux has changed in the recent years. It's really useful in practice.
Wireguard and exFAT are a couple of notable ones that have been mainlined since 5.4, with the latter impacting basically anything that uses SD cards (as it's a required part of the SDXC spec)
Due to the unparalleled transparency of not just a GPL source but a completely open development model, there's a whole lot more than just a version number to appreciate and investigate if so inclined.
Also having the bulk of drivers in-tree, kernel releases affect a lot more than just core stuff like the scheduler, memory management, and interrupt controllers.