Thursday, March 5, 2009

Java Midlet as a guitar tuner - fail & success :)

[Updated]

So, just about 2 days ago i started to play around with my nokia e51 phone and java midlets. After some frustration i managed to come up with an application that measures the sound frequencies for me. And all that just to leave me in trouble after all.

It turns out that the micrphone of a mobile phone is just awful :) Literally awful. Anything that goes below 150hz is not noticed ... which is the lower 3 strings of the guitar (82.4, 110.0, 146.8). After i fixed the buffer reading and decoding, i did get the higher frequencies correct, so at least that's good. I detect correctly the 3 higher strings of the guitar (329.6, 246.9, 196.0), not missing by an inch (tested with audacity).

It looks like a mission impossible to get a correct reading from this on it's own, for the lower frequencies, it just won't work. No matter what you measure ( FFT aka Fast Fourier Transforms, just zero crossing counting, whatever else ...), the pcm reading that you get isn't just accurate below 150hz. What a shame :(

Long story short : you need something a lot better than a mobile phone microphone, to get an audio tuning that is good enough to tune any kind of instrument (well maybe drums would work but :p, you get the idea)

psps. it's really easy to create java midlets if you have any idea how the language works

pspsps. i will keep the code around in my gmail box, i may need it one day :)

maybe i will give the same code a shot behind a pc mic as well, just to know how good sensitivity do those have.

Monday, February 9, 2009

Ordi Enduro 6490BF+

Sai siis ordis ikkagi 2ra k2idud, kuna ilmselgelt midagi asjalikumalt selles hinnaklassis turul pole.

Ordi Enduro 6490BF+

Mis siis selle kasti sees on ? :)

Ordi keeles:

Intel Core 2 Duo T6400, 4GB DDR2, 15,4" WXGA+,HDD 320GB,DVDRW,Intel 45PM chip,VGA 512MB NV9600M GT,klaviatuur ESTvõi US,Wifi,LAN,SD/MMC/MS,3xUSB,HDMI,veebikaamera, kaal 2,9kg, aku ~4,5t, Bluetooth, FP

Riistvara emakeeles


Protsessor: Intel(R) Core(TM)2 Duo CPU T6400 @ 2.00GHz
M2lu: 4GB RAM
Graafika: Nvidia Geforce 9600M GT (512MB)
Kiibistik: ICH9, ICH9M
Veebikaamera: Suyin Corp. Standard UVC
Heli: Intel HDA
Ketas: SAMSUNG HM320JI (320GB , SATA1)
DVD-RW: Optiarc DVD RW AD-7590S (SATA ? IDE ?)
Touchpad: ALPS GlidePoint
Ekraan: 1440x900 resolutsiooniga LCD


Mulisemist ka : LCD vaatenurk v6iks parem olla, k6vaketas ise on SATA2 v6imeline, aga ilmselt madal rpm v chipseti kiiksatus ei lase paremat v2lja suruda. Vahet pole tegelt, 70MByte/sec lugeda on ju kiire kyll (hdparm -tT), sylearvuti kohta.


riistvara linuxi keeles :



---
martin@repeator /tmp $ sudo lspci
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:01.0 PCI bridge: Intel Corporation Mobile 4 Series Chipset PCI Express Graphics Port (rev 07)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
00:1f.2 IDE interface: Intel Corporation ICH9M/M-E 2 port SATA IDE Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
00:1f.5 IDE interface: Intel Corporation ICH9M/M-E 2 port SATA IDE Controller (rev 03)
01:00.0 VGA compatible controller: nVidia Corporation GeForce 9600M GT (rev a1)
0e:00.0 Network controller: Intel Corporation PRO/Wireless 5300 AGN [Shiloh] Network Connection
14:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
1a:00.0 System peripheral: JMicron Technologies, Inc. SD/MMC Host Controller
1a:00.2 SD Host controller: JMicron Technologies, Inc. Standard SD Host Controller
1a:00.3 System peripheral: JMicron Technologies, Inc. MS Host Controller
1a:00.4 System peripheral: JMicron Technologies, Inc. xD Host Controller
---


ja usb toru otsast vaatab vastu :


---
martin@repeator /tmp $ sudo lsusb
Bus 005 Device 001: ID 1d6b:0001
Bus 002 Device 003: ID 064e:a115 Suyin Corp.
Bus 002 Device 001: ID 1d6b:0002
Bus 008 Device 002: ID 046d:c016 Logitech, Inc. M-UV69a Optical Wheel Mouse
Bus 008 Device 001: ID 1d6b:0001
Bus 007 Device 001: ID 1d6b:0001
Bus 004 Device 001: ID 1d6b:0001
Bus 003 Device 002: ID 0a5c:2151 Broadcom Corp.
Bus 003 Device 001: ID 1d6b:0001
Bus 006 Device 002: ID 147e:1000
Bus 006 Device 001: ID 1d6b:0001
Bus 001 Device 001: ID 1d6b:0002
---


See optical mouse on siis minu hiireke :$

Suyin Corp - uvc tyypi kaamera
Broadcom - bluetooth ( BCM2046 Bluetooth Device )

Et siis, asjad mis siiamaani t88tavad


---
nimi : kerneli moodul

default inteli sound : snd_hda_intel
nvidia 9600m gt : nvidia
kaamera : uvcvideo
sd kaardi lugeja : sdhci_pci (moodul laetud, testida pole viitsind)
bluetooth : btusb (moodul laetud, testida pole viitsind)
wifi : iwlagn, iwlcore , inteli wifi 5300 firmware (suur socketite arv tundub lollitavat)
lan : r8169 (t88tab kenasti, suured failid said selle kaudu kopeeritud)
---


//

xorg.conf-is tuleb synapticsi juurde imetrikke teha et scrollimine fungaks kenasti :


---
Option "VertEdgeScroll" "true"
Option "HorizEdgeScroll" "true"
Option "RightEdge" "900"
Option "BottomEdge" "600"


Muidu on need servad liiga kaugel ja asi ei funka normaalselt v yldse scrollimiseks.

Ah et s6rmej2ljelugejast ? Pole aimugi :D

lisaks veel neile kes T6400 kohta ammulisui otsivad :


#cat /proc/cpuinfo

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T6400 @ 2.00GHz
stepping : 10
cpu MHz : 1200.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm
bogomips : 3989.85
clflush size : 64
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T6400 @ 2.00GHz
stepping : 10
cpu MHz : 1200.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm
bogomips : 3989.79
clflush size : 64
power management:


// grep x86info kasulikust infost
CPU Model: Core 2 Duo
Processor name string: Intel(R) Core(TM)2 Duo CPU T6400 @ 2.00GHz

Cache info
L1 Instruction cache: 32KB, 8-way associative. 64 byte line size.
L1 Data cache: 32KB, 8-way associative. 64 byte line size.
L2 unified cache: 2MB, sectored, 8-way associative. 64 byte line size.
TLB info
Instruction TLB: 4x 4MB page entries, or 8x 2MB pages entries, 4-way associative
Instruction TLB: 4K pages, 4-way associative, 128 entries.
Data TLB: 4MB pages, 4-way associative, 32 entries
L1 Data TLB: 4KB pages, 4-way set associative, 16 entries
L1 Data TLB: 4MB pages, 4-way set associative, 16 entries
Data TLB: 4K pages, 4-way associative, 256 entries.
64 byte prefetching.
Feature flags:
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflsh ds acpi mmx fxsr sse sse2 ss ht tm pbe
Extended feature flags:
sse3 [2] monitor ds-cpl est tm2 ssse3 cx16 xTPR [15] [19] [26] [27]




Skaleerub : 1.2 , 1.6 , 2.0 GHz kaudu