Some of you old farts may remember the classic PC Game Jazz Jackrabbit. Which basically was a straight ripoff of Sega’s Sonic the Hedgehog with a rabbit and an awesome gun. It ran back in the days of DOS, and while it may be possible to get the game to run in a DOS emulator, it hardly makes sense to have a whole DOS Emulator for only one game. So that leaves us old folgies with no way to enjoy one of our favorite blasts from the past.

Enter the OpenJazz project. An open-source recreation of the Jazz Jackrabbit game engine. All you need are the game files from your old Jazz Jackrabbit CD-ROM!! The following excerpt is from the OpenJazz website. http://alister.eu/jazz/oj/

“OpenJazz was started on the 23rd of August, 2005, by Alister Thomson. Academic pressures put the project on hold until late December 2005. The source code was released on the 25th, and the first version with a degree of playability was released on the 15th of January. Since then, a variety of ports have been released by other people.”

So to install it can be a little difficult depending on what you are doing. If you are on Windows or Arch Linux, you are in luck, there are easy avenues to install OpenJazz, if you are compiling from scratch it can be a little more difficult.

On Windows you can download these two zip files, from the openjazz download page.

http://alister.eu/jazz/oj/OpenJazz-w32-080511.zip, http://alister.eu/jazz/oj/OpenJazz-w32l-010810.zip

One contains the executable and the other contains libraries that the OpenJazz executable requires, which are SDL (Simple Direct Media Layer) and Modplug (a sound library). If you extract these zip files into the same directory, then also place your game files in that directory. Then, run the OpenJazz executable and your nostalgic urges should be satisfied with the Original Jazz Jackrabbit you remember!

Unfortunately, those binaries and libraries will only work on a 32-bit Windows system. If you have 64-bit you’ll have to compile Jazz from source, possibly the supporting libraries as well. I will leave this as an exercise to the poor soul that decided to use 64-bit windows.

If you are lucky enough to be on Arch Linux, then installing OpenJazz should also be a sinch thanks to the Arch User Repository and myself.🙂 The Arch User Repository is basically a way Arch users can submit scripts that allow others to easily download and compile software into packages that can then be installed. As of writing the openjazz in the aur should work fine and with sound. If you have yaourt all you need to do is yaourt -S openjazz and in no time you will be waxing nostalgic.
Compiling OpenJazz isn’t so hard either. By default however, it compiles without sound but enabling sound is a cinch. Just as long as you have the dependencies which are the SDL development library and the modplug development library. Instead of knowing what to add to the makefile like before, all you need to do is open the makefile and uncomment the lines in the makefile that enable sound. Since this document is intended for users of all skill level, I’ll get a little more specific. First, download and unzip the source file found at http://alister.eu/jazz/oj/OpenJazz-src-080511.zip, (i’ll assume you can do this), when you open the directory there will be a file called Makefile.debian. Open the file and “uncomment” lines 32 and 33 by erasing the “#”. In the world of many linux config files and some programming languages like Python, “#” are lines that are ignored by the necessary interpreter on the Computer.

Hopefully this will spur more interest in the project especially for those that had trouble getting it working and in open source game engines in general. The project is still under development and there are some flaws like holes jazz can’t get out of and the music doesn’t loop during levels. But it is still awesome to play again natively on Linux. Happy Gaming!!!

I’m over gnome. Even when I was a gnome user I did minimal gnome installs. However, I like many still use many gtk applications. Most of the applications I use are gtk applications. However, I don’t use a DE, I either use xfce4.8 or compiz as a standalone wm.

However, I still want my desktop to look nice. Now with some of the gtk applications I use adopting gtk3, such as Nautilus and Gedit, I want my gtk2 and gtk3 apps to use the same icon and gtk theme.

The first step to acheiving this is using icon and gtk themes that support both gtk2 and gtk3. I went over to gnome-looks and selected the “Zukitwo” theme.

To change gtk themes without installing an application is rather simple. However, there are two seperate files for gtk2 and gtk3 which you must edit. Below are examples of the two files on my system.

## ~/.gtkrc-2.0
## Edit GTK2 Theme Settings
gtk-theme-name="Zukitwo-Dark"
gtk-icon-theme-name="Tango"
gtk-font-name="Zekton 10"
gtk-toolbar-style=2
## ~/.config/gtk-3.0/settings.ini
## Edit GTK3 Theme Settings
## Create this File if it doesn't already exist
[Settings]
gtk-theme-name = Zukitwo-Dark
gtk-icon-theme-name = Tango
gtk-fallback-icon-theme = gnome
# next option is applicable only if selected theme supports it
gtk-application-prefer-dark-theme = true
# set font name and dimension
gtk-font-name = Zekton 10

Here is the link to the Zukitwo theme that I used.

http://gnome-look.org/content/show.php/Zukitwo?content=140562

I reported this bug with debian and it seems they will not make the changes to glibc. It does seem that one of the patches to libflashplayer.so seems to work and that is the workaround I will be using.

I’ve assisted a few others in fixing this. Here is a blog post with how to apply the patch.


http://tehrabbitt.com/index.php?content=debian&type=audiobug

This is an updated version of the How-To I used to have on Debian User Forums. I found my How-To cited on various websites around the internet and I felt awful for not updating it in so long, so I finally gathered up all the new information and edited my How-to. The old version was heavily outdated.

Pulseaudio is a sound server which acts as drop in replacement for the old Esound. It allows users without a sound card capable of hardware mixing to playback multiple sounds at once. It also allows users to send sounds over a network. Learn more here:
http://pulseaudio.org/

If you’re wondering why one should switch to Pulseaudio, consider reading this article by Nathan Willis on Linux.com, where he mentions this very How-To.
http://www.linux.com/feature/119926

This article talks about some of the many features Pulseaudio has.
http://arstechnica.com/journals/linux.a … y-to-linux

On with the How-To:

Pulseaudio has always been easy to configure, as it is intended to neatly replace esd. It is even easier to configure now. Just install the packages, run the command and presto.

Before we can begin we have to install Pulseaudio in the first place. You can go into synaptic and search for Pulseaudio and install every package by that name, which will work, or you can try this:

apt-get install pulseaudio libao4 paprefs libpulse-mainloop-glib0 pulseaudio-module-jack pavucontrol pulseaudio-module-hal pulseaudio-module-x11 gstreamer0.10-pulseaudio pulseaudio-utils libasound2-plugins paman pulseaudio-module-gconf libgconfmm-2.6-1c2 libpulse-browse0 pavumeter libglademm-2.4-1c2a pulseaudio-esound-compat libpulse0 libpulse-dev pulseaudio-module-bluetooth pulseaudio-module-zeroconf

Please note that entering the above command will uninstall Esound!

That command just includes the packages and modules that I just deemed most useful. All of those aren’t needed, and there are other modules that add more functionality for pulseaudio such as pulseaudio-module-lirc.

After you have installed pulseaudio, copy the following into /etc/asound.conf. You must create the file! As we go along we will add some settings to this file in order to extend its functionality. On some systems the appropriate file may be /home/user/.asoundrc

pcm.pulse {
type pulse
}</code>

ctl.pulse {
type pulse
}

pcm.!default {
type pulse
}

ctl.!default {
type pulse
}

Once everything is installed and the asound.conf file is in place, start the pulseaudio server with the following command:

pulseaudio -D

I’m pretty sure Pulseaudio should autostart by default, but if it doesn’t, you may want to enable software sound mixing, this is done in gnome by going to system>preferences>sound then go to the sound tab and click the check box to enable software sound mixing. If you do not want system sounds, you can always disable each system sound individually, but this will start pulseaudio automatically at boot. You could also go to sessions and add the pulseaudio -D command to begin at startup, and this too will start pulseaudio automatically. There are other ways to do this as well. I use XFCE so I add pulseaudio -D to the applications that autostart.

Pasuspender

I never actually use this feature anymore because all my applications use pulseaudio beautifully. I use audacity as an example but audacity now works with pulseaudio out of the box. I’m just leaving this an example for other applications that may have trouble that I may not be aware of.

I would like to mention one of the newest and most useful developments in the Pulseaudio sound server and that is the pasuspend or pasuspender feature. This new feature enables Pulseaudio to automatically suspend it’s lock of the audio device in order to allow other application to control the audio device. Whenever Pulseaudio is idle, meaning any application using sound is not running, it automatically suspends it’s lock of the audio device, which will allow the user to open an application such as Audacity which does not natively use Pulseaudio, and Audacity will work through the ALSA sound system.

It is also possible for the user to force Pulseaudio to relinquish it’s lock of the audio device. Just precede the command of the program you wish to start with the pasuspender command. For instance:

pasuspender audacity

This will cause Pulseaudio to suspend it’s control of the sound device and allow Audacity to run through ALSA as if Pulseaudio didn’t exist. Pasuspender will work with any application that does not support Pulseaudio but support ALSA.

Because Pulseaudio automatically relinquishes control of the sound device and allows applications to use ALSA, this could cause a situation where you think the sound is going through Pulseaudio when it is actually going directly through ALSA. (Does that make sense?).

Well, the best idea is to check to make sure that Pulseaudio is running and that the sound is running through Pulseaudio, and there are many ways to do this.

1. If your notice that your system sounds stopped running, then the Pulseaudio daemon must not be running.

2. If you open up two application using sound simultaneously, the second one will not be able to access the sound card.

3. Open up the Pulseaudio Manager, in Applications>Sound and Video>Pulseaudio Manager, it will say if it is connected or not.

4. Run the command

ps_ax | grep pulseaudio

Which should return something similar to the following if Pulseaudio is running properly.

3319 ? Sl 1:31 /usr/bin/pulseaudio --log-target=syslog
3322 ? S 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
26493 pts/1 R+ 0:00 grep pulseaudio

5. You could always check if it is running through the system monitor, which is the same thing as the ps_ax command above.

Network Audio
Playing Sounds on other computers

Mac has airport which allows you to stream Itunes to speakers that are connected to airport. Well, rather than spend some insane amount of money for airport, we can do better with Pulseaudio. Lennart Pottering the developer of Pulseaudio, is also a developer of Avahi, the network discovery daemon. So as long as the other computer is shared on the home network, Pulseaudio should be able to play sounds on it.

The catch is, first make sure you can view the network shares of both computers from the other computer. This way you can be sure that the computers can see each other. My home network works fine, so I didn’t have to worry about this, so I don’t know what will happen, but make sure the computers can atleast ping each other before trying anything.

Both computers must both be running Pulseaudio. I have only tried it on Linux computers, but it should work with any computer that runs Pulseaudio including Mac and Windows, but you may run into problems unique to those systems. Also you must make sure Pulseaudio is configured to share its server.

To configure Pulseaudio to share its server, you need to go into Pulseaudio Preferences which is located in System>Preferences>Pulseaudio Preferences. Then you need to enable all the options for network discovery. Here is what mine looks like.

Then you must do the same process on the networked computer you wish to share audio on. When you are done the process the Pulseaudio Preferences tray icon should appear.

The final step is to click on the Pulseaudio Preferences tray icon, and from there you can change the default Pulseaudio Server on the computer you are sitting at, to the Pulseaudio server on your networked computer, and all sounds played on the computer you are sitting at will play through the speakers on your networked computer. It is that easy!!

You will need the paprefs package to set this up. Even if you do not have gnome, I would recommend installing the gnome-system-tools in order to do this. If you absolutely against doing that you can change the default server by editing the file /etc/pulse/client.conf

Uncomment “default server” and change it to
tcp:REMOTEIP:4713

Where REMOTEIP is the IP address of the computer you want your sounds to be sent to.

Bluetooth
I will not get into using bluetooth because it works flawlessly without any setup. Basically all I had to do was pair the bluetooth headset and it appeared as a device in pulseaudio-volume-control, and you can then select which streams you want to send to the headset. Pulseaudio-volume-control is an amazing application, it’s like a compiz for sound as Lennart puts it.

ProjectM
I just wanted to take a second and mention this awesome application. It is called projectm-pulseaudio. It is in the repositories. It displays awesome visualizations for pulseaudio streams, independent of the application that the sound originates from. Exaile my favorite music player removed support for visualizations, however projectm-pulseaudio will show visualizations for the music and use fewer resources while doing it. I absolutely love this application. Absolutely no setup required and it will visualize any stream, it doesn’t care, it is only visualizing what is coming out of pulseaudio. Awesome!

Applications
Getting specific applications to work with Pulseaudio.

I will only mention applications which do not appear at the Pulseaudio Wiki or that I am unhappy with the Pulseaudio Wiki’s explination of. http://pulseaudio.org/wiki/PerfectSetup
The methods used in this section were performed using the “Default Setup” from above.

OpenAl
This is no longer necessary because OpenAl supports Pulseaudio now.

I used to need to edit my asound.conf and add dmix devices to get applications that used OpenAl to work, however mednafen now supports pulseaudio out of the box, so this is no longer needed for me atleast, but I will keep the information up for legacy applications.

Much of this is from the Dmix Wiki and it is my current personal setup. This enables me to get pulseaudio to work with some applications it wouldn’t normally work with, specifically applications using OpenAl.

# Part I directly from ALSA Dmix Wiki</code>

pcm.paul { # paul is my name, you can use your name, just make sure you use it below too
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
#format "S32_LE"
#periods 128
rate 44100
}
}

pcm.dsp0 {
type plug
slave.pcm "paul"
}

# This following device can fool some applications into using pulseaudio
pcm.dsp1 {
type plug
slave.pcm "pulse"
}

ctl.mixer0 {
type hw
card 0
}

# Part II directly from Pulseaudio Wiki

pcm.pulse {
type pulse
}

ctl.pulse {
type pulse
}

# Optional, set defaults

pcm.!default {
type pulse
}

ctl.!default {
type pulse
}

This creates virtual devices in Alsa which applications which cannot use Pulseaudio directly to play sounds. The default device is still Pulseaudio however. The program I use that utilized the OpenAl system was Mednafen a Nintendo emulator. In order to get this to run, first you need the OpenAl utilities, which should already be taken care for you when you install whatever program utilizes OpenAl. (isn’t automatic dependency resolution wonderful :)) Anyway, if it isn’t search through synaptic or some other package management system.

Then, try to force whatever program you are using to make use of the pcm.dsp1 device I created earlier in my asound.conf. In Mednafen I simply specify -sounddevice pcm.dsp1 and mednafen will then output through pulseaudio. However, sometime the audio can stutter and be poor, so what I do is increase the sound buffer size slightly. (The default buffersize in Mednafen is 32). This may not be needed in other applications that use OpenAl but I thought I would mention that here.

This is the command I use in Mednafen to use OpenAl through Pulseaudio

mednafen -sounddriver alsa -sounddevice pcm.dsp1 -soundbufsize 64 -vdriver 0 -nes.stretch 1 -fs 1 -nes.input.port1 gamepad "$rom"

If you are actually trying to use mednafen, you don’t need to do any of this anymore. I’m just leaving the command up as an example for people who may be using legacy applications.

Avidemux

This is no longer necessary.

This one is easy, specify “Pulse” [no quotes] as the Alsa device in Edit,Preferences,Audio. Or you can tell Avidemux to use OSS and then start the application using “padsp Avidemux”
(Make sure you are using “Xvideo Accel” in Edit,Preferences,Video)

Audacity

Audacity now uses portaudio and runs with pulseaudio out of the box. Yay!

Iceweasel

Getting flash to work used to be a headache. It really isn’t anymore even if you use 64bit. When Adobe temporarily removed the 64bit flash plugin I still used an old alpha version so that Pulseaudio would continue to work. I’m not too uptight about security. You’ll never get pulseaudio to work with flash using nspluginwrapper.

I recommend using the newest version of flash, the beta of square is incredibly stable, it is fast, and uses less memory than previous incarnations.

To install flash player 10, is a pretty straight forward process, just go to the site, download the archive, extract it, and replace the flash plugin that is currently on your system. WARNING: You may want to back up flash player 9 before begining this upgrade.

Copy the plugin to /usr/lib/mozilla/plugins/libflashplayer.so, there is plenty of information on how to do this so I will not go into more detail. Just know that there should be no problems using the right version of flash.

Tinkering
Getting Applications to work with Pulseaudio.

If your application does not work with Pulseaudio, I would try the following steps in this order. But before you try on your own, check the applications section of this How-To and the Pulseaudio wiki http://pulseaudio.org/wiki/PerfectSetup for directions for specific applications.

1.Try to specify that the program use the device “Pulse” [no quotes]
2.Try to specify that the program use the device “pcm.pulse” [always without quotes]
3.Try to specify that the program use the device “pcm.dsp1” (You must have an asound.conf that I created (or similar))
4.Try to specify that the program use the device “pcm.paul” or “paul” (or whatever name you used in your asound.conf)
5.Try to specify that the program use “dmix”
6.Try to specify that the program use the OSS sound driver. Then wrap the program with “padsp” [no quotes] (padsp is similar to aoss, except that it outputs to Pulseaudio and it seems to work much faster.)
7.Use the pasuspender command

pasuspender $program

Troubleshooting

1.Make sure the Pulseaudio Daemon is currently running. Check gstreamer-properties (Multimedia Systems Selector) to be sure. It may have crashed or whatever.
2.Make sure you copied the asound.conf exactly.
3.Try copying the asound.conf to /.asoundrc (this means make a file in your home directory called .asoundrc and put the same contents as you /etc/asound.conf into it.) The file will be a hidden file. For me only asound.conf works but it may be different for other people especially if you are not on debian.
4.Try a restart
5.Try the commands “sudo dpkg-reconfigure pulseaudio” and “sudo dpkg-reconfigure pulseaudio-utils” to set things back to default.
6.Try a different device as stated in the Tinkering section.
7.”sudo apt-get alsa-utils gnome-audio” then type the command “aplay -D pulse /usr/share/sounds/startup3.wav” This will check if Pulseaudio is running and that your asound.conf or /.asoundrc is correct. Again, no quotes.

Notes

I have tried the oss2pulse daemon which emulates oss devices. It creates fake OSS devices that naturally output to Pulseaudio, which allows old OSS application to run easily through Pulseaudio. This is still alpha software, very much in the testing phase, but worth mentioning.

Pulseaudio and Jack

Pulseaudio and Jack are two seperate sound servers that have two completely different purposes. Pulseaudio is great for consumer audio and jack is great for commercial audio. As a musician I have actually created music using both, which for me is possible, but it is obviously not ideal for professional audio which will need jack. Lennart Pottering the developer of Pulseaudio wrote about this and gave at talk at the 2010 Linux Audio Conference.
http://0pointer.de/blog/projects/when-pa-and-when-not.html

Pulseaudio has the ability to connect to jack through it’s module, however, this has to be done manually and it is not trivial. Pulseaudio will however get out of jack’s way when it is started. I have no problems starting jack if I start it when no applications are running which is the norm when I’m doing a music project.

The only reason one would want pulseaudio to connect to jack is if you want the streams from pulseaudio. It requires jack_transport which isn’t packaged, and the whole implementation in general is a bit finicky.

However, is an e-mail sent to me by CJ Van Den Berg on the pulseaudio discussing the procedure.
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2007-March/000330.html

and here is an Ubuntu How-to based upon that e-mail that goes more in depth.
http://ubuntuforums.org/showthread.php?t=548178

Like I said, It’s not something I use, but that shouldn’t have kept me from posting the information sooner.

System Sounds

libcanberra has a pulseaudio library, which should make it easy to use pulseaudio to play system sounds. However, I an not currently get system sounds to work, partially because I use xfce mostly and don’t use gnome often. You can however enable accessible login if you are using gdm and get sounds to play that way. You can also add a command to the autostarted applications that plays a sound on startup. For this I use the play command provided by the sox package.

play /path/to/sound.ogg

(It can be pretty much any format when you are using the play command, that’s why I use it.)

Acknowledgements

By the way, Pulseaudio is in rapid devleopment. It used to be a difficult task to get sound that originates on one computer, to play on another computer over the internet. Now that process, is really simple, and uses a great GUI. It’s called Pulseaudio Device Chooser. It works really well if you have multiple computers using Pulseaudio. I just though I would mention how awesome that is, and acknowledge the great work the Pulseaudio developers are doing.

A special thanks to all the guys at the Pulseaudio Mailing List, without whom I would not even have Pulseaudio working.

Quick and Simple Samba Setup

Posted: March 11, 2011 in Uncategorized

This post is about Samba, the *nix implementation of the smb protocol. Put simply it runs as a daemon and can allow a *nix/bsd box to share folders with other *nix/bsd boxes and even windows boxes.

In this post we are going to dig into a quick and easy configuration of Samba.

In Windows with one click you can share folders and anyone can have access to your documents, to create and delete, and possibly upload mallicious software. On Linux thankfully we have permissions and other security measure some built directly into Samba which prevents this, although Linux could still be setup to share folders with one simple click.

Two basic security settings in Samba are Security=user and Security=share. I like to use Security=Share and that is what we will dive into first.

You can read more about the different security settings here. Basically security=share is a little more relaxed security wise and does not require usernames.

Not only do we have to deal with Samba permissions, we also have linux filesystem permissions to be concerned with, given that you are using a filesystem that supports permissions which is usually the case with Linux. The filesystem permissions supercede the Samba permissions.

Keep in mind in order for others who are not created as users on the host machine to view Samba shares, the permissions for others must be set so that they can execute the directory. This means in order to give others the permission to read and write to the shared directory they will need to have rwx permissions. In order to achieve this we will need to use the chmod command.

chmod -R 777 /directory/iam/sharing/

This will give everyone the ability to create and delete files in this directory I am creating.

This may seem like a gaping security hole, but luckily by default, files created through samba by other users are owned by nobody, which has extremely low permission and will not execute. This means that others cannot upload and run mallicious code. However, this settings could always be changed so that others could create files with more relaxed permission and not under the nobody user.

Read more about chmod and basic permissions here.

With this type of settings it would be more wise to only allow others to access and read the files in the directory. For this 775 permissions would be sufficient. (rx)

Let’s say I want to create a shared directory of my mp3s and I want to allow selected users to create and add files to this directory.

One way to accomplish this would be to use security=user.

We will make a directory where we will store the mp3s.

mkdir /home/user/mp3s

We will create a group of users that are allowed to access these mp3s.

# groupadd mp3users

Next, we make sure that the mp3users own the mp3 directory, first making sure your user is a member of the mp3users group

# gpasswd -a user mp3users
# chown -R user:mp3users /home/user/mp3s

Now you own the mp3 directory and it belongs to the mp3users group. Now we will change the access permissions of the directory so that you can read,write, and execute it, the members of the group can read, write and execute it, but others have no access.

#chmod -R 770 /home/user/mp3s

This takes care of the Linux setup of the directory. Now we must setup Samba.

First I will show you, my basic samba configuration. I stripped out a lot of the stuff that is unnecessary for me, to make my file simpler and easier to read.

/etc/samba/smb.conf

### Paul's Samba Configuration

#======================= Global Settings =======================

[global]

workgroup = MSHOME

server string = %h

####### Authentication #######

security = user

encrypt passwords = true

passdb backend = tdbsam

obey pam restrictions = yes

unix password sync = yes

passwd program = /usr/bin/passwd %u

passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

pam password change = yes

Most of that is default. You may want to change workgroup=MSHOME to the workgroup that the computers in your house use, it is easier to MS computers to find other computer that are on the same workgroup, that's just the way it is.

server string =%h

This means that the hostname of the computer will be used as the network name of the machine through samba.

Now we will append /etc/samba/smb.conf with the shares we want to setup.

[MP3]

comment = music

path = /home/user/mp3s

writeable = yes

public = yes

guest ok = yes

valid users = paul rita @mp3users

[MP3] is the name of the share over the network.
Valid users restricts access to only the users and groups listed. Now we must create the user “rita” and add her to the mp3users group and enable her in samba. Here is how we do this.

adduser rita
## creates the user rita

gpasswd -a rita mp3users
## adds rita to the mp3users group

smbpasswd -a rita
## adds rita to the samba database

smbpasswd -e rita
## enables the user rita in the samba database

smbpasswd -n rita
## this makes it so rita does not need a password

Read more about restricting access through Samba here.

Smbpasswd is where passwords are stored, it handles samba access to your computer. The -n switch doesn’t always work as intended for me. Keep in mind that the users will need the passwords created when you ran smbpasswd -a in order to access the shares.

You can change the guest account from nobody to somebody else by settings the following in the Authentification section of /etc/samba/smb.conf

guest account = mp3user

You can then control that user’s permissions and which group he belongs to with the commands used above. Be careful because this is how you can grant anyone the permission to upload mallicious code.

You can also change the permissions of the files and directories that your guest users create by adding the following to the shares that you setup.

create mask = 0770
directory mask = 0770

This mean that the files (create mask) will be rwx for the owner and those in the group, and directories (directory mask), will be rwx for the owner and those in the group.

Anyway, that is a quick Samba setup, and a crash course in permissions. You could do other things like making sure all your shared folders are owned by a “sambashare” group and add your selected users to that group. The choices are yours and yours alone. Good Luck.

Flash Player Sample Rate Issues?

Posted: March 3, 2011 in Linux Sound
Tags: ,

Well, after building and settings up my HTPC I experienced an issue with some flash videos. Certain videos, particularly videos of lesser quality, not youtube’s 720p videos, would sound like there was a sample rate conversion problem.

After trying several things, I finally came across this bug report on Red Hat, and it turns out that Linus Torvalds had the same problem!!

Well, they used their fancy developer tools and figured out that the problem was in glib. It turns out glib made a change to memcpy which broke binary compatibility. As Linus said, it doesn’t make much sense to make a change to something like memcpy, and break binary compatibility, if there isn’t a VERY large upside. Which is what happened. Even if it would take 10 minutes for Adobe to fix it, and I completely agree that it sucks to have to cater to the likes of Adobe’s proprietary flash. Anyway, you could read the interesting debate in the thread.

Here’s how to fix it.

I tried the other fixes in the bug report and couldn’t get them to work, this is the one that worked the best.

Basically we compile our own version of memcpy and use LD_PRELOAD to use it with our web browser.

First download and untar memcpy. Then change directories and compile it.

wget https://spideroak.com/share/LJUXIWQ/ilovelinux/home/paul/Interweb/Public/memcpy/mymemcpy-1.1.tar.gz && tar -xzf mymemcpy-1.1.tar.gz && cd mymemcpy-1.1 && ./configure && make && make install

Now, as root, run

make install

It should tell you where it put the library, it should be /usr/local/lib/libmymemcpy.so

Now when you start your browser just do the following

LD_PRELOAD=/usr/local/lib/libmymemcpy.so /usr/bin/iceweasel

That information is also in the README.

Now just decide how you want open your browser so that this change i implemented.

Thanks to Yersinia for the tarball.

https://github.com/yersinia/junkcode/blob/master/linux/mymemcpy/mymemcpy-1.1.tar.gz

Sometimes it may be desirable to connect a bluetooth audio device, such as headset, to the Linux audio service from the commandline. This isn’t well documented, especially since it wasn’t possible in some older versions of bluez, and just recently became possible again.

Firstly, as far as I know you need atleast bluez 4.87 to do this. Well, it doesn’t work in bluez 4.66.

Firstly, to do this we need to get the dbus address of the bluetooth adapter, which changes with restarts.

dbus-send --system --print-reply --dest=org.bluez / \
org.bluez.Manager.DefaultAdapter|awk '/object path/ {print $3}'

This will output the address of the bluetooth device.

Next, we will use bluez-simple-agent to pair the device. My device like many can be paired with the passphrase “0000”. So I pipe that to the bluez-simple-agent.

echo "0000" | bluez-simple-agent hci0 00:12:A1:90:39:A9

With the device paired and the address of the bluetooth adapter, we can now connect the device to the audio sink.

dbus-send --print-reply --system --dest=org.bluez BT_ADAPTER/dev_00_12_A1_90_39_A9 org.bluez.AudioSink.Connect

This command requires pulseaudio-module-bluetooth to be installed (I’m big on pulseaudio). You can see where I have the mac address and the bluetooth adapter address.

To disconnect the device from the audio sink you can simple run the same command again, but replace “Connect” with “Disconnect”.

You can also use the following command to “unpair” the bluetooth device.

bluez-test-device remove 00:12:A1:90:39:A9

So, just remember to use the mac address of your own device in substitution for mine.

Also, note that none of these commands need to be run as root!

Here is a script I wrote which automates the process. If I can find the script that I referenced, I will credit it. “pulsespeak” is a program I wrote as a wrapper to espeak.

#!/bin/bash

### The Mac of the device I'm connecting to is
### 00:12:A1:90:39:A9

### I should make a variable
### MAC_ADD=00:12:A1:90:39:A9

_BT_ADAPTER=`dbus-send --system --print-reply --dest=org.bluez / \
org.bluez.Manager.DefaultAdapter|awk '/object path/ {print $3}'`
BT_ADAPTER=${_BT_ADAPTER//\"/}
#echo "$BT_ADAPTER"

if [ "$1" == "off" ]; then
dbus-send --print-reply --system --dest=org.bluez $BT_ADAPTER/dev_00_12_A1_90_39_A9 org.bluez.AudioSink.Connect
#echo "0000" | bluez-simple-agent hci0 00:12:A1:90:39:A9 remove
bluez-test-device remove 00:12:A1:90:39:A9
fi

if [ "$1" == "on" ]; then

echo "0000" | bluez-simple-agent hci0 00:12:A1:90:39:A9

dbus-send --print-reply --system --dest=org.bluez $BT_ADAPTER/dev_00_12_A1_90_39_A9 org.bluez.AudioSink.Connect
#pulsespeak "Bluetooth is now connected"
fi