събота, 7 декември 2013 г.

Atheros AR9485 kills my wifi router (solved)

Ok, here's the story:
I have a laptop with atheros ar9485. The wired connection works fine, but the moment I connect to my wifi TENDA router, the wireless network dies. And by dies, I mean that it disappears and the router needs to be manually rebooted.
I used another router (OpenWrt), and it doesn't crash. But the connection is very unstable, it drops at random.
I still don't know whether the problem was between the Atheros and the Tenda router (I read somewhere that Atheros has a problem with Netgear routers), but it doesn't matter. Here's how I fixed it.
First, as suggested in the Sabayon Forum (link), I got the outputs from:
uname -a
rfkill list
iwconfig (before the router crash)
iwconfig (after)
dmesg|tail -25

The output from the dmesg looked like this:
[ 5858.487813] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 5858.487817] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 5858.487821] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 5858.487824] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 5859.529403] wlan0: authenticate with c8:3a:35:27:51:58
[ 5859.548446] wlan0: send auth to c8:3a:35:27:51:58 (try 1/3)
[ 5859.550322] wlan0: authenticated
[ 5859.551076] wlan0: associate with c8:3a:35:27:51:58 (try 1/3)
[ 5859.612983] wlan0: RX AssocResp from c8:3a:35:27:51:58 (capab=0x11 status=0 aid=1)
[ 5859.613012] wlan0: associated
[ 5859.613079] cfg80211: Calling CRDA for country: CN
[ 5859.614768] ath: regdomain 0x809c updated by CountryIE
[ 5859.614771] ath: EEPROM regdomain: 0x809c
[ 5859.614772] ath: EEPROM indicates we should expect a country code
[ 5859.614773] ath: doing EEPROM country->regdmn map search
[ 5859.614774] ath: country maps to regdmn code: 0x52
[ 5859.614775] ath: Country alpha2 being used: CN
[ 5859.614776] ath: Regpair used: 0x52
[ 5859.614790] cfg80211: Regulatory domain changed to country: CN
[ 5859.614791] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 5859.614793] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[ 5859.614794] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (N/A, 3000 mBm)
[ 5859.614796] cfg80211:   (57240000 KHz - 59400000 KHz @ 2160000 KHz), (N/A, 2800 mBm)
[ 5859.614797] cfg80211:   (59400000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4400 mBm)
[ 5859.614798] cfg80211:   (63720000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 2800 mBm)


So after some digging, I discovered that there seems to be a problem with CRDA and the network adapter identification. You can see more on the story here and here. There you can find also some recommended solutions, but what I did is the following:

sudo equo install crda (if you don't have it)
sudo nano /etc/default/crda

and added this line: 
REGDOMAIN=BG 
And that was it. I got this solution from this site. It turned out it worked. Now, the connection is stable and the router - alive. 
I lost half a day on this, but now I feel quite happier. And I have wireless :) 
Enjoy!

събота, 23 ноември 2013 г.

tomtom mydrive not installing

Well, not really a Linux related post, but anyway.
I had to install tomtom's mydrive on a Windows XP machine. It couln't install for no obvious reasons. The machine had the .net 4.0 and SP3, but it was very unclear what the problem was. I tried installing it on my Sabayon with Wine and it turned out it installed just fine. It couldn't run and I thought the reason is that I don't have the .net 4.0 installed, so I did:
$­wget http://winetricks.googlecode.com/svn/trunk/src/winetricks
$ bash winetricks dotnet40 corefonts
It didn't help, really, but then I checked in wine for the tomtom app. And thanks to it, I found out that 1) it won't run under wine because of " KERNEL32.dll.SetVolumeMountPointW" which has not been implemented so far.
2) You need Microsoft Visual C++ 2005 SP1 runtime to run it!
Voila! That was the problem the whole time. Since the Windows machine has been used only for browsing, nobody bothered to install Visual C on it. The tomtom app of course didn't feel obligated to report this problem, it just crashed silently leaving me scratching my head. After installing it, the app installed fine, connected the device and started updating. It still has not finished, but at least it is working.
My biggest surprise was that my Sabayon recognised the tomtom protocol (network type) and connected fine. It was unbelievable. So, that's the story for today.

понеделник, 7 октомври 2013 г.

How to embed cyrillic subtitles in a video, 2013

Finally I got this to work. I needed to embed Cyrillic subtitles in a video, to be able to watch it on a lame device which likes to screw the subtitles (which it would otherwise read ok).
Anyway, we tried this for quite long but the final try was the working one. I follow this guide.
1. First, locate a working Cyrillic font. I ran a kfind to find Tahoma.TTF
2. Edit ~./mplayer/config
and add:
# Set font.
#set your ttf fonts here, example:
font=/path/to/Tahoma.TTF
# Set font encoding.
subfont-encoding=unicode
# Set subtitle file encoding.
unicode=yes
utf8=yes
3. Close this file.
4. Open your subtitles file with kwrite and then click Save As and pick UTF8 as encoding.
5. Well, that's it, then just use:
$ mencoder -UTF8 -sub movie_subtitle.srt -ovc xvid -xvidencopts bitrate=70000 -oac copy -o new.movie.name.avi movie.avi
and mencoder will do the rest. Well, it takes some time, but it works.
Note, if you do -ovc copy, it won't embed the subtitles, just copy the whole movie.
I'm not sure how high you should go with bitrate.
Also, I've found this: -subfont-text-scale 3
if you want to increase the font size. I haven't tried it yet.
For people wanting to try with cp1251, you can try this link, but it didn't work with me.
You can also read this guide, with which you can do a lot of cool things. But all I need is to embed the subtitles, so I'm fine with this command.
Enjoy!