embeded/raspberry pi2018. 9. 10. 19:26

USB 사운드 카드가 잠시 생겨 일단 테스트 해보고 싶은 마음에 찾아보니..


arecord --device=hw:1,0 --format S16_LE --rate 44100 -c1 test.wav -V mono

aplay --device=plughw:1,0 test.wav 

[링크 : https://www.instructables.com/id/How-to-Record-Voice-With-USB-Microphone-Then-Play-/]


speaker-test -c2 -D plughw:1,0 

[링크 : https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/testing-audio]

[링크 : https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/recording-audio]

[링크 : https://scribles.net/voice-recording-on-raspberry-pi/]


[링크 : https://linux.die.net/man/1/arecord]


+

[433655.786504] usb 1-1.4: new full-speed USB device number 4 using dwc_otg

[433655.924800] usb 1-1.4: New USB device found, idVendor=0d8c, idProduct=013c

[433655.924820] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0

[433655.924831] usb 1-1.4: Product: USB PnP Sound Device

[433655.936390] input: USB PnP Sound Device as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3/0003:0D8C:013C.0001/input/input1

[433656.007216] hid-generic 0003:0D8C:013C.0001: input,hidraw0: USB HID v1.00 Device [USB PnP Sound Device] on usb-3f980000.usb-1.4/input3

[433656.114545] usbcore: registered new interface driver snd-usb-audio 


$ arecord -l

**** List of CAPTURE Hardware Devices ****

card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]

  Subdevices: 1/1

  Subdevice #0: subdevice #0 


$ aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]

  Subdevices: 8/8

  Subdevice #0: subdevice #0

  Subdevice #1: subdevice #1

  Subdevice #2: subdevice #2

  Subdevice #3: subdevice #3

  Subdevice #4: subdevice #4

  Subdevice #5: subdevice #5

  Subdevice #6: subdevice #6

  Subdevice #7: subdevice #7

card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]

  Subdevices: 1/1

  Subdevice #0: subdevice #0 


일단 해보는데 극성이 문제인지

그냥은 안되고 마이크 쇼트 시키니 볼륨 메터가 뜨긴 한다.


결론 : 되긴하는데 마이크를 잘 골라야 할지도?


+

2019.09.11

윈도우에서 꽂으니 아래와 같은 식별자로 뜬다.

일단은(?) CM108 인듯?


[링크 : https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/figure-out-your-chipset]

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=74982]

'embeded > raspberry pi' 카테고리의 다른 글

라즈비안 업데이트  (0) 2018.09.11
node.js on rpi  (0) 2018.09.11
라즈베리 파이 SPI 속도  (0) 2018.05.18
라즈베리 2B + waveshare 35a + MAME 0.182  (0) 2018.05.18
odroid u3 headless setup중 문제..  (0) 2018.05.14
Posted by 구차니
embeded/raspberry pi2018. 5. 18. 15:56

SPI 설정이 무한대로 되는건 아니고

250MHz를 분기해서 쓰는데

일단은.. SPI LCD 쓰는데 62M를 설정해주면 통신 속도를 못 버티는지 색이 깨진다.

60보다 낮은건 31.2MHz 인가?

아무튼 40메가로 설정해도 일단은 돌아가는 가네..


SPEED

The driver supports the following speeds:


  cdiv    speed

     2    125.0 MHz

     4     62.5 MHz

     8     31.2 MHz

    16     15.6 MHz

    32      7.8 MHz

    64      3.9 MHz

   128     1953 kHz

   256      976 kHz

   512      488 kHz

  1024      244 kHz

  2048      122 kHz

  4096       61 kHz

  8192     30.5 kHz

 16384     15.2 kHz

 32768     7629 Hz 

[링크 : https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md]

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=43442&p=347073]

'embeded > raspberry pi' 카테고리의 다른 글

node.js on rpi  (0) 2018.09.11
라즈베리 파이 USB 사운드 카드로 녹음 및 재생하기  (4) 2018.09.10
라즈베리 2B + waveshare 35a + MAME 0.182  (0) 2018.05.18
odroid u3 headless setup중 문제..  (0) 2018.05.14
rpi firmata  (0) 2018.05.11
Posted by 구차니
embeded/raspberry pi2018. 5. 18. 10:01

귀찮으니 img 받아서 그냥 까세요 수준으로 대격변 ㄷㄷ

[링크 : https://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)]


귀찮아서.. 스크립트 분석하면 될걸.. 썡으로 뒤지는중


일단 화면 갱신이 꽤나 느린데

/etc $ grep -rni "fbcp" ./

./rc.local:21:fbcp &

[링크 : https://github.com/tasanakorn/rpi-fbcp]


동영상을 보면 확실히 fbcp를 통해 복사하는거라 그런지 화면 갱신이 느리다. (cpu는 5% 미만이긴 하지만)


그래서 아래처럼 설정하고 다시 찰칵

기분인진 몰라도 확실히 좀 빨라진 기분?


$ cat /boot/config.txt

# For more options and information see

# http://www.raspberrypi.org/documentation/configuration/config-txt.md

# Some settings may impact device functionality. See link above for details


# uncomment if you get no picture on HDMI for a default "safe" mode

#hdmi_safe=1


# uncomment this if your display has a black border of unused pixels visible

# and your display can output without overscan

#disable_overscan=1


# uncomment the following to adjust overscan. Use positive numbers if console

# goes off screen, and negative if there is too much border

#overscan_left=16

#overscan_right=16

#overscan_top=16

#overscan_bottom=16


# uncomment to force a console size. By default it will be display's size minus

# overscan.

#framebuffer_width=1280

#framebuffer_height=720


# uncomment if hdmi display is not detected and composite is being output

#hdmi_force_hotplug=1


# uncomment to force a specific HDMI mode (this will force VGA)

#hdmi_group=1

#hdmi_mode=1


# uncomment to force a HDMI mode rather than DVI. This can make audio work in

# DMT (computer monitor) modes

#hdmi_drive=2


# uncomment to increase signal to HDMI, if you have interference, blanking, or

# no display

#config_hdmi_boost=4


# uncomment for composite PAL

#sdtv_mode=2


#uncomment to overclock the arm. 700 MHz is the default.

#arm_freq=800


# Uncomment some or all of these to enable the optional hardware interfaces

dtparam=i2c_arm=on

#dtparam=i2s=on

dtparam=spi=on

#enable_uart=1

# Uncomment this to enable the lirc-rpi module

#dtoverlay=lirc-rpi


# Additional overlays and parameters are documented /boot/overlays/README


# Enable audio (loads snd_bcm2835)

dtparam=audio=on

dtoverlay=waveshare35a:rotate=270

#dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swapxy=1,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900

#hdmi_force_hotplug=1

#max_usb_current=1

#hdmi_group=2

#hdmi_mode=1

#hdmi_mode=87

#hdmi_cvt 480 320 60 6 0 0 0

#hdmi_drive=2

#display_rotate=2 


[링크 : https://github.com/swkim01/waveshare-dtoverlays/issues/7]


$ cat /usr/share/X11/xorg.conf.d/99-fbturbo.conf

# This is a minimal sample config file, which can be copied to

# /etc/X11/xorg.conf in order to make the Xorg server pick up

# and load xf86-video-fbturbo driver installed in the system.

#

# When troubleshooting, check /var/log/Xorg.0.log for the debugging

# output and error messages.

#The driver is made by Waveshare&Spotpear

# Run "man fbturbo" to get additional information about the extra

# configuration options for tuning the driver.


Section "Device"

        Identifier      "Allwinner A10/A13 FBDEV"

        Driver          "fbturbo"

        Option          "fbdev" "/dev/fb0"


        Option          "SwapbuffersWait" "true"

EndSection



Section "Device"

        Identifier      "Waveshare 35a spi"

        Driver          "fbturbo"

        Option          "fbdev" "/dev/fb1"


        Option          "SwapbuffersWait" "true"

EndSection


Section "Monitor"

        Identifier      "primary"

EndSection


Section "Screen"

        Identifier      "primary"

        Device          "Waveshare 35a spi"

        Monitor         "rpi spi"

EndSection 


일단 mame를 깔고

$ sudo apt-get install gnome-video-arcade mame mame-tools

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  liblua5.3-0 libsdl2-2.0-0 libsdl2-ttf-2.0-0 mame-data

Suggested packages:

  devhelp mame-doc mame-extra

The following NEW packages will be installed:

  gnome-video-arcade liblua5.3-0 libsdl2-2.0-0 libsdl2-ttf-2.0-0 mame

  mame-data mame-tools

0 upgraded, 7 newly installed, 0 to remove and 49 not upgraded.

Need to get 45.0 MB of archives. 


gnome 어쩌구 말고

mame를 실행하니 CPU는 미쳐 날뛰고(라즈베리 2B인데 오버 해야하나..)


/dev/fb1 덤프해서 보니 RGB565 480x320으로 복원



+

HDMI로 해도 느린건 마찬가지(아니 해상도 높아져서 더 느려진 기분.. 실행이 안되고 뻗는 수준?)

0.78 구버전을 구해서 빌드 해보려니 소스를 못 받는다.. 아놔

Posted by 구차니
embeded/raspberry pi2018. 5. 14. 11:30

0. MAC address 및 호스트 이름 설정

$ sudo vi /etc/smsc95xx_mac_addr


1. 로케일 설정

~$ pptpsetup

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

        LANGUAGE = (unset),

        LC_ALL = (unset),

        LC_PAPER = "en",

        LC_ADDRESS = "en",

        LC_MONETARY = "en",

        LC_NUMERIC = "en",

        LC_TELEPHONE = "en",

        LC_IDENTIFICATION = "en",

        LC_MEASUREMENT = "en",

        LC_TIME = "en",

        LC_NAME = "en",

        LANG = (unset)

    are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

/usr/sbin/pptpsetup: too few arguments.

Try '/usr/sbin/pptpsetup --help' for more information. 


#/etc/environment

LANG="ko_KR.utf8"

LANGUAGE="ko_KR;ko;en_GB;en"

LC_ALL="ko_KR.utf8" 

[링크 : https://forum.ubuntu-kr.org/viewtopic.php?t=18025]



'embeded > raspberry pi' 카테고리의 다른 글

라즈베리 파이 SPI 속도  (0) 2018.05.18
라즈베리 2B + waveshare 35a + MAME 0.182  (0) 2018.05.18
rpi firmata  (0) 2018.05.11
라즈베리 2B 효용성에 대해서...  (2) 2018.05.09
rpi 3b PMIC  (0) 2018.04.23
Posted by 구차니
embeded/raspberry pi2018. 5. 11. 17:51

비얌 만세.. ㄷㄷ


Arduino에 firmata 펌웨어 올리고

아두이노와 라즈베리는 시리얼을 통해서 통신을 함


[링크 : https://raspberrypi-aa.github.io/session3/firmata.html]

'embeded > raspberry pi' 카테고리의 다른 글

라즈베리 2B + waveshare 35a + MAME 0.182  (0) 2018.05.18
odroid u3 headless setup중 문제..  (0) 2018.05.14
라즈베리 2B 효용성에 대해서...  (2) 2018.05.09
rpi 3b PMIC  (0) 2018.04.23
rpi img 생성하기  (0) 2018.04.18
Posted by 구차니
embeded/raspberry pi2018. 5. 9. 09:39

고민을 해보니..

apache + php + mysql + phpmyadmin 돌리는데

2.5W 정도 먹는 상황


비슷하게 설정한 odroid U3가

성능은 훨신 쾌적한데 약간 더 먹는 2.7W 정도?


라즈베리 3B+ 이런거랑 Odroid U3가 비교가 될지 모르겠지만

[링크 : https://www.datenreise.de/en/raspberry-pi-3b-and-3b-in-comparison/]


간접적으로 XU4(Exynos5422 Cortex™-A15 2Ghz and Cortex™-A7 Octa core CPUs)

Odroid U3(1.7GHz Exynos4412 Prime Cortex-A9 1.7GHz Quad-core processor)

일단 3B랑 3B+이랑 비교하면 클럭만 10% 정도 증가이기에 성능 상승폭은 그리 크지 않을 것으로 보이고

아래 벤치마크만 본다면 3b보다 u3가 나을 것으로 예상된다.

[링크 : http://www.hardkernel.com/main/products/prdt_info.php?g_code=G143452239825]

[링크 : https://magazine.odroid.com/wp-content/uploads/ODROID-Magazine-201401.pdf]


아무튼..

랜도 별도의 USB 포트를 이용하기에 라즈베리 보다 병목도 적을꺼고..

이래저래 소비전력을 따라잡은 상황에서는 라즈베리 2b 빼고 U3로 갈아타는것도 방법일 듯..

'embeded > raspberry pi' 카테고리의 다른 글

odroid u3 headless setup중 문제..  (0) 2018.05.14
rpi firmata  (0) 2018.05.11
rpi 3b PMIC  (0) 2018.04.23
rpi img 생성하기  (0) 2018.04.18
라즈베리 저전력 관련 설정  (0) 2018.04.17
Posted by 구차니
embeded/raspberry pi2018. 4. 23. 14:16

오.. 어떤식으로 쓸 수 있을지 모르겠지만

라즈베리 3B 되면서 PMIC가 장착되었다고 한다.


근데 벤치상에... 3B는 그나마 양호한데..

3B+의 자비없는 대기전력.. ㄷㄷ (생각해보면 Odroid U3 급이긴 한데 성능은 누가 나으려나?)

[링크 : https://www.raspberrypi.org/magpi/raspberry-pi-specs-benchmarks/]


Witty Pi 라는 HAT은 RTC와 Power on/off 기능 추가

전원 버튼이 HAT에 추가되고 그걸 누르면 On 되고

On 상태에서 Off를 누르면 라즈베리가 SW적으로 종료절차를 따르게 된다.

Suspend도 지원하는 매력적인 녀석 (23.04USD 꽤 쎄네...)

[링크 : http://www.uugear.com/witty-pi-realtime-clock-power-management-for-raspberry-pi/]

  [링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=149008]


I2C를 켜라고 하는것 봐서는 I2C를 통해 리눅스에게 전원 On/Off 상태를 알려주도록 되어 있는 듯?

Please notice that sudo is necessary to run this script. This script will automatically do 

these tasks in order:

1. Enable I2C on your Raspberry Pi

2. Install i2cctools, if it is not installed yet

3. Configure Bluetooth to use minicUART (Raspberry Pi 3 only)

4. Install wiringPi, if it is not installed yet

5. Install Witty Pi programs, if they are not installed yet

[링크 : http://www.uugear.com/doc/WittyPi_UserManual.pdf]



3B+은 2018년 3월 출시되었고

CPU 클럭 1.2->1.4로 상향

기가비트 이더넷 추가, PoE Ready

802.11ac 추가

의 차이가 존재한다.

[링크 : https://www.datenreise.de/en/raspberry-pi-3b-and-3b-in-comparison/]

'embeded > raspberry pi' 카테고리의 다른 글

rpi firmata  (0) 2018.05.11
라즈베리 2B 효용성에 대해서...  (2) 2018.05.09
rpi img 생성하기  (0) 2018.04.18
라즈베리 저전력 관련 설정  (0) 2018.04.17
라즈베리 파이 배포용 이미지 만들기  (0) 2018.02.23
Posted by 구차니
embeded/raspberry pi2018. 4. 18. 17:45

생각해보니 예전에 i.MX283 에

dd로 생성한 img 굽다가 실패한 이유가..

단순 dd로 만들고 나서 

mkfs로 포맷만 했기 때문이려나?


아래 스크립트에서는

dd로 생성 후

fdisk로 파티션을 만들고

mkfs.vfat과 mkfs.ext4로 포맷을 해주도록 되어있다.


[링크 : https://github.com/andrius/build-raspbian-image/blob/master/raspbian/build_raspbian_sd_card.sh]

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=41520]

Posted by 구차니
embeded/raspberry pi2018. 4. 17. 15:29


Edit /boot/cmdline.txt and add maxcpus=N

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=99372]

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=152692]


USB 허브 끄기 - 단, 네트워크도 죽어버림(그럼 도대체 어떻게 쓰란거지 -ㅁ-?)

#!/bin/bash

#Code to stop

/etc/init.d/networking stop

echo 0 > /sys/devices/platform/bcm2708_usb/buspower;

echo “Bus power stopping”


#!/bin/bash

#Code to start

echo 1 > /sys/devices/platform/bcm2708_usb/buspower;

echo “Bus power starting”

sleep 2;

/etc/init.d/networking start 


video output 끄기

This tip has been suggested by many people. If your system is headless (no video output) you can turn off the HDMI port with:

sudo /opt/vc/bin/tvservice -o

to turn it back on:

sudo /opt/vc/bin/tvservice -p

This command will save you around 20-30mA. 

[링크 : https://babaawesam.com/2014/01/24/power-saving-tips-for-raspberry-pi/]


/sys/devices/system/cpu/cpu0/online 이 있으면 논리적으로 on/off 가능하다는데

라즈베리에는 

/sys/devices/system/cpu/online

/sys/devices/system/cpu/offline 만 존재한다.

[링크 : https://stackoverflow.com/questions/44907731/programmatically-disable-cpu-core]


+

$ chcpu


Usage:

 chcpu [options]


Options:

  -h, --help                    print this help

  -e, --enable <cpu-list>       enable cpus

  -d, --disable <cpu-list>      disable cpus

  -c, --configure <cpu-list>    configure cpus

  -g, --deconfigure <cpu-list>  deconfigure cpus

  -p, --dispatch <mode>         set dispatching mode

  -r, --rescan                  trigger rescan of cpus

  -V, --version                 output version information and exit 


라즈베리에서는 안되네..

$ sudo chcpu -r

chcpu: This system does not support rescanning of CPUs

$ sudo chcpu -e 2

chcpu: CPU 2 is not hot pluggable 

[링크 : https://www.ibm.com/support/knowledgecenter/en/linuxonibm/com.ibm.linux.z.lgdd/lgdd_t_cpu_online.html]


+

/sys/devices/system/cpu/cpufreq/ondemand $ cat up_threshold

50 

[링크 : https://raspberrypi.stackexchange.com/questions/9034/how-to-change-the-default-governor]

'embeded > raspberry pi' 카테고리의 다른 글

rpi 3b PMIC  (0) 2018.04.23
rpi img 생성하기  (0) 2018.04.18
라즈베리 파이 배포용 이미지 만들기  (0) 2018.02.23
라즈베리 파이 번개모양 아이콘  (2) 2018.02.19
rpi config.txt avoid_safe_mode=1  (0) 2018.02.18
Posted by 구차니
embeded/raspberry pi2018. 2. 23. 19:34

예전부터 찾던건데 잊고 있다가 다시 검색

라즈베리 같은거 보면 img 파일로 배포하는데

내가 아는 img 만드는 방법은 SD 메모리에서 dd로 덤프하는 것 -_-

용량 크면 의미도 없고 작게 만들기 힘들어서

시도해봤던게


dd로 가상 파일 만들고

dd로 만든 파일을 파일시스템 만들어서 마운트 하고

거기다 쑤셔 박고 땡~ 하는 거였는데


전에 회사에서 막상 해보니 정상작동하지 않는 문제가 있어서 완료하지 못했는데

배포하는 방법을 찾으면 될 걸 왜 생각을 못했을까..


[링크 : https://raspberrypi.stackexchange.com/.../build-custom-raspbian-jessie-distribution-image-from-source]

[링크 : https://github.com/RPi-Distro/pi-gen]

[링크 : https://github.com/ShorTie8/my_pi_os]

[링크 : https://github.com/TheSin-/rpi-img-builder]

'embeded > raspberry pi' 카테고리의 다른 글

rpi img 생성하기  (0) 2018.04.18
라즈베리 저전력 관련 설정  (0) 2018.04.17
라즈베리 파이 번개모양 아이콘  (2) 2018.02.19
rpi config.txt avoid_safe_mode=1  (0) 2018.02.18
블투 동글이 비싸!  (0) 2018.02.17
Posted by 구차니