So, I decided after many years and many tries to finally move to Ubuntu on my HTPC. VLC has always been there for me on OSX and Windows, so naturally I threw out banshee and installed VLC.
First of all: Tearing. I can only say: Everything was unwatchable. I searched forums and everywhere the same suggestion came up: Turn on vsync in the Nvidia Control Panel and in CompizConfig. Done. Nothing. Until I found this.
So I edited xorg.com (sudo nano /etc/X11/xorg.conf) and added
Section "Extensions"
Option "Composite" "disable"
EndSection
at the end of the file. Fine, no more effects. I can live with that as long as I get rid of the tearing problems.
Next up: Audio delay. The audio delay was not only noticable, it was 100 - 400 ms too late and varying depending on cpu load. I should probably point out that none of the cores were at full load.
At this point I was ready to give Ubuntu the finger and wait another 2 years for it to grow up. But then I figured: "No, I've configured clusters of databases and webservers on *nix systems before. I'm not giving up on account of a poor default configuration.". So said and done I continued my quest. Luckily I came across this excellent post on how to use ALSA instead of PulseAudio. (Short version: set VLC sound output to ALSA instead of PulseAudio/Default).
So now, finally after many hours, I have a HTPC playing videos smoothly without tearing or audio delay. I know, I'm ranting about how bad my first experience with Ubuntu 11.04 are, but what I left out is that there are many reasons why I choose to stay. PulseAudio is not one of them.
Monday, September 5, 2011
Tuesday, August 17, 2010
JS localStorage and IE 8 bug
How to crash an Internet Explorer 8 tab: localStorage.setItem(name, emptyString);
I discovered this when I was writing a function for autosaving a textarea and had to add the bold area below.
var Storage = {
Save: function(txt, type) {
if (txt.length == 0) {
Storage.Remove(type);
return;
}
try {
localStorage.setItem(type, txt);
} catch (ex) { }
},
Remove: function(type) {
try {
localStorage.removeItem(type);
} catch (ex) { }
}
};
I discovered this when I was writing a function for autosaving a textarea and had to add the bold area below.
var Storage = {
Save: function(txt, type) {
if (txt.length == 0) {
Storage.Remove(type);
return;
}
try {
localStorage.setItem(type, txt);
} catch (ex) { }
},
Remove: function(type) {
try {
localStorage.removeItem(type);
} catch (ex) { }
}
};
Friday, June 4, 2010
Chrome ajax status == 0 and C# .net
I just found out that using Response.Close(); makes Chrome XmlHttpRequests fail with status 0.
I often use ajax to get a small variable from a page and since I don't want the whole page i simply
Response.Write(myVar);
Response.Flush();
Response.Close();
but none of the pages worked in Google Chrome. When changing Response.Close() to Response.End(); everything worked as intended.
I often use ajax to get a small variable from a page and since I don't want the whole page i simply
Response.Write(myVar);
Response.Flush();
Response.Close();
but none of the pages worked in Google Chrome. When changing Response.Close() to Response.End(); everything worked as intended.
Sunday, March 7, 2010
Hannover 2010
Så är nu tillbaks från en otrolig mässa i Hannover.
CeBIT 2010 var häftig som fan.
Jag trodde aldrig att det fanns områden som var så stora med så många teknikintresserade som jag själv. Vi gick i nio timmar non-stop och hann ändå inte med dessa byggnader som motsvarar ca 10 flyghangarer.

Efter det gick vi och satte oss i ett riktigt Bierhaus och åt schnitzel och drack Löwenbräu. Utanför satt ett 10 meter högt lejon som drack öl och skrålade "Löööööööfenbräääääääääääuuu".
Nej på det stora hela har det varit en sjukt häftig semester. Jaja, det var väl lite jobbrelaterat, men på det stora hela var det var faktiskt mer semester.
Idag är det spel, kaffe, programmerings och tvättdag.
K = glad
CeBIT 2010 var häftig som fan.
Jag trodde aldrig att det fanns områden som var så stora med så många teknikintresserade som jag själv. Vi gick i nio timmar non-stop och hann ändå inte med dessa byggnader som motsvarar ca 10 flyghangarer.

Efter det gick vi och satte oss i ett riktigt Bierhaus och åt schnitzel och drack Löwenbräu. Utanför satt ett 10 meter högt lejon som drack öl och skrålade "Löööööööfenbräääääääääääuuu".
Nej på det stora hela har det varit en sjukt häftig semester. Jaja, det var väl lite jobbrelaterat, men på det stora hela var det var faktiskt mer semester.
Idag är det spel, kaffe, programmerings och tvättdag.
K = glad
Friday, February 26, 2010
Friday, June 12, 2009
Internet i knäna
Sitter på tåget med min lilla LG X110 och kontantkort från tre. High-tek! Eller som att ha internet inopererat i eh, knäna.

Per säger:
undra om det är med internet som med regn, att om man springer/åker tåg så åker man in i massa regndroppar/kilobits så att det går snabbare
KalluX säger:
hahhahahahha
Per säger:
=)
KalluX säger:
Det är nog snarare tvärtom
KalluX säger:
Man springer ifrån internetet
Per säger:
man åker ifrån dom? Ahh det tror jag med

Per säger:
undra om det är med internet som med regn, att om man springer/åker tåg så åker man in i massa regndroppar/kilobits så att det går snabbare
KalluX säger:
hahhahahahha
Per säger:
=)
KalluX säger:
Det är nog snarare tvärtom
KalluX säger:
Man springer ifrån internetet
Per säger:
man åker ifrån dom? Ahh det tror jag med
Wednesday, May 20, 2009
Fix 4227 on windows server 2008
The error message:
Event 4227, Tcpip
TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint. This error typically occurs when outgoing connections are opened and closed at a high rate, causing all available local ports to be used and forcing TCP/IP to reuse a local port for an outgoing connection. To minimize the risk of data corruption, the TCP/IP standard requires a minimum time period to elapse between successive connections from a given local endpoint to a given remote endpoint.
The problem:
We have an IIS that talks to a local MySql server. And it does that a lot. I'm talking about thousands and thousands of connections every second. Most connections only lasts a millisec but we still open and close the connections.
The problem is that we max out our connection quota way too fast for windows and windows doesn't like to reuse a port without giving it some cooldown time before opening a new connection. So what do we do? Well, we give the user more connections to use. Windows server 2008 only allows 5000 connections per user by default. So if we increase the value to max (65534) we will have a lot more connections to reuse and the cooldown won't become such a problem.
The solution:
Open regedit and go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
then add:
Value Name: MaxUserPort
Data Type: REG_DWORD
Value: 65534
Restart your system.
(In order to reset the system, don't just delete the key. Set it back to it's default value (5000))
Event 4227, Tcpip
TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint. This error typically occurs when outgoing connections are opened and closed at a high rate, causing all available local ports to be used and forcing TCP/IP to reuse a local port for an outgoing connection. To minimize the risk of data corruption, the TCP/IP standard requires a minimum time period to elapse between successive connections from a given local endpoint to a given remote endpoint.
The problem:
We have an IIS that talks to a local MySql server. And it does that a lot. I'm talking about thousands and thousands of connections every second. Most connections only lasts a millisec but we still open and close the connections.
The problem is that we max out our connection quota way too fast for windows and windows doesn't like to reuse a port without giving it some cooldown time before opening a new connection. So what do we do? Well, we give the user more connections to use. Windows server 2008 only allows 5000 connections per user by default. So if we increase the value to max (65534) we will have a lot more connections to reuse and the cooldown won't become such a problem.
The solution:
Open regedit and go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
then add:
Value Name: MaxUserPort
Data Type: REG_DWORD
Value: 65534
Restart your system.
(In order to reset the system, don't just delete the key. Set it back to it's default value (5000))
Subscribe to:
Posts (Atom)