Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Wednesday, April 9, 2025

Quick Roku vs Ubuntu Rygel DLNA Note

(from the Okaaaay department)

Trying to get media streaming working between Ubuntu using the default Rygel DLNA server in Gnome and the Roku Media Player.

For some reason, Roku wants Rygel to transcode all MP4/H.264 videos to MPEG.  Rygel goes "OK - I can do that" then errors out.

Other DLNA clients work fine.

So - as a Hail Mary - in ~/.config/rygel.conf - I disabled transcoding.

# Set it to 'false' if you want to disable transcoding support.
enable-transcoding=false

Now - Roku accepts the videos as MP4 and plays them back great.

Hmm - not quite sure where's the breakdown here.  Why didn't Roku ask for MP4 in the first place, since that's the file encoding?  Why did transcoding break anyway?  

Weird.

Cheers,
Paul

Saturday, December 31, 2022

Switching Desktop Environments in Ubuntu 22.04

(from the Don't you have better things to do? department)

Introduction:

Hi everyone,

Much like many tech sector workers, I spend a lot of time on a Linux desktop lately.  I tend to prefer Enterprise or Long Term Support (LTS) editions of Linux - like Ubuntu 22.04 LTS - as opposed to the rolling update Linux versions like Arch.  They tend to be very stable, with most bugs ironed out so I can concentrate on the software being tested and not worry about tracking issues in the distribution. 

Now - I'm always in search of the perfect desktop experience.  I enjoy trying the latest Linux GUIs - Gnome, KDE, Xfce, etc.  Ubuntu allows you to install these simultaneously - switching between them when you login.  It used to work flawlessly - but since the desktops are becoming more customized - extra steps are needed to switch between them. 

This document will contain my notes for switching between Ubuntu Gnome/Gnome, Unity, and Xfce on Ubuntu 22.04 LTS.  I'll leave the installing of these into a stock Ubuntu installation as an exercise for the user. (Hint:  there are great online guides like this one: How to Switch from GNOME to Unity in Ubuntu 18.04 and 17.10).  I'll also assume this is a stock Ubuntu installation with Ubuntu Gnome as the default environment.

Xfce4:

  • Switch the Display Manager from GDM to LightDM via the sudo dpkg-reconfigure gdm3 command, and selecting lightdm
  • Change LightDM from the Unity greeter to lightdm-gtk greeter by editing /etc/lightdm/lightdm.conf and adding the line greeter-session=lightdm-gtk-greeter, commenting out the line greeter-session=unity-greeter
  • If present, you'll have to uninstall gtk3-nocsd - it now interferes with Xfce4 menus, since they're starting to use client side decorations.  In Ubuntu the command is sudo apt remove gtk3-nocsd libgtk3-nocsd0
  • If you have Unity installed - you may run into an issue where notifications are using the Unity handler instead of the Xfce handler.  The easiest way to make sure that Xfce notifications are used is to issue the following command, which just renames the Unity notifier and is easily undone: sudo mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service /usr/share/dbus-1/services/org.freedesktop.Notifications.service.disabled
    • You can test the default handler by using the notify-send command.  Xfce notifications should be clickable - they close you click on them.
  • Once rebooted and logged into Xfce, you'll want to add an additional panel to the top bar - the "Indicator Plugin" - this will make sure Unity style notifications like Skype, Slack, etc. - are displayed in the top bar.  I put it next to the Status Tray Plugin for continuity.
    • Don't forget to select Xfce Session from the LightDM login screen!
  • UPDATE:  There may be an issue with XFCE panel notifications and something called ayatana-indicator-application.  Uninstalling this via apt made panel notifications work - however it looks like it's installed by default with Xubuntu.  Not sure what's going on - but I'm removing it for now.  See more information here: https://forum.xfce.org/viewtopic.php?id=16436

Unity:

  • Switch the Display Manager from GDM to LightDM via the sudo dpkg-reconfigure gdm3 command, and selecting lightdm
  • Make sure LightDM is set to the Unity greeter by editing /etc/lightdm/lightdm.conf and insuring that the line greeter-session=unity-greeter is set.
  • Make sure gtk3-nocsd is installed via the command sudo apt install gtk3-nocsd
  • Install additional yaru icons with the sudo apt install yaru-theme-unity
  • If you have Xfce installed - you may run into an issue where notifications are using the Xfce handler instead of the Unity handler.  The easiest way to make sure that Unity notifications are used is to issue the following command, which just renames the Xfce notifier and is easily undone: sudo mv /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service.disabled
    • You can test the default handler by using the notify-send command.  Unity notifications should not be clickable - they should fade when you hover over them.
  • Once rebooted and logged into Unity, you'll want to use Unity Tweak Tool to select the Yaru-dark Theme and Yaru-dark Icon to make it match the latest Unity builds.
    • Don't forget to select Unity from the LightDM login screen!
  • In addition, current Unity builds are using Nemo instead of Nautilus for default file handling. After locking Nemo to the Unity Launcher, you can switch to Nemo file handling by using the following command: xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search 
    • You can revert back to Nautilus by using the following command: xdg-mime default nautilus.desktop inode/directory application/x-gnome-saved-search
  • NOTE:  If you've been experimenting with KDE desktops, for some reason, this kind of trashes the ~/.config/gtk-3.0/settings.ini file.  This shows up as a messed-up right click Unity Desktop menu, among other things.  The quick fix is to edit the ~/.config/gtk-3.0/settings.ini file, and set gtk-menu-images=false.  Logging out and logging back in should now have fixed your right click Unity Desktop menu.
  • NOTE:  Electron apps have issues with Ubuntu AppIndicator Tray Icons.  There's a fix here: https://askubuntu.com/questions/1469305/unity-desktop-tray-icons-of-some-apps-not-showing-anymore-ubuntu-22-04
  • NOTE:  If Nemo menus no longer move to the top of the Unity desktop - but are stuck to the Nemo window - you may need to reload unity-gtk3-module.  I'm not sure what clobbers this.

Ubuntu Gnome/Gnome:

  • Switch the Display Manager from LightDM to GDM via the sudo dpkg-reconfigure gdm3 command, and selecting gdm3
  • Remove the additional yaru icons with the command sudo apt remove yaru-theme-unity
  • If you switched to Nemo, be sure to switch back to Nautilus:  xdg-mime default nautilus.desktop inode/directory application/x-gnome-saved-search
  • Once rebooted, and logged into Ubuntu Gnome or Gnome, you may need to reset your theme from Gnome Tweaks or the Settings control panel. 
    • Don't forget to select Ubuntu or GNOME from the GDM login screen!
  • I had an issue where GNOME was really slow after switching back - and the GTK windows ignored theme requests.  I fixed it by removing xdg-desktop-portal-gnome.  I don't think this is a good fix - but it got it working again.  Caveat emptor. 
    UPDATE: This was caused by potential bug fix for a Unity 90 second logout issue - as described here: Bug #2063383 “[SRU] Ubuntu Unity takes 90 seconds to log out” : Bugs : gnome-session package : Ubuntu Commenting out the line as indicated breaks
    xdg-desktop-portal-gnome
Cheers,
Paul

Thursday, May 30, 2019

Fixed: x2vnc not working with Mac OS X

(from the Wow - this was obscure department)

Hi everyone,

If you're trying to control your Mac OS X screen from your Linux box using x2vnc and the built-in Mac OS Screen Sharing server, and it's not working - or has stopped working - I finally figured out why.

It's because the Mac now adds a small security screen during an unencrypted VNC login.

To get around this, you need to bypass this screen so that VNC goes to the currently logged-in user.

This is done via this command:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement VNCAlwaysStartOnConsole -bool true

Be aware that this bypasses some added security, so use this carefully.  

Cheers,
Paul

Wednesday, March 23, 2016

Setting up Oracle Java JRE 8 on Ubuntu

(from the Java - But Not Coffee department)

Hi everyone,

(This is a quick post - these instructions are necessarily terse and mainly serve as a reminder to myself. If you do try this - you do so at your own risk - I can't provide any help if you mess anything up.)

I needed to set up Oracle Java JRE 8 on my Ubuntu 12.04 LTS 64-bit system.

For previous versions of Oracle Java, I followed the steps in "6. Installation from RPM package" on the web page here:
http://how-to.linuxcareer.com/oracle-java-jdk-7-on-ubuntu-linux-installation

These instructions worked fine for previous versions of Java but broke with JRE 8.

When I analyzed the failure, I saw it was breaking with the alternatives command.  Ubuntu uses update-alternatives instead of alternatives.

So - I decided to try something bold.  I created a symbolic link to alternatives from update-alternatives:

cd /usr/sbin
sudo ln -s update-alternatives alternatives

Then, I followed the steps in "6. Installation from RPM package".  The package installed properly.  Just for reference, here's the commands I used for the JRE 8u77 I installed today:

sudo alien --scripts jre-8u77-linux-x64.rpm
sudo dpkg -i jre1.8.0-77_1.8.077-1_amd64.deb

That left connecting up the Firefox Java plugin.  There's many ways to do that, but I like using alternatives.. er... I mean update-alternatives:

sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/default/lib/amd64/libnpjp2.so 20

Obviously - these are for a 64 bit system.  These won't work as written for a 32 bit system or a mixed 64/32 bit system.

Good luck!

Cheers,
Paul 


Monday, February 15, 2016

Turn your Ubuntu 12.04 LTS into SteamOS (kinda)

(from the This is a cool trick department)

When I first heard about Steam for Linux, I immediately looked at their website and decided to try it.  Here's the specifications from the original page: https://github.com/ValveSoftware/steam-for-linux

Steam for Linux requires the following:
  • 1 GHz Pentium 4 or AMD Opteron with 512 megabytes of RAM and 5 gigabytes of hard drive space, or better
  • Internet connection (Cable/DSL speeds recommended)
  • Ubuntu 12.04 LTS, fully updated
  • Latest graphics driver
  • NVidia driver support - For recent cards (e.g. series 8), you will need to install 310.x. For older cards, driver 304.x supports the NVidia 6 and 7 GPU series. To access these drivers, first update your cache and then install the specific driver you need from the list in Additional Drivers.
  • AMD driver support - For recent cards (e.g. series 5 and above), we recommend installing the 12.11 driver. For older cards, Catalyst 13.1 Legacy supports the HD 2400 Pro card and is the latest for the 2 and 4 GPU series.
  • Intel HD 3000/4000 driver support - you will need to use the latest Mesa drivers, Mesa 9 or later. For installation instructions, see here.
So -  I added a new hard disc to my Windows gaming system, and created a stand-alone Ubuntu 12.04 LTS installation.

Then - I heard about SteamOS.  It's built on Debian - like Ubuntu.  I was curious what it was like, but - hey - I'd already fine tuned my Ubuntu system - and I didn't feel like re-inventing the wheel.

That's where it stayed - until tonight.

I saw an article or two about Marc Deslauriers and a project he'd been working on: https://plus.google.com/103632865447092840471/posts/1nVUjx8WtWC

"I've rebuilt a couple of #SteamOS packages in a PPA for Ubuntu 12.04 LTS. They add a "SteamOS" session that runs Valve's compositor and starts Steam in big picture mode."

There was an explanation of what this means here:  http://www.webupd8.org/2013/12/install-steamos-session-in-ubuntu.html

This had instructions on how to install it:
http://askubuntu.com/questions/302488/can-i-run-steam-as-its-own-standalone-session

but they only work for Ubuntu 14.04, so here's the 12.04 instructions. 

NOTE:  Try this at your own risk.  It worked for me - but I can't guarantee it will work for you. Nor can I provide any tech support if your system is rendered unusable.

Enter these three commands in a terminal window - each sudo command should be one line - don't add any extra line breaks:

sudo add-apt-repository ppa:mdeslaur/steamos
sudo apt-get update
sudo apt-get install steamos-compositor steamos-modeswitch-inhibitor steamos-xpad-dkms

This will add a SteamOS login to the Ubuntu login screen.  Selecting it will launch Steam in Big Picture mode without the overhead of a normal Linux window manager.

I haven't fully tested this yet.  It seems to be behaving itself - I'll update this post as I find out more.  And - you can always remove it by

sudo apt-get remove steamos-compositor steamos-modeswitch-inhibitor steamos-xpad-dkms

and your system will be back to normal, pending a reboot.

UPDATE:  After running in SteamOS mode, then rebooting and starting Unity, my Ubuntu 12.04 LTS system lost the use of the Volume Up, Volume Down and Volume Mute keys on my multimedia keyboard.  This was a real head scratcher - none of the online guides seemed to work - and some of the fixes were downright dangerous.

I finally got my keys back by following the advice here: http://askubuntu.com/questions/387379/ubuntu-12-04-volume-up-down-mute-stopped-working and deleting my ~/.pulse directory.  You'll want to reboot immediately after doing this.

Apparently, running in SteamOS mode disables the volume keys.  Deleting the ~/.pulse folder and rebooting recovers it safely.  You'll just have to reset your audio output next time you log into Unity/Gnome.

UPDATE 2: I finally upgraded to 14.04 LTS.  There's an additional package you can add - plymouth-themes-steamos.  This is only available for 14.04 LTS and 16.04 LTS - I had to leave it out for 12.04 LTS.  So - the instructions would be the same as above but with the extra package.  e.g.:

sudo apt-get install steamos-compositor steamos-modeswitch-inhibitor steamos-xpad-dkms plymouth-themes-steamos

It doesn't change a lot - but there's an extra SteamOS splash screen.

Also - I haven't had to delete the ~/.pulse directory in 14.04 LTS - my keys have continued to work - so that's nice.  I don't know if it's the change in videocards since I wrote this originally - had AMD, now nVidia - but it does seem to set the sound to HDMI even if I had headphones or analog selected.  But - that's easy enough to set once you go back to the Ubuntu desktop.

Cheers,
Paul

Sunday, June 7, 2015

If Video DownloadHelper in Ubuntu fails with a "Failed Aggregating" error message

(from the I Love Linux department)

Hi everyone,

I use Video DownloadHelper for Firefox in Ubuntu 12.04 LTS.

Sometimes, when trying to aggregate video, it fails with a "Failed Aggregating" message.

Specifically, you see this error:

ffmpeg version 0.8.17-4:0.8.17-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 16 2015 13:26:50 with gcc 4.6.3
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/media.tmp':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2015-04-22 12:53:09
  Duration: 00:07:02.96, start: 211.487256, bitrate: 64 kb/s
    Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16
    Metadata:
      creation_time   : 2015-04-22 12:53:09
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/media.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2015-04-22 13:13:56
  Duration: 00:07:02.83, start: 211.419544, bitrate: 1147 kb/s
    Stream #1.0(und): Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 tbr, 90k tbn, 47.95 tbc
    Metadata:
      creation_time   : 2015-04-22 13:13:56
Unrecognized option 'c:v'
Failed to set value 'libx264' for option 'c:v'

So - what happened?  Well - by default, Video DownloadHelper is installed to work with avconv.  But - if you reset Video DownloadHelper's settings, it falls back to an older conversion method based on ffmpeg.

This normally wouldn't be a problem, except that in Ubuntu 12.04 LTS, there is no ffmpeg.  It's actually a script front-end for avconv, and doesn't take ffmpeg's arguments.  This is the error you're seeing.

The fix is simple.  Go into Video DownloadHelper's settings, and go to the Conversion setting:



Note the Converter path - it's most likely set to /usr/bin/ffmpeg.  Change this to the location of avconv, usually /usr/bin/avconv:



Now - try your file again.  It should work.  Hope this helps!

Cheers,
Paul