Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: saladin on June 27, 2021, 05:14:41 PM

Title: Having trouble with hdmi audio through alsa
Post by: saladin on June 27, 2021, 05:14:41 PM
When I run:

Code: [Select]
speaker-test -D plughw:0,3 -c2 -t wav -l1
I get audio. But not otherwise. So I created a .asoundrc file in /home/tc

Code: [Select]
pcm.!default {
      type hw
      card 0
      device 3
 }
ctl.!default {
    type hw
    card 0
#    device 3
}

If I remove the # alsamixer says:

Code: [Select]
cannot open mixer: Invalid argument
With the # in there, it will load, but there's no mention anywhere of HDMI. I've unmuted Master and turned up the volume, but still no sound.

When I follow the instructions here (http://forum.tinycorelinux.net/index.php/topic,22145.msg138620.html#msg138620), the echo command gives me the error:

Code: [Select]
sh: can't create /opt/bootlocal.sh: Permission denied
Edit: fixed the alsamixer not starting error by replacing the second !default with card0. Still no help though.
Title: Re: Having trouble with hdmi audio through alsa
Post by: patrikg on June 28, 2021, 06:09:52 AM
When getting permission errors you maybe you have to use sudo like this.

Code: (bash) [Select]
sudo sh -c 'echo alsactl restore >> /opt/bootlocal.sh'
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on June 28, 2021, 06:18:45 AM
Oh I see. Thank you, I didn't know I could do that.

But I still must be doing something wrong, because even after completing the instructions like that, I don't have audio. Except with the speaker test command
Title: Re: Having trouble with hdmi audio through alsa
Post by: Juanito on June 28, 2021, 06:53:25 AM
but there's no mention anywhere of HDMI

On my laptop I need the graphics-KERNEL extension and then alsa-config loaded before alsa for hdmi to work.
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on June 28, 2021, 07:20:05 AM
Ok, I've loaded them and run through my instructions again, but I'm not noticing any difference. I still hear the speaker test, but nothing else. Still don't see mention of hdmi anywhere.
Title: Re: Having trouble with hdmi audio through alsa
Post by: Juanito on June 28, 2021, 08:43:47 AM
What does “aplay -l” give?
Title: Re: Having trouble with hdmi audio through alsa
Post by: Rich on June 28, 2021, 09:48:10 AM
Hi saladin
I think the  graphics-KERNEL  extension has to get loaded before ALSA. Edit the  /etc/sysconfig/tcedit/onboot.lst  file
and move the  graphics-KERNEL  entry towards the beginning of the file. Then save, reboot, and see if anything changed.
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on June 28, 2021, 10:02:12 AM
Juanito:

Code: [Select]
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Rich:

I'll try that now.
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on June 28, 2021, 10:29:15 AM
Ok, I changed the order and rebooted. Now espeak is no longer giving me an "invalid input" error when I test it, but aside from that, and with regards to everything I've mentioned in the thread so far, I'm not noticing any changes.
Title: Re: Having trouble with hdmi audio through alsa
Post by: Juanito on June 28, 2021, 10:47:57 AM
Is alsa-config loaded before alsa?
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on June 28, 2021, 11:20:25 AM
Yes it is. It has been since my original post. Though I didn't have the graphics loaded originally.

I've always had python and opera first, followed by alsa-config, then alsa. I inserted graphics-4.19.10-tinycore64.tcz before alsa-config.
Title: Re: Having trouble with hdmi audio through alsa
Post by: Rich on June 28, 2021, 11:23:24 AM
Hi saladin
As Juanito pointed out, alsa-config needs to be loaded before alsa. If you need to fix that, you should then reboot so
they get loaded in the correct order.
You should probably also run steps 5 through 7 again.
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on June 28, 2021, 02:50:36 PM
Ok, this is a completely fresh install. No saves. I want to show exactly what I'm doing.

I boot tinycore64 from CD. I open Apps to find the fastest mirror, then go to the command line:

Code: [Select]
tce-load -wi graphics-4.19.10-tinycore64.tcz
This installs a few things, then the screen goes black. By this point I've turned off my keyboard to make sure I don't push anything by accident. I go and start dinner, so that just in case something is happening that I can't see, it has time to finish. A few minutes later I return and push ctrl-alt-backspace, then type:

Code: [Select]
startx
Now I'm back to a graphical desktop. I open the command line again and type:

Code: [Select]
tce-load -wi alsa-config.tcz
tce-load -wi alsa.tcz
alsactl init
speaker-test -D plughw:0,3 -c2 -t wav -l1
sudo alsactl store
sudo sh -c 'echo alsactl restore >> /opt/bootlocal.sh'
sudo sh -c 'echo usr/local/etc/alsa/asound.state >> /opt/.filetool.lst'
alsamixer
speaker-test [-Ddefault:1] -c2 -t wav -l1
sudo alsactl store
sudo sh -c 'echo alsactl restore >> /opt/bootlocal.sh'
sudo sh -c 'echo usr/local/etc/alsa/asound.state >> /opt/.filetool.lst'
alsamixer

Neither time I run alsamixer has anything changed. The first speaker-test gives me audio. The second one does not, but that's the one in the instructions, so I tried it to be sure. I don't see anything about hdmi, and I don't have options when I push F6.
Title: Re: Having trouble with hdmi audio through alsa
Post by: Juanito on June 28, 2021, 11:53:02 PM

This installs a few things, then the screen goes black…

The graphics-KERNEL extension cannot be installed from within the gui, you need to exit to the console prompt.
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on June 29, 2021, 11:17:07 AM
Oh I see. That must be the problem then. This whole time I thought it was installed when it wasn't.
Title: Re: Having trouble with hdmi audio through alsa
Post by: Rich on June 29, 2021, 02:11:15 PM
Hi saladin
To exit to the console prompt:
Click on the  Exit  icon. Select the  Exit to Prompt  option. Click  OK.
Title: Re: Having trouble with hdmi audio through alsa
Post by: saladin on July 03, 2021, 01:02:29 PM
Ok, I installed it from the command prompt and then started the GUI and did everything else as before, and I don't see any difference. I still don't have sound, except when doing that one particular speaker test.

Didn't see Rich's message until just now. I exited to the prompt with ctrl-alt-backspace rather than clicking the menu option, but I think it works the same?