[SOLVED] ALSA equal "Operation not permitted"

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

[SOLVED] ALSA equal "Operation not permitted"

Postby isabido » Wed Jul 30, 2014 7:29 am

I need to start a script at startup to run sound through a PCM type EQUAL. If I run it directly from the SSH session works correctly.

For example:$this->bbcode_second_pass_quote('', ' ')/ usr/bin/aplay-D equal /root/piano2.wav


But if it is run from the "units" start as a service, displays an error that does not have permissions to access the pcm.equal.

$this->bbcode_second_pass_quote('', '[')Unit]
Description=Aplay test

[Service]
ExecStart=/bin/bash -c '/usr/bin /aplay-D equal / root/piano2.wav'

[Install]
WantedBy=multi-user.target


Error to start unit:

$this->bbcode_second_pass_quote('', 'J')ul 30 09:11:28 raspi bash[720]: aplay: main:722: audio open error: Operation not permitted



and this asound settings
/etc/asound.conf
$this->bbcode_second_pass_quote('', '
')ctl.equal {
type equal;
}

pcm.plugequal {
type equal;
slave.pcm "plug:dmix";

}
pcm.equal {
type plug;
slave.pcm plugequal;
}


I created the alsaequal package from the AUR repository.
https://aur.archlinux.org/packages/alsaequal/

Seems to be a permissions issue when trying to access the pcm from a non-interactive session. I could do? Greetings and sorry for my bad English.
Last edited by isabido on Thu Jul 31, 2014 11:46 am, edited 1 time in total.
isabido
 
Posts: 3
Joined: Tue Jul 29, 2014 11:45 pm
Top

Re: ALSA equal "Operation not permitted"

Postby sdjf » Wed Jul 30, 2014 4:36 pm

Try removing the space in the following line between bin and /aplay-D

$this->bbcode_second_pass_code('', '
ExecStart=/bin/bash -c '/usr/bin /aplay-D equal / root/piano2.wav'
')

Also should there be a space between / and root? if the wav file is in root, you have to refer to it with
$this->bbcode_second_pass_code('', '
/root/piano2.wave
')
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: ALSA equal "Operation not permitted"

Postby isabido » Thu Jul 31, 2014 7:25 am

Excuse me, was a copy & paste error, spaces are incorrect. I tried to try on a newly installed Arch X86, and is exactly the same. It's something in the permissions-EQUAL ALSA module.

If I run a SSH session and leave it running as a daemon, it works perfectly, but if I try to load from systemd to have it in the boot, there is no way to make it work.

Thans!
isabido
 
Posts: 3
Joined: Tue Jul 29, 2014 11:45 pm

Re: ALSA equal "Operation not permitted"

Postby moonman » Thu Jul 31, 2014 10:51 am

Add User=root under service?
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: ALSA equal "Operation not permitted"

Postby isabido » Thu Jul 31, 2014 11:14 am

PERFECTLY!!!! THANKS THANKS!

$this->bbcode_second_pass_quote('', '[')root@localhost ~]# systemctl status aplay
â aplay.service - Aplay test
Loaded: loaded (/etc/systemd/system/aplay.service; disabled)
Active: active (running) since jue 2014-07-31 13:12:45 CEST; 4s ago
Main PID: 535 (aplay)
CGroup: /system.slice/aplay.service
ââ535 /usr/bin/aplay -D equal /root/piano2.wav

jul 31 13:12:45 localhost bash[535]: Playing WAVE '/root/piano2.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
isabido
 
Posts: 3
Joined: Tue Jul 29, 2014 11:45 pm
Top


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 4 guests