IT/라즈베리파이2

CHANGING THE AUDIO OUTPUT

단디1969 2017. 7. 13. 16:40

라즈베리파이2 오디오출력을 HDMI나 헤드폰잭으로 나오게 변경하는 방법


원본: https://www.raspberrypi.org/documentation/configuration/audio-config.md


AUDIO CONFIGURATION


The Raspberry Pi has two audio output modes: HDMI and headphone jack. You can switch between these modes at any time.


If your HDMI monitor or TV has built-in speakers, the audio can be played over the HDMI cable, but you can switch it to a set of headphones or other speakers plugged into the headphone jack. If your display claims to have speakers, sound is output via HDMI by default; if not, it is output via the headphone jack. This may not be the desired output setup, or the auto-detection is inaccurate, in which case you can manually switch the output.


CHANGING THE AUDIO OUTPUT


There are two ways of setting the audio output.


1. COMMAND LINE


The following command, entered in the command line, will switch the audio output to HDMI:


pi@raspberrypi ~ $ sudo amixer cset numid=3 2

numid=3,iface=MIXER,name='PCM Playback Route'

  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0

  : values=2


Here the output is being set to
2, which is HDMI. Setting the output to 1 switches to analogue (headphone jack). The default setting is 0 which is automatic.


2. RASPI-CONFIG


1. Open up raspi-config by entering the following into the command line:


pi@raspberrypi ~ $ sudo raspi-config


This will open the configuration screen:


2. Select Option 8 Advanced Options and press Enter, then select Option A6:  Audio and press Enter:



3. Now you are presented with the two modes explained above as an alternative to the default Auto option. Select a mode, press Enter and press the right arrow key to exit the options list, then select Finish to exit the configuration tool.


IF YOU'RE STILL NOT GETTING SOUND VIA HDMI


In some rare cases, it is necessary to edit config.txt to force HDMI mode (as opposed to DVI mode, which does not send sound). You can do this by editing  /boot/config.txt and setting hdmi_drive=2, then rebooting for the change to take effect.