Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Platform][Audio-Server][PortAudio] Cannot play sound sampled at 22050Hz when playback is set at 16000Hz #148

Open
Psychokiller1888 opened this issue May 22, 2019 · 24 comments

Comments

Projects
None yet
7 participants
@Psychokiller1888
Copy link

commented May 22, 2019

What's the issue?
Always worked with my usb mic, can't get the audio server running on latest version

Use Cases Impacted
No start

How to reproduce
Use a USB dongle mic

Expected behavior
Well, the audio server to start at least

Logs

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
[11:59:21.385278] DEBUG:snips_audio_portaudio : Portaudio: Ok("PortAudio V19-devel (built May  9 2019 13:17:19)")
[11:59:21.385367] DEBUG:snips_audio_portaudio : Looking for default input device
[11:59:21.385555] INFO :snips_audio_portaudio : Use input device: "USB PnP Sound Device: Audio (hw:1,0)"
[11:59:21.385671] DEBUG:snips_audio_portaudio : Start capture: InputSettings { params: Parameters { device: Index(DeviceIndex(1)), channel_count: 1, suggested_latency: 0.008684807256235827, is_interleaved: true, sample_format: PhantomData }, sample_rate: 16000.0, frames_per_buffer: 256, flags:  }
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2043
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2714
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
[11:59:21.387713] DEBUG:snips_audio_portaudio : Mike source capture ended
[11:59:21.407851] DEBUG:snips_audio_portaudio : Attempt 1
[11:59:21.408018] ERROR:snips_audio_server    : InvalidSampleRate

[11:59:21.408024] ERROR:rumqtt::client        : snips-audio-server|915-raspberrypi-1 Disconnected: (Error(SyncMpsc(Disconnected), State { next_error: None, backtrace: None }))
[11:59:21.408064] DEBUG:rumqtt::client        : snips-audio-server|915-raspberrypi-1: Entering reconnecting loop
[11:59:21.408132] INFO :rumqtt::client        : not seeking reconnection
[11:59:21.408155] INFO :rumqtt::client        : client thread done
[11:59:21.408180] ERROR:snips_common_cli::cli : Unable to reconnect to the mqtt broker, ending the program.
pi@raspberrypi:~ $

[Edit cpoisson]

ROOT CAUSE(s)

  • A bug in portaudio prevent sound sampled at 22050 Hz to be played on an audio playback configured at 16000 Hz. This problem does not appears when using alsa directly.
  • For piHAT 2 users, playback and capture interface cannot be set independently. If the capture interface is set with a sampling rate of 16000 Hz, the playback interface will also be set at 16000 Hz (whatever the value set for the playback device)

Workaround
This one solve seem to solve most of the issues.

Add the following options to the snips-audio-server configuration in your snips.toml

[snips-audio-server]
alsa_capture = "default"
alsa_playback = "default"

Workaround 2

this configuration seems to work in most cases:

  • use dsnoop to share the microphone input
  • use dmix to share the sound output
  • Play sample at 22050 Hz on the audio-server
  • Reduce the cpu load of the audio server. (Warning: PiHAT2 users need then to use alsa_playback="default" option of the the audio server)
# The IPC key of dmix or dsnoop plugin must be unique
# If 555555 or 666666 is used by other processes, use another one


# use samplerate to resample as speexdsp resample is bad
defaults.pcm.rate_converter "samplerate"

pcm.!default {
    type asym
    playback.pcm "playback"
    capture.pcm "capture"
}

pcm.playback {
    type plug
    slave.pcm "dmixed"
}

pcm.capture {
    type plug
    slave.pcm "array"
}

pcm.dmixed {
    type dmix
    slave {
        pcm "hw:seeed2micvoicec"
        period_time 0
        period_size 1024
        buffer_size 4096
        # rate 48000, commented, it should be the default output rate for most audio cards
    }
    ipc_key 555555
    ipc_perm 0666 # allow all users to use the dmix interface
}

pcm.array {
    type dsnoop
    slave {
        pcm "hw:seeed2micvoicec"
        channels 2
        rate 16000 # drastically reduce the audio-server cpu consumption by avoiding resampling
        # Warning, for piHAT 2, the playback interface will be also forced to 16000 Hz, you must use alsa_playback="default" option or comment this rate configuration.
    }
    ipc_key 666666
    ipc_perm 0666 # allow all users to use the dsnoop interface
}

@cpoisson cpoisson changed the title Invalid sample rate causes snips-audio-server crash [Platform][Audio-Server] Invalid sample rate causes snips-audio-server crash May 22, 2019

@Psychokiller1888

This comment has been minimized.

Copy link
Author

commented May 22, 2019

Ok, for some reason I need to specify the "speaker" sample rate to 16000 in asound.conf now for the audio server to work

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2019

Thanks for the tip,

We are looking also on our side, here is the result:

Kernel 4.14 - Works fine by only updating the hw address of the usb microphone (like before)

Kernel 4.19 - Does not work when doing the same. We obtain the same results as yours.

After two reboots, the problem was fixed. 🤔

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2019

I have upgraded my Pi,
I confirm that the problem disappear after two reboot. (Without having to set an explicit sample rate)

But now I have lost the piHAT, seems that I need to update its driver.

@Psychokiller1888

This comment has been minimized.

Copy link
Author

commented May 22, 2019

Hmmm, I did reboot maybe 150 times since this morning? Maybe 120 until I posted the bug report ;) I'm creating ProjectAlice installer, rebooting all the time....

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2019

Urm... same thing for the piHAT, after a hard reboot the board is back.

@Psychokiller1888

This comment has been minimized.

Copy link
Author

commented May 22, 2019

Well, I'm gonna wipe the sd an an hour or so, i'll report back ;)

@paulvt

This comment has been minimized.

Copy link

commented May 22, 2019

I have a similar problem, but then with snips-satellite on the Raspberry Pi 3 since upgrading it (including the Snips platform) and switching to using snips-satellite:

May 22 21:05:56 voice snips-satellite[1659]: INFO:snips_audio_portaudio       : Playing "160b3816-c277-4d89-a7d9-a4dc777ee2ce" using output "bcm2835 ALSA: IEC958/HDMI (hw:0,1)", wav spec: WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
May 22 21:05:56 voice snips-satellite[1659]: Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2043
May 22 21:05:56 voice snips-satellite[1659]: Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2717
May 22 21:05:56 voice snips-satellite[1659]: Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
May 22 21:05:56 voice snips-satellite[1659]: thread 'portaudio.player' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"ERROR:snips_audio_server_hermes   : could not play "160b3816-c277-4d89-a7d9-a4dc777ee2ce"
May 22 21:05:56 voice snips-satellite[1659]:  -> caused by: InvalidSampleRate
May 22 21:05:56 voice snips-satellite[1659]: ', src/libcore/result.rs:997:5

Note that using ALSA's speaker-test seems to have no issues doing playback using the set channels/sample rate/bits per sample as logged above:

$ speaker-test -Dhw:0,1 -c 1 -f 4000 -r 22050

speaker-test 1.1.3

Playback device is hw:0,1
Stream parameters are 22050Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 22050Hz (requested 22050Hz)
Buffer size range from 512 to 65536
Period size range from 512 to 65536
Using max buffer size 65536
Periods = 4
was set period_size = 16384
was set buffer_size = 65536
 0 - Front Left
Time per period = 0.011003
 0 - Front Left
[...]
@dnknth

This comment has been minimized.

Copy link

commented May 22, 2019

Same here on RPi3, reboot (as suggested by cpoisson) does not make any difference. Also, we seem to have two issues here:

  • paulvt and I observe a playback problem caused by snips-audio-server or snips-satellite attempting to use the HDMI output (which is not configured in my asound.conf)
  • the original error is related to audio capture.
@Psychokiller1888

This comment has been minimized.

Copy link
Author

commented May 23, 2019

@cpoisson Ok, I have reinstalled my pi about 20 times since yesterday and what I can say is that, on a freshly flashed sd I install Snips and the asound.conf contains the sample rate, everything goes fine. Yes, before installing Snips I force a dist-upgrade, so I'm using the latest headers

@Psychokiller1888

This comment has been minimized.

Copy link
Author

commented May 23, 2019

@dnknth I have to configure the speaker sample rate

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 23, 2019

All those issues seem linked to audio configuration issues and somehow portaudio

@paulvt

There is two things that cause issues:

  • The sampling rate
  • The number of channels used

Nominal configuration

On my side, everything seems ok using the basic configuration.

pcm.!default {
  type asym
   playback.pcm {
     type plug
     slave.pcm "hw:0,0"
   }
   capture.pcm {
     type plug
     slave.pcm "hw:1,0"
   }
}

everything means:

  • Microphone input is correctly captured
  • Playing 16bit wave 1 and 2 channels from 16000 to 44100 sampling rate

Advanced Configuration

but...

Things got a bit weird when I tried a more advanced configuration, then I could not play 2 channels wav files.

The audio-server does not crash but produces an error related to the configuration of the sound card I try to use. (like @paulvt)

[15:03:46.826433] INFO :snips_audio_portaudio      : Playing "dd6b17ed-61b9-435c-b989-bbb027d740a1" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
[15:03:46.834631] DEBUG:snips_audio_portaudio      : Padding output with 87 frames
Expression 'alsa_snd_pcm_hw_params_set_rate_near( pcm, hwParams, &setRate, NULL )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3196
Expression 'paUnanticipatedHostError' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2717
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
[15:03:46.841516] ERROR:snips_audio_server_hermes  : could not play "dd6b17ed-61b9-435c-b989-bbb027d740a1"
 -> caused by: UnanticipatedHostError

One channel wave file are still played correctly.

[15:07:14.628654] INFO :snips_audio_portaudio      : Playing "8ewnjksdf093jb42" using output "default", wav spec: WavSpec { channels: 1, sample_rate: 44100, bits_per_sample: 16, sample_format: Int }
[15:07:14.681155] DEBUG:snips_audio_portaudio      : Padding output with 173 frames
[15:07:18.907815] INFO :snips_audio_portaudio      : Playing of "8ewnjksdf093jb42" finished

The error comes from PortAudio (An open source library we use to play and record sound to abstract the platform used)

Workaround

It is possible to use alsa directly and bypass this middle man using the following options of snips-audio-server

        --alsa_capture <ALSA_CAPTURE>      Use the specified ALSA device instead of the default as a source
        --alsa_playback <ALSA_PLAYBACK>    Use the specified ALSA device instead of the default as a playback

In this case, things get back to normal

using sudo -u _snips snips-audio-server -v --alsa_playback default (using snips.toml, just add alsa_playback = "default" in the snips-audio-server section.

[15:08:58.887233] INFO :snips_broadcast_mqtt_server: Starting broadcasting audio on hermes as site "default"
[15:09:01.689453] INFO :snips_audio_alsa::playback : Using ALSA output Some("playback") ("USB Audio") for "efc6b6f6-da07-40f1-ac81-f94f4d46a6e9", WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
[15:09:02.186136] INFO :snips_audio_alsa::playback : Playback for efc6b6f6-da07-40f1-ac81-f94f4d46a6e9 finished
[15:09:07.002661] INFO :snips_audio_alsa::playback : Using ALSA output Some("playback") ("USB Audio") for "51566ca0-efb4-4390-bbb7-667440a74302", WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
[15:09:08.128028] INFO :snips_audio_alsa::playback : Playback for 51566ca0-efb4-4390-bbb7-667440a74302 finished
[15:09:08.165773] INFO :snips_audio_alsa::playback : Using ALSA output Some("playback") ("USB Audio") for "18c7a675-dddd-4338-a34e-f7f9d6759a8b", WavSpec { channels: 2, sample_rate: 44100, bits_per_sample: 16, sample_format: Int }
[15:09:08.541095] INFO :snips_audio_alsa::playback : Playback for 18c7a675-dddd-4338-a34e-f7f9d6759a8b finished

I'll investigate a bit more on alsa configuration and why portaudio chokes on it in some cases.

@cpoisson cpoisson changed the title [Platform][Audio-Server] Invalid sample rate causes snips-audio-server crash [Platform][Audio-Server][PortAudio] Sound cannot be played or recorded for some configuration. (channel or sampling errors) May 23, 2019

@HakanL

This comment has been minimized.

Copy link

commented May 23, 2019

I have the same issue with a brand new install on RPi 3B+ and Respeaker 4-mic hat. I'm using the 3.5mm audio jack on the RPi for playback. Snips can record fine, it detects the wake word, but it fails to playback the ACK sound with an error of paInvalidSampleRate in the log file. The built-in RPi audio output seems to be limited to 44.1kHz, and I can confirm that with the above speaker-test commands as well. But if I use "plughw:0,1" instead of "hw:0,1" in speaker-test then it works fine. However asound.conf already has "type plug", so my guess is that PortAudio is using the "hw" identifier directly instead of going via the "plug" (I don't know ALSA that well to confirm this theory).
If I plug in a USB soundcard then it all works fine, but I want it to all to be integrated, and since we have the "plug" in ALSA I don't see any reason for it to not work.

@HakanL

This comment has been minimized.

Copy link

commented May 23, 2019

I was able to figure out a workaround. I updated the snips-audio-server.service file in /etc/systemd/system/multi-user.target.wants to set the environmental variable PA_ALSA_PLUGHW=1 and now it works!

[Service]
Environment="PA_ALSA_PLUGHW=1"
...
@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 24, 2019

@HakanL interesting, thanks for the tip

pointing to the source

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 24, 2019

Another thing I found out is that the output produce the error only when declared as a dmix plugin, plug seems to work well.

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 27, 2019

Ok, It is getting clearer (not the root cause tough)

  • Using alsa directly there is no issue (--alsa_capture or --alsa_playback)

  • Using portaudio and dmix,

    • dmix must be behind a plug type interface
    • format, rate and channels must be set in /etc/asound.conf for some playback device (or buffer_size and period_size)

e.g.

pcm.playback_pihat {
    type plug
    slave.pcm {
        type dmix
        ipc_key 555555
        slave {
            pcm "hw:1,0"
            period_time 0
            period_size 1024
            buffer_size 4096
            #format S16_LE
            #rate 16000
            #channels 2
         }
    }
}

Here's a link to more documentation about alsa ring buffer.

And more info about alsa plugin documentation

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 27, 2019

Anyway, I'm closing this one as it's more related to alsa configuration.

@cpoisson cpoisson closed this May 27, 2019

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented May 28, 2019

Same issue using pyaudio (based on portaudio)

Here is the output when playing a two channels, 16bits wave file at 22050Hz on a respeaker piHAT2

Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:583:(snd_pcm_dsnoop_open) unable to create IPC semaphore
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:583:(snd_pcm_dsnoop_open) unable to create IPC semaphore
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:583:(snd_pcm_dsnoop_open) unable to create IPC semaphore
Expression 'alsa_snd_pcm_hw_params_set_rate_near( pcm, hwParams, &setRate, NULL )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3201
Expression 'paUnanticipatedHostError' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2053
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2722
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
Traceback (most recent call last):
  File "test.py", line 20, in <module>
    output=True)
  File "/home/pi/venv-pyaudio/local/lib/python2.7/site-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/home/pi/venv-pyaudio/local/lib/python2.7/site-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
IOError: [Errno -9999] Unanticipated host error

Those issue are also driver dependant.

We will patch snips-audio-server to use alsa directly to avoid those issues for makers.

@cpoisson cpoisson reopened this May 28, 2019

@Psychokiller1888

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

I'm still unable to dsnoop my mic. Any idea how to get around this?

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented Jun 11, 2019

@Psychokiller1888

Did you try to configure the snips audio server to use alsa_capture directly?

@Psychokiller1888

This comment has been minimized.

Copy link
Author

commented Jun 29, 2019

@cpoisson
Yeah tried and tried agin with everything... Can't get to share my mic when snips is running

Do you have a working dsnoop config for snips?

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented Jul 10, 2019

Porting here the alsa configuration provided in #165

# The IPC key of dmix or dsnoop plugin must be unique
# If 555555 or 666666 is used by other processes, use another one


# use samplerate to resample as speexdsp resample is bad
defaults.pcm.rate_converter "samplerate"

pcm.!default {
    type asym
    playback.pcm "playback"
    capture.pcm "capture"
}

pcm.playback {
    type plug
    slave.pcm "dmixed"
}

pcm.capture {
    type plug
    slave.pcm "array"
}

pcm.dmixed {
    type dmix
    slave {
        pcm "hw:seeed2micvoicec"
        period_time 0
        period_size 1024
        buffer_size 4096
    }
    ipc_key 555555
    ipc_perm 0666
}

pcm.array {
    type dsnoop
    slave {
        pcm "hw:seeed2micvoicec"
        channels 2
        rate 16000 # drastically reduce the audio-server cpu consumption by avoiding resampling.
    }
    ipc_key 666666
    ipc_perm 0666
}
@farfade

This comment has been minimized.

Copy link

commented Jul 13, 2019

My two cents, even if I don't understand them... I think it could get brighter people on the way to solve the real problem :

I performed an update from stretch to buster, then I tried to update my fully functional snips installation from 0.63.2 to 0.63.3. I'm using pulseaudio.

Snips-audio-server failed to start with the "InvalidSampleRate" error.
I added the

[snips-audio-server] alsa_capture = "default" alsa_playback = "default"

and the "InvalidSampleRate" error let place to a clearer error :

PulseAudio: Unable to connect: Access denied

I added the snips user ("_snips") to the pulse-access group, removed it from the "audio" group, and removed

[snips-audio-server] alsa_capture = "default" alsa_playback = "default"

and it's allright now.

As far as I understand, before buster, there was no control of "pulse-access" membership but "audio" was sufficient; and things changed with buster.

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented Jul 15, 2019

@farfade

Thanks for the tip, It is more pulse audio related but yes you need to set correctly the rights to do so.

@cpoisson cpoisson changed the title [Platform][Audio-Server][PortAudio] Sound cannot be played or recorded for some configuration. (channel or sampling errors) [Platform][Audio-Server][PortAudio] Cannot play sound sampled at 22050Hz when playback is set at 16000Hz Jul 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.