Page 1 of 1

Raspberry Pi Audio Only Works for Pi User

Posted: 30 Apr 2018 17:43
by StellarDoor5319
I have compiled OpenTTD on my raspberry pi. When I run the executable, the program launches without any errors. After an hour, I managed to get the sound working using another thread on this forum.

However, when I switch to my friend's account (sudo is accessible to that account w/o password FYI), the music unexpectedly stops working. Any ideas how to fix this?

Re: Raspberry Pi Audio Only Works for Pi User

Posted: 30 Apr 2018 18:22
by leifbk
StellarDoor5319 wrote:I have compiled OpenTTD on my raspberry pi. When I run the executable, the program launches without any errors. After an hour, I managed to get the sound working using another thread on this forum.

However, when I switch to my friend's account (sudo is accessible to that account w/o password FYI), the music unexpectedly stops working. Any ideas how to fix this?
Don't know about Pi in particular, but on most Linux systems the user must be a member of the "audio" group in order to get sound.

Re: Raspberry Pi Audio Only Works for Pi User

Posted: 30 Apr 2018 19:38
by StellarDoor5319
The user is a member of all the groups that the default "pi" user is in, including "audio".

Re: Raspberry Pi Audio Only Works for Pi User

Posted: 01 May 2018 10:34
by Alberth
Likely something related to music doesn't have the correct ownership and/or access rights, for example the music files themselves?

Being able to use sudo without password is not significant by the way, the system does not switch to a different user to resolve access problems by itself. (Which is a good thing imho, making sure everything has the right owner, group, and access rights is a far better solution.)

Re: Raspberry Pi Audio Only Works for Pi User

Posted: 01 May 2018 14:46
by StellarDoor5319
Alberth wrote:Likely something related to music doesn't have the correct ownership and/or access rights, for example the music files themselves?

Being able to use sudo without password is not significant by the way, the system does not switch to a different user to resolve access problems by itself. (Which is a good thing imho, making sure everything has the right owner, group, and access rights is a far better solution.)
What permissions should I use for the files? I noticed that a separate config file and content-download folder are placed into the user's home directory - so surely the user should own them?

Re: Raspberry Pi Audio Only Works for Pi User

Posted: 02 May 2018 04:29
by Alberth
That seems a good idea indeed.

The program looks for files at several places, depending on how and where you install things. You may want to read the README file, which explains in details how that works.