Master audio output changes to None and not all devices are listed on ALSA in Linux
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Low
|
Phillip Whelan | ||
1.7 |
Fix Released
|
Low
|
Phillip Whelan |
Bug Description
(This has been an issue since at least 1.6.0.)
Normally, Mixxx lists quite a few audio devices using the ALSA API such as front, surround, iec958, the actual sound card, default, dmix, etc. (I normally choose "default.") Sometimes when I start Mixxx though, the list is much shorter, showing only "None," "spdif," "default," and "dmix." Since "default" is normally item #12 or so for me, Mixxx changes to "None" when this happens because there is no #12. I have to restart Mixxx three or four times before the correct list shows again. (If I instead choose "default" off the short list, when the list returns to normal size the wrong device is selected.)
So a quick fix would be to search for the device name rather than its index from the config file (since they're both stored there.) The real fix is to find out why this is happening at all. (_Might_ be related to bug #248202.)
I'm on Debian testing (squeeze).
description: | updated |
description: | updated |
Changed in mixxx: | |
importance: | Undecided → Low |
milestone: | none → 1.6.2 |
status: | New → Confirmed |
description: | updated |
description: | updated |
Changed in mixxx: | |
assignee: | nobody → ironstorm-gmail |
status: | Confirmed → In Progress |
Changed in mixxx: | |
milestone: | 1.7.0-moving → none |
Changed in mixxx: | |
status: | In Progress → Confirmed |
Changed in mixxx: | |
status: | Fix Committed → Confirmed |
Changed in mixxx: | |
status: | Confirmed → Fix Committed |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
I've the problem with sound devices being unavailable can happen a couple of different ways. I've seen it two ways:
1) In the pre-pulseaudio days, if you ran artsd --> there was a sound device timeout that needed to elapse after the last sound was played by artsd before portaudio+ALSA could acquire the handle to the device. I made the mistake of setting timeout to 0 (which actually made it never time out) and I lost the device from Mixxx's ALSA sound list until I set it to 1 second again (the default was more 5 seconds I think). You will still see digital devices in the list as long as artsd is not configured to use them.
2) In the post-pulseaudio days, you can get this situation if you run another non-PA application that requests the exclusive use of the device via ALSA or OSS... One such example is firefox with flash, if the flash plays sound, the device will be used until you close all firefox processes. Another way to reproduce this would be to start 2 copies of Mixxx, the first will bind the device, the second will fail to get that device in the list from portaudio. This is a bit non-obvious because PulseAudio will still play desktop sound effects even though flash has obtained control over the sound card (so there neat trick of software mixing going on there, though it sometimes crackles horribly on AMD64 so it is still much a work in progress).
In both cases it boils down to another device having the handle on primary sound device, and portaudio being unable to get that device when querying ALSA. So when you can't get the handle to that device, Mixxx will look at it and go, this device is gone -> set to None.
The issue is not so much how Mixxx saves the data, which it does as a string (unless your hw0,1 is changing to something else it should match regardless of the order it appears in the list), but rather that if "None" is selected then the primary sound device is not saved at all (which because it is now invalid according to the ALSA list we got back).
One approach to killing this bug would be to institute a message box dialog that pops up whenever the Sound Device is transitioned from "Some Sound Card (hw0,1)" to "None" at device open on start-up. I'm guessing if you put something to the effect:
"Mixxx was unable to bind to 'Some Sound Card (hw0,1)' at start-up, this could be because another application is using the sound device or the device is not plugged in (USB sound cards), would you like to *retry* after closing the other application or reconnected the sound device or *continue* into the Mixxx hardware prefs screen to select a new sound device. You can also read about this problem on our Wiki - [Retry] [Wiki] [Continue]"
When retry is hit, re-poll ALSA, look for the original device and try to re-init it.