Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

AVS don't use Alsa system config, need it to use DMIX. #879

Closed
6 tasks
Smanar opened this issue Jul 26, 2018 · 8 comments
Closed
6 tasks

AVS don't use Alsa system config, need it to use DMIX. #879

Smanar opened this issue Jul 26, 2018 · 8 comments

Comments

@Smanar
Copy link

Smanar commented Jul 26, 2018

Briefly summarize your issue:

Hello, I have problem with skill, eg (if I want to alexa say something during playing music, even if the player is on background).
So I m trying to use this file https://github.com/shivasiddharth/Assistants-Pi/blob/master/audio-drivers/USB-DAC/scripts/asound.conf without changes on alexa.
Just to test I have set "hw0,0", my speaker is "hw1,0".
If I try "aplay sound.wav" I have no sound, normal, but alexa STILL WORKING !!!!

I have tried editing /etc/asound.conf and ~/.asoundrc
I have tried too "aplay -D default sound.wav" it don't work too, in fact alexa is the only app that still working on all the OS (I have too error message on the GUI) ...

What is the expected behavior?

Will be nice if alexa players/renderers use system config file. there is a special audio configuration file somewhere ? It's not the first time I have this kind of incomprehensible sound bug, last time, the only way we have found was a fresh install. Except the previous time, was alexa don't working, and all the OS working.

What version of the AVS Device SDK are you using?

  <1.8.0>

Tell us what hardware you're using:

  • Desktop / Laptop
  • [x ] Raspberry Pi
  • Other - tell us more:

Tell us about your OS (Type & version):

  • Linux
  • MacOS
  • [x ] Raspbian Stretch
  • Raspbian Jessy
  • Other - tell us more:
@Smanar
Copy link
Author

Smanar commented Jul 27, 2018

For information I have in the JSON config file.

 {
    "gstreamerMediaPlayer":{
        "audioSink":"alsasink"
    },

So I have tried too
gst-launch-1.0 -m audiotestsrc ! alsasink

And It don't work, still normal, but why AVS is still working ! Even Gstreamer use system config file. It's like AVS doesn't take care about system config, but in this case how I can use DMIX plugin ?

@celinval
Copy link
Contributor

Hi @Smanar,

The SDK uses the alsa configuration files (.asoundrc and asound.conf). Please check this troubleshooting (Raspberry Pi section) for more information.

@Smanar
Copy link
Author

Smanar commented Jul 27, 2018

Yeah, I know, I had similar bug somes weeks ago. But this time it's not a troubleshooting, if all was normal AVS need to bug too.
I intentionnaly set bad config to make a test, and all is HS atm, aplay/gstreaming/vlc except AVS.

How can you explain it can still working with bad configuration if it use same configuration ?

I can send you all the logs, results from command you want, but to resume I can put all I want in theses 2 files, AVS don't take care about them.

All is bugging ATM with this bad config, except AVS.

It's the second time I have this kind of problem, It's surely from my configuration, but how ? I rly don't have ideas/clues.

Even Gstreaming is buggy with alsasink, how it can work 2s after when I use it with AVS ?

@Smanar
Copy link
Author

Smanar commented Jul 27, 2018

Some examples

pi@raspberrypi:~/sounds $ aplay -D default med_ui_endpointing_touch.wav
ALSA lib pcm_dmix.c:1109:(snd_pcm_dmix_open) unable to open slave
aplay: main:788: erreur à l'ouverture audio: Argument invalide
pi@raspberrypi:~/sounds $ play med_ui_wakesound.wav
ALSA lib pcm_dmix.c:1109:(snd_pcm_dmix_open) unable to open slave
play FAIL formats: can't open output file `default': snd_pcm_open error: Invalid argument

Gstreaming don't working, but no error messages.

But a full working AVS sesssion, with shell command "play" during listening (exactling the same command than the previous), and believe me, all sounds have worked.
https://pastebin.com/A9WQArhR

Seriously, it's not possible, there is other thing than only theses 2 files ...

@Smanar
Copy link
Author

Smanar commented Jul 29, 2018

OK, some new tests, I have tried with pulseaudio, because it can mix audio too.

sudo apt-get install pulseaudio
sudo apt-get install gstreamer1.0-pulse

gst-launch-1.0 -m audiotestsrc ! pulsesink >> working
So I have edited /home/pi/alexa/build/Integration/AlexaClientSDKConfig.json

    "gstreamerMediaPlayer":{
        "audioSink":"pulsesink"
    },

And now new bug

2018-07-29 09:56:47.330 [  4] 9 MediaPlayer:messageReceived:type=error,source=audio_sink
2018-07-29 09:56:47.330 [  4] E MediaPlayer:handleBusMessageError:source=audio_sink,error=Failed to connect\: Connection refused,debug=pulsesink.c(615)\: gst_pulseringbuffer_open_device ()\: /GstPipeline\:audio-pipeline/GstPulseSink\:audio_sink

Do you know a command to test Gstream with distant mp3 and pulseaudio ? to see if the bug is coming from gstream or AVS ? I don't think it's a missing pluggin because it work with alsasink.

Also tried

    "gstreamerMediaPlayer":{
         "outputConversion":{
             "rate":16000,
             "format":"S16LE",
             "channels":1
         },"audioSink":"pulsesink"
    },

@Smanar
Copy link
Author

Smanar commented Jul 29, 2018

Lol, and just for fun, I wanted to try the bcm2835 because I have read somewhere it had 8 channel.
And now AVS is locked on usb card. I can change everything I want in the config, impossible to use the jack output.
I have on the same raspberry 3/4 media players, the google assistant, all are using jack output ATM, ...... except AVS ^^.

There is something modified only during compilation ?

@kclchan
Copy link
Contributor

kclchan commented Dec 14, 2018

Hi @Smanar, since we use "sudo bash startupsample.sh" to run the SampleApp, the SampleApp is actually using the .asoundrc in the /root directory, so maybe you can try this:

sudo su -
nano /root/.asoundrc

And modify it based on your system. Hope this helps!

@visayamv
Copy link
Contributor

visayamv commented Jan 4, 2019

I am closing this issue due to inactivity, please reopen if you need more assistance regarding this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants