'라이눅스'에 해당되는 글 3건

  1. 리눅스에서 노트북 내장 스피커가 나오지 않을 때 (intel sound card) (6) 2008/10/09
  2. pxa270tku ramdisk booting (2) 2008/04/07
  3. 코드테스트 2007/12/30
여기서 이야기 하고자 하는 문제는
리눅스를 운영체제로 사용하는 노트북에서 이어폰으로는 소리가 나오지만
정작 내장스피커로는 소리가 나오지 않는 경우이다.

이어폰을 꽂았는데도 내장스피커와 이어폰에서 동시에 소리가 나오는 경우와
아니면 아예 어떤 소리도 나오지 않는 경우는
짧은 검색을 통해 그 해결책을 쉽게 찾을 수 있지만
이 글에서 언급하고자 하는 문제는 그 해결책을 찾아내기가 쉽지 않다.
(찾고 포기하고 찾기를 길게는 2년 정도 한 거 같다. @_@;;)

이 문제는 Intel onboard HDA (High Definition Audio)에서 발생하는데
sound stack (각 output의 배열)을 제대로 찾지 못해 발생하는 문제라고 한다.

일반적으로

/etc/modprobe.d/alsa-base

의 가장 아랫 줄에

options snd-hda-intel model=3stack 이나 options snd-hda-intel model=6stack

를 추가함으로써 문제를 해결할 수 있었다. 하지만 HDA 사운드카드의 경우
그 종류에 따라 이 문제의 해결에 영향을 미치는 요소가 다양하기 때문에 해결이 쉽지 않다.

우선

cat /proc/asound/card0/codec#* | grep Codec  이나  aplay -l 을 통해서 카드나 칩의 종류를
파악한다.

ex)
Codec
Codec: Realtek ALC880
Codec: Generic 11c1 Si3054

그 다음 아래 첨부된 리스트에서 해당하는 부분을 참조한다.
위에 보인 예시를 이용해 보면 ALC880을 아래 목록에서 찾고

그 다음 자기 컴퓨터에 맞는 모델이름을 사용하는 것이다. 만약 LG 노트북일 경우
( 아래 lg가 있다. )

options snd-hda-intel model=lg

를 /etc/modprobe.d/alsa-base  가장 아랫 줄에 추가해 주면 된다.
만약 작동하지 않는다면 ALC880  아래의 다른 줄의 모델 이름들을 사용해 본다.

options snd-hda-intel model=uniwill
options snd-hda-intel model=fujitsu
options snd-hda-intel model=tcl

처럼 말이다. 물론 이 과정을 되풀이 하면서 사운드설정에서 음소거가 되어 있는지
확인해 볼 필요가 있다. 물론 리부팅도.

이 글의 출처는 우분투 포럼의
http://ubuntuforums.org/showthread.php?t=616845&highlight=ALC880 이다.

이것은 우분투닷컴의 어찌보면 정식발매 솔루션이겠네요
https://help.ubuntu.com/community/HdaIntelSoundHowto

Model name Description
---------- -----------
ALC880
3stack 3-jack in back and a headphone out
3stack-digout 3-jack in back, a HP out and a SPDIF out
5stack 5-jack in back, 2-jack in front
5stack-digout 5-jack in back, 2-jack in front, a SPDIF out
6stack 6-jack in back, 2-jack in front
6stack-digout 6-jack with a SPDIF out
w810 3-jack
z71v 3-jack (HP shared SPDIF)
asus 3-jack (ASUS Mobo)
asus-w1v ASUS W1V
asus-dig ASUS with SPDIF out
asus-dig2 ASUS with SPDIF out (using GPIO2)
uniwill 3-jack
fujitsu Fujitsu Laptops (Pi1536)
F1734 2-jack
lg LG laptop (m1 express dual)
lg-lw LG LW20/LW25 laptop
tcl TCL S700
clevo Clevo laptops (m520G, m665n)
test for testing/debugging purpose, almost all controls can be
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)

ALC260
hp HP machines
hp-3013 HP machines (3013-variant)
fujitsu Fujitsu S7020
acer Acer TravelMate
will Will laptops (PB V7900)
replacer Replacer 672V
basic fixed pin assignment (old default model)
auto auto-config reading BIOS (default)

ALC262
fujitsu Fujitsu Laptop
hp-bpc HP xw4400/6400/8400/9400 laptops
hp-bpc-d7000 HP BPC D7000
benq Benq ED8
benq-t31 Benq T31
hippo Hippo (ATI) with jack detection, Sony UX-90s
hippo_1 Hippo (Benq) with jack detection
sony-assamd Sony ASSAMD
basic fixed pin assignment w/o SPDIF
auto auto-config reading BIOS (default)

ALC268
3stack 3-stack model
toshiba Toshiba A205
acer Acer laptops
auto auto-config reading BIOS (default)

ALC662
3stack-dig 3-stack (2-channel) with SPDIF
3stack-6ch 3-stack (6-channel)
3stack-6ch-dig 3-stack (6-channel) with SPDIF
6stack-dig 6-stack with SPDIF
lenovo-101e Lenovo laptop
auto auto-config reading BIOS (default)

ALC882/885
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
arima Arima W820Di1
targa Targa T8, MSI-1049 T8
asus-a7j ASUS A7J
asus-a7m ASUS A7M
macpro MacPro support
mbp3 Macbook Pro rev3
imac24 iMac 24'' with jack detection
w2jc ASUS W2JC
auto auto-config reading BIOS (default)

ALC883/888
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
3stack-6ch 3-jack 6-channel
3stack-6ch-dig 3-jack 6-channel with SPDIF I/O
6stack-dig-demo 6-jack digital for Intel demo board
acer Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc)
acer-aspire Acer Aspire 9810
medion Medion Laptops
medion-md2 Medion MD2
targa-dig Targa/MSI
targa-2ch-dig Targs/MSI with 2-channel
laptop-eapd 3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE)
lenovo-101e Lenovo 101E
lenovo-nb0763 Lenovo NB0763
lenovo-ms7195-dig Lenovo MS7195
haier-w66 Haier W66
6stack-hp HP machines with 6stack (Nettle boards)
3stack-hp HP machines with 3stack (Lucknow, Samba boards)
auto auto-config reading BIOS (default)

ALC861/660
3stack 3-jack
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack with SPDIF I/O
3stack-660 3-jack (for ALC660)
uniwill-m31 Uniwill M31 laptop
toshiba Toshiba laptop support
asus Asus laptop support
asus-laptop ASUS F2/F3 laptops
auto auto-config reading BIOS (default)

ALC861VD/660VD
3stack 3-jack
3stack-dig 3-jack with SPDIF OUT
6stack-dig 6-jack with SPDIF OUT
3stack-660 3-jack (for ALC660VD)
3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD)
lenovo Lenovo 3000 C200
dallas Dallas laptops
hp HP TX1000
auto auto-config reading BIOS (default)

CMI9880
minimal 3-jack in back
min_fp 3-jack in back, 2-jack in front
full 6-jack in back, 2-jack in front
full_dig 6-jack in back, 2-jack in front, SPDIF I/O
allout 5-jack in back, 2-jack in front, SPDIF out
auto auto-config reading BIOS (default)

AD1882
3stack 3-stack mode (default)
6stack 6-stack mode

AD1884
N/A

AD1981
basic 3-jack (default)
hp HP nx6320
thinkpad Lenovo Thinkpad T60/X60/Z60
toshiba Toshiba U205

AD1983
N/A

AD1984
basic default configuration
thinkpad Lenovo Thinkpad T61/X61

AD1986A
6stack 6-jack, separate surrounds (default)
3stack 3-stack, shared surrounds
laptop 2-channel only (FSC V2060, Samsung M50)
laptop-eapd 2-channel with EAPD (Samsung R65, ASUS A6J)
laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
ultra 2-channel with EAPD (Samsung Ultra tablet PC)

AD1988
6stack 6-jack
6stack-dig ditto with SPDIF
3stack 3-jack
3stack-dig ditto with SPDIF
laptop 3-jack with hp-jack automute
laptop-dig ditto with SPDIF
auto auto-config reading BIOS (default)

Conexant 5045
laptop Laptop config
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y

Conexant 5047
laptop Basic Laptop config
laptop-hp Laptop config for some HP models (subdevice 30A5)
laptop-eapd Laptop config with EAPD support
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y

STAC9200
ref Reference board
dell-d21 Dell (unknown)
dell-d22 Dell (unknown)
dell-d23 Dell (unknown)
dell-m21 Dell Inspiron 630m, Dell Inspiron 640m
dell-m22 Dell Latitude D620, Dell Latitude D820
dell-m23 Dell XPS M1710, Dell Precision M90
dell-m24 Dell Latitude 120L
dell-m25 Dell Inspiron E1505n
dell-m26 Dell Inspiron 1501
dell-m27 Dell Inspiron E1705/9400

STAC9205/9254
ref Reference board
dell-m42 Dell (unknown)
dell-m43 Dell Precision
dell-m44 Dell Inspiron

STAC9220/9221
ref Reference board
3stack D945 3stack
5stack D945 5stack + SPDIF
intel-mac-v1 Intel Mac Type 1
intel-mac-v2 Intel Mac Type 2
intel-mac-v3 Intel Mac Type 3
intel-mac-v4 Intel Mac Type 4
intel-mac-v5 Intel Mac Type 5
macmini Intel Mac Mini (equivalent with type 3)
macbook Intel Mac Book (eq. type 5)
macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3)
macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3)
imac-intel Intel iMac (eq. type 2)
imac-intel-20 Intel iMac (newer version) (eq. type 3)
dell-d81 Dell (unknown)
dell-d82 Dell (unknown)
dell-m81 Dell (unknown)
dell-m82 Dell XPS M1210

STAC9202/9250/9251
ref Reference board, base config
m2-2 Some Gateway MX series laptops
m6 Some Gateway NX series laptops
pa6 Gateway NX860 series

STAC9227/9228/9229/927x
ref Reference board
3stack D965 3stack
5stack D965 5stack + SPDIF
dell-3stack Dell Dimension E520

STAC9872
vaio Setup for VAIO FE550G/SZ110
vaio-ar Setup for VAIO AR

pxa270tku ramdisk booting

from 라이눅스 2008/04/07 01:36
hibus 사의 xhyper270tku를 ramdisk로 부팅하는 방법을 알아보자


우선 bootp와 tftp 기본 설정이 되어 있다는 가정 하에서 rootfs를 이용한 파일시스템이 아닌
ramdisk 를 이용한 파일시스템을 사용하기 위해서는 커널 컴파일을 다시 해야 한다. ~_~;;
뭐 이미 ramdisk 관련 옵션을 활성화 시켰다면 문제는 쉬워질 수 있다. 그렇다 쉬워질 수도 있다.
자 그럼 세세한 부분으로 진행하기에 앞서 기본 베이스에 대해 간략한 복습을 선행해 보자.
일단 pxa270tku 의 경우 SDRAM 128M, flashROM 32M 의 기본 리소스를 가지고 있다. 부팅 시
이 flashROM에 write 해 놨던 걸 boot loader가 주어진 메모리 멥 구성에 알맞게 SDRAM 으로
kernel이나, rootfs, ramdisk 등등을 다운로드하는 하는 것이다. 여기서 체크!
오늘 우리가 뽀개려고 하는 ramdisk.
ramdisk는 말 그대로 ram을 disk처럼 쓰겠다는 것이다. 원래 주메모리인 SDRAM은 우리가 일반 디스크
를 사용하는 방법과는 약간 다른 명령어를 써서 접근해야 하는데 이 SDRAM의 일정 부분을 mount 해서
일반디스크와 같이 사용하겠다는 것이다. 당연히 disk 보다 SDRAM에 대한 접근과 처리가 빠르므로 우리가
의도한 작업들을 보다 빨리 처리할 수 있게 된다는 이야기다. 자 잡설은 여기까지

커널컴파일 시

'make xhyper270tku_defconfig' 를 통해 우리가 타켓으로 하는 270tku 보드에 기본적으로 필요한
옵션들을 쉽게 설정할 수 있다. 이렇게 베이스를 깔아 놓고

'make menuconfig'
로 들어가서 우선 'block device' . 여기서 아래 그림과 같이 옵션을 활성화 시켜 준다. ramdisk 용량은
물론 만들고자 하는 ramdisk 이미지를 고려해야 한다.

사용자 삽입 이미지


주의!!! 하지만, 한가지 주의해야 하는데 SDRAM 이 아닌 flashROM의 경우 ramdisk 영역으로 할당된 부분이
3M인 거 같다. 이거 자세한 건 메뉴얼을 좀 봐야 하겠지만, 나의 경우는 그러했다. 그래서 나중에
ramdisk 를 만들고 gzip 으로 압축할 때 이 크기를 고려해야 한다. 뭐 flashROM에 안쓰고 SDRAM
에서만 일회용으로 돌릴거라면 크게 문제는 없다. 만약 이렇게 돌리고 싶다면 boot loader에서 ramdisk
를 'tftp ramdisk_img ramdisk'로 SDRAM에 올리고 'load kernel'을 해서 flashROM의 kernel
이미지를 다운로드하고 boot 명령을 입력해 주면 재부팅없이 부팅이 진행된다.

이렇게 옵션을 활성화했으면 (모듈이 아니라 포함시켜야 한다. 그래야 initrd 옵션이 나온다.)
이젠 kernel command 를 수정해야 한다. 메인메뉴의 두 번째

'General Setup'


사용자 삽입 이미지

맨 끝에 내려가면 설정을 바꿀 수 있는데 기본 값은

'console=ttyS0,115000 console=tty0 mem=128M root=1F02 rw'

뭐 이런 식이다. 여기서 신경써야 할 부분은 root 부분인데 root filesystem이 있는 장소를 가르키도록 설정해야 한다. 1F02이란 값은 MTD에 의해서 (여기에 관해서는 주제가 다르므로 따로 언급하지 않겠다. ) 나뉘어진 SDRAM 영역들 중 3 번째 시작주소를 지시하는 거 같다.(00,01,02) 램디스크 ( 더 자세히는 initrd 옵션) 옵션 설정없이 기본 설정으로 커널컴파일하면 SDRAM의 구조가 bootloader , kernel, rootfs 이런 식으로 구성되어 진다. 따라서 일반적인 경우 1F02이란 rootfs 의 시작주소를 가르키므로 정상적인 설정이라 할 수 있다. 하지만 우리는 ramdisk를 사용하기 위해 옵션 설정을 했기 때문에 (더 자세히는 initrd) 다시 컴파일하면 SDRAM 구조가 bootloader, kernel, initrd, user 이런 식으로 바뀌게 된다. ( initrd = initial ram disk. 참고로 initrd 옵션이 켜지면 rootfs 대신 initrd, user 영역이 생긴다.  ) - 그렇다면 당연히 'root=1F02' 값을 수정해 주어야 하는 것이다. 만약 이 값을 수정해 주지 않으면 부팅 과정 중 기껏 ram disk를 마운트 했으면서 다시 rootfs주소에 접근해 또 파일시스템을 마운트하려고 한다. 이 경우 파일시스템 마운트 에러가 발생한다. 자세한 에러 메시지는 미처 캡처하지 못했다. -
( 이 부분에서 삽질을 좀 한 사람이라면 모순을 발견할 수 있을 것이다. ~_~;; initrd 를 포함시켰을 때 SDRAM의 구조가 bootloader, kernel, initrd, user 라면 root=1F02 그냥 써도 initrd를 읽어야 하지 않느냐라고 생각할 수 있는데... 그러게나; 미처 이것저것 테스트해 볼 시간이 없어서 확실하게 답을 해주지 못하겠다. 이런 무책임한 ㅜ. 이 문단은 수정해야 한다.  )


아무튼 이 'root= ' 값을 ramdisk에 맡게 수정해 주어야 하는데 간단하게

root=/dev/ram0

라고 수정해 주면 된다. 뒤애 숫자 제로다. ( 말이 쉽지 이거 몰라 몇시간을 삽질 했는지 )
좋다. 수정했다고 하자. 만약 여기까지 하고 컴파일 후 부팅을 하다면


Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.


이와 같은 에러메시지를 볼 수 있다. 참. 먹고 살긴 힘들다. -_-
대충 때려 맞춰보면 init 명령을 찾을 수 없다는 말인데 일반 데탑의 경우는 init=/sbin/init 이런 식으로
해결 가능하다고 한다. ( 리눅스에서 init는 pid 1번으로 모든 프로세스의 부모가 된다. )
하지만 나의 경우 이렇게는 안됐었고, "root=/dev/ram0"만으로는 뭔가 부족하다는 생각에 약간 추론과 검색을
통해 부가옵션을 알아냈다.
원래 데스크탑 리눅스 부트로더 LILO의 경우 램디스크로 부팅시 initrd=ramdisk_img 이런 식으로
램디스크 이미지를 지정해 주는데 지금과 같은 경우 SDRAM에 올라가 있는 상태이므로 주소와 offset을 지정해 주어야 한다.


사용자 삽입 이미지


나의 경우는 bootloader에서 ramdisk를 SDRAM에 fusing할 때 ( ' tftp ramdisk_img ramdisk ')
 그 쓰기 시작하는 주소가 0xa1000000 이었다. 그리고 쓰는 용량은 3017611 byte. 그래서
initrd=0xa1000000,3017511 과 같이 입력해 주었다. 자 그럼 최종적인 kernel command 를 살펴보자


" console=ttyS0,115000 console=tty0 mem=128M root=/dev/ram0 rw initrd=0xa1000000,3017511 keepinitrd "

사용자 삽입 이미지

keepinitrd 는 나도 잘 모르겠고, 시간 관계상 이걸 빼놓고 테스트 해보지 못했다. 그리고 kernel command를 적을 때 쉼표로 연결되는 부분에는 공백이 포함되서는 안된다. 쉼표 다음이나 이전에 공백이 포함되면 에러가 발생한다고 한다.

대충 이렇다. 그렇다 여기까지가 키트에 동봉된 메뉴얼에서 빠져있는 내용이다. 자 그럼 행운을 빈다.



제가 이 테스트에 사용한 램디스크이미지는
hybus.co.kr -> 자료실 -> BULVERDE -> Xhyper270A ramdisk
에 올라와 있는 10M 짜리입니다. 참고하세요~




코드테스트

from 라이눅스 2007/12/30 04:04