Raspberry Pi Audio Only Works for Pi User

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
StellarDoor5319
Engineer
Engineer
Posts: 3
Joined: 30 Apr 2018 15:11

Raspberry Pi Audio Only Works for Pi User

Post 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?
Image
leifbk
Chairman
Chairman
Posts: 810
Joined: 23 Dec 2013 16:33
Location: Bærum, Norway

Re: Raspberry Pi Audio Only Works for Pi User

Post 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.
StellarDoor5319
Engineer
Engineer
Posts: 3
Joined: 30 Apr 2018 15:11

Re: Raspberry Pi Audio Only Works for Pi User

Post by StellarDoor5319 »

The user is a member of all the groups that the default "pi" user is in, including "audio".
Image
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Raspberry Pi Audio Only Works for Pi User

Post 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.)
Being a retired OpenTTD developer does not mean I know what I am doing.
StellarDoor5319
Engineer
Engineer
Posts: 3
Joined: 30 Apr 2018 15:11

Re: Raspberry Pi Audio Only Works for Pi User

Post 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?
Image
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Raspberry Pi Audio Only Works for Pi User

Post 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.
Being a retired OpenTTD developer does not mean I know what I am doing.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 6 guests