Posts Tagged Gnome
The following is (I hope) an adequately-documented procedure to stream desktop audio capture via icecast2.
What you will need:
- Basic audio hardware
- An Internet connection
- Ability to accept inbound connections on a port (default 8000)
- Some basic idea of what you’re doing :)
Setting up the icecast2 server
Icecast2 is a free server for streaming multimedia similar to SHOUTcast. I won’t go in to all of the differences here — you can easily Google them or visit the respective websites and do some light reading. What I will actually explain here is how to get the server actually running.
Install icecast2 from either Synaptic or command line.
sudo apt-get install icecast2
By default, the icecast2 server’s logging configuration is set up in a way that might deeply frustrate the amateur user. This is because it is set up to log to /var/log/icecast2, which is set up with the following permissions:
drwxr-xr-x 2 icecast2 icecast 4096 2011-06-27 23:45 icecast2
That’s 0755 for user icecast2 and group icecast. Fortunately that user and group account are already created for us, but the configuration file isn’t set to change the running process id (it’s commented out) and the entered defaults are for user nobody. No worries. Read on.
Now edit the /etc/icecast2/icecast.xml config file using your favorite text editor. If you don’t mind my recommendation, and you’re doing this on a machine running Gnome or Unity, gedit is excellent. Make sure to edit the file as root.
sudo gedit /etc/icecast2/icecast.xml
Edit the file to your preference.
The next settings change depends on whether you’re running Ubuntu Desktop or Server. Find the section below that applies to you.
Ubuntu Desktop: Make sure to head down to the bottom and make the important change to set the correct user/group combination. Find the
section and uncomment (remove the
--> marks) from around the
to icecast2 and
to icecast, like so:
Now start the icecast2 server
sudo icecast2 -c /etc/icecast2/icecast.xml
You should see messages similar to the following:
Changed groupid to 125. Changed userid to 115.
… and then the program will not produce any more output, but remains running (does not drop back to a prompt). Congratulations, your icecast2 server is running. If it produced an error message, or dropped back to a prompt, investigate the configuration file for any problems, and make sure the port you have icecast2 set to isn’t being used by another process.
To stop the server, hold ctrl and press c (CTRL-c). It does take a few seconds after the keypress to completely halt.
Ubuntu Server: Edit the /etc/default/icecast2 file. The uid and gid should already be set correctly. Verify they are set as follows:
# Name or ID of the user and group the daemon should run under USERID=icecast2 GROUPID=icecast
Next, follow the instructions on the last 3 lines:
# Edit /etc/icecast2/icecast.xml and change at least the passwords. # Change this to true when done to enable the init.d script ENABLE=true
Now start the service
You should get the following output:
Starting icecast2 Detaching from the console icecast2.
Finding your audio device for streaming
I tried using various programs to set up my audio stream, such as the SHOUTcast Transcoder (sc_trans), darkice, and a few others that I don’t even recall — but none worked correctly for my case. The reason? I either couldn’t figure out what audio device to use, or it wouldn’t work with the audio device I gave it.
As it turns out, Linux machines primarily use PulseAudio as a sound system and many of these utilities expect or are designed to work with an ALSA sound system. I tried /dev/dsp and /dev/audio as input devices but neither existed on my system. I tried padsp with darkice configured to use /dev/dsp but that didn’t work either. I found Alexandru Csete’s GStreamer article and a few other posts and figured gst-launch-0.10 would be the answer that I needed. As it turns out, that was completely correct.
With all credit to Alexandru Csete, here are the steps to find the correct PulseAudio device name for your scenario.
Run the following command:
pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2
You should get output similiar to the following:
alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor alsa_output.pci-0000_00_1b.0.analog-stereo.monitor alsa_input.pci-0000_00_1b.0.analog-stereo
These output ‘monitor’ sources feed your devices entire playback stream — effectively ‘what you hear’. The input sources are a microphone or other line-in device. Select the device appropriate for your scenario. If you are trying to capture a webcam microphone or other removable device, generate this list with your device plugged and then unplugged and then compare the lists to find your device.
Once you have your device name, it’s time to…
Set up your audio stream
gst-launch-0.10 pulsesrc device=DEVICE ! audioconvert ! vorbisenc bitrate=BITRATE ! oggmux ! shout2send ip=IP port=PORT password=PASSWORD mount=MOUNT
An explanation of the options:
- DEVICE: Your audio device (from above)
- IP and PORT: The IP address and PORT number of your Icecast2 server
- PASSWORD: The password to your icecast2 server
- MOUNT: The mount point of your stream.
- BITRATE: The bitrate you want your audio to be (see examples below)
In my case the audio device I wanted to use was:
So my line was:
gst-launch-0.10 pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioconvert ! vorbisenc bitrate=32000 ! oggmux ! shout2send ip=localhost port=8000 password=XXXXXX mount=stream
The above produces an OGG stream. This works pretty well, but some Windows users report issues with OGG streaming. If you want MP3 streaming instead, try this:
gst-launch-0.10 pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioconvert ! lame bitrate=32 ! shout2send ip=localhost port=8000 password=XXXXXX mount=stream
Note that if you are streaming to a SHOUTcast server (as opposed to an Icecast2 server), change the command as follows:
mount= and replace it with
protocol=2. Make sure you are connecting on the port specified in sc_serv.conf and not the +1 port. Example:
gst-launch-0.10 pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioconvert ! lame bitrate=32 ! shout2send ip=localhost port=8000 password=XXXXXX protocol=2
Running this produces output similar to the following:
Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstAudioSrcClock
If you get some sort of error investigate your shout2cast settings.
Again, CTRL-c stops the streaming.
At this point, you should have a working icecast2 server and a working stream (via gst-launch-0.10). Congratulations!
I’m sure this guide is far from perfect, so please feel free to share any feedback you may have in the comment sections below. Thank you!
Here’s a quick run-down of the steps that I took when setting up Guild Wars on a friends Ubuntu machine under PlayOnLinux.
We chose PlayOnLinux because of the ability to use Wine prefixes, so we could customize the Guild Wars prefix for best play experience and no interfere with other configured Wine software. It also gave the easiest installation experience. We also chose PlayOnLinux as a free alternative to commercial programs like CrossOver Games.
Your experience may vary but this is what worked for us.
First, install PlayOnLinux either from Synaptic or the command line.
sudo apt-get install playonlinux
PlayOnLinux will be found under Applications > Games > PlayOnLinux (Gnome) or can be searched for in Unity.
Next, install Guild Wars
After starting PlayOnLinux, click the Install button, then click Games in the left column, and locate Guild Wars on the right side. Click Apply. Follow the on-screen dialogs to complete the installation of Guild Wars.
Once Guild Wars is installed, it’s time to tune it for performance. Note that much of the following is subjective, and may not be needed under certain circumstances.
— Tune the Guild Wars wine configuration
Once Guild Wars is installed, locate it’s entry in PlayOnLinux and click it, then click Configure this application. The application configurator will open. Click Forward and choose Configure Wine, then Forward again to launch the Wine configuration utility.
Once the Wine configuration utility is open, click the audio tab. If you get a dialog message stating that the audio driver was auto-detected. That’s fine. Set the DirectSound Hardware Acceleration mode to Emulation. Next choose the Graphics tab and under Direct3D, uncheck Allow Pixel Shader.
— Force Guild Wars to start in windowed mode.
Guild Wars will inititally start in full-screen mode. If this causes the client to crash or causes strange graphics issues, you may force it to start in windowed mode using the following terminal command:
WINEPREFIX=~/.PlayOnLinux/wineprefix/GuildWars/ WINEDEBUG=-all wine "C:GWGw.exe" -windowed
This will start Guild Wars in a window.
— Further registry tweaks
Locate the Guild Wars entry in PlayOnLinux and click it, then click Configure this application. The application configurator will open. Click Forward and choose Registry Editor, then Forward again to launch the Wine configuration utility.
Navigate the registry to
(If the Direct3D key does not exist, right-click on Wine and choose New > Key and name it Direct3D)
Right-click and choose New > String value. Call it UseGLSL. Double-click on UseGLSL and set Value data to “disabled” without quotes.
This is one of several issues that I ended up helping a friend with last night on his Ubuntu installation. When clicking an item in the ‘Places’ menu, such as Pictures, Home, Music, etc, a dialog box appears that reads “Error: File not found”. We were scratching our heads until I realized that the error dialog looked suspiciously like it was being displayed using Wine.
After a bit of searching my suspicions were confirmed. This happens when, through one action or another, Wine is assigned the ‘Open Folder’ association. When you try to open a folder using the menu, Wine tries to open it and subsequently fails, and that’s where the error comes from.
Unfortunately I don’t have a screenshot but I do have a solution courtesy of Ubuntu Forums.
Open and edit the ~/.local/share/applications/mimeapps.list file. You can use this command:
Locate the line that starts with
inode/directory= and change it to read as follows:
Save. Changes take effect immediately.
This explains how to quickly and easily create a multipart (multivolume) RAR file using Gnome / File Roller in Ubuntu.
First, locate the file(s) / folder(s) you want to compress and highlight them. Next, right-click and select Compress...
When the Compress dialog appears, enter a filename for your archive and select rar as the extension. Click the arrow next to Other Options to expand the dialog. Check the box next to Split into volumes of and enter the desired max individual file size here.
Click Create and the compression process will begin. Note that on extremely large multipart archives with lots of part files, a heavy amount of disc activity may occur, and the archiving process (and some other programs) may stall or momentarily freeze because of the disc activity. Be patient and allow the process to complete.
Checking your hard drive’s SMART status is a good idea if you’re running into issues that make you think the hard drive may be bad. In this scenario, I’ll be showing you how to use a Ubuntu Live CD to check the hard drive’s SMART status. This is good for situations where you either boot to the installed OS, cannot reliably install an OS, or cannot install a program on the installed OS to check it yourself.
This walkthough uses the Ubuntu 10.10 Desktop 32-bit CD to prevent issues that may arise from Unity. Download links: old-releases.ubuntu.com, .
Assuming you follow only the instructions in this guide, the data on your hard drive won’t be affected by this check. However, if your drive is catastrophically failing, i.e. head crash, any disk activity may lead to further data loss.
First, boot off the CD.
Select your language with the arrow keys, press enter.
Select Try Ubuntu without installing
After a moment or two you will be at the GNOME desktop (Menu bar at the top and taskbar at the bottom). Don’t worry if it’s slow, it’s to be expected — you’re working off a Live CD.
From the System menu, select Administration then Disk Utility.
The Disk Utility window appears. On the left pane, locate and click your system’s hard drive.
On the right page, locate the field that says “SMART Status” — your drives status will appear.
If it says “Not Supported”, your drive (or host controller) doesn’t support the SMART protocol and can’t give you any information. However, it may take a few moments to refresh. You can always run the SMART tests to force it to check the drive again.
Once you’re finished checking the SMART status, shut down by clicking the power icon in the very top-right corner of your screen, or simply hold the power button on your PC for 4 seconds. Eject the disk and your PC will boot to the hard drive.
Questions or comments about using the Ubuntu Disk Utility to check SMART status are welcome in the comments.
So today I was using smbmount to mount a network share from my Synology DiskStation to my Linux PC when I noticed a rather annoying file permissions issue that I couldn’t seem to fix. Why am I using smbmount and not Gnome’s GUI to mount? Because I need root to have access to the file system as well so that CrashPlan can back up to it.
Here’s what happened:
First, I mounted the share (as root):
smbmount //diskstation/mike /mnt/mynas -o credentials=/home/mike/mike.cred,uid=mike,gid=mike
(For more information on the smbmount or the mount.cifs credentials file, see the Ubuntu manpage for mount.cifs)
That worked great, except for when I do this (as root)…
ls -ld /mnt/mynas
… I get the following output:
drwxrwxrwx 17 mike mike 0 2011-05-20 09:25 mynas
I sure didn’t want the directory world-writable. So I tried specifying
dir_mode as both
0755 using the following (as root):
smbmount //diskstation/mike /mnt/mynas -o credentials=/home/mike/mike.cred,uid=mike,gid=mike,file_mode=0755,dir_mode=0755
Then I checked it:
ls -ld /mnt/mynas
… and got:
drwxrwxrwx 17 mike mike 0 2011-05-20 09:25 mynas
That didn’t do anything at all to help. Why? Because as it turns out the DiskStation is using a Samba server with CIFS extensions and is passing the permissions to smbmount (mount.cifs). The
dir_mode options are ignored if the remote server is using CIFS extensions.
If the server does not support the CIFS Unix extensions this overrides the default file mode.
If the server does not support the CIFS Unix extensions this overrides the default mode for directories.
Source: Ubuntu manpages.
So there’s a couple of options here. First, I could set it to mount somewhere inside /home/mike, which would generally protect it. But I’d really like to know what’s up with the file permissions. So I did a little more Google-fu.
As it turns out, the CIFS extensions on the DiskStation can be disabled, all it takes is to edit a file. Lepoulpe posted on the Synology forums the following edit:
you can disable “unix extensions” in the ds106’s samba server. To achieve this, you need to add the folowing line in the [global] section of /usr/syno/etc/smb.conf :
So, I SSH’d into my DiskStation as root (should be the same password as ‘admin’ if you’re having trouble) and used the vi editor to make the edit. Afterwards, I restarted samba on the DiskStation by doing this:
Then I remounted the Samba share as root…
smbmount //diskstation/mike /mnt/mynas -o credentials=/home/mike/mike.cred,uid=mike,gid=mike,file_mode=0750,dir_mode=0750
… and checked the permissions:
ls -ld /mnt/mynas
… and got the following output:
drwxr-x--- 17 mike mike 0 2011-05-20 09:25 mynas
So now I have /mnt/mynas mounted to my share on the DiskStation. If I wanted it to mount on boot, I could add something like the following to /etc/fstab:
//diskstation/mike /mnt/mynas smbfs auto,credentials=/home/mike/mike.cred,uid=mike,gid=mike,dir_mode=0750,file_mode=0750,user 0 0
Questions about my method? Have any feedback or alternate methods to share? Please feel free to do so in the comments below. Thank you!
For about a week now I’ve been wrestling with implementing a system where CrashPlan would backup to my network drive. I ran into a really bit problem: When you mount a network location in Gnome using the GUI (gvfs), root can’t access it. Since the CrashPlan engine runs at root, it makes the network location unusable as a backup destination.
After a while of working on different ways to solve this rather large hurdle, I came up with the idea of simply mounting the network location using smbmount (mount.cifs). After some testing and tweaking, I was able to get it successfully working and added an entry to fstab to have it mount at boot time. I chose /mnt/mynas as the mount point.
See Synology DiskStation and Samba mount permissions for my method of getting it mounted with the correct file permissions.
Once it was set to mount at boot-time, I can now open the CrashPlan client and set /mnt/mynas as a destination folder, and now I have both local and off-site backups!
Feel free to share your thoughts and/or feedback in the comments below!
A friend brought me a Ubuntu system with the following issue:
On entering gdm, the login prompt was displayed on a black background and the following message appeared in the top-right corner:
“The configuration defaults for GNOME Power Manager have not been installed correctly. Please contact your computer administrator.”
Trying to log in as any user account was unsuccessful.
I don’t remember where I found the fix, but here’s what I did to fix it:
Once the gdm login screen appears, press CTRL-ALT-F1, which will switch you to a text-based login prompt, and log in using an account that has sudo privleges.
Run the following command:
sudo dpkg --configure -a
It may take a minute or two to complete. After that:
After the reboot, when gdm appears you should have your colored background and the message should not appear.
Questions, comments, and feedback on this are welcome.
It’s day two with Ubuntu Natty, and while I’m impressed, I’m also somewhat annoyed. The sum of changes that came down in 11.04 have me asking “Why?” Here’s a list of some of the pros and cons I’ve seen so far in Ubuntu Natty with Unity:
- The Unity Launcher has ‘keep in launcher’, which can be good for apps that you want 1-click access to.
- It seems that Unity has a great deal of respect for screen space: moving all the menu bars to a single location, making the notification area smaller, and auto-hiding the Unity launcher all help you get the last bit out of your screen real estate.
- Holding the Windows key shows keyboard shortcuts for the items in the launcher, allowing hot-key access to them.
- Navigation can be cumbersome. Things are not where you expect them to be, and in some cases, are simply not there anymore.
- The context-sensitive menu bar puts menus out-of-reach on larger monitors, and potentially on multi-monitor setups.
- Navigation seems less intuitive than Gnome 2.
- Any 1-click ‘view desktop’ / minimize all windows functionality is gone.
- Adding too many items to the launcher can cause it to scroll.
- There’s no way, that I can see right now, to edit the “shortcuts” that appear in the ‘dash’.
- Some programs do not iconify to the launcher correctly.
I’m also seeing a handful of mixed bugs in Synaptic Package Manager, Empathy, and the Unity launcher itself.
The release of Ubuntu with Unity and Firefox 4 (which causes regressions in several websites) leads me to the opinion that this is perhaps the most drastic change with the most negative user-facing experience that I’ve seen to-date with Ubuntu. I’m confident that the Ubuntu developers will work quickly to resolve these issues, but I think a lot of these issues should have been fixed prior to release.
As an alternative, the GNOME interface is still available. If you want to use the GNOME interface, you have to make a settings change at the log in screen. After selecting your user name, and before entering your password, change “Ubuntu” to “Ubuntu Classic” using the session changer at the bottom of the screen.
Also, Windows users just got Firefox 4.0.1 which includes a lot of security fixes. While some of them are Windows-specific, Firefox 4.0.1 is still not yet available for Ubuntu Natty. This is something I think should be made available as quickly as possible. UPDATE: To Ubuntu’s credit, Firefox 4.0.1 came down today via update manager. :)
These are a few of the issues and annoyances I’m having with the Unity interface. Do you have any to share?
In part 1, I explained how to generate and manage your encryption keys in GNOME. Now I’ll explain how to use your keys to easily encrypt your email. I’m going to only address doing this in Evolution (the default email manager in GNOME). You can access the Evolution email account settings by going to System > Preferences > Email settings [Natty/Unity: System Settings > Email], and I’ll assume that Evolution is already set up for your email account.
Integration into Evolution is painlessly simple: You just need the Key ID of your key.
Go to System > Preferences > Passwords and Encryption Keys and look in the column under Key ID. The Key ID is hex, so it only uses the characters 0-9 and A-F.
Once you have the Key ID, start Evolution and go to Edit > Preferences > Mail Accounts and click your mail account and click edit. Then, go to the Security tab and enter your Key ID in the PGP/GPG Key ID field.
That’s it. Now whenever you compose a message, you’ll see the PGP menu which will allow you to sign and/or encrypt your email messages, and in the reading pane you will see the status of signed/encrypted messages sent to you.
Questions, comments, and feedback to this are welcome, as always.