Optimizing Slackware
April 29, 2010 at 12:50 | Posted in Adventures | Leave a commentTags: linux, optimize, performance, slackware, speed, tips, tweak
- Disable whatever services you don’t need starting in /etc/rc.d by removing execute permissions (chmod -x)
- Compile custom kernel with only support for what you need
- Disable additional unnecessary virtual consoles (CTRL-ALT-F1,F2,F3,etc) in /etc/inittab
- Use a lightweight desktop environment such XFCE/LXDE/Openbox
- Move /tmp folder to memory if you have plenty of RAM by adding “tmpfs /tmp tmpfs defaults,noexec,nosuid 0 0” to your /etc/fstab
More later if I feel like it. I’ve read a bit about concurrent b0oting in Ubuntu, I’d like to find a way to achieve this in Slack. I <3 my quad-core.
Speech Recognition
October 30, 2009 at 00:47 | Posted in Adventures | 4 CommentsTags: cvoicecontrol, linux, recognition, speech, viavoice, voice, xvoice
Upon researching speech recognition software for linux (“Computer, open firefox!”), I’ve found that most projects are extremely outdated, nonfunctional, or achieve nothing for the regular end-user. Actually, I’ve found all projects to be at one of these three, so if there’s one I missed, give me a shout.
However, xvoice and CVoiceControl were the two outdated finalists. Xvoice requires the commercial product by IBM, ViaVoice, so I am torrenting my copy now. However, while we wait, I’ve installed CVoiceControl!
I’ve also already hit my first error:
bash-3.1$ microphone_config
No mixer devices available!
Please purchase a sound card and install it!
*facepalm*
First, the tool generates a list of available mixer and audio devices. If the tool fails at this time, it is because it could not find any appropriate mixer and/or audio devices in your system. In this case, make sure that your sound device is installed correctly and that your sound driver is working properly.
My sound driver is actually working fine, thank you, I am enjoying my The Cure. In the file microphone_config.c in the source code, I find:
/* ***** detect available mixer devices */
mixer_devices = scanMixerDevices();
if (mixer_devices == NULL || mixer_devices->count == 0)
{
/* ***** no mixer devices available -> exit! */fprintf(stderr, “No mixer devices available!\n”);
fprintf(stderr, “Please purchase a sound card and install it!\n”);
exit(-1);
And in the file mixer.c I find:
MixerDevices *scanMixerDevices()
{
int i,j; /***** counter variables */
int mask_mixer, fd; /***** mixer device related variables */
glob_t result; /***** result of the glob() call */MixerDevices *devices; /***** temporary variable */
/***** get a list of device names that fit the pattern /dev/mixer* */
if (glob(“/dev/mixer*”, 0, NULL, &result) != 0)
return NULL;
if (result.gl_pathc < 1)
return NULL;
I don’t speak C, but it looks like it’s looking for my mixer at /dev/mixer*.
bash-3.1$ ls /dev|grep mix
mixer
bash-3.1$ file /dev/mixer
/dev/mixer: character special (14/0)
Well, it looks like I have a /dev/mixer file, but what is going wrong here? Okay, so this is what glob means… Perhaps it’s expecting a /dev/mixer0 or /dev/mixer1. I’m sure it won’t hurt to make a symlink.
bash-3.1$ sudo ln -T /dev/mixer /dev/mixer0 –symbolic
Password:
bash-3.1$ microphone_config
No mixer devices available!
Please purchase a sound card and install it!
No go. Well those are the only two instances that return NULL to give me that error… This is getting on my nerves.
Alright, I’ve tested my mic in audacity, and it can, in fact, record things. I thought perhaps my mixer wasn’t being added to the mixer count variable here, though:
for (i = 0, j = 0; i < result.gl_pathc; i++)
{
/***** scan abilities of current mixer device */if ((fd = open(result.gl_pathv[i], O_RDWR, 0)) != -1 &&
ioctl(fd, SOUND_MIXER_READ_DEVMASK, &mask_mixer) != -1 &&
(mask_mixer & SOUND_MASK_MIC) &&
/* (mask_mixer & SOUND_MASK_IGAIN) && */
ioctl(fd, SOUND_MIXER_READ_RECMASK, &mask_mixer) != -1 &&
(mask_mixer & SOUND_MASK_MIC))
{
/***** if mixer device looks ok add it to the list */devices->name[j] = malloc(strlen(result.gl_pathv[i])-5+1);
strcpy(devices->name[j], result.gl_pathv[i]+5);
j++;
}close(fd);
}
So I researched programming with /dev/mixer, and tweaked myself a handy little test program:
#include <unistd.h> /*I just made sure I had all the same includes as mixer.c did*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/soundcard.h>int main()
{
int fd;
int devmask;
int recmask;ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devmask);
if (devmask & SOUND_MASK_MIC)
printf(“The mic input is supported\n”);ioctl(fd, SOUND_MIXER_READ_RECMASK, &recmask);
if (recmask & SOUND_MASK_MIC)
printf(“The mic input can be a recording source\n”);return 0;
}
When I use SOUND_MASK_CD like the example on the linked page, I get:
bash-3.1$ ./a.out
The CD input is supported
The CD input can be a recording source
But when I use SOUND_MASK_MIC like in the mixer.c file, I only get:
bash-3.1$ ./a.out
The mic input can be a recording source
So what does this mean? My mic is really not supported? It seems to work fine under Audacity. Well, here are my relevant entries from $amixer:
Simple mixer control ‘Front Mic’,0
Capabilities: pvolume pswitch
Playback channels: Front Left – Front Right
Limits: Playback 0 – 31
Mono:
Front Left: Playback 31 [100%] [12.00dB] [on]
Front Right: Playback 31 [100%] [12.00dB] [on]Simple mixer control ‘CD’,0
Capabilities: pvolume pswitch
Playback channels: Front Left – Front Right
Limits: Playback 0 – 31
Mono:
Front Left: Playback 31 [100%] [12.00dB] [on]
Front Right: Playback 31 [100%] [12.00dB] [on]Simple mixer control ‘Mic’,0
Capabilities: pvolume pswitch
Playback channels: Front Left – Front Right
Limits: Playback 0 – 31
Mono:
Front Left: Playback 31 [100%] [12.00dB] [on]
Front Right: Playback 31 [100%] [12.00dB] [on]Simple mixer control ‘Capture’,0
Capabilities: cvolume cswitch
Capture channels: Front Left – Front Right
Limits: Capture 0 – 54
Front Left: Capture 39 [72%] [0.00dB] [on]
Front Right: Capture 39 [72%] [0.00dB] [on]Simple mixer control ‘Capture’,1
Capabilities: cvolume cswitch
Capture channels: Front Left – Front Right
Limits: Capture 0 – 54
Front Left: Capture 39 [72%] [0.00dB] [on]
Front Right: Capture 39 [72%] [0.00dB] [on]Simple mixer control ‘Input Source’,0
Capabilities: cenum
Items: ‘Front Mic’ ‘Mic’ ‘CD’ ‘Mix’
Item0: ‘Front Mic’Simple mixer control ‘Input Source’,1
Capabilities: cenum
Items: ‘Front Mic’ ‘Mic’ ‘CD’ ‘Mix’
Item0: ‘Front Mic’
I wonder.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.