-1

I'm running Rasbian OS on a raspberry pi 4 with two HDMI ports and via terminal, I can run a video with audio working on HDMI 1 using sudo cvlc --alsa-audio-device default video.mp4 now the problem I'm facing is running a second video on HDMI 2 with audio, I can get the video running using this command DISPLAY=:0 cvlc --qt-fullscreen-screennumber=1 --alsa-audio-device hw:1,0 video.mp4 but I can't seem to get the audio working on HDMI 2.

I checked my audio outputs using aplay -l which gave me the following output.

**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 3/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: b2 [bcm2835 HDMI 2], device 0: bcm2835 HDMI 2 [bcm2835 HDMI 2]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 2: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1

The problem is I'm not really sure how to address the sound card 1 on --alsa-audio-device

rijotech
  • 356
  • 3
  • 17
  • Probably because your question is not a programming question here on SO which is a programming Q&A platform. [What topics can I ask about here?](https://stackoverflow.com/help/on-topic) – Rob Jun 25 '22 at 11:14
  • Don't refer to off topic questions to justify your off topic question. There are 8000 to 10000 visitors to SO every day. We can't catch them all but I'll get started (and many of those are programming questions). In the meantime, go to the bottom of this page and find the raspberry pi stackexchange. – Rob Jun 25 '22 at 11:34
  • My apologies but when I said hate I was referring to the -1 I received on my question. – rijotech Jun 25 '22 at 12:12

2 Answers2

1

This solved my problem, I can now send audio individually to each HDMI by selecting the specific hardware output via command line.

HDMI1

DISPLAY=:0 cvlc  --alsa-audio-device hw:0,0 video.mp4

HDMI 2

DISPLAY=:0 cvlc --qt-fullscreen-screennumber=1 --alsa-audio-device hw:1,0 video.mp4
rijotech
  • 356
  • 3
  • 17
0

Your problem is that the pi thinks of them as hdmi 0 and hdmi 1, so hdmi 0 is acctually 1, and hdmi 1 is 2. You can see this on the labelling on the ports on the pi

fozzy
  • 13
  • 6