mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.05k stars 567 forks source link

Dev 2.9 - software volume not working #226

Closed moodeaudio closed 8 years ago

moodeaudio commented 8 years ago

Hi Mike,

Did a quick test this morning using DAC that does not have hardware vol controller and 2.9 dev binary does not produce any audio output. Swapping back to version 2.8 binary and audio output happens.

I used same Pi as last nights successful tests using 2.9 dev binary with DAC that had hdwr vol.

-Tim

mikebrady commented 8 years ago

Hi Tim.

As you mentioned in a separate communication, it might be an issue of recompilation – you are running 4.1.15+ whereas the binary was compiled on 4.1.13+. (It seems unlikely to me, TBH.)

Alternatively, could it have anything to do with dtoverlay, I wonder, though it also seems quite unlikely.

At any rate, as soon as I have one of these DACs, I'll have a look at the problem.

joerg-krause commented 8 years ago

I can confirm this! Just tried the latest commit from the development branch...

mikebrady commented 8 years ago

Golly, that's really unexpected. What's your output device?

joerg-krause commented 8 years ago

output device is "softvol", an alsa plugin:

pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0"
        period_size 2048
        buffer_size 16384
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}
pcm.softvol {
    type softvol
    slave { pcm "dmixer" }
    control {
        name "Master"
        card 0
    }
}

I'm running shairport-sync now with commit 686082b34dd80f6544a570fe62ed955bebc30118, which works fine. I'll test tomorrow again with HEAD and get some logs...

mikebrady commented 8 years ago

That would be great thanks.

mikebrady commented 8 years ago

Got a pimoroni pHAT DAC yesterday and have it installed and working. I can confirm the problem with 2.9. Now to see what's causing it...

mikebrady commented 8 years ago

Just pushed a fix of a silly error – the alsa subsystem was locking a mutex upon initialisation and then not unlocking it on completion of initialisation if there was no mixer. The locked mutex prevented access to the alsa system thereafter.

Just to let you know what I'm trying to do – I'm trying to regulate access to the alsa subsystem so that different threads don't interfere with one another, and this involves using mutex locks. Also, the way Shairport Sync terminates a session and restarts is inherited from the original Shairport (though I might have damaged it by mhistake), and needs to be tidied up because of the way iOS 9.2 manages changing tracks and the way the System Audio works when, for example, playing YouTube tracks. So I'm trying to make headway on both of these fronts.

BTW, the pimoroni pHAT is really pretty good – I think I'll get another!

moodeaudio commented 8 years ago

Hi Mike,

Nice! Also thanks to joerg-krause!

-Tim

joerg-krause commented 8 years ago

Version 2.9.1 runs fine now, many thanks for the fix!

moodeaudio commented 8 years ago

Confirming that 2.9.1 OK :-)

Closing issue.