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

Incorrect MIXER_TRACK choosen #307

Closed
levesqu6 opened this Issue Jan 3, 2013 · 4 comments

Comments

2 participants
@levesqu6

levesqu6 commented Jan 3, 2013

mopidy appears to select a incorrect mixer track when using Logitech Z-10 USB speakers.

issue worked around by adding the following to settings.py

OUTPUT = u'alsasink'
MIXER_TRACK = u'Master'

mopidy log follows

INFO     2013-01-03 15:47:01,091 [7328:MainThread] mopidy.utils.log
  Starting Mopidy 0.11.1
INFO     2013-01-03 15:47:01,095 [7328:MainThread] mopidy.utils.log
  Platform: Linux-3.2.0-4-amd64-x86_64-with-debian-7.0
INFO     2013-01-03 15:47:01,095 [7328:MainThread] mopidy.utils.log
  Python: CPython 2.7.3rc2
DEBUG    2013-01-03 15:47:01,097 [7328:MainThread] mopidy.utils
  Loading: mopidy.backends.local.LocalBackend
WARNING  2013-01-03 15:47:01,101 [7328:MainThread] mopidy.backends.local
  Could not open tag cache: [Errno 2] No such file or directory: u'/home/levesqu6/.local/share/mopidy/tag_cache'
INFO     2013-01-03 15:47:01,101 [7328:MainThread] mopidy.backends.local
  Loading tracks from /home/levesqu6/None using /home/levesqu6/.local/share/mopidy/tag_cache
INFO     2013-01-03 15:47:01,102 [7328:MainThread] mopidy.backends.local
  Loading playlists from /home/levesqu6/.local/share/mopidy/playlists
DEBUG    2013-01-03 15:47:01,104 [7328:MainThread] mopidy.utils
  Loading: mopidy.backends.spotify.SpotifyBackend
INFO     2013-01-03 15:47:01,104 [7328:Audio-1] mopidy.audio
  Audio output set to "alsasink"
DEBUG    2013-01-03 15:47:01,123 [7328:Audio-1] mopidy.audio.mixers.auto
  AutoAudioMixer chose: alsamixerelement1
INFO     2013-01-03 15:47:01,124 [7328:Audio-1] mopidy.audio
  Audio mixer set to "alsamixer" using track "Bass Boost"
INFO     2013-01-03 15:47:01,127 [7328:SpotifyBackend-4] mopidy.backends.spotify
  Mopidy uses SPOTIFY(R) CORE
DEBUG    2013-01-03 15:47:01,129 [7328:SpotifyBackend-4] mopidy.backends.spotify
  Connecting to Spotify
DEBUG    2013-01-03 15:47:01,132 [7328:SpotifyThread] mopidy.utils.process
  SpotifyThread: Starting thread
DEBUG    2013-01-03 15:47:01,134 [7328:SpotifyThread] mopidy.backends.spotify
  System message: 20:47:01.134 I [offline_authorizer.cpp:297] Unable to login offline: no such user
DEBUG    2013-01-03 15:47:01,134 [7328:SpotifyThread] pyspotify.manager.session
  No message received before timeout. Processing events
DEBUG    2013-01-03 15:47:01,134 [7328:Dummy-5] mopidy.backends.spotify
  System message: 20:47:01.134 I [ap:1752] Connecting to AP ap.spotify.com:4070
DEBUG    2013-01-03 15:47:01,135 [7328:SpotifyThread] pyspotify.manager.session
  Will wait 300.041s for next message
ERROR    2013-01-03 15:47:01,139 [7328:MainThread] mopidy.main
  float division by zero
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/mopidy/__main__.py", line 61, in main
    core = setup_core(audio, backends)
  File "/usr/lib/pymodules/python2.7/mopidy/__main__.py", line 164, in setup_core
    return Core.start(audio=audio, backends=backends).proxy()
  File "/usr/lib/pymodules/python2.7/pykka/actor.py", line 461, in proxy
    return _ActorProxy(self)
  File "/usr/lib/pymodules/python2.7/pykka/proxy.py", line 99, in __init__
    self._known_attrs = self._get_attributes()
  File "/usr/lib/pymodules/python2.7/pykka/proxy.py", line 111, in _get_attributes
    attr = self._actor._get_attribute_from_path(attr_path)
  File "/usr/lib/pymodules/python2.7/pykka/actor.py", line 296, in _get_attribute_from_path
    attr = getattr(attr, attr_name)
  File "/usr/lib/pymodules/python2.7/mopidy/core/playback.py", line 280, in get_volume
    return self.audio.get_volume().get()
  File "/usr/lib/pymodules/python2.7/pykka/future.py", line 116, in get
    'raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/pymodules/python2.7/pykka/actor.py", line 194, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/pymodules/python2.7/pykka/actor.py", line 265, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/pymodules/python2.7/mopidy/audio/actor.py", line 393, in get_volume
    avg_volume = float(sum(volumes)) / len(volumes)
ZeroDivisionError: float division by zero
DEBUG    2013-01-03 15:47:01,141 [7328:MainThread] mopidy.utils
  Loading: mopidy.frontends.mpd.MpdFrontend
DEBUG    2013-01-03 15:47:01,183 [7328:MainThread] mopidy.utils.process
  Stopping 0 instance(s) of MpdFrontend
DEBUG    2013-01-03 15:47:01,183 [7328:MainThread] mopidy.utils
  Loading: mopidy.frontends.lastfm.LastfmFrontend
DEBUG    2013-01-03 15:47:01,199 [7328:MainThread] mopidy.utils.process
  Stopping 0 instance(s) of LastfmFrontend
DEBUG    2013-01-03 15:47:01,200 [7328:Dummy-5] mopidy.backends.spotify
  System message: 20:47:01.184 I [ap:1226] Connected to AP: 193.182.8.35:4070
DEBUG    2013-01-03 15:47:01,200 [7328:MainThread] mopidy.utils
  Loading: mopidy.frontends.mpris.MprisFrontend
DEBUG    2013-01-03 15:47:01,247 [7328:MainThread] mopidy.utils.process
  Stopping 0 instance(s) of MprisFrontend
DEBUG    2013-01-03 15:47:01,248 [7328:MainThread] mopidy.utils.process
  Stopping 1 instance(s) of Core
DEBUG    2013-01-03 15:47:01,248 [7328:MainThread] mopidy.utils
  Loading: mopidy.backends.local.LocalBackend
DEBUG    2013-01-03 15:47:01,248 [7328:MainThread] mopidy.utils.process
  Stopping 1 instance(s) of LocalBackend
DEBUG    2013-01-03 15:47:01,248 [7328:MainThread] mopidy.utils
  Loading: mopidy.backends.spotify.SpotifyBackend
DEBUG    2013-01-03 15:47:01,249 [7328:MainThread] mopidy.utils.process
  Stopping 1 instance(s) of SpotifyBackend
DEBUG    2013-01-03 15:47:01,249 [7328:SpotifyBackend-4] mopidy.backends.spotify
  Logging out from Spotify
DEBUG    2013-01-03 15:47:01,249 [7328:MainThread] mopidy.utils.process
  Stopping 1 instance(s) of Audio
DEBUG    2013-01-03 15:47:01,250 [7328:MainThread] mopidy.utils.process
  All actors stopped.
~$ amixer
Simple mixer control 'Bass Boost',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 704
  Mono:
  Front Left: Playback 90 [13%] [-35.38dB] [on]
  Front Right: Playback 90 [13%] [-35.38dB] [on]
Simple mixer control 'Auto Gain Control',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]

~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Speaker [Z-10 USB Speaker], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0


:~$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Speaker
    Z-10 USB Speaker, USB Audio
    Default Audio Device
sysdefault:CARD=Speaker
    Z-10 USB Speaker, USB Audio
    Default Audio Device
front:CARD=Speaker,DEV=0
    Z-10 USB Speaker, USB Audio
    Front speakers
surround40:CARD=Speaker,DEV=0
    Z-10 USB Speaker, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Speaker,DEV=0
    Z-10 USB Speaker, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Speaker,DEV=0
    Z-10 USB Speaker, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Speaker,DEV=0
    Z-10 USB Speaker, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Speaker,DEV=0
    Z-10 USB Speaker, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Speaker,DEV=0
    Z-10 USB Speaker, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

@ghost ghost assigned adamcik Jan 3, 2013

@adamcik adamcik closed this in ea5bb18 Jan 3, 2013

@adamcik

This comment has been minimized.

Member

adamcik commented Jan 5, 2013

@levesqu6 btw, if you have time please try removing the workaround and testing against develop so we have confirmation that this indeed does fix this for you :-)

@levesqu6

This comment has been minimized.

levesqu6 commented Jan 5, 2013

I am out of town for the weekend. I'll try it out sometime this week.

@levesqu6

This comment has been minimized.

levesqu6 commented Jan 13, 2013

pulled from git and it works.

@adamcik

This comment has been minimized.

Member

adamcik commented Jan 13, 2013

Yay, thanks for verifying :-)

adamcik added a commit that referenced this issue Mar 12, 2013

audio: Update mixer track selection logic (fixes #307)
We now ensure that the track we choose has one or more volume channels we can
control. This change also fixes that fact the MIXER_TRACK setting would not
work if we happened to find a track that was flaged as MASTER OUPUT before
finding the right label, so far no one has reported this as an issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment