Playing a sound to 3.5 mm jack connected speakers instead of HDMI

Probably a stupid question, but here goes.

My Vero V connects to a TV via HDMI cable, and it’s all splendid for playing media with Kodi on that TV.

But now I would like to also be able to play some audio files from the “host environment”, so not from Kodi but from a bare command line, for example while being connected via SSH, so for instance with aplay /path/to/some.wav, and I would like to output that sound from speakers that are connected via 3.5 mm jack output instead of HDMI-connected TV.

At the moment when I execute aplay /path/to/some.wav, the sound comes from both the TV and the 3.5 mm speakers. But is it possible to make it so that aplay outputs this sound only through 3.5 mm connected speakers?

Here are the devices that aplay reports on Vero V:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: AMLAUGESOUND [AML-AUGESOUND], device 0: TDM-A-dummy-alsaPORT-pcm dummy-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 1: TDM-B-dummy-alsaPORT-i2s multicodec-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 2: TDM-C-T9015-audio-hifi-alsaPORT-i2s2hdmi T9015-audio-hifi-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 3: SPDIF-A-dummy-alsaPORT-spdif dummy-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 4: SPDIF-B-dummy-alsaPORT-spdifb dummy-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
bluealsa
    Bluetooth Audio Hub
btaudio
    Bluetooth Audio
hw:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND,
    Direct hardware device without any conversions
hw:CARD=AMLAUGESOUND,DEV=1
    AML-AUGESOUND,
    Direct hardware device without any conversions
hw:CARD=AMLAUGESOUND,DEV=2
    AML-AUGESOUND,
    Direct hardware device without any conversions
hw:CARD=AMLAUGESOUND,DEV=3
    AML-AUGESOUND,
    Direct hardware device without any conversions
hw:CARD=AMLAUGESOUND,DEV=4
    AML-AUGESOUND,
    Direct hardware device without any conversions
plughw:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND,
    Hardware device with all software conversions
plughw:CARD=AMLAUGESOUND,DEV=1
    AML-AUGESOUND,
    Hardware device with all software conversions
plughw:CARD=AMLAUGESOUND,DEV=2
    AML-AUGESOUND,
    Hardware device with all software conversions
plughw:CARD=AMLAUGESOUND,DEV=3
    AML-AUGESOUND,
    Hardware device with all software conversions
plughw:CARD=AMLAUGESOUND,DEV=4
    AML-AUGESOUND,
    Hardware device with all software conversions
default:CARD=AMLAUGESOUND
    AML-AUGESOUND,
    Default Audio Device
sysdefault:CARD=AMLAUGESOUND
    AML-AUGESOUND,
    Default Audio Device
hdmi:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND,
    HDMI Audio Output
dmix:CARD=AMLAUGESOUND,DEV=0
    AML-AUGESOUND,
    Direct sample mixing device
dmix:CARD=AMLAUGESOUND,DEV=1
    AML-AUGESOUND,
    Direct sample mixing device
dmix:CARD=AMLAUGESOUND,DEV=2
    AML-AUGESOUND,
    Direct sample mixing device
dmix:CARD=AMLAUGESOUND,DEV=3
    AML-AUGESOUND,
    Direct sample mixing device
dmix:CARD=AMLAUGESOUND,DEV=4
    AML-AUGESOUND,
    Direct sample mixing device

Trying to use different devices, I noticed that:

  • aplay --device hw:0,2 /path/to/some.wav plays the sound both to HDMI and 3.5
  • aplay --device hw:0,3 /path/to/some.wav plays the sound only to HDMI
  • aplay --device hw:0,4 /path/to/some.wav plays the sound only to HDMI

but I did not find a device that would play only to 3.5 without HDMI.

When the TV is off, then it is fine, as I quite naturally get the sound only from the 3.5 speakers, but when the TV is on, then I don’t want the “duplicated” output from the TV, plus if Kodi is playing something, then aplay refuses the play the sound saying that Device or resource busy.

…And the other way around, is it also possible to “disable” 3.5 mm output in Kodi, so it would play my movies only through HDMI-connected TV, so I wouldn’t get “duplicated” output from 3.5 mm speakers?

There are no stupid questions in this forum.

The three audio outputs - HDMI, S/PDIF and DAC - are joined together in the kernel, not via any ALSA conf so it’s not trivial to separate them in the Kodi interface.

Since you are comfortable with the command line, I suggest you fire up alsamixer (sudo apt-get install alsa-utils) and play with the controls there. There’s an ACODEC mute, Audio hdmi-out mute and DAC Digital Volume. Also SPK mute which probably mutes everything. (I’m not near a Vero to check). Do not touch anything with ‘CLK’ in the name - you would have to reboot to restore order.

If you find what you want, then you can find the command line equivalents for those controls and maybe write a script that can be mapped to a remote key to toggle things on and off.

We do have a setting that mutes HDMI audio but IIRC it needs a reboot or Kodi restart when you toggle it so not very convenient.

HTH.

1 Like

You should be able to disable HDMI audio via the command line with:

echo audio_off | sudo tee /sys/class/amhdmitx/amhdmitx0/config

1 Like