Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

when I "play" (with SoX) a .wav file using my own account on Debian it plays fine:

jcomeau@aspire:~$ play ~petalumarentals/7077809525.1396808357.711.wav 

/home/petalumarentals/7077809525.1396808357.711.wav:

 File Size: 120k      Bit Rate: 128k
  Encoding: Signed PCM    
  Channels: 1 @ 16-bit   
Samplerate: 8000Hz       
Replaygain: off         
  Duration: 00:00:07.52  

In:100%  00:00:07.52 [00:00:00.00] Out:361k  [      |      ]        Clip:0
Done.

however, when I attempt to play it on the same computer after sudoing to another account, it makes no sound, and shows a much smaller number for "Out:" when done:

petalumarentals@aspire:~$ play 7077809525.1396808357.711.wav

7077809525.1396808357.711.wav:

 File Size: 120k      Bit Rate: 128k
  Encoding: Signed PCM    
  Channels: 1 @ 16-bit   
Samplerate: 8000Hz       
Replaygain: off         
  Duration: 00:00:07.52  

In:100%  00:00:07.52 [00:00:00.00] Out:60.2k [     -|-     ]        Clip:0    
Done.

a hint was gained when looking at the strace results of both:

petalumarentals@aspire:~$ strace -eopen play 7077809525.1396808357.711.wav 2>&1 | grep /dev/
open("/dev/shm/pulse-shm-757337927", O_RDONLY|O_NOFOLLOW|O_CLOEXEC) = 7
open("/dev/urandom", O_RDONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 6
open("/dev/shm/pulse-shm-3973466970", O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0700) = 6
open("/dev/shm/pulse-shm-757337927", O_RDONLY|O_NOFOLLOW|O_CLOEXEC) = 9
open("/dev/urandom", O_RDONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 8
open("/dev/shm/pulse-shm-3705645700", O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0700) = 8

and

jcomeau@aspire:~$ strace -eopen play ~petalumarentals/7077809525.1396808357.711.wav 2>&1 | grep /dev/
[snipped]
open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 4
open("/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 4
open("/dev/snd/pcmC0D0p", O_RDWR|O_APPEND|O_NONBLOCK|O_CLOEXEC) = 5
open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 4
open("/dev/snd/timer", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 4
open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 6
open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 6
open("/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 6

also, when I run alsamixer with no args as the new user, PulseAudio comes up as the "card", whereas when I run it from my account, HDA Intel shows by default.

Googling with various related keywords brings up lots of advice on uninstalling or reinstalling PulseAudio, or configuring things as root, but after about an hour still haven't found some simple solution for per-user setting of the default sound card in Debian. there has to be some stupid thing I'm overlooking, but so far nothing has come to mind, other than add the audio group to the new user, which I did early on.

share|improve this question

1 Answer 1

on the advice of my brother, I copied $HOME/.pulse/ and $HOME/.pulse-cookie from jcomeau to petalumarentals, chowning them to petalumarentals, and both SoX play and alsamixer now work the same under both accounts. there must be a better way to set this up, but it works as is.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.