0

I have a google coral dev board. I want the gstreamer plugin to work with user other than default user mendel .I performed the following steps and ran into problem.

  1. Installed the gstreamer using the following command.
    sudo apt-get install -y gstreamer1.0-plugins-bad gstreamer1.0-plugins-good python3-gst-1.0 python3-gi

  2. Then cloned the mendel user in the following script.

SRC=$1
DEST=$2

SRC_GROUPS=$(id -Gn ${SRC} | sed "s/${SRC} //g" | sed "s/ ${SRC}//g" | sed "s/ /,/g")
SRC_SHELL=$(awk -F : -v name=${SRC} '(name == $1) { print $7 }' /etc/passwd)

useradd --groups ${SRC_GROUPS} --shell ${SRC_SHELL} --create-home ${DEST}
passwd ${DEST}


3. If we save the above file under the name clone-user.sh. Then use the following command
./clone-user.sh mendel user2.

  1. If we switch to the user created above using sudo su - user2 and run the command the gst-launch-1.0 videotestsrc ! waylandsink. Then gstreamer wont work.

  2. Where as the command gst-launch-1.0 videotestsrc ! waylandsink works if we are using a default user. In my case it is mendel.

I have tried the link. But it also doesnot work.

  • Define `GST_DEBUG=3` environment variable or add `-v` command line options to `gst-launch-1.0` see debug messages. – RSATom Feb 19 '20 at 12:55
  • I found out the solution in this [doc](https://docs.google.com/document/d/1JJX1-1DcklfEEyQ5py5Qcyy1fcTYZLRlIfpBRonNiMY/edit?usp=sharing). – Deepanshu Yadav Feb 19 '20 at 13:23
  • But the socket file that is created in the **/run/user/1000** should be also be created for the new user in the directory **/run/user/** . – Deepanshu Yadav Feb 19 '20 at 13:27

1 Answers1

0

You can get the new user's id with:

$ echo $UID

copy the files from /run/user/1000 to the new user's id:

$ cp -r /run/user/1000 /run/user/$UID

own it:

$ sudo chown username:username -R /run/user/$UID/*

set XDG_RUNTIME_DIR:

$ export XDG_RUNTIME_DIR=/run/user/1000

I'm able to do this and run the edgetpu_classify and gst-launch-1.0 with both mendel and root.

Nam Vu
  • 1,727
  • 1
  • 11
  • 24
  • 1
    I agree with your solution , but if look closely the first three lines are not actually required. Because you are setting `XDG_RUNTIME_DIR` as `/run/user/1000`. This approach is listed in the document uploaded. The error actually arises when we set `XDG_RUNTIME_DIR` as `/run/user/$UID`. I have also used a soft link to the socket file using `ln -s /run/user/1000/wayland-0 /run/user/1003/wayland-0` . This approach works. The above socket file is failing when directly copied from `/run/user/1000/` – Deepanshu Yadav Feb 20 '20 at 13:33