You are not logged in.

#1 2016-05-21 17:54:43

Alexarch
Member
Registered: 2016-05-21
Posts: 11

Problem: cannot get alsa sound on systemd login

System:
4.5.4-1-ARCH x86_64 GNU/Linux
ALSA v1.1.1
HDMI sound

Task description:
I would like to get a short "Boot complete" sound at the point
where the machine is fully up waiting at the "login:".
On "System V"-type init the task is very simple:
insert a line like "aplay Bootup.wav" in 'rc.local'.

PROBLEM
I cannot reproduce this action in the "systemd" Arch.

Tests:
I created a '/usr/lib/systemd/system/test.service' file:

[Unit]
Description=test Service
After=systemd-logind.service

[Service]
Type=simple
ExecStart=/sbin/speaker-test -c2 -l1

[Install]
WantedBy=multi-user.target

This works "perfectly" (OK sound, as I expected) EXCEPT
when I change the "ExecStart" line above to my ultimate goal,

ExecStart=/sbin/aplay /root/Bootup.wav

I do NOT get any sound.

IMPORTANT
Once I log in when I do the very same command
/sbin/aplay /root/Bootup.wav
at the console prompt, I get (as expected) the perfect sound
(also, as expected, a speaker-test continues to work OK).
BTW, Bootup.wav is a short 2-sec sound, especially compared
to the interminable speaker-test sound!
----------------------------------------------------------------------------------
In the final analysis, it seems my problem could be solved
if I knew the answer to the question,

What is the difference in the way ALSA generates sound through
its 'speaker-test' and thorough its 'aplay', for the same
hardware and _configuration_ (/etc/asound.conf, no ~/.asoundrc)
which is affected by the "state" of the system (user logged in or not).

Thanks,
-- Alex

Offline

#2 2016-05-22 17:01:36

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Problem: cannot get alsa sound on systemd login

/root/Bootup.wav

/root   is the home folder of the user root, check it's permissions :

drwxr-x---  21 root root  4096  8 jan 15:34 root

try putting Bootup.wav in /   to test if that works.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB