1

Is it possible to have (the same) audio going through HDMI and the line out on the Pi2 board at the same time?

I want to use my Pi2 as a RetroPie station, using HDMI for gaming, so video/audio are in sync, and as a ShairPort for when the TV is off. Alternatively it would be ok if I could detect if the HDMI device is on, and switch accordingly.

I don't need the two outputs to be bound to the same device. If ALSA represents them as different devices that would be ok as well. The Shairport should only use the Stereo jack.

Arne
  • 2,226
  • 2
  • 18
  • 35

1 Answers1

1

I found out that I can manually switch to 3.5mm output:

 $ amixer cset numid=3 1                      
numid=3,iface=MIXER,name='PCM Playback Route'               
  ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
  : values=1                                                

However the ALSA device does not seem to support both outputs at the same time.

The OMX API for the Broadcom chip however does seem to support setting the audio splitter to route to both outputs .

Furthermore I found out that aplay lists two devices for the Broadcom card:

**** List of PLAYBACK Hardware Devices ****                              
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]       
  Subdevices: 7/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                                             

The second one always being HDMI. Maybe it is possible to configure this to be the default output device for the system and use device 0 for the shairport.

Arne
  • 2,226
  • 2
  • 18
  • 35