Re: [Alsa-user] Function providing current output level (like a VU meter)

2015-03-05 Thread Clemens Ladisch
Ray wrote:
> Am 2015-03-03 10:47, schrieb Clemens Ladisch:
>> Ray wrote:
>>> is there some ALSA function which I can use to get the current music
>>> output level from the soundcard output?
>>
>> No; be default, samples are written by the application directly into the
>> DMA buffer, and there is no opportunity for anybode else to listen in.
>
> Ok, this puts an end to my efforts in userland, I suppose. How about 
> kernel-land then?

The DMA buffer is read directly by the hardware.

You would have to route the audio data through some other software (like
PulseAudio or Jack), but these are components on top of ALSA, and are
not guaranteed to be use everwhere.  That said, PulseAudio probably does
what you want.


Regards,
Clemens

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Alsa-user] Continuous Recording

2015-03-05 Thread Robin _
Hi All,

I am working on an audio logger for a University radio station.  The
idea is to log all data to disk, 24/7/365 without interruption.  What
I am finding is that to record 1s of audio, it takes 1s of waiting,
plus a small additional bit of time to copy that audio into userspace,
about 1.8 ms on the system I am using.  Therefore, in a day, I can not
record a full day of audio.   I am not using the MMAP functions, which
I suppose might reduce that delay, if it is mostly caused by copying
the data.  Does that sounds like a solution, or am I missing something
obvious?  Or, if I am reinventing the wheel, does anyone know of a
readymade open source program for 24/7/365 logging?

Thanks,

Robin.

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Continuous Recording

2015-03-05 Thread Alexandre Ratchov
On Thu, Mar 05, 2015 at 09:39:17AM -0800, Robin _ wrote:
> Hi All,
> 
> I am working on an audio logger for a University radio station.  The
> idea is to log all data to disk, 24/7/365 without interruption.  What
> I am finding is that to record 1s of audio, it takes 1s of waiting,
> plus a small additional bit of time to copy that audio into userspace,
> about 1.8 ms on the system I am using.  Therefore, in a day, I can not
> record a full day of audio.   I am not using the MMAP functions, which
> I suppose might reduce that delay, if it is mostly caused by copying
> the data. 

Hi,

I'm not sure to understand the problem. While data's being copied
from memory to disk, your sound card will be recording the next
block of data to memory, so no samples are lost.

> does anyone know of a readymade open source program for 24/7/365
> logging?
> 

AFAICS, any program recording raw samples could do the job
(arecord, sox, etc...)

The problem is how to always keep available space on the
filesystem. The simpler option would to record to a unix pipe and
then store data into 1-day long files without closing the pipe (for
instance with the dd utility). Then, from time to time move old
files away to free space.

HTH

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Alsa-user] Kingston HyperX Cloud II (USB)

2015-03-05 Thread phil
Hi,

I'm using alsa in conjunction with pulseaudio and I get some strange entries in 
my system log. The headset seems to work fine so I'm not sure if it is a real 
problem...

kernel: usb 3-2: 2:1: cannot get freq at ep 0x1
kernel: usb 3-2: 2:1: cannot get freq at ep 0x1
kernel: usb 3-2: 1:1: cannot get freq at ep 0x81
kernel: usb 3-2: 1:1: cannot get freq at ep 0x81
kernel: usb 3-2: 1:1: cannot get freq at ep 0x81
kernel: usb 3-2: 2:1: cannot get freq at ep 0x1
kernel: usb 3-2: 2:1: cannot set freq 44100 to ep 0x1
kernel: usb 3-2: 2:1: cannot get freq at ep 0x1
kernel: usb 3-2: 2:1: cannot get freq at ep 0x1
kernel: usb 3-2: 1:1: cannot get freq at ep 0x81
kernel: usb 3-2: 1:1: cannot set freq 44100 to ep 0x81
kernel: usb 3-2: 2:1: cannot get freq at ep 0x1
kernel: usb 3-2: 2:1: cannot set freq 44100 to ep 0x1
kernel: usb 3-2: 2:1: cannot get freq at ep 0x1
pulseaudio[10020]: ALSA woke us up to write new data to the device, but there 
was actually nothing to write!
pulseaudio[10020]: Most likely this is a bug in the ALSA driver 
'snd_usb_audio'. Please report this issue to the ALSA developers.
pulseaudio[10020]: We were woken up with POLLOUT set -- however a subsequent 
snd_pcm_avail() returned 0 or another value < min_avail.


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Continuous Recording

2015-03-05 Thread Clemens Ladisch
Alexandre Ratchov wrote:
> On Thu, Mar 05, 2015 at 09:39:17AM -0800, Robin _ wrote:
>> does anyone know of a readymade open source program for 24/7/365
>> logging?
>
> AFAICS, any program recording raw samples could do the job
> (arecord, sox, etc...)
>
> The problem is how to always keep available space on the
> filesystem. The simpler option would to record to a unix pipe and
> then store data into 1-day long files without closing the pipe (for
> instance with the dd utility). Then, from time to time move old
> files away to free space.

arecord automatically creates a new file when the old file becomes
too big (2 GB for .wav) or exceeds the length specified with the
--max-file-time option.


Regards,
Clemens

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user