Commit Graph
66 Commits
Author SHA1 Message Date
Yihui Xiong 8e847aa4a4 use alsa mmap feature if supported 2016-07-07 15:28:32 +08:00
Mike Brady 02651562a4 Only try to set volume at play if there's a mixer. 2016-05-09 11:28:37 +00:00
Mike Brady 1b7fceb7d1 Merge pull request #293 from joerg-krause/alsa-softvol
Add support for ALSA softvol plugin
2016-05-07 10:52:05 +01:00
Mike Brady ab979d5967 Fix warning about redefined function. 2016-05-07 08:01:05 +00:00
Jörg Krause f3dcf8d69b Add support for ALSA softvol plugin
The ALSA softvol plugin allows the user to add a new volume control and control
the sound volume by software. This is necessary if the sound card can't control
the volume by hardware.

An example configuration in the `~/.asoundrc` file might look like this:
```
pcm.softvol {
  type softvol
  slave {
    pcm "hw:0"
  }
  control {
    name "Master"
    card 0
  }
  min_dB -57.2
  max_dB -6.2
}
ctl.softvol {
  type hw
  card 0
}
```

The corresponding entries in the shairport-sync would be:
```
alsa =
{
  output_device = "softvol";
  mixer_control_name = "Master";
}
```

Please check the (ALSA documentation)[http://alsa.opensrc.org/Softvol] and the
(ALSA PCM library reference)[http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html]

If shairport-syncs alsa backend does not have success in getting the dB volume
information from the hardware device it tries to get these information from a
software volume control with the name mixer device name as for the hardware
mixer.
2016-05-06 22:23:16 +02:00
Mike Brady 6cfc9f9897 Demote some debug messages, add check for empty or null buffer argument to pcm_snd_writei 2016-05-06 16:28:40 +00:00
Mke Brady dace5b0511 Cleaned up a few warnings detected by clang 2016-04-05 16:48:29 +01:00
Mike Brady ca5526ce85 Brown bag commit -- not printing delay error messages properly. 2016-04-02 20:32:44 +00:00
Mike Brady 1f814c7c78 Tidy up alsa diagnostic messages and reinstate the nominal frame rate. 2016-04-02 15:09:29 +00:00
Mike Brady 0d06016cb8 Clean up alsa settings information output -- make more precise too. 2016-04-01 16:27:06 +01:00
Mike Brady cbc4caa63a Add the ability to set period size and buffer size. List characteristics of the alsa device afterwards. 2016-03-30 12:34:59 +00:00
Mike Brady 1e408d1b7c Make the delay() procedurec return a frame value, positive or negative and a separate status value. Also, don't ever try to change the buffer size. 2016-03-29 16:06:26 +00:00
Mike Brady beae604b70 Put debug message before attempt to recover from snd_pcm_delay negative result 2016-03-29 12:29:54 +00:00
Mike Brady 82a033e590 Use type long for delay as it corresp[onds with the alsa type used 2016-03-29 12:04:34 +00:00
Mike Brady 953ee31349 add option disable synchronization; delay() should return a signed integer, duh. 2016-03-26 21:35:49 +00:00
Mke Brady 24bd670842 Use snd_pcm_delay instead of snd_pcm_avail_delay, see if it fixes an incompatability with some DACs. 2016-03-24 09:26:02 +00:00
Mike Brady fff33fe619 Quieten a few debug messages 2016-02-29 15:07:03 +00:00
Mike Brady da50f19b1a Quieten some more annoying debug messages 2016-02-22 14:42:13 +00:00
Mike Brady e525bbe266 Turn off an annoying debug message 2016-02-22 14:18:31 +00:00
Mike Brady 0f14aad875 Unlock mutex when initialising a device without a hardware mixer. Add check for hardware mixer to uses of mixer handle 2016-02-20 13:46:27 +00:00
Mike Brady 7b94913c17 Add a few debug messages, a few more lock/unlocks and tidy up a bit. 2016-02-08 22:05:19 +00:00
Mike Brady 686082b34d Take a little more care of access to the alsa system; wait 100 ms after finishing with it to release data strucutres 2016-02-02 14:43:37 +00:00
Mike Brady d414c07ec3 Check for existence of a hardware mixer before messing with it. 2016-01-26 22:32:51 +00:00
Mike Brady ae0c974512 Release and reacquire the hardware mixer in tandem with the output device. This ensures the mixer volume setting is correctly reset by the mixer on resumption after a pause, and not ignored as before. 2016-01-26 13:22:10 +00:00
Mke Brady 4e395ff3a5 Tiny changes 2015-12-26 15:14:01 +00:00
Mike Brady 53b289618d Fix unintended deletion of two definitions 2015-12-21 13:44:59 +00:00
Mike Brady d5881f636e Add some extra diagnostics to setting the desired buffer length in ALSA 2015-12-21 13:12:31 +00:00
Mike Brady 9725830d9a Use the correct tag name for desired alsa buffer length -- audio_backend_buffer_desired_length 2015-12-18 13:39:51 +00:00
Mike Brady 33e39b7eb7 Add some extra information to the notices placed in the logfile if there are prtoblems with alsa 2015-11-24 12:18:29 +00:00
Mike Brady b0bfbdc04e Add back in the code used to store the volume level set initially. 2015-11-09 13:29:04 +00:00
Mike Brady b5e4b258f9 Hook up the mute function. 2015-11-07 19:07:37 +00:00
Mike Brady 4c70223f5a Work in progress, doesn't compile 2015-11-05 18:03:58 +00:00
Mike Brady c9601426a1 Check desired buffer length -- abort if not feasible 2015-10-31 13:27:15 +00:00
Mike Brady 22a8664d61 Add some extra error checking to alsa initialisation, add shairport-sync.exe to .gitignore 2015-10-31 12:42:42 +00:00
Mke Brady ea25011394 Functional volume_range_db setting in the general stanza 2015-10-07 22:33:20 +01:00
Mike Brady 2a4f404953 Disable using linear mixer scale for the time being. 2015-10-03 21:33:10 +01:00
Mke Brady b82952dc13 Remove some scaffolding, turn off some debug messages 2015-10-03 20:26:06 +01:00
Mke Brady ba02dee443 playing with using just a linear mixer 2015-10-03 12:49:56 +01:00
Mike Brady e052b5fb9e Use pkg-config to find libdaemon -- useful in FreeBSD -- and quieten a few warnings in FreeBSD 2014-10-11 19:55:29 +01:00
Mike Brady 312bcd03ba Remove mixer_type or -t stuff, add messages about deprecation 2015-08-20 10:15:12 -04:00
Mike Brady 3d10ddb5b5 Remove separate latencies for software and hardware mixers in alsa back end. 2015-07-10 14:56:30 +00:00
Mike Brady 8c68c722ea Reverty the hardware buffer size to 6615 -- might get rid of it. 2015-07-01 10:21:30 +00:00
Mike Brady 4654d9201d Fix small bug associating chosen buffer length 2015-06-18 16:56:04 +00:00
Mike Brady 193fd3f0ca Use two different buffer sizes for alsa -- a short one for software mixer, a longer one for hardware mixer, giving more resilience against delays, etc. without affecting responsiveness 2015-06-18 16:14:40 +00:00
Mike Brady 58a13cf800 Modify latency and buffer size limits, fix a few dying message bugs. 2015-06-02 13:18:07 +00:00
Mke Brady 87a0475c16 Reformat using clang-format. 2015-06-01 23:16:50 +01:00
Mke Brady c56a9ee26e Add support for settable buffer length and latency offset. 2015-06-01 21:36:18 +01:00
Mike Brady 744214df54 Apply command line arguments _after_ sewttings from configuration file 2015-05-20 19:58:07 +00:00
Mike Brady d1b06891af Parse libconfig info during init. 2015-05-04 17:15:19 +01:00
Mike Brady a2790fc102 Improve metadata output -- maybe it works reliably now. Add call to get audio parameters from back ends, to be able to give volume metadata. 2015-03-16 11:11:54 +00:00