# Distorted sound after playing http uri

**URL:** <https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045>\
**Category:** Misc\
**Created:** [June 25, 2021, 2:15pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045 "2021-06-25T14:15:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 25, 2021, 2:15pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/1 "2021-06-25T14:15:40Z")

</div>

Hello,

First I want to say thank you to the developers of mopidy for all there work spent in to this great tool.

I hope that I post in the right category, if not feel free to move to the correct one.

I am currently doing a POC to develop a frontend using RFID cards to load playlists in order to make playing audio books easy for kids. In order to have a good user experience I planned to announce the loaded Playlist with text to speach. To have a quick success I use google translate for my tests which is basically a mp3 stream from http. Unfortunately after this stream is played the following track which is a mp3 file has a distorted sound. If I skip in iris one track forward the sound is OK.

My setup is a Raspi 4 with 2GB and audio output alsasink.

Here is my code I am using:

```auto
def my_callback(self,channel):
    global counter  
    self.core.tracklist.clear()
    playlist_name="Ich spiele für Dich " + self.playlists[counter].name
    logger.info("Playing: {0}".format(playlist_name))
    self.core.tracklist.add(uris=["http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=" +playlist_name+"&tl=de"])
    tracks = self.core.playlists.get_items(self.playlists[counter].uri).get()
    track_uris = [track.uri for track in tracks]
    logger.info("Track URI: {0}".format(track_uris))
    self.core.tracklist.add(uris=track_uris)
    self.core.playback.play()
    counter += 1  

```

The complete code of the frontend is available at github:

> <https://github.com/mike1098/mopidy-figlio/blob/develop/mopidy_figlio/frontend.py>

Any help is much appreciated.

greets

Mike

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [June 25, 2021, 2:28pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/2 "2021-06-25T14:28:31Z")

</div>

Could you please read [Troubleshooting — Mopidy 3.1.1-1-gf17acacf documentation](https://docs.mopidy.com/en/latest/troubleshooting/) and provide the `deps` and `config` and also a _debug_ log.

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 25, 2021, 5:41pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/3 "2021-06-25T17:41:00Z")

</div>

Hello Nick,

Thanks for your quick reply.  
How can I upload files or do you want me to paste all output in to the reply?  
I found only a solution to upload pictures ☹

Thanks

Mike

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [June 25, 2021, 5:54pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/4 "2021-06-25T17:54:45Z")

</div>

Definitely no pictures thanks. You should be able to paste the first two, and the log you can put at [https://dpaste.com/](https://dpaste.com/)

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 25, 2021, 6:27pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/6 "2021-06-25T18:27:30Z")

</div>

OK, thanks

```auto
[core]
cache_dir = $XDG_CACHE_DIR/mopidy
config_dir = $XDG_CONFIG_DIR/mopidy
data_dir = $XDG_DATA_DIR/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
color = true
config_file =

[loglevels]
mopidy_figlio.frontend = info

[audio]
mixer = software
mixer_volume = 30
output = alsasink
buffer_time = 

[proxy]
scheme = 
hostname = 
port = 
username = 
password = 

[Figlio]
enabled = true

[file]
enabled = true
media_dirs = 
  ~/Music|Music
excluded_file_extensions = 
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 192.168.0.10
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins = 
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir = ~/Music
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = ~/Music

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols = 
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist = 
timeout = 5000

[iris]
enabled = true
country = NZ
locale = en_NZ
spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
data_dir = $XDG_DATA_DIR/iris

```

Executable: /usr/local/bin/mopidy  
Platform: Linux-5.10.17-v7l±armv7l-with-debian-10.9  
Python: CPython 3.7.3 from /usr/lib/python3.7  
Mopidy: 3.1.1 from /usr/local/lib/python3.7/dist-packages  
Pykka: 3.0.1 from /usr/local/lib/python3.7/dist-packages  
importlib-metadata: 4.5.0 from /usr/local/lib/python3.7/dist-packages  
typing-extensions: 3.10.0.0 from /usr/local/lib/python3.7/dist-packages  
zipp: 3.4.1 from /usr/local/lib/python3.7/dist-packages  
requests: 2.21.0 from /usr/lib/python3/dist-packages  
tornado: 6.1 from /usr/local/lib/python3.7/dist-packages  
setuptools: 40.8.0 from /usr/lib/python3/dist-packages  
mopidy-figlio: 0.0.1 from /home/pi/develop/mopidy-figlio  
Mopidy: 3.1.1 from /usr/local/lib/python3.7/dist-packages  
Pykka: 3.0.1 from /usr/local/lib/python3.7/dist-packages  
importlib-metadata: 4.5.0 from /usr/local/lib/python3.7/dist-packages  
typing-extensions: 3.10.0.0 from /usr/local/lib/python3.7/dist-packages  
zipp: 3.4.1 from /usr/local/lib/python3.7/dist-packages  
setuptools: 40.8.0 from /usr/lib/python3/dist-packages  
Mopidy-Iris: 3.58.0 from /usr/local/lib/python3.7/dist-packages  
Pykka: 3.0.1 from /usr/local/lib/python3.7/dist-packages  
importlib-metadata: 4.5.0 from /usr/local/lib/python3.7/dist-packages  
typing-extensions: 3.10.0.0 from /usr/local/lib/python3.7/dist-packages  
zipp: 3.4.1 from /usr/local/lib/python3.7/dist-packages  
Mopidy: 3.1.1 from /usr/local/lib/python3.7/dist-packages  
setuptools: 40.8.0 from /usr/lib/python3/dist-packages  
GStreamer: 1.14.4.0 from /usr/lib/python3/dist-packages/gi  
Detailed information:  
Python wrapper: python-gi 3.30.4  
Relevant elements:  
Found:  
uridecodebin  
souphttpsrc  
appsrc  
alsasink  
osssink  
oss4sink  
id3demux  
id3v2mux  
lamemp3enc  
mpegaudioparse  
mpg123audiodec  
vorbisdec  
vorbisenc  
vorbisparse  
oggdemux  
oggmux  
oggparse  
flacdec  
flacparse  
shout2send  
Not found:  
pulsesink  
flump3dec  
mad

```auto
type or paste code here

```

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 25, 2021, 6:39pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/7 "2021-06-25T18:39:01Z")

</div>

Config:  
[https://dpaste.com/BFFC3LA5H](https://dpaste.com/BFFC3LA5H)

Deps:  
[https://dpaste.com/H492RV7UZ](https://dpaste.com/H492RV7UZ)

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 25, 2021, 6:41pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/8 "2021-06-25T18:41:35Z")

</div>

Debug:  
[https://dpaste.com/9C7RKSCQ4](https://dpaste.com/9C7RKSCQ4)

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 30, 2021, 2:00pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/9 "2021-06-30T14:00:46Z")

</div>

Hello,

I implemented GStreamer in my frontend to play announcments as was not successful using mopidy.audio.  
Current problem I have is that the playing of MP3 tracks doesnt stop with self.core.playback.stop(). The track continous playing even that playback.get\_state() says its stopped.  
With HTML streams I dont have this issue.

Current code could be found here:

> <https://github.com/mike1098/mopidy-figlio/blob/develop/mopidy_figlio/frontend.py>

I will post deps, config and debugs later.

Any help is much appreceated.

thanks

Mike

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 30, 2021, 6:19pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/10 "2021-06-30T18:19:15Z")

</div>

Executable: /usr/local/bin/mopidy  
Platform: Linux-5.10.17-v7l±armv7l-with-debian-10.9  
Python: CPython 3.7.3 from /usr/lib/python3.7  
Mopidy: 3.1.1 from /usr/local/lib/python3.7/dist-packages  
Pykka: 3.0.1 from /usr/local/lib/python3.7/dist-packages  
importlib-metadata: 4.5.0 from /usr/local/lib/python3.7/dist-packages  
zipp: 3.4.1 from /usr/local/lib/python3.7/dist-packages  
typing-extensions: 3.10.0.0 from /usr/local/lib/python3.7/dist-packages  
requests: 2.21.0 from /usr/lib/python3/dist-packages  
setuptools: 40.8.0 from /usr/lib/python3/dist-packages  
tornado: 6.1 from /usr/local/lib/python3.7/dist-packages  
Mopidy-Iris: 3.58.0 from /usr/local/lib/python3.7/dist-packages  
Pykka: 3.0.1 from /usr/local/lib/python3.7/dist-packages  
importlib-metadata: 4.5.0 from /usr/local/lib/python3.7/dist-packages  
zipp: 3.4.1 from /usr/local/lib/python3.7/dist-packages  
typing-extensions: 3.10.0.0 from /usr/local/lib/python3.7/dist-packages  
setuptools: 40.8.0 from /usr/lib/python3/dist-packages  
Mopidy: 3.1.1 from /usr/local/lib/python3.7/dist-packages  
mopidy-figlio: 0.0.1 from /home/pi/develop/mopidy-figlio  
Mopidy: 3.1.1 from /usr/local/lib/python3.7/dist-packages  
Pykka: 3.0.1 from /usr/local/lib/python3.7/dist-packages  
importlib-metadata: 4.5.0 from /usr/local/lib/python3.7/dist-packages  
zipp: 3.4.1 from /usr/local/lib/python3.7/dist-packages  
typing-extensions: 3.10.0.0 from /usr/local/lib/python3.7/dist-packages  
setuptools: 40.8.0 from /usr/lib/python3/dist-packages  
GStreamer: 1.14.4.0 from /usr/lib/python3/dist-packages/gi  
Detailed information:  
Python wrapper: python-gi 3.30.4  
Relevant elements:  
Found:  
uridecodebin  
souphttpsrc  
appsrc  
alsasink  
osssink  
oss4sink  
id3demux  
id3v2mux  
lamemp3enc  
mpegaudioparse  
mpg123audiodec  
vorbisdec  
vorbisenc  
vorbisparse  
oggdemux  
oggmux  
oggparse  
flacdec  
flacparse  
shout2send  
Not found:  
pulsesink  
flump3dec  
mad

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 30, 2021, 6:20pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/11 "2021-06-30T18:20:28Z")

</div>

[core]  
cache\_dir = /tmp  
config\_dir = ~/.config/mopidy  
data\_dir = ~/Music/data  
max\_tracklist\_length = 10000  
restore\_state = false

[logging]  
verbosity = 0  
format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s  
color = false  
config\_file =

[loglevels]  
mopidy\_figlio.frontend = info

[audio]  
mixer = software  
mixer\_volume = 5  
output = alsasink  
buffer\_time = 5000

[proxy]  
scheme =  
hostname =  
port =  
username =  
password =

[Figlio]  
enabled = true

[file]  
enabled = true  
media\_dirs =  
~/Music|Music  
excluded\_file\_extensions =  
.directory  
.html  
.jpeg  
.jpg  
.log  
.nfo  
.pdf  
.png  
.txt  
.zip  
show\_dotfiles = false  
follow\_symlinks = false  
metadata\_timeout = 1000

[http]  
enabled = true  
hostname = 192.168.0.10  
port = 6680  
zeroconf = Mopidy HTTP server on $hostname  
allowed\_origins =  
csrf\_protection = true  
default\_app = mopidy

[m3u]  
enabled = true  
base\_dir = ~/Music  
default\_encoding = latin-1  
default\_extension = .m3u8  
playlists\_dir = ~/Music

[softwaremixer]  
enabled = true

[stream]  
enabled = true  
protocols =  
http  
https  
mms  
rtmp  
rtmps  
rtsp  
metadata\_blacklist =  
timeout = 5000

[iris]  
enabled = true  
country = NZ  
locale = en\_NZ  
spotify\_authorization\_url = [https://jamesbarnsley.co.nz/iris/auth\_spotify.php](https://jamesbarnsley.co.nz/iris/auth_spotify.php)  
lastfm\_authorization\_url = [https://jamesbarnsley.co.nz/iris/auth\_lastfm.php](https://jamesbarnsley.co.nz/iris/auth_lastfm.php)  
genius\_authorization\_url = [https://jamesbarnsley.co.nz/iris/auth\_genius.php](https://jamesbarnsley.co.nz/iris/auth_genius.php)  
data\_dir = $XDG\_DATA\_DIR/iris

---

<div class="post-metadata">

**Author:** ![mike1098](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/mike1098/32/2316_2.png) [@mike1098](https://discourse.mopidy.com/u/mike1098)\
**Post date:** [June 30, 2021, 6:53pm UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/12 "2021-06-30T18:53:29Z")

</div>

Debug:  
[https://dpaste.com/3NZ9AAX5N](https://dpaste.com/3NZ9AAX5N)

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/system/32/1_2.png) [@system](https://discourse.mopidy.com/u/system)\
**Post date:** [December 30, 2021, 6:53am UTC](https://discourse.mopidy.com/t/distorted-sound-after-playing-http-uri/5045/13 "2021-12-30T06:53:53Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
