WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: alsa.tcz generates error message  (Read 3971 times)

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
alsa.tcz generates error message
« on: September 15, 2015, 05:41:11 PM »
Hi guys,

I am using

Code: [Select]
tc@box:/usr/local/tce.installed$ version
7.0alpha3

tc@box:~$ uname -a
Linux box 4.1.6-piCore+ #1 PREEMPT Fri Aug 28 07:13:51 CEST 2015 armv6l GNU/Linux

and I get this error message when alsa.tcz loads.

Code: [Select]
amixer: Mixer attach default error: No such file or directory
I believe the error is generated here /usr/local/tce.installed/alsa

Code: [Select]
tc@box:/usr/local/tce.installed$ cat alsa
#!/bin/sh

[ -e /etc/udev/rules.d/90-alsa-restore.rules ] || sudo ln -s /usr/local/etc/udev/rules.d/90-alsa-restore.rules /etc/udev/rules.d/ > /dev/null 2>&1

udevadm control --reload-rules 2> /dev/null
udevadm trigger 2> /dev/null

[ -d /opt/alsa ] || mkdir /opt/alsa

if [ ! -d /var/lib/alsa ]; then
  mkdir -p /var/lib/alsa
fi

if [ ! -e /usr/local/etc/asound.state ]; then
  amixer set Master on 60
fi

Code: [Select]
tc@box:/usr/local/tce.installed$ amixer set Master on 60
amixer: Mixer attach default error: No such file or directory

AFAIK this script contains multiple errors and I am not sure we actually need this startup script at all.

I did make a version of alsa.tcz without the alsa startup script and piCorePlayer still worked in minimal tests.

I have noticed this error message for a long time it is just with the release of the piScreen other people are noticing the error message as well.

regards
Greg






gordon64

  • Guest
Re: alsa.tcz generates error message
« Reply #1 on: September 15, 2015, 07:50:43 PM »
Hi

I don't use RPi so I hope bmarkus does not mind me making a suggestion.

Greg Erskine
Some suggestions for you
Please set your mixer levels
Save those mixer levels with
Code: [Select]
sudo alsactl storecheck if a new file exists called /usr/local/etc/asound.state

If not found then try this
Code: [Select]
sudo alsactl -f /usr/local/etc/asound.state storethen save that file in your backup file


add script to bootlocal
/usr/local/sbin/alsactl restore
reboot to test

retest script....it should no longer give an error as
1) the file is found
2) the restore mixer volumes will be set

good luck
« Last Edit: September 15, 2015, 07:57:15 PM by gordon64 »

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: alsa.tcz generates error message
« Reply #2 on: September 15, 2015, 08:32:39 PM »
hi gordon64,

Thanks for you help.

"sudo alsactl store" by default writes /var/lib/alsa/asound.state so doing a "sudo alsactl -f /usr/local/etc/asound.state store" will overcome the issue but is it the right solution?

It would be good if both use the same default location.

Next, we skip this command if /usr/local/etc/asound.state exists but "amixer set Master on 60" still produces an error message.

Code: [Select]
tc@box:/var/lib/alsa$ amixer set Mixer on 60
amixer: Unable to find simple control 'Mixer',0

It looks like the Simple mixer control is called PCM not Mixer.

Code: [Select]
tc@box:/var/lib/alsa$ amixer
Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback 0 [96%] [0.00dB] [on]
tc@box:/var/lib/alsa$ amixer set Master on 60
amixer: Unable to find simple control 'Master',0

Code: [Select]
tc@box:/var/lib/alsa$ amixer set PCM on 60
Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback 60 [97%] [0.60dB] [on]

regards
Greg

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: alsa.tcz generates error message
« Reply #3 on: September 16, 2015, 01:02:54 AM »
Thanks for feedback. ALSA startup script was copied over from x86 5.x (4x) version and didn't changed as ALSA was working. I'm not using sound too much. Looks like it is the time to review it.

Advice for updated startup script welcome.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: alsa.tcz generates error message
« Reply #4 on: September 17, 2015, 03:28:51 AM »
Seems that there is no soundcard installed and initiated correctly.
Use:
Code: (bash) [Select]
aplay -l
to display all available cards.
If there is no card found, you need to set some via overlays, even the integrated one need to be enabled via overlay:
Code: (bash) [Select]
dtparam=audio=on

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: alsa.tcz generates error message
« Reply #5 on: September 17, 2015, 03:34:51 AM »
You are right, by default no any soundcard. The bult-in SoC audio kernel module is not modprobed to avoid issues with USB sound devices, it must be done explicitely in bootlocal.sh

We can add a startup script back to alsa-modules-KERNEL.tcz to to modprobe or possibly a more clever script to make it only if no other sound card installed.

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: alsa.tcz generates error message
« Reply #6 on: September 20, 2015, 10:00:29 PM »
You are right, by default no any soundcard. The bult-in SoC audio kernel module is not modprobed to avoid issues with USB sound devices, it must be done explicitely in bootlocal.sh

We can add a startup script back to alsa-modules-KERNEL.tcz to to modprobe or possibly a more clever script to make it only if no other sound card installed.

Hi bmarkus,

I haven't lost interest in this, just the opposite, it's just the more I research ALSA the bigger can of worms it gets.

Generally, the existing ALSA scripts don't really apply to the Raspberry Pi. Files and directories are different or don't exist. I don't even think any startup scripts are really needed anymore???

Most of the conf files are PCI related devices that will never be available on the Raspberry Pi and one script run lspci which is not appropriate for the RPi.

I can't find Raspberry Pi specific conf files. It just uses generic alsa configuration.

I realise I have a couple of problems:

1. I don't understand all the different startup procedures of the various flavours of Linux, so I can't relate information on the internet to Rasbian and piCore.
2. I don't comprehend how much work is required maintaining a modified version of ALSA specifically tailored for the Raspberry Pi.
3. ALSA seems to have changed a lot and most of the information on the internet seems to be referring to the older versions of ALSA.

regard
Greg