Tuesday, December 17, 2013

fixing Sony Xperia SP sudden music stops and other sound problems


1. The most common problem in Xperia devices: music playing sudenly stops while browsing with chrome or other browser. Pressing "pause/play" button does not help, have to restart the player. Happens in all players, including Walkman. Most common solution is to do a clean firmware reinstall.

Steps:
1) backup everything (i use Titanium Backup pro, root required)
2) download Sony Update Services tool:  http://www.sonymobile.com/gb/tools/update-service/
3) run it, follow the steps on screen
4) wait for applications to auto-reinstall, restore your backup users data, enjoy.

UPDATE:  it helped only for a while. after i some useage, especially, the software reinstall, the problems repeat. V6 SUPERCHARGE script did not help either. Only option is to use OperaMini.

2. Second most annoying problem, is not sufficient music volume in headphones. Most people say, that is done by manufacturer on purpose due to some law and sanitary restrictions to prevent ear damage. Well, if you are no afraid of ear damage, you may try apps like Volume+ (Sound Boost) in Play Market. (needs root) -- results vary. Personally I used this: http://forum.xda-developers.com/showthread.php?t=2370047&highlight=volume+boost . But the next thing works also good.

3. Music  sound enhancer: I recomend Viper4Android (root required, /system remount fix also needed): http://vipersaudio.com/blog/, far better than anything built in. Install the driver in normal mode, use "force" install, plug in the headphones, go into Settings -> Sound -> Sound Effect and choose Viper4Android. Afterwards it works in every player app you have. If the phone spontanously reboots, see the /system fix below.

4. Folder play: Walkman is neat, but it cannot play music by folders. Use "Rocket Player" (more feature rich) or "FolderPlayer" (simplier, faster) instead. MX video player is beast for video.

Otherwise, its a great device! The first time i do not want to experiment with firmwares. Besides, Android 4.3 and Android 4.4 official updates are promised! Tested its LTE with Russian BeeLine provider -- great speed!

Prerequisites for the above:
Other info:

UPDATE 20.03.2014:  I hoped that update to v12.1.A.0.266 with Android version 4.3 would've solved first to problems, but it didnt

Wednesday, November 27, 2013

Cuda 5.5 on OpenSUSE 13.1

Seems to work OK. Although it is not supported officially. The default compiler in OpenSuSE is gcc-4.8.1

All you have to do is:

1) install NVIDIA drivers (from a repository via YaST or manually from .run file)
2) download CUDA v5.5 as "run" file, not as "rpm".
3) run installer as

./cuda_5.5.22_linux_64.bin -toolkit -samples -override

no additional fixes needed, samples compile and run just fine. Have Fun! 

Friday, March 22, 2013

QT-Creator 2.6 with Intel Compiler

Recently i started developing a heavy-calculations application, which required iMKL, so that i decided to use Intel  C++ Composer as well, both in Linux and in Windows. I also decided to use QT-creator as my primary IDE for GUI development, although i kept using other IDE-s (VS, Eclispe) for tests.

1) Linux experience: 

I used OpenSuSE 12.3, that comes with  qt4-devel v 4.8.4 and qtcreator 2.6 packages. Intel says that it does not support opensuse, and installer refuses to work, so a little override is required. How to install Intel Composer 2013 on OpenSuSE 12.3
1) unpack the Intel Composer (or Parallel Studio), and go into the unpacked distribution folder
2) edit  silent.cfg file -- set the correct serial number or license information, set INSTALL_MODE=RPM
3) run  ./install --silent silent.cfg
4) If you use Eclipse CDT, dont forget to add Intel Integrations for Eclipse CDT (here)

Open Qt-Creator,
1) open Menu -> Tools -> Options -> Build&Run -> Compilers press "Add" and select "Linux ICC".
2) go to "Kits" options tab, select the default "Desktop" toolkit, press "Clone",
3) set its compiler to the ICC selected from above
4) set mkspecs filename to linux-icc

now the helloworld should build and run, and GDB should work as debugger. At least it stops on breakpoints. 

2) Windows experience - with Visual Studio: 

You are supposed to have VisualStudio in order to use Intel C++ Composer. So far I tested with VS 2012.  Also, my application was 64bit only, and, for compatibility reasons, i decided to stick with QT-4.8.4. 

It could work with pre-compiled Qt-4.8 built with vs2010, but since i needed 64bit application, i had to compile it myself. Open the according 64-bit VisualStudio compiler command prompt, go to QT sources and build them as usual: 

configure -prefix C:/install/path 
nmake
nmake install 

Now you need to setup an Intel toolchain within QtCreator. For some reason it does not allow it to do in GUI, so a trick is required. 
1. Go to Menu-> Parameters-> Build and Run -> Compilers
2. Select the according VS compiler, the same you used to compile your QT with. and press "Clone" button. Rename the new compiler toolchain. 
3. We will need to change it's path to initialization .bat file, but the GUI does not allow to do it, and we have to do it manually in config files. Open the file Explorer and go to  %AppData%\QtProject\qtcreator  folder (just copy-paste it into address bar) and open the toolchains.xml file with your favorite editor. It is an XML file that consist of ... entries. Find the entry which correponds to the toolchain copy  that you created previously. (Normally, It should be the one with the largest ToolChain.N number.) And replace the     <value key="ProjectExplorer.MsvcToolChain.VarsBat" type="QString"> and  <value key="ProjectExplorer.MsvcToolChain.VarsBatArg" type="QString"> lines with the following values: 

   <value key="ProjectExplorer.MsvcToolChain.VarsBat" type="QString">c:\Program Files (x86)\Intel\Composer XE\bin\compilervars.bat</value>
   <value key="ProjectExplorer.MsvcToolChain.VarsBatArg" type="QString">intel64 vs2012shell</value>

See the compilervars.bat itself for details. Note, that you should set the VarsBatArgs value according to you compiler version and platform. 

3. Create a new "Toolkit".
Go to Menu->Parameters->Kits 
Add the one you have, if it is still absent. It is configured to work with the same compiler that was used to build it. Now press the "Duplicate" button, and rename the new option for your convenience. In its properties change the compiler to the intel toolchain, created previously, and set mkspecs option to win32-icc

Now select this toolkit in the project properties. The sample helloworld project should compile and run just fine. However, it is possible, that the debugger is still not working - it never stops on breakpoints. To fix this go to QT installation folder and open the mkspecs/win32-icc/qmake.conf file. 
find the   QMAKE_CFLAGS_DEBUG = -Zi -MDd -O2  line, and change -O2 parameter to -Od so that it looks like: 

QMAKE_CFLAGS_DEBUG = -Zi -MDd -Od  

(UPD: seems like the latest versions already have this fixed)

So now the debugging should work as well, at least it stops on breakpoints!.


3) Visual Studio Express Edition notes:

 If you only have Visual Studio Express edition , you may encounter "Visual Studio is not found in the system" error when launching Intel 64 command prompt from Start menu. It is said that Express Edition does not support the Composer integration, so we only can use the Command Prompt to build applications. That is OK with me since i wanted to use QtCreator for development.

For most cases see:  http://software.intel.com/en-us/articles/error-visual-studio-2005-2008-or-2010-is-not-found-in-the-system-when-launching-intel-64

I have only Visual Studio 2012 Express edition for Windows Desktop, so I did the following:

1) locate compilervars_arch.bat file in  c:\Program Files (x86)\Intel\Composer XE\bin\  and open it for editing.
2)
locate the following strings:

::VS2012
if /i "%TARGET_VS%"=="vs2012" (
  if defined VS110COMNTOOLS (
    if exist "%VS110COMNTOOLS%..\IDE\devenv.exe" (
      if exist "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" (
         set MSVS_VAR_SCRIPT="%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
         goto Calls
      )
    )

and promptly after them add the following:

    if exist "%VS110COMNTOOLS%..\IDE\WDExpress.exe" (
      if exist "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" (
         set MSVS_VAR_SCRIPT="%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
         if /i "%TARGET_ARCH%"=="intel64" set TARGET_VS_ARCH=x86_amd64
echo "VS 2012 express for Desktop found"
         goto Calls
      )
    )

just before the if exist "%VS110COMNTOOLS%..\IDE\VSWinExpress.exe"  string. 

Friday, March 15, 2013

Running NVidia CUDA SDK 5.0 on OpenSuSE 12.3

There is a number of difficulties installing NVIDIA CUDA SDK 5.0 onto OpenSUSE 12.3. The major reason that it does not support  gcc 4.7.2 compiler that is distribution's default. There is a number of ways to overcome it.

1. install drivers. You may use packages from  OpenSUSE's NVidia repository or use the ones that come with cuda-sdk package. Both cases work fine, just make sure your driver's version maches the requirement.
There may be a problem with missing libraries, like libglut.so, just fix them with appropriate symlinks in your /usr/lib64 .

2. install cuda-sdk. Get the package from https://developer.nvidia.com/cuda-downloads. I used version for openSuSE 12.1. Install as superuser it with the following options: 

su - 
./cuda_5.0.35_linux_64_suse12.1-1.bin -toolkit -samples -override 

These options disable installation of NVidia drivers and skip the dependency  checks. 

Consider you've installed it into its default directory, i.e. /usr/local/cuda-5.0
(for other options see ./cuda_5.0.35_linux_64_suse12.1-1.bin --help)

Go to this directory, and do the following

3. disable GCC version check: 
open  /usr/local/cuda-5.0/include/host_config.h  
find

  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)

and replace it with 

  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)

That alone won't help, and if you try to compile the samples you'll most likely get compile time errors like: 

/usr/include/c++/4.7/ext/atomicity.h(48): error: identifier "__atomic_fetch_add" is undefined

/usr/include/c++/4.7/ext/atomicity.h(52): error: identifier "__atomic_fetch_add" is undefined

4. To disable there "__atomic_fetch_add is undefined" compiler errors: 

You have to include commands like  

#undef _GLIBCXX_ATOMIC_BUILTINS
#undef _GLIBCXX_USE_INT128

into beginning of you .cu file or put them into a separate include file. Lets put them into 

/usr/local/cuda-5.0/include/__cuda_gcc47_fix.h

or other name you like. Now you may compile a hello world application with 
nvcc --pre-include __cuda_gcc47_fix.h command

in order to have the whole "samples" directory compile with default makefiles, lets do a little trick. 
save nvcc binary into a separate file, and create a small wrapper script with the following commands: 

cd /usr/local/cuda-5.0
mv bin/nvcc bin/nvcc.bin
echo '#!/bin/sh 
$0.bin --pre-include __cuda_gcc47_fix.h $@' > bin/nvcc 
chmod +x bin/nvcc 

After that the whole samples directory should compile without errors. (check for mpicxx to work in order to build some samples). Warnings on delegating contructors may be ignored. 

I guess the same steps may apply to other Linux distributions with gcc 4.7, like Ubuntu 12.10 and etc, that it How to make nVidia cuda sdk 5.0 to work with gcc 4.7 

Sunday, November 27, 2011

IM+ messenger accounts migration in Android

I have got a nice HTC-Desire smartphone recently. After 6 months playing with it, I desided to change the firmware, i used the famous ruHD-rom, with ext-partition on SD card useing the "unrevoked" toolset. Next, i used "Revolutionary" to S-OFF, and now i can do whatever i want with my phone.

CAUTION: use "rooting" and "S-OFF" only if you know what you DO !!!

Now, a small example, where having a "rooted" phone helps:

Recently, i used IM+ lite multiprotocol messenger, which proved to be the best of its kind. (maybe U-talk can compare...) I liked it, so i decided to by the "advanced" IM+ pro -- it's worth it's money.

The only dissapointment was that IM+ lite and IM+ pro are two different applications, so non of the contacts from IM+ lite got imported into IM+ pro. I was too lazy to manually re-enter all accounts from all IMs, so i looked for a option to "migrate", and here it is (tried on IM+ version 5.0.2):

Task: How to import account settings from IM+ lite (aka implusfree) into IM+ pro (aka implusfull).

Prerequisites: rooted device, your favorite file manager in "root mode" (like ES File Explorer), IM+ lite and IM+ pro installed.

Actions:

  • Close IM+ and IM+ pro. Make sure they are not running (use your favorite task manager)
  • Make have you file explorer into "root" mode. Navigate to /data/data/de.shapeservices.implusfree/databases.
  • Copy file IMPLUS_DB into /data/data/de.shapeservices.implusfull/databases
  • Now, start Im+ pro, and make sure you accounts are in place. (facebook may need to re-authorise). After that remove IM+lite


Enjoy!

PS: I think that IM+ accounts setting export between devices works the same way.

Wednesday, January 27, 2010

intel 5150 wifi in OpenSuSE linux 11.2 in WPA mode

I have a nice netbook Lenovo S10-2 with Intel Wifi/Mimax 5150 builtin adapter. When i started playing with it, I installed OpenSuSE 11.2 (among others, including even MacOS X!). The result was: ALMOST everything working out of the box, even KDE4 was nice! Except for the mentioned Intel 5150 card. Actually, wifi worked, but only unsecure version.

The following steps helped me to fix it:
1) in YaST (Start->Computer->Yast) start "Software Repositories", then "Add", "by URL", enter URL:
http://download.opensuse.org/repositories/driver%3a/wireless/11.2-update/
and some name for the repository. then "OK"

2) in YaST start "Software Manager" and look for "iwl-5150-ucode" package, and mark it for installation, Also, do all the software update by selecting menu "Package -> All Packages -> Update if newer version available", make sure that you have "kernel-firmware", "compat-wireless-experimental-kmp-...", "iflugd" and all "NetworkManager" packages selected, then click "Accept" to install .

3) reboot

4) make sure that your network settings are managed by "Network manager" and in KDE you have "Network Manager" started (usually, it should be like that by default).

5) In network manager applet menu (should be in system tray), select "enable wireless" menu. Soon, a list of available Wifi hotpots should appear right in the network-manager applet menu. Simply click on one, and enter WPA password when asked to. If not, go to "Connect to other network",and select a network from list, or click "New ad-hoc network" and search for appropriate SSID in there.

Good night and good luck.

Tuesday, February 3, 2009

Anaconda vs YaST -- install on mdadm RAID volumes

Recently i had a possibility to compare both.
One of my clients depends on RHEL, so I installed CentOS 5.2 for them. There were usual 2xquad-core-Xeon servers, with a cheap SATA controller, so the only option for me was creating mdadm RAID volumes. Another of my clients had similar server, but they had no preferences, so i installed OpenSuSE 11.1 there.

both installers (i mean, both YaST and Anaconda) could not present me GUI to allow me to do things that i wanted to. But, frankly speaking, YaST allows more fine tuning of RAID volumes being created. For example, in YaST i could manually specify size of chunk. However, YaST did not allow me to create RAID10 volume. I did the following: I rebooted from OpenSuSE 11.1 install disk in rescue mode, and made myself a needed configuration with sfdisk and mdadm commands. Then i rebooted into installer, YaST found all volumes that i created, and pointed which filesystems to create there, and was successfull. In Anaconda, i could not do such a trick. For some reason, it did not allow me to use existing RAID volumes. I always resulted in "/dev/sdd4 device or resource busy" error. The only option that helped was:
deleting whole partition table with parted mklabel command, and then re-create them in installer.

Another feature that made me a complete YaST zealot is possibility to create YaST modules myself. Once upon a time i used it to fix user management routines on LDAP+KOLAB+SAMBA PDC machine. I cant imagine a good way to do it for Anaconda.

as a result: Anaconda sucks!