Bug 839413

Summary: speaker-test does not clear out memory with ctrl-c interrupt disallowing another user from running speaker-test
Product: Red Hat Enterprise Linux 6 Reporter: Dave Sullivan <dsulliva>
Component: alsa-utilsAssignee: Jaroslav Kysela <jkysela>
Status: CLOSED ERRATA QA Contact: Ken Benoit <kbenoit>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.3CC: jshortt, tpelka
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 00:39:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 838951    
Bug Blocks: 1269638, 1270066    

Description Dave Sullivan 2012-07-11 22:03:13 UTC
Description of problem:


usermod -G audio dummy

That works without changing permissions on the /dev/snd/* devices.

[root@seaking ~]# ls -l /dev/snd/*
crw-rw----. 1 root audio 116, 12 Jun 27 18:20 /dev/snd/controlC0
crw-rw----. 1 root audio 116, 11 Jun 27 18:20 /dev/snd/hwC0D2
crw-rw----. 1 root audio 116, 10 Jun 27 18:20 /dev/snd/hwC0D3
crw-rw----. 1 root audio 116,  9 Jun 27 18:20 /dev/snd/pcmC0D0c
crw-rw----. 1 root audio 116,  8 Jun 27 18:23 /dev/snd/pcmC0D0p
crw-rw----. 1 root audio 116,  7 Jun 27 18:20 /dev/snd/pcmC0D1c
crw-rw----. 1 root audio 116,  6 Jun 27 18:20 /dev/snd/pcmC0D1p
crw-rw----. 1 root audio 116,  5 Jun 27 18:20 /dev/snd/pcmC0D2c
crw-rw----. 1 root audio 116,  4 Jun 27 18:20 /dev/snd/pcmC0D3p
crw-rw----. 1 root audio 116,  3 Jun 27 18:20 /dev/snd/seq
crw-rw----. 1 root audio 116,  2 Jun 27 18:20 /dev/snd/timer

I went a little bit further with this and created another user dummy2.

Either way that I get this to work, the way above or the way from Comment #19.

If I log in as two consoles.

console1
su - dummy

console2
su - dummy2

console1
speaker-test
#it works, so ctrl-c

console2
speaker-test
#it doesn't work

[dummy2@seaking ~]$ speaker-test 

speaker-test 1.0.21

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:985:(snd_pcm_dmix_open) unable to create IPC semaphore
Playback open error: -13,Permission denied
ALSA lib pcm_dmix.c:985:(snd_pcm_dmix_open) unable to create IPC semaphore
Playback open error: -13,Permission denied

but if I go back to root in console2 I can simultaneously have both root and dummy running speaker-test at the same time, I can hear both working.

so if I do an ipcs -a I see some sem/shm left around for dummy after I do a ctrl-c, I suspect this is a bug with speaker-test.

because as soon as I remove the sem and shared memory, I can then run speaker-test as  dummy2

let me try to find another way to test the sound, nevermind

#-l option let's speaker-test stop after so many iterations, and doing it this way cleans up the shared memory/semaphores
speaker-test -c 2 -t wav -l 1

once that is cleared up I can then run as the other user dummy2

Note the adding of dummy to the audio group was only to allow users to run speaker-test from a root owned 777 directory

See following KCS article.
https://access.redhat.com/knowledge/solutions/128963

This case is just to ensure that speaker-test on ctrl-c clears out shared memory.

Comment 6 RHEL Program Management 2012-10-03 14:26:25 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 7 Jaroslav Kysela 2013-03-22 13:06:06 UTC
This patch should solve this issue:

http://git.alsa-project.org/?p=alsa-utils.git;a=commitdiff;h=741064c601754b5cbf3bed14fdab6115dd3f9500

Comment 8 RHEL Program Management 2013-10-14 00:34:10 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 12 Ken Benoit 2016-02-17 18:56:10 UTC
Installed RHEL-6.7 on a test system and ran the following commands:

# useradd -G audio dummy1
# useradd -G audio dummy2

From a separate terminal:

# su - dummy1
$ speaker-test
...
Performed ctrl-c

From a separate terminal:

# su - dummy2
$ speaker-test

speaker-test 1.0.23

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:985:(snd_pcm_dmix_open) unable to create IPC semaphore
Playback open error: -13,Permission denied

Reinstalled RHEL-6.8-20160217.n.0 (x86_64 and i386) and through the same steps as above. speaker-test was able to run for both users without issue. Marking as verified.

Comment 14 errata-xmlrpc 2016-05-11 00:39:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0921.html