6

if I execute: speaker-test -D plughw:1,0 -t wav , sound gets played over the hdmi cable, as it is supposed to.

But if I type speaker-test -t wav , no sound gets played over the hdmi cable, so I guess the issue is the default output device.

Here is a list of what I've already tried:

  • change the output device in the top left corner on the Desktop
  • execute amixer cset numid=3 2 in the console
  • uncomment those 2 lines in the config: hdmi_drive=2 hdmi_force_hotplug=1
  • change to those 2 lines in the alsa.conf file: defaults.ctl.card 1 defaults.pcm.card 1 (also tried with 2 instead of 1)

My goal is to later play sound over a browser, but chrome seems to only be able to output sound over the default audio output device, so I guess I somehow need to change it.

I am a noob, so please tell if me if you need more informations and how to get them.

If anyone has some hits on how to solve this issue, I'd be really grateful

  • Try adding `defaults.pcm.device 0` to `/etc/asound.conf`. Check the output of `aplay -v /path/to/wav` that the given card was actually selected. – dma_k Sep 26 '22 at 21:13

2 Answers2

10

had the same problem (PI 4, Bullseye).
what helped was:
sudo raspi-config

  • 1. System options  
    
  • S2. Audio
    
  • Select HDMI Option (In my case it was HDMI 2, because default output was on HDMI 1)
    

After that default output worked. Everything else (changing config.txt or alsa.conf) wasn't necessary in my case.

reference: Raspberry Pi Configuration

reallyATypo
  • 103
  • 5
0

At the time I tried to get into the configuratioms via

sudo raspi-config

as @reallyATypo suggested, but it seemed to be broken somehow. Even navigating into it on the desktop environment didn't work...

Since there were those weird things going on with the os and there wasn't much data on the RasPi anyways, I decided to set up an entirely new os on the same SD card. On there the default configurations seemed to be already correct and there also was no problem anymore with the os.

Thank you all for answering :) Idk if that is the right thing to do, but I'm gonna set my answer as a workig one in order to close the issue