Saturday, October 13, 2012

Choppy audio in Ubuntu 12.04

This problem seems to affect ALC XXXX chips, it has to do with some wrong settings for pulse-audio.  Try this to move forward:

Edit /etc/modprobe.d/alsa-base.conf:
And append this:
options snd-hda-intel model=generic

or try this one-liner:
echo "options snd-hda-intel model=generic" >> /etc/modprobe.d/alsa-base.conf

How do you know if you have this card?

bgs@dev1:~/Desktop$ dmesg | grep intel
[    1.103778] intel_idle: MWAIT substates: 0x1120
[    1.103793] intel_idle: v0.4 model 0x1E
[    1.103794] intel_idle: lapic_timer_reliable_states 0x2
[   20.411326] snd_hda_intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[   20.411378] snd_hda_intel 0000:00:1b.0: irq 50 for MSI/MSI-X
[   20.411403] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[   20.465477] snd_hda_intel 0000:01:00.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[   20.465480] hda_intel: Disabling MSI
[   20.465508] snd_hda_intel 0000:01:00.1: setting latency timer to 64
bgs@dev1:~/Desktop$ lsmod | grep intel
snd_hda_intel          32765  6 
snd_hda_codec         109562  2 snd_hda_codec_hdmi,snd_hda_intel
snd_pcm                80845  5 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd                    62064  24 snd_usb_audio,snd_usbmidi_lib,snd_hda_codec_hdmi,snd_rawmidi,snd_seq,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer,snd_seq_device
snd_page_alloc         14108  2 snd_hda_intel,snd_pcm
bgs@dev1:~/Desktop$ 



Friday, August 17, 2012

Setting emacs like behavior in Bash

% set -o emacs

http://www.pythian.com/news/1010/emacs-keybindings-in-bash/


Friday, May 18, 2012

Logitech Revue PS3 media server config

Can't quite get the integration between Google TV and PS3 Media Server?

Here is a renderer file that worked for me:

$ cat ps3mediaServer/renderers/LogitechRevue.conf

RendererName=Revue
RendererIcon=android.png
UserAgentSearch=MediaPlayer
Video=true
Audio=true
Image=true
SeekByTime=false
TranscodeVideo=MPEGAC3
TranscodeAudio=LPCM
TranscodeFastStart=false
DefaultVBVBufSize=true
MuxH264ToMpegTS=true
MuxDTSToMpeg=false
WrapDTSIntoPCM=false
MuxLPCMToMpeg=false
MaxVideoBitrateMbps=0
MaxVideoWidth=0
MaxVideoHeight=0
H264Level41Limited=true
MimeTypesChanges=audio/wav=audio/L16
TranscodeExtensions=dts
StreamExtensions=mkv,m4v,mov,flv,mts,mt2s,ts,avi,mp42,mp3,mp4,m4a,wma,flac
mediainfo=true

Saturday, April 28, 2012

facebook-android-sdk\facebook\build.xml:46: sdk.dir is missing


Why:
Missing local.properties in the facebook library project folder. (need to provide the sdk.dir env variable, this solution describes how to make the local.properties)

Dependencies:
Path to tools batch files:
C:\<path_to_location_of_your_android_sdk>\android-sdks\tools

Fix:
Open CMD to the directory of downloaded facebook library:
(Windows) $ android.bat update lib-project -p .
(Linux) $ android update lib-project -p .

This will generate local.properties to keep you going.

local.properties:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=C:\\
<path_to_location_of_your_android_sdk>\\android-sdks

You can also write this file to that project directory and be done.

Friday, January 27, 2012

rename git commits with git filter-branch

This how you could change the committer / author email / names:

Or for more control

      
Thank you SO.

Adding Eclipse to Unity bar

Once you install your own custom Eclipse (Ubuntu repos are few versions behind) try this recipe to put the Eclipse start icon on your bar:
1. Create/edit sudo emacs /usr/share/applications/eclipse.desktop


## Add following content to file and save ##
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse SDK 3.7.1
Exec=/path/to/eclipse/folder/eclipse
Icon=/path/to/eclipse/folder/icon.xpm
Terminal=false
Type=Application
Categories=Unity;GNOME;Application;Development;
StartupNotify=true

NOTE: absolute paths must, shortcuts like ~ do not get expanded. If you find the secret to the expansion of these common system variables - let me know in comments.

2. Drag and drop the new .desktop file onto your Unity bar.
nautilus /usr/share/applications/

Optional test: To make sure everything worked double click on the shortcut and your eclipse should launch. (if you favorite editor launches .desktop file, don't worry)

Drag the eclipse.desktop onto the Unity bar. If you unity bar is on auto hide, might want to make it revealed for this on.

Done.

Rescuing disk MBR with Ubuntu

I was very pleasantly surprised with a tool called Boot-Repair provided by Ubuntu. If you end up hosing up the MBR of your drive, Boot-Repair will come to the rescue:

http://help.ubuntu.com/community/Boot-Repair

Will re-install grub for you on your Linux partition. It really saved me hours of researching and troubleshooting. Thank you Ubuntu developers and Canonical for making such great contributions to open source.

Saturday, January 21, 2012

?????? in Devices on Eclipse

Attaching new devices on your Ubuntu Linux can be annoying because the system does not give you permission to access. Simply put, you have to let udev know about special permission to your device.

First we have to grab vendor id from lsusb or android developers site.

lsusb method:
Run

lsusb

look for a your device (phone manufacturer), the listing looks like formatted like this vendorId:modelId, i.e.:
...
Bus 001 Device 006: ID 22b8:7090 Motorola PCS
...

now make sure permission get set on every usb plug event:
add/create new to /etc/udev/rules.d/51-android.rules:

SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"

set the right permissions on 51-android.rules (if just created the file):

-rw-r--r-- 1 root root  213 2008-12-04 22:45 51-android.rules

or

chmod a+r 51-android.rules

Done.

Credit: Android developer site

Tuesday, January 17, 2012

Upgrade to PAE kernel on Ubuntu 11.04

In case you got some new ram installed and now your total ram is more than 4GB, upgrading your Ubuntu kernel (PAE) to support that higher memory is a breeze.

sudo apt-get install linux-generic-pae linux-headers-generic-pae


Credits: Ubuntu PAE Wiki.

Thank you Ubuntu developers and community for making your best work available for free.