WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: alsa-config.tcz inserted into alsa.tcz.dep ?  (Read 5107 times)

Offline nick65go

  • Hero Member
  • *****
  • Posts: 833
alsa-config.tcz inserted into alsa.tcz.dep ?
« on: May 12, 2019, 11:06:10 AM »
Code: [Select]
c@box:~$ arecord -c2 -d2 -f dat test.wav
ALSA lib conf.c:3731:(snd_config_hook_load) cannot stat file/directory /usr/local/etc/alsa/cards/aliases.conf
ALSA lib pcm.c:2501:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.default
arecord: main:828: audio open error: No such file or directory

tc@box:~$ aplatc@box:~$ aplay test.wav
ALSA lib conf.c:3731:(snd_config_hook_load) cannot stat file/directory /usr/local/etc/alsa/cards/aliases.conf
ALSA lib pcm.c:2501:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.default
aplay: main:828: audio open error: No such file or directory

but the file '/usr/local/etc/alsa/cards/aliases.conf' is in alsa-config.tcz
so, few files from alsa.tcz should be in alsa-config.tcz, or  alsa-config.tcz inserted into alsa.tcz.dep ?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #1 on: May 13, 2019, 02:17:23 AM »
alsa-config is kept separate from alsa because it is nearly 1mb in size and is not required in many situations - if you do need it, load it before alsa.

Offline nick65go

  • Hero Member
  • *****
  • Posts: 833
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #2 on: May 13, 2019, 03:46:54 AM »
I have no problem with still keeping them separated. But as I suggested, then maybe arecord (and others) should not be in alsa.tcz
IMHO, any tool in a tcz (without dependency) should work alone, right?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #3 on: May 14, 2019, 12:48:20 AM »
You have a point - the problem is that there are so many hardware possibilities for sound that it is almost impossible to get things right for everybody..

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #4 on: May 14, 2019, 01:44:31 AM »
I have no problem with still keeping them separated. But as I suggested, then maybe arecord (and others) should not be in alsa.tcz
IMHO, any tool in a tcz (without dependency) should work alone, right?
Hi, nick65go!

I am TC newbie, but will try to say a pair of words. As i see, TinyCore extensions are built to allow you get  the full spectre of software features, starting from the basic minimum and finishing with the full-pack. So usually you have two extensions for every suite. So maintainers alsa.tcz compiled sources and divided the output directory tree into two parts - the absolutely needed minimum (without any docs and mans) was packed into alsa.tcz, the rest was put into alsa-config.tcz. For example i use alsa.tcz alone, alsa-config was needed only for the first steps and configuring.
So if maintainers will pack everything into one extension they will leave me without possibility not to overload the system with unused files.
It is excellent approach, for me it is one of TinyCore's killer-features.
I want remind you other Linuxes, for example Debian. You can
Code: [Select]
sudo apt install conky-cli
sudo apt install conky
sudo apt install conky-full

As it was told in Corebook (the brilliant one, i am not tired to repeat!) one of TinyCore concepts is to keep system clean.

So i hope you are not against my attitude to use only alsa basic tools without additional software?

Offline nick65go

  • Hero Member
  • *****
  • Posts: 833
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #5 on: May 15, 2019, 07:48:10 AM »
Hi jazzbiker, I totaly agree with you. I like modularity, small size packages (tcz). Please, allow me to be more clear this time:
My observation was that few appl (aplay) were not working out-of-the box. Maybe it works later, after instaling (one time only) alsa-config.tcz, then remove/forget about alsa-config.tcz;
1 Then my sugestion is to say it so, in the info page of alsa.tcz ;)
2 Or maybe split further alsa.tcz in two: alsa-base.tcz and alsa-apps.tcz (and have alsa-apps.tcz.dep calling alsa-config.tcz). So now is even more modular.

EDIT: no advertise intended here, but have a look of how many (123) small packs has libreoffice in alpine linux, if we talk modularity
Code: [Select]
https://pkgs.alpinelinux.org/packages?name=*libreoffice*&branch=edgeversus one in tinycore. Now this I name it efficiency, if you need only "Excel in English" (pun intended)
« Last Edit: May 15, 2019, 08:01:52 AM by nick65go »

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #6 on: May 15, 2019, 10:21:42 AM »
Hi,nick65go!

I assume such a logic:

1. You install alsa.tcz.
2. You try to play sound with native aplay, not with some external player.
3. If you hear no sound, means you need alsa-config.

Maybe this was the reason?

Offline nick65go

  • Hero Member
  • *****
  • Posts: 833
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #7 on: May 19, 2019, 07:20:15 AM »
hi jazzbiker, my problem i can solve manually. but does not work out-of-the-box as is documented in info files of this web-site.
first i followed the advice to load both:
Code: [Select]
tc@box:~$ tce-load -i alsa-config
alsa-config is already installed!
tc@box:~$ tce-load -i alsa
alsa is already installed!

now my problem was that my intel sound card is the second one (card 1) not the first one (card 0)
Code: [Select]
tc@box:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC3227 Analog [ALC3227 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

tc@box:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: ALC3227 Analog [ALC3227 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

stopping and re-starting alsa server was not helpfully:
Code: [Select]
tc@box:~$ sudo /usr/local/etc/init.d/alsasound status
Alsa is not running.
tc@box:~$ sudo /usr/local/etc/init.d/alsasound stop
alsactl: save_state:1595: No soundcards found...

tc@box:~$ sudo /usr/local/etc/init.d/alsasound start
rmmod: can't unload module 'snd_seq': Resource temporarily unavailable
rmmod: can't unload module 'snd_timer': Resource temporarily unavailable
rmmod: can't unload module 'snd_seq_device': Resource temporarily unavailable
rmmod: can't unload module 'snd': Resource temporarily unavailable
^C

this is because only few modules were unloaded, not all of them.
so now only manually loading them back will work (if you know what to load, after checking with lsmod):
Code: [Select]
tc@box:~$ modprobe soundcore
tc@box:~$ sudo modprobe snd_hda_intel
tc@box:~$ sudo /usr/local/etc/init.d/alsasound status
Alsa is running.

now it works
Code: [Select]
tc@box:~$ arecord -d 2 123test.wav
Recording WAVE '123test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
tc@box:~$ aplay 123test.wav
Playing WAVE '123test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

so my second problem was that i did NOT successfully make alsa to see Intel HDA before AMD HDMI
Code: [Select]
tc@box:~$ cat /etc/modprobe.conf
# /etc/modprobe.conf: Modprobe config file.
#
options snd-hda-intel index=1,0
options radeon aspm=1 vce=1 uvd=1 dynclks=Enable
tc@box:~$
maybe syntax options snd-hda-intel index=1,0 is not correct, i need to 'google it' again.

But, we started from here, not solved at the beginning:
Code: [Select]
tc@box:~$ arecord -c2 -d2 -f dat test.wav
ALSA lib conf.c:3731:(snd_config_hook_load) cannot stat file/directory /usr/local/etc/alsa/cards/aliases.conf
because the folder /usr/local/etc/alsa/cards/ does not exist loading only alsa.tcz, it is created by instaling alsa-conf.tcz
« Last Edit: May 19, 2019, 07:23:16 AM by nick65go »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #8 on: May 19, 2019, 07:35:30 AM »
I have a similar set up - hdmi sound is the default card0 99% of the time and analogue sound is card1.

If I load graphics-KERNEL and alsa, analogue sound works after un-muting the master volume with alsamixer.
If I load graphics-KERNEL, alsa-config and alsa, hdmi and analogue sound work without needing to un-mute the master volume with alsamixer.

In the very few cases analogue sound comes up as the default, I only need to load alsa for sound to work.

In all the above cases, sound will work with pulseaudio.

I contacted the alsa kernel people to point out that it makes no sense for hdmi to be the default on a laptop, but they were not receptive to a fix.

Offline nick65go

  • Hero Member
  • *****
  • Posts: 833
Re: alsa-config.tcz inserted into alsa.tcz.dep ?
« Reply #9 on: May 19, 2019, 07:47:18 PM »
hi juanito, here below are my solutions:

1. for me, neither the /etc/modprobe.conf, nor the /etc/modprobe./*.conf work alone if alsa.tcz is into the onboot.lst. it work only if alsa.tcz is ondemand. so my naive, but efective, solution is in persistent /opt/bootlocal.sh to do unload then load, as
Code: [Select]
modprobe -r snd_hda_intel && modprobe snd_hda_intel, so now /etc/modprobe*/*.conf will do its job.
[of course i have also saved /usr/local/etc/alsa/asound.state for knobs controls].
and flit or alsaMixerGUI can mute/unmute and up/down sound-volum nicely from flwm; not need for bloated pulseaudio for a laptop sound.

2. about my INITIAL proposal, the main subject here, to make aplay and arecord to work, out-of-the-box, without loading alsa-config.tcz, I found that we need two things added in alsa.tcz
- and empty file /usr/local/etc/alsa/cards/aliases.conf
- and file /usr/local/etc/alsa.conf.d/default.conf [762 bytes] , shame-less copied from alsa-config.tcz

I hope that my proposal will help other TC users, to allow testing sound with arecord/aplay, without loading 1 MB for speaker-test, alsactl and *.conf files
« Last Edit: May 19, 2019, 07:57:08 PM by nick65go »