WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Alsa sound not working (Newbie)  (Read 6554 times)

Offline Adutchman

  • Newbie
  • *
  • Posts: 8
Alsa sound not working (Newbie)
« on: October 04, 2018, 09:30:28 AM »
Disclaimer: I am very new to TinyCore Linux and configuring ALSA so it could be very well some very simple issue but I have already been working on this for 2 hours so I thought: might as well ask the forums.

I am having issues with ALSA. If I open the ALSAmixergui it shows my sound device (HDA Intel) and nothing looks wrong. If I type in the commands: lsmod | grep snd and aplay -l it returns results very similar to the "setting up sound wiki": http://wiki.tinycorelinux.net/wiki:setting_up_sound. Despite all of these good signs, vlc still doesn't detect any sounddevices. I did get them to work at some point, but back then I litterally installed all things popping up in the Apps program at ALSA, OSS and pulseaudio because I hadn't read the wiki, so I can't say what worked. Also, at that point, VLC worked but Firefox didn't (Firefox_getLatest)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: Alsa sound not working (Newbie)
« Reply #1 on: October 04, 2018, 09:43:43 AM »
Hi Adutchman
Quote
... I litterally installed all things popping up in the Apps program at ALSA, OSS and pulseaudio ...
Remove them all and start over.

Here's a step by step that got ALSA working for me:
http://forum.tinycorelinux.net/index.php/topic,22145.msg138620.html#msg138620

aus9

  • Guest
Re: Alsa sound not working (Newbie)
« Reply #2 on: October 04, 2018, 09:54:07 AM »
Hi

Rich beat me to it but heres my 2 cent worth

Since you mention firefox, I believe you will need to have pulseaudio set up in addition to alsa.

so if you bookmark
https://imgur.com/

you can open a terminal and take a screenshot of you terminal command for alsamixer....which I find better than alsamixergui.....just my opinion.....so we can see if your mixer is unmuted for outputs and levels high enough

2) the command to run to take a screenie is
Code: [Select]
screenshot.sh
then upload it to ingur and copy and paste the link in your reply please.

3) now in the terminal run this command
Code: [Select]
speaker-test  and you will need the alsa-config package loaded to run that command

Can you report.....Do you hear sound?

4) Now lets look at Pulseaudio
We assume above is good....but continue even if you do not hear sound please

Please re-read the Apps info for pulseaudio.....Hint you need dbus running
later on.....we might suggest how you can automate that......but for now confirm dbus is running
Code: [Select]
/usr/local/etc/init.d/dbus status

dbus is running

if above shows its not running we start it with root powers like this
Code: [Select]
sudo /usr/local/etc/init.d/dbus start
5) now repeat
Code: [Select]
pulseaudio -vvv
do you see any errors

6) assuming none now load pauvcontrol and click the icon in wbar
go to the extreme right hand tab and set it up for your device

I have onboard sound speaker lead to desktop powered speaker or headphones so I need
analog stereo duplex.....while you may have a surround sound  so need 5.1 etc

Let us know what you have please?

now play something and report




aus9

  • Guest
Re: Alsa sound not working (Newbie)
« Reply #3 on: October 04, 2018, 10:14:30 AM »
and in addition to above.....as per Rich suggestion on init please show the output to
Code: [Select]
alsactl init

Offline Adutchman

  • Newbie
  • *
  • Posts: 8
Re: Alsa sound not working (Newbie)
« Reply #4 on: October 04, 2018, 12:01:50 PM »
I followed the guide from Rich first to make sure ALSA worked, that made it work flawlessly. After that I installed Pulseaudio with the guide from aus9 and everything works flawlessly. I think ALSA didn't work because I didn't initialise the speakers, they don't mention it on the wiki page. Is this because the wiki page is outdated or something similar or am I missing something?
Also, how can I automate all of this because I do have to start dbus again after rebooting and this step in Rich's tutorialecho alsactl restore >> /opt/bootlocal.sh didn't work. Even when using sudo, it returns: can't create ...: Permission denied. Can you help me with this?

PS: a big thank you to all of you! The response is so quick and it reminds me how kind and friendly the linux community is, it surprises me every time! :)
« Last Edit: October 04, 2018, 12:13:37 PM by Adutchman »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: Alsa sound not working (Newbie)
« Reply #5 on: October 04, 2018, 12:29:01 PM »
Hi Adutchman
Quote
... Also, how can I automate all of this because I do have to start dbus again after rebooting ...
From the  pulseaudio.tcz.info  file:
Quote
                howto:
                alsa needs to be working for whatever sound device you have.
                Create dbus entry for booting into X
                $ echo  'dbus-launch --sh-syntax --exit-with-session' > ~/.X.d/dbus
                $ /usr/local/etc/init.d/dbus status [Check dbus is running]
                If not running, start dbus with
                $ sudo /usr/local/etc/init.d/dbus start
                If dbus was not, initially running, add a command to start it next reboot
                $ sudo echo '/usr/local/etc/init.d/dbus start' >> /opt/bootlocal.sh

Quote
... and this step in Rich's tutorialecho alsactl restore >> /opt/bootlocal.sh didn't work. Even when using sudo, it returns: can't create ...: Permission denied. Can you help me with this? ...
Maybe  bootlocal.sh  has the wrong permissions. Try:
Code: [Select]
sudo chown root:staff /opt/bootlocal.shthen try the echo command again.

Offline Adutchman

  • Newbie
  • *
  • Posts: 8
Re: Alsa sound not working (Newbie)
« Reply #6 on: October 04, 2018, 03:29:00 PM »
Hi Adutchman
Quote
... Also, how can I automate all of this because I do have to start dbus again after rebooting ...
From the  pulseaudio.tcz.info  file:
Quote
                howto:
                alsa needs to be working for whatever sound device you have.
                Create dbus entry for booting into X
                $ echo  'dbus-launch --sh-syntax --exit-with-session' > ~/.X.d/dbus
                $ /usr/local/etc/init.d/dbus status [Check dbus is running]
                If not running, start dbus with
                $ sudo /usr/local/etc/init.d/dbus start
                If dbus was not, initially running, add a command to start it next reboot
                $ sudo echo '/usr/local/etc/init.d/dbus start' >> /opt/bootlocal.sh

Quote
... and this step in Rich's tutorialecho alsactl restore >> /opt/bootlocal.sh didn't work. Even when using sudo, it returns: can't create ...: Permission denied. Can you help me with this? ...
Maybe  bootlocal.sh  has the wrong permissions. Try:
Code: [Select]
sudo chown root:staff /opt/bootlocal.shthen try the echo command again.
After your last piece of code I still got permission denied as a return

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: Alsa sound not working (Newbie)
« Reply #7 on: October 04, 2018, 08:06:00 PM »
Hi Adutchman
What does this command return:
Code: [Select]
ls -l /opt/bootlocal.sh

aus9

  • Guest
Re: Alsa sound not working (Newbie)
« Reply #8 on: October 04, 2018, 08:09:07 PM »
Quote
because I didn't initialise the speakers, they don't mention it on the wiki page.
we shall see if we can fix that shortly.
EDIT  done

Quote
After your last piece of code I still got permission denied as a return
but for the moment you can reboot and still get sound using manually starting of dbus yes?

so is opt in your backup list?
click on the wbar icon for control panel.....click on TAB for "included for Backup"

There is a possibility your saved backup restores a faulty /opt directory

If so, there are 2 ways of handling this.

1) remove opt from your backup and do a full reboot.....should restore /opt to the TC Base owner and permissions
then repeat Rich's request to automate command

2) remove opt from your backup.....edit your bootloader entry to name opt for persistence and do a full reboot
and repeat Rich's request etc etc.

#####################
There are advantages and disadvantages of a fully persistent /opt
Main pro for me.....no time wasted writing to backup and restoring from backup......not a LOT of time but I am impatient  ;)

Main con.....just like files in your tce directory....if you are human and make error....you have to find and fix with or without forum help. Of course....its also true that a backup that saves a bad file....will also restore that bad file

« Last Edit: October 04, 2018, 08:22:58 PM by aus9 »

Offline Adutchman

  • Newbie
  • *
  • Posts: 8
Re: Alsa sound not working (Newbie)
« Reply #9 on: October 07, 2018, 08:43:39 AM »
Hi Adutchman
What does this command return:
Code: [Select]
ls -l /opt/bootlocal.sh
This returns:
-rwxr-xr-x    1 root    staff           51 mar 19   2018  /opt/bootlocal.sh

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: Alsa sound not working (Newbie)
« Reply #10 on: October 07, 2018, 09:04:23 AM »
Hi Adutchman
Quote
... and this step in Rich's tutorialecho alsactl restore >> /opt/bootlocal.sh didn't work. Even when using sudo, it returns: can't create ...: Permission denied. Can you help me with this? ...
I don't understand why you are getting a creation error. The file exists and you are trying to append to it. See if this helps:
Code: [Select]
sudo chmod 775 /opt/bootlocal.sh

Offline Adutchman

  • Newbie
  • *
  • Posts: 8
Re: Alsa sound not working (Newbie)
« Reply #11 on: October 07, 2018, 10:00:11 AM »
Hi Adutchman
Quote
... and this step in Rich's tutorialecho alsactl restore >> /opt/bootlocal.sh didn't work. Even when using sudo, it returns: can't create ...: Permission denied. Can you help me with this? ...
I don't understand why you are getting a creation error. The file exists and you are trying to append to it. See if this helps:
Code: [Select]
sudo chmod 775 /opt/bootlocal.sh
That did the trick, thanks
« Last Edit: October 07, 2018, 10:03:03 AM by Adutchman »

Offline Adutchman

  • Newbie
  • *
  • Posts: 8
Re: Alsa sound not working (Newbie)
« Reply #12 on: October 07, 2018, 10:03:44 AM »
I still don't have dbus and pulseaudio booting up with the OS thought, what do I need to do for that?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: Alsa sound not working (Newbie)
« Reply #13 on: October 07, 2018, 10:30:25 AM »
Hi Adutchman
As I said in reply #5:
Hi Adutchman
Quote
... Also, how can I automate all of this because I do have to start dbus again after rebooting ...
From the  pulseaudio.tcz.info  file:
Quote
                howto:
                alsa needs to be working for whatever sound device you have.
                Create dbus entry for booting into X
                $ echo  'dbus-launch --sh-syntax --exit-with-session' > ~/.X.d/dbus
                $ /usr/local/etc/init.d/dbus status [Check dbus is running]
                If not running, start dbus with
                $ sudo /usr/local/etc/init.d/dbus start
                If dbus was not, initially running, add a command to start it next reboot
                $ sudo echo '/usr/local/etc/init.d/dbus start' >> /opt/bootlocal.sh

Offline Adutchman

  • Newbie
  • *
  • Posts: 8
Re: Alsa sound not working (Newbie)
« Reply #14 on: October 07, 2018, 11:29:38 AM »
Everything works, thank you all so much. One thing that would be handy for future beginners is that the Pulseaudio tutorial and the way to autoboot dbus would be put in the alsa sound entry on the Wiki.