Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: Adutchman on October 04, 2018, 06:30:28 AM

Title: Alsa sound not working (Newbie)
Post by: Adutchman on October 04, 2018, 06: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 (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)
Title: Re: Alsa sound not working (Newbie)
Post by: Rich on October 04, 2018, 06: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
Title: Re: Alsa sound not working (Newbie)
Post by: aus9 on October 04, 2018, 06: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



Title: Re: Alsa sound not working (Newbie)
Post by: aus9 on October 04, 2018, 07:14:30 AM
and in addition to above.....as per Rich suggestion on init please show the output to
Code: [Select]
alsactl init
Title: Re: Alsa sound not working (Newbie)
Post by: Adutchman on October 04, 2018, 09:01:50 AM
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! :)
Title: Re: Alsa sound not working (Newbie)
Post by: Rich on October 04, 2018, 09:29:01 AM
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.
Title: Re: Alsa sound not working (Newbie)
Post by: Adutchman on October 04, 2018, 12: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
Title: Re: Alsa sound not working (Newbie)
Post by: Rich on October 04, 2018, 05:06:00 PM
Hi Adutchman
What does this command return:
Code: [Select]
ls -l /opt/bootlocal.sh
Title: Re: Alsa sound not working (Newbie)
Post by: aus9 on October 04, 2018, 05: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

Title: Re: Alsa sound not working (Newbie)
Post by: Adutchman on October 07, 2018, 05: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
Title: Re: Alsa sound not working (Newbie)
Post by: Rich on October 07, 2018, 06: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
Title: Re: Alsa sound not working (Newbie)
Post by: Adutchman on October 07, 2018, 07: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
Title: Re: Alsa sound not working (Newbie)
Post by: Adutchman on October 07, 2018, 07: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?
Title: Re: Alsa sound not working (Newbie)
Post by: Rich on October 07, 2018, 07: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
Title: Re: Alsa sound not working (Newbie)
Post by: Adutchman on October 07, 2018, 08: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.
Title: Re: Alsa sound not working (Newbie)
Post by: coreplayer2 on October 07, 2018, 09:31:23 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.
Confused?   Pulseaudio is a separate entity and is listed separately from Alsa in the Wiki. 
http://wiki.tinycorelinux.net/wiki:pulseaudio (http://wiki.tinycorelinux.net/wiki:pulseaudio)
Did you have trouble finding this?   

BTW the wiki is unofficial and while it is a valuable resource it takes forth place in terms of importance.    I just attempted to read the Pulseaudio section of the wiki and am totally confused by the information given, even  incorrect information...   

IMO there should be a wiki entry to show folks where to find the latest information pertaining to each extension.  For example, the INFO file which in most cases contains all the latest information you'll ever need.

http://tinycorelinux.net/9.x/x86/tcz/pulseaudio.tcz.info (http://tinycorelinux.net/9.x/x86/tcz/pulseaudio.tcz.info)
Was this really so hard to find?

Title: Re: Alsa sound not working (Newbie)
Post by: aus9 on October 07, 2018, 05:27:48 PM
@ coreplayer2
Quote
just attempted to read the Pulseaudio section of the wiki and am totally confused by the information given
As my nickname appears in the wiki.....you should know that I am not the best person to proof read my own work

Quote
even  incorrect information
Since you have chosen to state this as a fact......I do not dispute it.

I am disappointed that no one has editted out any errors.

I am very disappointed that the first chance I get to hear I have supplied errors that mislead members is by public forum post. Can I declare that you are not on my banned list.....altho time may tell ;) so in future the best way of handling this is fix it and pm the list of errors or pm the list of errors. And the wiki has been around since 2013.
But I now declare your option of sending me a list of errors will NOW not work as you already have concerns on how confusing the wiki is.......so I am honour bound to say you are now the best person who know the errors and how to fix them please AND  remove confusion.

I formally request that you edit the wiki to fix up all issues you see.

Thankyou in advance
Title: Re: Alsa sound not working (Newbie)
Post by: aus9 on October 07, 2018, 05:37:38 PM
@ Adutchman
Quote
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
alsa does not need dbus

Not all members run pulseaudio. Sometimes there can be more than one way to start a daemon or service.....onboot but I have disowned the pulseaudio wiki so coreplayer2 has the freedom to provide better and more accurate information on what he knows is the correct way.