UPERFECT X Mini lapdock works with Librem 5

Ah ok good tip I’ll give that a try. I guess I can turn off the screen manually with the power button.

Another useful thing is to turn off the phone screen and use only the dock one while plugged, I was trying to do it nicely for a while, you can see the discussion here Initial Librem5/Nexdock360 impression but now I just created a .desktop file that calls a script to disable the phone display when open using wlr-randr --output DSI-1 --off then to go back to the phone I just unplug it and it crash and reload phosh to the phone display, not ideal but it works.

1 Like

Interesting. I am also looking for a way to easily use the lapdock screen as the main screen and turn the phone screen off when I don’t need it. Doing this through gnome-settings is rather cumbersome.

1 Like

I have noticed when you do this and unplug the phone it does tend to crash. I should inspect the logs to see what’s going on when this happens.

I’d agree that would be important for any setup there not to skip this:

That’s why here linking specifications (again and as orientation) of the one (length is important usage consideration as well) that @Kyle_Rankin already recommended (while it works): https://www.dockcase.com/category/cables.

EDIT: @johan-bjareholt, how about connecting there and powering Librem 5 through REVOXEN − twin USB-C bi-directional switcher?

That is what I said on my comment, my plan was to create a udev rule so every time the nexdock is connected or disconnected it will trigger a script but I couldn’t manage, so I’m just doing it like that by the time being.

So, I finally received my UPERFECT lapdock.
Things mostly work but I’m a bit puzzled about the touch screen as it seems to work for everyone after enabling in the mobile settings…
But here it doesn’t! Touching the screen will trigger the corresponding point on the phone screen. Basically what @Altor said in that post but for another device: when I touch the right side of the lapdock screen it’s as if I touched the right side of the phone screen, if the left of the lapdock screen then the left of the phone screen, and so on. Dragging a finger on the lapdock screen will scroll whatever is on the phone screen.
What does that mobile-settings option do? I don’t see any difference when I enable it or not. Can I somehow configure that by hand? What is the gsetting command that @Kyle_Rankin mentioned?

So in the PureOS Mobile Settings application under convergence you have map built in touch screen enabled?

I will update my initial post. Unfortunately, I can’t open an issue on the git to update mobile setting.

for me, the working gsetting command is

gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/2d1f:524c/ output “[‘Lenovo Group Limited’,‘M14t’,‘V307G6CZ’]”

the touchscreens identification (in my case 2d1…) is found thanks to lsubs (here aftter my output line)

Bus 003 Device 004: ID 2d1f:524c Wacom Taiwan Information Co. Ltd. Pen and multitouch sensor

and the output ([’Lenov…]) is found thanks to journalctl -b 0 _COMM=phoc and then search for Output ‘DP-1’

Output ‘DP-1’ added (‘Lenovo Group Limited’/‘M14t’/‘V307G6CZ’)

just change the / by , in the gsetting command.

3 Likes

Awesome! Thank you @Altor that works. (I’m wondering how you found out how to do all that)

Actually I don’t have the mini, I guess that’s why it wasn’t working (I wanted the mini but it wasn’t in stock so they sent me another one, not sure which model exactly). Maybe mobile settings detects a uperfect something and tries to configure the touchpad of the mini and it doesn’t because it’s not the same ids…

This is the command I ran:

gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/27c0:0819/ output "['Unknown','uperfect','8R33926O00QS']"
1 Like

I finally got around to learning how udev works and using that to switch off the phone screen when the lapdock is connected.

  1. apt install wlr-randr to be able to change screen configuration from scripts
  2. Look for a suitable device in lsusb to trigger the rule. I used this line from the output: Bus 003 Device 004: ID 27c0:0819 Cadwell Laboratories, Inc. WingCoolTouch, i.e. the lapdock touch screen.
  3. Create file /etc/udev/rules.d/99-lapdock-then-phone-screen-off.rules with following contents:
ACTION=="add" \
, ATTRS{idVendor}=="27c0" \
, ATTRS{idProduct}=="0819" \
, ENV{XDG_RUNTIME_DIR}="/run/user/1000" \
, RUN+="/usr/bin/wlr-randr --output DSI-1 --off"

Adapt the vendor and product id to what you found in lsusb if you don’t have the same model as me, and the RUN+= lines if you want to do other stuff when the lapdock is connected.

Hope this helps!

4 Likes

I would bring to other readers’ attention though the following caveats from the man page

This can only be used for very short-running foreground tasks. Running an event process for a long period of time may block all further events for this or a dependent device.

So for any command that you choose to run, you should consider a) how long it would take to execute under normal circumstances, and b) whether there are any abnormal circumstances under which the command would block.

Also

Note that running programs that access the network or mount/unmount filesystems is not allowed inside of udev rules, due to the default sandbox that is enforced on systemd-udevd.service.

(Accessing the network would in many circumstances violate the first quoted paragraph anyway.)

and

Starting daemons or other long-running processes is not allowed; the forked processes, detached or not, will be unconditionally killed after the event handling has finished. In order to activate long-running processes from udev rules, provide a service unit and pull it in from a udev device using the SYSTEMD_WANTS device property. See systemd.device(5) for details.

None of this necessarily applies to the one specific command that you have chosen but other readers may be tempted to get creative ;-), since you invite them to do so, in which case a service is probably a better approach.

2 Likes

I finally got around to trying out my UPERFECT lapdock with my Librem 5.

Is it my imagination or are the left and right audio channels reversed? Does this happen with all sound output from the Librem 5? All sound output via HDMI from the Librem 5? No, Irvine, it’s your imagination?

I normally output sound via a pair of cordless speakers that connect to the Librem 5 via Bluetooth, which means “left” and “right” are meaningless (for two reasons - the speakers can be moved around anywhere, and the way the speakers are “paired” to each other it seems to me results in “left” and “right” being random anyway).

More concerningly, while playing music, the USB-C video seemed to drop out intermittently, frequently enough to be a problem. Without music playing, the video was rock solid. ??? Anyone else seeing this?

Otherwise it seems like a nice combination that works well as a “laptop”.

The gsettings command to make the touchscreen work seems completely inconsistent between UPERFECT models, which is a bit weird and not very helpful. But anyway the touchscreen works fine.

I’m not a fan of touchpads so I also tried out a mini-mouse in the spare USB port on the lapdock. That gives 3 pointing devices (touchpad, touchscreen and mouse). I’m undecided on whether a mouse will be needed for my usage.

PS Oh and of course there’s the known problem that the UPERFECT seemingly doesn’t have enough power to keep both itself and the Librem 5 charged. The supplied USB-C power supply is 30W (max.). Has anyone tried something with more juice?

1 Like

Looks like this hasn’t been fixed yet. I received 12,000-odd journal entries of this nature from a handful of hours of use. This can’t be good for time-on-battery.

1 Like

Thanks for the info @irvinewade , that’s really helpful. On a side note, however, that reeks of the kind of thing that drove me (as a programmer) away from Android: things that should work but don’t because Android decided my app takes or requests too much resources, and the app either gets silently killed/suspended, or the request (to run periodic tasks or whatever) gets simply ignored. Even though it’s an app I wrote myself for my own use on my own device. (See https://dontkillmyapp.com/) (Then there’s another new new API to do what could already be expressed in the former API, but it still doesn’t work in some cases for obscure reasons). Still less extreme because we can still find a way to do what we want but I don’t like it.

</side note/rant>

2 Likes

In this case, the justification is, I think, simpler than that. The restrictions exist largely because the command executes synchronously. (There may be some security considerations too.)

1 Like

No takers?

Anyone with a UPERFECT lapdock able to confim whether, when playing sound via the lapdock:

  • the left and right channels are swapped?
  • the audio/video drops out intermittently?

I tested AV output from the Librem 5 to my TV (using a USB-C to HDMI dongle) and it seemed to work fine, so I don’t think there is a generic problem with this functionality with the Librem 5.

2 Likes

Okay this is fun. I did a series of tests, both with the Sound Settings application (the one which opens from the pull-down menu next to the volume slider, it has a “Test” button and two “front left” / “front right” buttons) and with a “stereo test” YouTube video. Here are the results:

  1. As far as I know the Librem5 itself, despite having two sets of holes at the bottom, only ever emits sound from the left side. (EDIT: seems the right set is the microphone)
  2. Plugging a USB headset directly into the phone : the channels are INVERTED (I hear “front left” from the right side. HOWEVER I have a doubt now: have I been wearing it backwards ever since? There’s no L/R indicators!
  3. Plugging the UPERFECT Lapdock with a usb-c - usb-c cable: the channels are CORRECT (I hear “front left” from the left side)
  4. Plugging Jack headphones directly into the phone: channels are CORRECT
  5. Plugging Jack headphones into the lapdock (itself connected through usb-c) : channels are CORRECT
  6. Plugging the phone to the TV with an HDMI adapter: channels are CORRECT.

I have an old mini-HDMI cable but it’s plugged in my Raspberry PI and if I even look at it the wrong way, it stops transmitting images so never mind attempting to unplug it, so, sorry, I can’t test the lapdock HDMI input.
(I do have another mini HDMI cable somewhere that I received wirh the lapdock but can’t remember where I put it…).

Funny (or not) thing is that after all these experiments, my lapdock’s keyboard and touchpad no longer work. Hopefully that will fix itself after a reboot… (EDIT: indeed all good again after a reboot)

Anyway: tl; dr: it works for me. And I’ve been wearing my headset backwards for years.

2nd EDIT: I don’t notice any video drop out when playing videos on the lapdock. I’ve a feeling that video playback is not super fluid (very short pauses in the video every now and then, but not in the audio) but that happens identically when playing on the phone itself when no screen/headphones are plugged in.

3 Likes

Lucky you! My UPERFECT lapdock has no spare USB ports. Only an SD card reader I never use and a headphone jack I never use either (except today for testing). I ordered a DELL dock with (allegedly) a usb-C out supporting video to put between the phone and the lapdock so I can hopefully plug stuff like a mouse into the dock while using the lapdock. (I suppose Bluetooth might be another option but that would mean yet another device I need to recharge.)

1 Like

OK, thanks for taking the time to do some testing.

One question though … what specific model of UPERFECT lapdock? Mine’s the 15.6", which I suspect very few Librem 5 customers have.

And, yes, while I was testing I had a pair of headphones that are clearly marked “left” and “right”. However even without using headphones, it is reasonably evident that sound is coming out of the wrong speaker on the lapdock.

To be clear … I am playing audio in the background via the lapdock while using the lapdock as a regular laptop i.e. just working with windows and applications. So I am not even attempting to play video (which has its own challenges with the current state of the Librem 5 software, at least on byzantium).

My next test might be to put a USB audio dongle on the spare USB port on the lapdock and then plug the headphones into the dongle - to see whether this is an HDMI (really DisplayPort) problem or a generic audio problem with the lapdock + Librem 5 combination. (Of course that gets away from the neatness of the lapdock as a solution but this is just for testing.)

What I really need, for fault isolation, is another device that is capable of outputting video over USB-C but I don’t think I have such a device.

1 Like