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

Monday, February 10, 2014

nvidia-settings don't load on reboot

UPDATE:
This seems to no longer fix the problem for me lately after an upgrade to Mint 17, and I'm unsure why.

Problem: 

You are using an Ubuntu/Mint/Debian with an Nvidia driver (or perhaps another proprietary GPU driver), and your custom resolutions are lost at each restart even though you applied them and saved to xorg.conf. This frustrates you to no end, and even if you script a live modeline change putting your box to sleep or a reboot will mean it doesn't get automatically reapplied. Also, your settings don't get reloaded into the settings GUI after a reboot, and you are mystified.

Explanation: 
The built-in Mint Preferences > Displays tool doesn't give a crap about your custom configuration, and it will reload whatever it had set previously just to torture you. You can kill it with fire though. To see if it has a settings file look for a ~/.config/monitors.xml file.

Solution:
You may not need the first four steps, or you may have already performed them.

  1. sudo nvidia-xconfig    # create a fresh xorg.conf
  2. gksudo nvidia-settings # set it up like you wanted it; my overscan fix example
  3. Click "apply"
  4. Click "save to x-config file"
  5. rm ~/.config/monitors.xml  # get rid of the non-xorg Displays configuration
  6. restart
I have seen this problem again and again on forums where nobody knew that deleting that file would fix the problems. Spread the word my friends.

Monday, February 14, 2011

m4b audiobook to cd's with Ubuntu: Valentine's Day Edition

Problem:
My wife came to me asking about putting her large .m4b audiobook files on cd's to listen to while she is on the road for work.  These are biiiiig files with some over 10 hours each.  They were not DRM'ed, but they did have still jpeg images as a video stream.

Bad Solution:
Files this big require using compressed output since WAV files will exceed aloud maximum size.  This prevented me from using the mplayer -ao pcm trick successfully to write a file.  I ended up with WAV files that only captured half or less of each book.

Good Solution:
I settled on ffmpeg to write mp3 files.  After getting the mp3's, it would be easy if she had an mp3 cd player in her car, but she doesn't.  Therefore I will also describe how to split the mp3's at cd-length intervals at the end.

1.) First get the tools.  Only the first two are needed if you don't want to split your mp3's at the end.

sudo apt-get install ffmpeg libavcodec-extra-52 mp3splt

Also, if you have spaces in your file names and a bunch of m4b files you will want to process iteratively, you may want to replace the spaces with underscores.  Otherwise, common shell for looping methods will treat each word like a filename.  This can be done easily with rename.


rename 's/\ /_/g' *.m4b 

This says to replace all spaces in all file names ending in '.m4b' with underscores.

2.) Create an mp3 file from your m4b file.

ffmpeg -i yourfile.m4b -acodec libmp3lame -ar 22050 -ab 320k yourfile.mp3

The codec libmp3lame is included in that libavcodec package I told you to get.  The sample rate of 22050 sounds fine for most audio books, but you can adjust this if needed.  Lastly, set the bitrate for encoding your mp3.  Even though I specified 320k, the software only did it at 160k owing to a codec implementation limitation I suppose.

I had a bunch of m4b files to convert, so I used the following one liner to do all of them.  It will replace the extension with .mp3.


for m4b in *.m4b; do ffmpeg -i $m4b -acodec libmp3lame -ar 22050 -ab 320k ${m4b%.m4b}.mp3; done

3.) Now you have one or many big mp3's.  If that is all you need, then have fun.  For me, the 10 hour mp3's are a problem.  Now you'll need to split the large mp3's.  Luckily this is trivial on Linux with mp3splt.

mp3splt -t 80.0 yourfile.mp3

My cd's are 80 minutes, so the command above says split my file into as many 80 minute and 0 second files as needed. The split files will be named with start and end time data in this case, but the mp3splt tool has options to customize how the file names are numbered and named if you want more control.


In my case, I used this on a bunch of mp3 files so I did the following.

for m in *.mp3; do mp3splt -t 80.0 -d ${m%.mp3} $m; done

This command creates a separate directory (-d flag) which has the name with the original mp3 sans ".mp3" and places all the split files inside it (handy to prevent creating a jumble of files).


Have fun, and happy valentine's day.

Wednesday, September 24, 2008

Connecting to an SMB (Windows file share) server

Here is an excellent guide to connecting from an Ubuntu Linux machine to a SMB server:
Setting Up Samba (I recommend using cifs).

Thursday, July 17, 2008

Wireless working with Broadcom 4306 and Ubuntu 8.04

Okay, this is a Linux fix, but Linux boxes are PC's too.

If you are like me, you dread loading Ubuntu onto your laptop because of the pain of getting the wireless up and running. You got it working before in the last version, but now things have changed. It may be time to give up hope of using fwcutter. The only way I have ever gotten my wireless working in the last 3 releases was with ndiswrapper. The fwcutter method let me see networks but never connect to them.

This wiki has all you need to get your wireless working via ndiswrapper including the obscure (and still evolving) fixes to make it work under Ubuntu 8.04 (the hardy bugfix section was very useful for me).