enclosure-picroft icon indicating copy to clipboard operation
enclosure-picroft copied to clipboard

Audio input/output selection is overwritten after restart due to bug in auto_run

Open Alfiva opened this issue 2 years ago • 1 comments

Describe the bug Using the release candidate 2021-06-04, the setup wizard works OK, I select USB audio out and USB microphone, and the audio test works OK. But after restart the audio no longer works. I check with pactl info and see that indeed the audio sink is not the one I selected. I use pactl set-default-sink and all other solutions from audio troubleshooting, but after restart it gets back to the prior wrong state.

I managed to figure out that the problem is in auto_run.sh. The one in Release Candidate 2021-06-04 is different from the one in the current main branch (I couldn't pin which commit the RC is using). In this case, the audio section of the wizard uses this to save the audio setup to audio_setup.sh (I show only sink but it's the same for source):

echo 'pactl st-default-sink ${card_name}'

This writes out ${card_name} into audio_setup.sh instead of the actual card name. You have to use double quotes instead of single quotes in order for the variable to be replaced:

echo "pactl st-default-sink ${card_name}"

Otherwise Picroft will use the default device. If it just so happens that the default card number is the one you want, you will not realize the problem.

To Reproduce Steps to reproduce the behavior:

  1. Burn Picroft Release Candidate 2021-06-04 image to RPi
  2. Follow setup wizard
  3. Select audio input and output and check that it works in the audio test
  4. Restart
  5. Audio in/out may no longer work (if they are not the default number)

Expected behavior The audio in/out devices should remain the ones selected during the wizard.

Log files Sorry but I sent my test Raspberry to a user test session and cannot use it right now to get logs.

Environment (please complete the following information):

  • Device type: Raspberry Pi 4 Model B 4GB
  • OS: Picroft Release Candidate 2021-06-04
  • Mycroft-core version: v21.02.0

Additional context I am using the release candidate because it is the only one that works on the newer RPi 4 with 4GB that I used, since the stable version does not work on this newer hardware, as per #164

I am using an eMeet Luna conference speaker/mic combo for audio in/out through a single USB. With the fix described in this issue it works OK, and it also works without any problem in an older RPi that uses the stable version.

Alfiva avatar Jun 23 '22 07:06 Alfiva

Hey, thanks for flagging this. Looks like a fix is already in #153 it just didn't get to the release candidate.

Will see if I can carve out time to do a new RC release

krisgesling avatar Jun 24 '22 07:06 krisgesling