Cannot open the same soundcard for Output and Vinyl Control when using OSS API

Bug #534076 reported by Phillip Whelan
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Won't Fix
High
Unassigned

Bug Description

When I try to open the same soundcard for Vinyl Control Input as the card I'm using for Output Mixxx hangs.

Apparently it is some kind of deadlock in libportaudio:

Thread 1 (Thread 0x7fcadb9ac7a0 (LWP 24697)):
#0 0x00007fcad63913c1 in sem_wait () from /lib/libpthread.so.0
#1 0x00007fcad65b75bd in ?? () from /usr/lib/libportaudio.so.2
#2 0x0000000000612c98 in SoundDevicePortAudio::open (this=0x7fcac00edd60)
    at src/sounddeviceportaudio.cpp:223
#3 0x0000000000607ea1 in SoundManager::setupDevices (this=0x7fcac009ef60)

Before it hangs I usually get the following error message (dialog box):

  Configuration Error:
        Audio device could not be opened

Steps to Reproduce:

    * Choose the OSS API in Sound Hardware
    * Select a multiple out soundcard for Deck 1 (ch1/ch2)
    * Select the same card for Deck2 (ch3/ch4)
    * Select the same card for Vinyl Control
    * Ignore the Dialog (the drop down does not revert to None anyways)
    * Select the Channels for Vinyl Control on that card

Expected Result:

    No Hang, No error, just plain old good full duplex sound.

Actual Result:

    Dialog Box Error. The Dropdown is *NOT* reset. Hang on selecting the channels.

This may or may not be related to a slew of old bugs.

Tags: vinylcontrol
Revision history for this message
Phillip Whelan (pwhelan) wrote :

This part of the mixxx.log might be relevant:

Debug: [Main]: PortAudio: Started stream successfully
Debug: [Main]: iNumDevicesOpenedForOutput: 1
Debug: [Main]: iNumDevicesOpenedForInput: 0
Debug: [Main]: Displaying mixxx
Debug: [Main]: Running Mixxx
Debug: [Main]: select()
Debug: [Main]: select()
Debug: [Main]: select()
Debug: [Main]: select()
Debug: [Main]: Setting vinyl device #2's channels to: ""
Debug: [Main]: SoundManager::setupDevices()
Debug: [Main]: Building timecode lookup tables...
Debug: [Main]: Starting vinyl control xwax thread
Debug: [Main]: Building timecode lookup tables...
Debug: [Main]: Starting vinyl control xwax thread
Debug: [Main]: SoundDevicePortAudio::open() "1, /dev/dsp1"
Debug: [Main]: m_dSampleRate 44100
Debug: [Main]: iLatencyMSec: 5
Debug: [Main]: output channels: 4 | input channels: 2
Debug: [Main]: iFramesPerBuffer 256
Debug: [Main]: iLatencyMSec: 5
Debug: [Main]: Opening stream with id 1
Debug: [Main]: Error opening stream: Invalid number of channels

That's when the Dialog Error shows up.

The Log for the hang is here:

Debug: [Main]: select()
Debug: [Main]: Setting vinyl device #2's channels to: "2"
Debug: [Main]: SoundManager::setupDevices()
Debug: [Main]: Building timecode lookup tables...
Debug: [Main]: Starting vinyl control xwax thread
Debug: [Main]: Building timecode lookup tables...
Debug: [Main]: Starting vinyl control xwax thread
Debug: [Main]: SoundDevicePortAudio::open() "1, /dev/dsp1"
Debug: [Main]: m_dSampleRate 44100
Debug: [Main]: iLatencyMSec: 5
Debug: [Main]: output channels: 4 | input channels: 4
Debug: [Main]: iFramesPerBuffer 256
Debug: [Main]: iLatencyMSec: 5
Debug: [Main]: Opening stream with id 1
Debug: [Main]: Opened PortAudio stream successfully... starting
Debug: [Main]: Dynamically loaded PortAudio library!

Changed in mixxx:
importance: Undecided → High
tags: added: vinylcontrol
Phillip Whelan (pwhelan)
Changed in mixxx:
status: New → Won't Fix
Revision history for this message
Phillip Whelan (pwhelan) wrote :

I was able to get full duplex working with ALSA.

In case anyone is wondering, I used the a PPA kernel with the new BFS scheduler. With the CPUFREQ set at performance I am able to get 5ms latency with full duplex, using vinyl control.

For now I am marking the bug as wont fix since it seems like the OSS emulation layer does not support full duplex.

Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5357

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.