Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: LinuxUser01 on September 21, 2013, 06:47:15 PM
-
I'm currently running the new version of TinyCore v5.0. I have installed alsa.tcz and alsaconf.tcz as OnBoot. I have placed the script "/usr/local/etc/init.d/alsasound start" in /opt/bootlocal.sh as #/usr/local/etc/init.d/alsasound start. I've ran sudo alsaconf and had it configure and ran the speaker test successfully. I have tried typing in command "alsactl store" to only get:
alsactl: state_lock:121: file /var/lib/alsa/asound.state lock error: File exists
alsactl: state_lock:121: file /var/lib/alsa/asound.state unlock error: File exists
The thing is that its suppose to save it in /usr/local/etc/asound.state. which it never did, but i have still put the unlock file from /var/lib/alsa/asound.state in my backups. I have also added etc/modprobe.conf to the backup since it has already backed up the whole opt folder which has the alsa folder and the other two files in its subdirectory. Sometimes i don't need to go through the terminal and type sudo alsaconf to get the sound working after coming back from a reboot or turning on the computer. I just run flit and it shows the sound enabled already, which doesn't make any sense to me. Not sure if i should delete the /var/lib/alsa/asound.state subdirectory/files and just copy it to /usr/local/etc/asound.state then delete the /var/lib/alsa/asound.state unlock file from backup and add the new directory and unlocked file as shown in the comments section of alsa.tcz from the Apps Browser as stated. I'm sure i have already done too much for this sound to work as i've read over the comments section that either the script would do the job unless you want alsaconf installed and ran. Anybody with an idea would be great, thanks in advance.
-
Damn, I'm so sorry. You've asked me about ALSA via PM - But had to indeed do more than whats stated in the Appbrowser info.
I think alsa got kinda messed up.
I made a symlik from
/var/lib/alsa/asound.state (thats where setting being saved afer 'sudo alsactl store')
to
/usr/local/etc/asound.state
Also I have in
~/.X.d/audio (file name doesn't matter and is not exetutable)
/usr/bin/sudo /usr/local/etc/init.d/alsasound start &
/usr/bin/sudo /usr/local/sbin/alsactl restore &
Or that could be listed in bootlocal.sh instead.
-
I'm running emeIFM2 as a superuser and still will not allow me to symlink asound.state from /var/lib/alsa/asound.state to /usr/local/etc/asound.state. When you mention ~/.X.d/audio are you referring to /home/tc/.X.d/audio, because i'm not able to locate that folder "audio" in that subdirectory. I'll see if i can add those two commands to the bootlocal.sh.
Okay, this is how my bootlocal.sh looks like from the top:
#!/bin/sh
#/usr/local/etc/init.d/alsasound start
#/usr/bin/sudo /usr/local/etc/init.d/alsasound start &
#/usr/bin/sudo /usr/local/sbin/alsactl restore &
Hopefully this is the correct way of input. Not sure if i am suppose to delete #/usr/local/etc/init.d/alsasound start at this point.
-
I have tried different features in emeIFM2 to get this symlink to work to no success. I just opened a terminal and from tc@box:$, i typed cd /root and got tc@box$/root$ and tried, ln -s /var/lib/alsa/asound.state /usr/local/etc/asound.state only to get a permission denied once again.
-
~/.X.d/ is the 'autostart' folder.
Any file in there will be sourced (its contents will be executed but not the file itself).
I made some files in there one being named audio (so thats not a folder).
If elefm2 doesnt allow you to create symlinks, you might try doing that in terminal.
sudo ln -s /var/lib/alsa/asound.state /usr/local/etc/asound.state
bootlocal.sh is run as root so you don't need sudo there.
The # in front of a line is a comment symbol so the line will not be interpreted (exept for the first line).
#!/bin/sh
/usr/local/etc/init.d/alsasound start
/usr/local/sbin/alsactl restore &The & at the end of a line makes sure the next line will be processed even if the current line starts a program that hangs or takes some time to finish.
-
And include both files,
/var/lib/alsa/asound.state
and
/usr/local/etc/asound.state
to your backup.
-
So all i needed was sudo before ln -s /var/lib/alsa/asound.state /usr/local/etc/asound.state in the terminal and sure enough it worked. I then placed both var/lib/alsa/asound.state and usr/local/etc/asound.state in backup as you suggested. I also revised the bootlocal.sh:
#!/bin/sh
/usr/local/etc/init.d/alsasound start
/usr/local/sbin/alsactl restore &
These procedures that i have done still hasn't changed the way i have to get the sound working from a boot/reboot. I'm wondering why alsa is so hard to get properly installed compared to the easy OSS.tcz.
-
What are you doing then to get sound working?
--
Have you executed
sudo alsactl store
after you have added asound.state to your backup?
Nothing comes to my mind right now what else I did to make it work.
-
Yes, i did execute sudo alsactl store in the terminal before saving and shutting down. I just came back from a full shut down and the sound is still not working. So what i usually do is open a terminal and type: sudo alsaconf and when its finished it works everytime. Not sure what else to do either. Maybe change the command line from /usr/local/sbin/alsactl restore & to /usr/local/sbin/alsactl store & in the bootlocal.sh if that would make any difference at all at this point since i also tried sudo alsactl restore in the terminal which didn't do anything but give me an error alittle bit after i executed sudo alsactl store.
-
Putting
/usr/local/sbin/alsactl store
in bootlocal.sh wouldn't make any sense.
'store' saves the current values to asound.state
'restore' reads them.
--
I don't really think that matters but I have only alsa.tcz in my onboot.lst. No alsaconfig.tcz.
--
I also don't really think it makes any difference but might be worth a try to create a startup file like I did and put it in /home/tc/.X.d/
/usr/bin/sudo /usr/local/etc/init.d/alsasound start &
/usr/bin/sudo /usr/local/sbin/alsactl restore &This needs sudo so might not work if you have set a password for your user account.
-
Deleting alsaconf.tcz from the OnBoot maintenance didn't make any difference. Just created a filename called audio in /home/tc/.X.d and got into it with the Editor from the wbar and pasted those two commands you have in your post. Going to reboot and see what happens.
-
No, i still can't get sound coming back from that reboot. Just going to Add alsaconf.tcz back into the OnBoot and just run it everytime it doesn't enable. Thanks for your help.
-
~/.X.d is for commands related to running X, it would be better to put commands related to alsa in /opt/bootlocal.sh
-
Ah, OK. I will add the ALSA stuff to my bootlocal as well then.
--
[...] and just run it everytime it doesn't enable. [...]
It sounds like it does work 'sometimes', does it?
If so, then try adding sleep 1 & in front of the alsasound start command.
-
Oh, and one more thing.
After checking my .filetool.lst several times, this time I remembered why I have added etc/modprobe.conf.
It saves the soundcard to be used.
Try running sudo alsaconf once more, add etc/modprobe.conf to your backup.
-
Okay, so i deleted that file audio that i created and edited in /.X.d since Juanito stated it was for running x. I then added that command you mentioned sleep 1 & infront of the alsasound start in bootlocal.sh. I then went ahead and sudo alsaconfig and went through the installation process and it loaded the drivers. I then went into my .filetool.1st and made sure etc/modprobe.conf was still there and saved and rebooted. This time the sound works coming back from that reboot. I think we needed that sleep command in the bootlocal.sh that you mentioned in your post since it was stated in the comment section of alsa.tcz. I'll keep you posted. Thank you again.
-
Wohoo! (:
-
Hi LinuxUser01
sleep 1 &
I don't think you want that & in there since that puts the sleep command in the background to run asynchronously. You
want it in the foreground so it blocks the next command from executing until it completes.
-
I shut down the system then re-started it to no sound. I then changed that command sleep 1 & to sleep 1 in bootlocal.sh then rebooted and still no sound available. Not sure why its not saving any of this properly because after finding out that there is no sound, i open terminal and type sudo alsaconf and the sound is available.
-
Hi LinuxUser01
Try removing the & from your alsa start and restore commands.
-
This is what i have so far in my bootlocal.sh:
#!/bin/sh
/usr/local/etc/init.d/alsasound start sleep 1
/usr/local/sbin/alsactl restore
I've looked over the comment section in alsa.tcz and i can't understand why this is still not working.
-
Hi LinuxUser01
The sleep 1 should be on a separate line.
-
Sorry it wasn't clear to me that & puts a command into background. I've seen it many times as an example to delay the start of conky.
Maybe you could just do
#!/bin/sh
/bin/sleep 1
/usr/local/etc/init.d/alsasound start
/usr/local/sbin/alsactl restoreor
/bin/sleep 1 && /usr/local/etc/init.d/alsasound start
or
/bin/sleep 1 ; /usr/local/etc/init.d/alsasound start
Rich, please confirm.
-
I got the bootlocal.sh revised again to:
#!/bin/sh
/usr/local/etc/init.d/alsasound start
/bin/sleep 1
/usr/local/sbin/alsactl restore
and so far the sound has worked both reboots. Not sure about the third one.
-
Damn!
-
Put it above alsasound start.
If this still wont work, increase the number.
Be aware that sleep 2 would make the bootlocal.sh to stay inactive for 2 (two) seconds so you probably might not want to use very high value.
-
Hi Misalf
Rich, please confirm.
Yes, those look fine.
-
Hi LinuxUser01
You might want to try adding the syslog boot code. When alsa fails, look through /var/log/messages for messages
related to the sound system.
-
Okay, i'll look for any messages related to alsa when it fails in /var/log/messages and keep you updated. So for the bootlocal.sh either one would work?
#!/bin/sh
/bin/sleep 1 && /usr/local/etc/init.d/alsasound start
/usr/local/sbin/alsactl restore
or
#!/bin/sh
/bin/sleep 1 ; /usr/local/etc/init.d/alsasound start
/usr/local/sbin/alsactl restore
or
#!/bin/sh
/bin/sleep 1
/usr/local/etc/init.d/alsasound start
/usr/local/sbin/alsactl restore
And i'm not sure what you mean by adding the syslog boot code.
-
Hi LinuxUser01
All three would work. My preference is one command per line.
And i'm not sure what you mean by adding the syslog boot code.
You've seen boot codes before, like waitusb=5 home=sda1 nodhcp norestore etc. In this case add syslog to your
bootloader.
-
I'm not sure at this point if i should just reformat this USB stick (contains TC 5.0) and start over again with the alsa installation or just keep on opening a terminal and typing the same command over to get alsa working, or wait for OSS.tcz to be available in the Apps Browser because it doesn't matter what i try, it just doesn't have the sound enabled after either a reboot or coming from a full shut down. Thanks for all of your help guys.
-
rather than doing that, I'd make sure nothing is set "onboot" or "ondemand", boot to the console (boot code "text") and then:
$ tce-load -i alsa
$ sudo /usr/local/etc/init.d/alsasound start
$ speaker-test -c2 -t wav -l1
.and see if you have sound
-
Not sure how to boot to console properly, but i've tried using the Boot Core (Command Line Only) option which is below the regular options and it was telling me that it can't find alsa.tcz after typing tce-load -i alsa.tcz or tce-load -i alsa. I've tried hitting the TAB button so i can edit the boot and just type in text, but still nothing. I've looked in the F1-F4 options and i did notice the text option available, but can't figure out how to boot to it. Another thing, when i tried booting from Boot COre (Command Line Only on Slow Devices) it took me right into the desktop which i thought it was strange. Maybe the OS has become corrupt somehow at this point. I know its totally irrelevant, but here is how it looks:
ABEL core
MENU LABEL Boot Core (command line only).
TEXT HELP
No embedded X/GUI extensions are loaded. User extensions scanned or specified
will be loaded, and will need to provide X/GUI if required.
ENDTEXT
KERNEL /boot/vmlinuz
INITRD /boot/core.gz
APPEND loglevel=3
LABEL corew
MENU LABEL Boot Core (command line only on slow devices, waitusb=5)
TEXT HELP
No embedded X/GUI extensions are loaded. User extensions scanned or specified
will be loaded, and will need to provide X/GUI if required.
ENDTEXT
KERNEL /boot/vmlinuz
INITRD /boot/core.gz
APPEND loglevel=3 waitusb=5
-
KERNEL /boot/vmlinuz
INITRD /boot/core.gz
APPEND loglevel=3 waitusb=5
simply add ' text ' to boot text mode only
KERNEL /boot/vmlinuz
INITRD /boot/core.gz
APPEND loglevel=3 waitusb=5 text
or
KERNEL /boot/vmlinuz
APPEND initrd=/boot/core.gz loglevel=3 waitusb=5 text
-
I'm not sure what the boot options are when booting via CD or TinyCore created boot menu.
I think you can press "TAB" while in the GRUB4DOS menu or "E" in some other bootloaders to be able to edit the boot entry (it won't be saved).
This should boot TC as normal (restoring backup etc) exept not lauching the desktop.
Alternatively (but I don't know it it makes any sense if no backup has been restored), try to cd into your tce/optional/ folder after booting to text mode.
On my system that would be:
mount /mnt/sda4
cd /boot/tce-5.0/optional
Then I can do (with TAB autocompletion):
tce-load -i alsa
-
I don't believe there is a need to cd into /tce/optional to run tce-load -i xxxx.tcz from, it can be run from anywhere
-
In case the bootloader has base norestore in the menu entry he used.
In that case tce/ would be in /tmp/.
-
Well, after hitting tab on Boot Core (Command Line Only) i added "text" and it booted right into console, but it couldn't find alsa or alsa.tcz after trying to type in tce-load -i alsa.tcz or alsa. So i tried cd /mnt/sdc1/tce/optional since that is the way my USB stick has setup TC 5.0 and it couldn't cd into it. I even tried the /tmp/ that Misalf mention but still didn't work. I have deleted alsa.tcz and alsaconf.tcz from the OnBoot before doing all this as mentioned by Juanito. The funny thing is before i came back into the site to check if you guys had posted the sound was working. So this alsa is either corrupted or somehow buggy with my X-Fi Sound Blaster card. I never had any of these types of problems when i was using TC 4.7.7 with OSS.tcz. But i remember trying alsa on a previous version of TC and i never could get it to work either. I'll try again with the cd, but this time try /mnt/sdc1/tce/optional or if that doesn't work then /tmp/sdc1/tce/optional. Another thing, not sure why the APPEND is loglevel=3 cde for the default boot into TC desktop when this setup has been using tce/optional and not cde. Not sure what i'm talking about, what is cde?
-
cde is used when booting from CD.
If booted from CD and no tce directory exists, /tmp/tce/ will be used for (temporary) downloaded apps.
-
I keep coming back here because I'm interested in the Alsa configuration. Am trying not to interfere, but there is such confusion
LinuxUser01, It appears your install is not setup correctly
Many ways to correct this, but one method (which I use most of the time now) is first set a Label on your USB stick. this example uses label USBDRIVE
see the wiki http://wiki.tinycorelinux.net/wiki:install_usb (http://wiki.tinycorelinux.net/wiki:install_usb)
kernel /boot/vmlinuz
append initrd=/boot/core.gz loglevel=3 waitusb=5:LABEL=USBDRIVE text
Alternatively you may use UUID
blkid -s UUID /dev/sda1 to find your specific USB UUID then replace the example UUID below with yours
kernel /boot/vmlinuz
append initrd=/boot/core.gz loglevel=3 waitusb=5:UUID="9aff3da3-474d-440d-bb6c-3240afe84ac6" tce=UUID="9aff3da3-474d-440d-bb6c-3240afe84ac6" text
(rename cde to tce)
Also Replace the boot config entry cde (which is for CD's) with tce. Make sure the USB path to your extensions is similar to
/tce/optional
-
I have a 2G USB Stick that i formatted and installed TC v5.0 using USB2CORE v1.6. So not sure if USB2CORE created the cde or somehow the setup of TC created it. I think it has been like this since TC 4.7.x, but i never really paid that much attention to it. So just edit the syslinux.cfg file and change APPEND loglevel=3 cde waitusb=5 to APPEND loglevel=3 tce waitusb=5 for the Boot TinyCore and that should do the trick?
-
I don't think so, please see above
-
Okay, i named the USB stick to USBDRIVE and found out the UUID and edited the syslinux.cfg from APPEND initrd=/boot/core.gz loglevel=3 cde waitusb=5 to APPEND initrd=/boot/core.gz loglevel=3 waitusb=5:UUID="C6FA-C9A9" tce=UUID="C6FA-C9A9". So as you can see i replaced the cde before waitusb=5 to the tce=UUID...Wait, i don't even have a cde folder. I only see a tce/optional folder so not sure how that command even existed from the start. Let's see if this boots now.
-
It booted fine into the desktop, but the sound is still not working. I'll see how it boots into console with the text command infront of it now.
-
Okay, it booted fine into the console with the text command. The tce-load -i alsa gives me alsa already installed, so i typed sudo /usr/local/etc/init.d/alsasound start then speaker-test -c2 -t wav -l1 which gave me these results:
Playback device is default stream parameters are 48000Hz, s16_LE, 2 channels wav file(s)
ALSA lib pcm_dmix.c: 1022:(snd_pcm_dmix_open) Unable to open slave
Playback open error: -2, No such file or directory
-
You still need to adjust things to that the alsa extension is not loaded "onboot" - that way, once booted into console mode, you load alsa and see what modules are loaded and if there are any error messages in order to be able to troubleshoot.
-
I do have alsa.tcz and alsaconf.tcz in OnBoot. I just forgot to delete them before doing the things that i've mentioned in my last couple of posts.
-
..but what I'm saying is do not load alsa "onboot" - that way it will be easier to troubleshoot
-
It loads all of these as "OK" when i type tce-load -i alsa
depmod.tcz
alsa-config.tcz
ncurses-common.tcz
ncurses.tcz
libpci.tcz
pci-utils.tcz
libasound.tcz
input-joystick-3.8.10-tinycore.tcz
alsa-modules-3.8.10-tinycore.tcz
alsa.tcz
Then it just gives me another prompt when i type in sudo /usr/local/etc/init.d/alsasound start like:
tc@box:$ sudo /usr/local/etc/init.d/alsasound start
tc@box:$
Then it just gives me the same Playback open error as the one i pasted in my other post when i try to do the speaker-test command. I have looked into dmesg and i can't find any errors regarding this, nor i can find any files related to the sound in /var/log/messages that another user in this thread has mentioned. What i do know is that i have a PCI X-Fi Sound Blaster and there is also a built-in sound card in my Radeon card that might be conflicting somehow. I do see somethings related to the PC Speakers or the Radeon built-in sound in Xorg.0.log. Not sure if that is even related.
-
What would be good to know is which modules are loaded after you issue the command "/usr/local/etc/init.d/alsasound start"
Edit: like this: $ sudo /usr/local/etc/init.d/alsasound start
rmmod: can't unload 'snd_hda_codec_hdmi': Resource temporarily unavailable
rmmod: can't unload 'snd_hda_codec_idt': Resource temporarily unavailable
rmmod: can't unload 'snd_hda_codec': Resource temporarily unavailable
rmmod: can't unload 'snd_hwdep': Resource temporarily unavailable
rmmod: can't unload 'snd_pcm': Resource temporarily unavailable
rmmod: can't unload 'snd_timer': Resource temporarily unavailable
rmmod: can't unload 'snd': Resource temporarily unavailable
Starting sound driver: snd-hda-intel
..and: $ lsmod
Module Size Used by Not tainted
snd_seq_dummy 12288 0
snd_seq_oss 24576 0
snd_seq_midi_event 12288 1 snd_seq_oss
snd_seq 32768 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device 12288 3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss 32768 0
snd_mixer_oss 16384 1 snd_pcm_oss
snd_hda_codec_hdmi 28672 1
snd_hda_codec_idt 45056 1
snd_hda_intel 28672 0
snd_hda_codec 57344 3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel
snd_hwdep 12288 1 snd_hda_codec
snd_pcm 49152 4 snd_pcm_oss,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_timer 20480 2 snd_seq,snd_pcm
snd 36864 12 snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore 12288 1 snd
snd_page_alloc 12288 2 snd_hda_intel,snd_pcm
-
That command sudo /usr/local/etc/init.d/alsasound start has never given me any results but just gives me another prompt as i've mentioned in my last post. Not sure what its even doing to be honest with you. All of the other commands for alsa gives some kind of result, but just not this one, not sure. Well, lsmod sure worked, here are the results below:
Module Size Used by Not tainted
snd_ctxfi 53248 1
snd_seq_dummy 12288 0
snd_seq_oss 24576 0
snd_seq_midi_event 12288 1 snd_seq_oss
snd_seq 32768 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device 12288 3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss 32768 0
snd_mixer_oss 16384 2 snd_pcm_oss
cpufreq_powersave 12288 0
cpufreq_stats 12288 0
cpufreq_userspace 12288 0
cpufreq_conservative 12288 0
radeon 651264 2
i2c_i801 16384 0
serio_raw 12288 0
snd_hda_codec_hdmi 28672 0
drm_kms_helper 24576 1 radeon
ttm 40960 1 radeon
snd_hda_codec 57344 1 snd_hda_codec_hdmi
drm 143360 4 radeon,drm_kms_helper,ttm
snd_hwdep 12288 1 snd_hda_codec
backlight 12288 1 radeon
i2c_algo_bit 12288 1 radeon
snd_pcm 49152 4 snd_ctxfi,snd_pcm_oss,snd_hda_codec_hdmi,snd_hda_codec
intel_agp 12288 0
snd_timer 20480 2 snd_seq,snd_pcm
intel_gtt 16384 1 intel_agp
agpgart 24576 4 ttm,drm,intel_agp,intel_gtt
snd 36864 11 snd_ctxfi,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_hda_codec_hdmi,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore 12288 2 snd
snd_page_alloc 12288 2 snd_ctxfi,snd_pcm
squashfs 24576 85
loop 20480 170
mperf 12288 0
microcode 12288 0
lpc_ich 16384 0
mfd_core 12288 1 lpc_ich
pcspkr 12288 0
r8169 40960 0
xhci_hcd 65536 0
The ctxfi is my X-Fi Sound Blaster card as i remember selecting it for alsaconf.
-
Just curious, how do you start the sound drivers across reboots if you don't use ?
sudo /usr/local/etc/init.d/alsasound start
-
What i usually do when the sound doesn't work is, just go into terminal and type sudo alsaconf and it runs its configuration and i select my X-Fi Sound Blaster and it loads the drivers and it works. I got that command stored in my bootlocal.sh as you can see below:
#!/bin/sh
/bin/sleep 1
/usr/local/etc/init.d/alsasound start
/usr/local/sbin/alsactl restore
Just as it stated in the comments section for alsa in the Apps Browser. Not sure at this point if it is even doing anything.