Need some help with regional settings and other problems


Zink

Member
Joined
Mar 8, 2012
Messages
170
Hi, I have been playing with my newly received Pandora for three days now (got it two days before my birthday - it's the best birthday present I've ever got, despite the fact I had to pay for it :D ).


I was learning it for the time, and managed to solve some issues that came out (mostly by searching the forums). I have left with two of them:


1. This one is really important, as I would like to use Pandora also for writing texts: How to set it up to display national characters correctly? I'm Polish and we have some of the national characters, but none of them is shown correctly nor can be typed from the keyboard on Pandora. I've searched for topics with similar problems but haven't found anything. Here is the image to show what I'm talking about. On the left side it is how it looks on Pandora, on the right - how it should be looking (how it looks in Windows).


regional.png


I couldn't find any regional/codepage/charset settings in the system.


2. How to associate SMPlayer pnd with avi (and other) files? I tried the pnd_assoc file, but when I double-click on the avi it shows "pnd assoc loading" icon for a second, and then nothing happens. The pndrun_smplayer2.out file suggest that something is misconfigured either in the pndrun or smplayer, as an additional "x11" parameter is passed to the run script:



Code:
=======================================================================================

PND			 : /media/PANHDD/pandora/desktop/smplayer2_r4.pnd

PND_FSTYPE	  : Squashfs

APPDATADIR	  : /media/PANHDD/pandora/appdata/smplayer2

APPDD_FSTYPE	: vfat

PND_CPUSPEED	: <unset>

EXENAME		 : smplayer2.sh x11

ARGUMENTS	   : /media/PANHDD/Kuba.Wojewodzki.283.Kazadi.Rogucki.Malaszynski.avi

=======================================================================================

[ START ]--- Mount the PND ----------

Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/smplayer2"

Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/PANHDD/pandora/appdata/smplayer2=rw+nolwh":"/mnt/pnd/smplayer2=rr" none "/mnt/utmp/smplayer2"

[SUCCESS]--- Mount the PND ----------

[ START ]--- Starting the application (smplayer2.sh x11 /media/PANHDD/Kuba.Wojewodzki.283.Kazadi.Rogucki.Malaszynski.avi) ----------

/usr/pandora/scripts/pnd_run.sh: line 546: ./smplayer2.sh x11: No such file or directory

[ FAILED]--- Starting the application (smplayer2.sh x11 /media/PANHDD/Kuba.Wojewodzki.283.Kazadi.Rogucki.Malaszynski.avi) ----------

[ START ]--- Restoring the frame buffer status ----------

[SUCCESS]--- Restoring the frame buffer status ----------

[ START ]--- uMount the PND ----------

[ START ]--- Waiting the Union to be available ----------

[SUCCESS]--- Waiting the Union to be available ----------

auplink:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device

rmdir: failed to remove `/mnt/utmp/smplayer2': Device or resource busy

[ START ]--- Waiting the PND mount dir to be free ----------

[SUCCESS]--- Waiting the PND mount dir to be free ----------

cleanup done

[SUCCESS]--- uMount the PND ----------

=======================================================================================

Return code is : 3


The two below are not real problems, but rather just-out-of-curiosity questions:


3. How to relocate the Trash out of NAND? I already have the additional "delete permanently" action in Thunar, but using the normal Delete would be more convenient. For now I couldn't even find the exact path to the Trash directory.


4. I've read that some Pandoras can be powered from AC adaptor alone (without the battery), other ones would not do anything when powered from AC alone. I have tested my one, and it does something strange: When an SD card is in the left slot, and I connect it to the AC adaptor, it powers up by itself, Pandora logo shows for two seconds, then the logo disappears and it powers down. Flipping the power switch does nothing. If there is no card in the left slot, nothing happens when connecting the adaptor. Is it normal behaviour?
 
I'll try to answer your first question.

1. This one is really important, as I would like to use Pandora also for writing texts: How to set it up to display national characters correctly? I'm Polish and we have some of the national characters, but none of them is shown correctly nor can be typed from the keyboard on Pandora.

I think the problem in the text in your picture is the character encoding - it looks like ISO-8859-2 or (worse) CP1250 (WinLatin2) to me, while you should use UTF-8. The Pandora is fully capable of using UTF-8 encoded characters; I'm using this feature myself, learning Polish.


There is a (not so convenient) method to input special characters: first press <shift><enter>, then two characters (one after the other) building your desired character. Thus you can write ę (<shift><enter> <e> <,>), ł (<shift><enter> <l> </>), ż (<shift><enter> <z> <.>) and so on.

I couldn't find any regional/codepage/charset settings in the system.

I've added



Code:
export LANG="de_DE"

to my .bashrc, there is probably something similar for Polish.
 
Thank you for the answer.

I think the problem in the text in your picture is the character encoding - it looks like ISO-8859-2 or (worse) CP1250 (WinLatin2) to me, while you should use UTF-8. The Pandora is fully capable of using UTF-8 encoded characters; I'm using this feature myself, learning Polish.

It may be CP1250, as Win 7 seems to be still using it (for backwards compatibility maybe?). So the reasonable solutions would be:


1. Make Windows recognize and use UTF-8 (possible?)


2. Make Pandora mount FAT cards with CP1250 encoding.


I have tried to do the latter, according to this article, but it didn't work. The article tells to call ipkg list 'kernel-module-nls-*' in order to find the available charsets. The is no ipkg on Pandora, but I have browsed /lib/modules/3.2.17/kernel/fs/nls/, and there are only two files there: nls_ascii.ko and nls_utf8.ko. I guess utf8 is default, so I tried using ascii one, and the result is similar (characters are still wrong). I guess I need an nls_cp1250.ko or nls_iso8859-2.ko files to make it work? Does anybody know how to get them? I don't mind compiling them by myself, I just need to know where to start :) .


A side-question: there are some German users around (like ED himself), and maybe some other users whose languages contain accented letters. How do you cope with the issue?

There is a (not so convenient) method to input special characters: first press <shift><enter>, then two characters (one after the other) building your desired character. Thus you can write ę (<shift><enter> <e> <,>), ł (<shift><enter> <l> </>), ż (<shift><enter> <z> <.>) and so on.

Thanks, this one works, though it's a bit painful. How comes there is no simple way for this? I've just run my Linux box and I can easily input Polish characters with right Alt. This key, also called "Alt Gr(een)", is a shortcut for Ctrl + Alt. However it doesn't seem to be this straight in Linux, because Ctrl + Alt doesn't work (but it works in Windows). But since I can easily type Polish characters in "normal" Linux, why can't this be done in Pandora? Yes, It doesn't have right Alt, but we could use another key combination for it, like Ctrl + Alt, or Pandora + Alt (though Pandora + Ctrl would be more convenient). I've read about Xmodmap, but I don't think this could be done with it. Or maybe I'm wrong?

I couldn't find any regional/codepage/charset settings in the system.

I've added



Code:
export LANG="de_DE"

to my .bashrc, there is probably something similar for Polish.

For Polish it should be "pl_PL" - but it doesn't do anything for me (yes, I've rebooted after adding it).
 
I tried the keyboard layout changer before, and not only it didn't work, but it also messed up the Fn symbols (some symbols stopped working, others were replaced, like '#' instead of '}' and '?' instead of '{') - probably because it thinks it's an external keyboard.


So I looked more into it and found out that it defines right Alt for Polish characters. As Pandora doesn't have right Alt, I changed the setting to left Alt, and it started to work! :D


However, it caused other problems, as most of the Fn keys stopped working. I spent 1,5 days on this, trying many approaches, and finally made it :) .


This is a small guide how to make national characters and all Fn keys working at the same time:


First some background. Pandora uses two methods of mapping keys to symbols (characters): Xmodmap and xkb. The former is less advanced, but also less complicated and easier to manage. However, due to an unfortunate bug it will not work in this case. In Poland the national characters are traditionally constructed by holding right Alt (AltGr) and pressing the base key. This makes so-called level 3 shift: from a to ą, from o to ó, and so on. Pandora does not have the right Alt, but the AltGr functionality should be also achievable by pressing left Ctrl and left Alt at the same time. However this is true on Windows, it's not on Linux (don't ask me why, I don't know). To resolve this two things must be made:


1. Assigning national characters to level 3 shifted base characters,


2. Assigning AltGr to one of the existing keys.


Fortunately both of these tasks can be made using only Xmodmap, so an easy go, right? Well, not quite. Unfortunately Xmodmap that is installed on Pandora has a bug that prevents the 2nd point to be performed. So the only way is to use xkb, as described below.


First we have to have the xkb configured to support the Pandora keyboard. This is not default, as you might think. The Keyboard Layout pnd has the first preset described as "Default-pandora-US", but it's somewhat misleading. It probably describes an US external keyboard, but not the Pandora keyboard. If you apply this preset you will find most of the Fn keys not working. I have created the symbol map that covers all visible Pandora key symbols - the pandora file in the zip archive attached at the bottom of this guide. You need to copy this file to the /usr/share/X11/xkb/symbols/ directory (it will not replace any existing file, so don't worry about backups). You can open this file in a text editor to see it's contents, and include custom modifications. This file contains xkb symbol definitions in format:


key <code> { [ symbol1, symbol2 ] };


Where:


- code is the key code that will produce defined symbols. On the list there are almost all key codes that can be produced by Pandora keyboard. Almost all because the other ones (like Escape, function keys) work fine without mapping. You may add them if you want to remap their functions. The codes are not real key codes, but xkb mapped codes according to /usr/share/X11/xkb/keycodes/evdev file. Don't ask me why it is evdev and not xfree86 file - I have no idea. The numerical codes in evdev file are also not easy to find. You can guess most of them by looking at the ~/.pndXmodmap file.


- symbolx - these are symbols (characters) that the key code will generate. The first one to the left is generated while pressing the specified key alone (this is llevel 1), the second one is level 2 shift - usually generated while pressing Shift key along with the specified key. There can be more of them for level 3, 4, and so on shifts. I will shed some more light on this later. I said usually generated by Shift key, because in xkb this can be changed too. Though you don't have to bother with this now and assume that level 2 shift is always done with the Shift key.


For all available symbols look at the http://cgit.freedesk...ain/keysymdef.h file.


Next we have to define special symbols used in our language. As all symbols, the necessary files are located in the /usr/share/X11/xkb/symbols directory. Here you will find files named with country codes: pl, us, de, and so on. To make our keys working we have to make slight modifications to one of these files. First pick the right file for your language. I will describe all the changes on the pl file.


In the file we can find a section like this:



Code:
partial default alphanumeric_keys

xkb_symbols "basic" {


	include "latin"


	name[Group1]="Poland";


	key <AD03> { [		e,		E,		eogonek,	Eogonek ] };

	key <AD09> { [		o,		O,		 oacute,	 Oacute ] };

	...


	include "kpdl(comma)"

	include "level3(ralt_switch)"

};



I will describe only the lines that are interesting to us.

include "latin" - this is the line that causes the most of troubles. It includes another file from the symbols directory - latin, and that file contains definitions that break our Fn keys (because it has been designed for an external keyboard, not Pandora keyboard). So we need to replace it with our custom keyboard definition. Replace this line with:



include "pandora"



And we've got some sane base. Then we can define our precious national characters. The lines key <xxxx> {...}; have exactly the same meaning as in our pandora file. first the key code, next symbols that this code will produce. But here there are four of them for each key. This is because four shift levels are used. First is the symbol without any keys pressed (level 1), next with Shift pressed (level 2), next one is a symbol that will be produced when out modifier key is pressed (level 3), and the last one is the symbol produced with both Shift and the modifier key pressed at the same time (level 4). For Polish symbols the lines were already here (only one symbol was missing), so I didn't have to touch anything, but you can redefine this as you wish.



Next we have to actually tell xkb what our modifier key is. Yes, we can set it to our preferences as well! The line in question is include "level3(ralt_switch)". level3 is another file from symbols directory, that defines some common group-shifting utilities. Name in the parentheses (ralt_switch) is the name of the group that will be included here, and it tells which key will be used as our modifier. Most common ones are: ralt_switch - right Alt, lalt_switch - left Alt, switch - right Control. Look at the level3 file for more options.



When we have all this done, it's time to activate our settings. It can be done with the help of the Keyboard Layout pnd. You have to define a custom script with this content:





Code:
./setxkbmap -layout pl



Of course you should change pl to your country code, or more specifically, to the name of the file you have modified in the symbols directory.



If you want the modified keys to be loaded at startup, it's a bit more complicated. First you need the setxkbmap program to be outside of the Kayboar Layout pnd. I have included the program in the zip archive attached. You will have to copy it to the /usr/bin directory on your Pandora. But you cannot do this with Thunar, because the directory is only writable by root. You can either use terminal and sudo cp command for it, or place the program somewhere else, and call it from there. Once you have done this, open the .bashrc file from your home directory and add the following line to it:





Code:
setxkbmap -layout pl



Here is the zip package (it includes this guide too): http://kazekr.net/pn...tional_keys.zip



Drawbacks and how to deal with them:



The main drawback of this solution is that the remapped Alt or Control key will not be recognized by game emulators any more. The only working solution I have found so far is to switch the keyboard layouts on demand - again we can use the Keyboard Layout pnd for this. Just create an additional script for it that contains:





Code:
xmodmap /home/yourusername/.pndXmodmap



Selecting this script in the Keyboard Layout will call xmodmap program that will replace all xkb settings and restore the Pandora keyboard to default Layout (assumed that you haven't modified the .pndXmodmap file).



Yes, there already is a script provided by Keyboar Layout named Default-pandora-US that is supposed to do the same, but it doesn't work for me. The problem is that it contains this line: xmodmap ~/.pndXmodmap, which shoudl work, but it doesn't, and I don't know why. It seems that the .pndXmodmap file is looked for in the /mnt/utmp/kblayout directory instead of your home directory. I don't know why it's this way, maybe it's on my Pandora only.

UPDATE: slaeshjag says that it's because of the new PND management, and to work it around add HOME=$REALHOME as the first line of the keymap script.

ANOTHER UPDATE:

1. It should be $REAL_HOME, not $REALHOME

2. Apparently .pndXmodmap doesn't contain right Control definition, so if you set your modifier to that physical key (right shoulder button), xmodmap won't restore it. To make it working add the following like to .pndXmodmap file (in your home directory):



Code:
keycode 105 = Control_R VoidSymbol Control_R



I was also trying to set a combination of two keys (Ctrl + Alt) to be our modifier for national characters, but I have failed. Maybe I will return to it some time later.



Please don't ask me about xkb configuration, I know almost nothing, and what I achieved here was mostly by trials and errors :) .



And I found a solution for the SMPlayer issue too :)



You can dodge the problematic additional parameters by manually specifying which script to call from the pnd. So in the Open With dialog instead of the default





Code:
pnd_assoc smplayer2_r4 %f



type in:





Code:
pnd_assoc smplayer2_r4 smplayer2.sh %f


This will explicitly tell pnd_assoc to use smplayer2.sh script instead of searching it on it's own.
 
Last edited by a moderator:
So the reasonable solutions would be:


1. Make Windows recognize and use UTF-8 (possible?)


2. Make Pandora mount FAT cards with CP1250 encoding.


I have tried to do the latter, according to this article, but it didn't work. The article tells to call ipkg list 'kernel-module-nls-*' in order to find the available charsets. The is no ipkg on Pandora, but I have browsed /lib/modules/3.2.17/kernel/fs/nls/, and there are only two files there: nls_ascii.ko and nls_utf8.ko. I guess utf8 is default, so I tried using ascii one, and the result is similar (characters are still wrong). I guess I need an nls_cp1250.ko or nls_iso8859-2.ko files to make it work? Does anybody know how to get them? I don't mind compiling them by myself, I just need to know where to start :) .

I'm using the first solution (on Windows 7). I think generally using UTF-8 is better than permanently fiddling with different encodings.

A side-question: there are some German users around (like ED himself), and maybe some other users whose languages contain accented letters. How do you cope with the issue?

I'm German, too ;-) and I changed some more obscure symbols to the needed umlauts in .pndXmodmap.

For Polish it should be "pl_PL" - but it doesn't do anything for me (yes, I've rebooted after adding it).

At least Orage (the calender) now begins with Monday instead of Sunday and uses the German weekday abbreviations.
 
I'm using the first solution (on Windows 7). I think generally using UTF-8 is better than permanently fiddling with different encodings.
I have Windows 7 on my laptop, but it doesn't use UTF-8 by default. How did you make your to do so?

I'm German, too ;-) and I changed some more obscure symbols to the needed umlauts in .pndXmodmap.
Ah, right, but that won't work for me. Polish has twice more special characters than the number of obscure symbols on Pandora's keyboard :) .

For Polish it should be "pl_PL" - but it doesn't do anything for me (yes, I've rebooted after adding it).

At least Orage (the calender) now begins with Monday instead of Sunday and uses the German weekday abbreviations.
Hmm, pl_PL doesn't do any of these things for me, and in addition it prevents console from running. Strange things :blink:
 
Anyhow, there should be a way to specify iocharset for mount to use with SD cards. Does anybody know where this setting can be changed? I've seen nothing relevant in fstab.
 
Back
Top