Re: [Alsa-user] How to record audio from a live video (youtube via firefox) ?

2020-12-27 Thread tuxic
Hi,

ok...it works now...somehow...incompletly...so to say 

My $HOME/.asoundrc looks like this:


# default device
pcm.!default {
type plug
slave.pcm "loop"
}

# output device
pcm.loopout {
type dmix
ipc_key 328211
slave.pcm "hw:Loopback,0,0"
}

# input device
pcm.loopin {
type dsnoop
ipc_key 686592
slave.pcm "hw:Loopback,1,0"
}

# duplex plug device
pcm.loop {
type plug
slave {
  pcm {
 type asym
 playback.pcm "loopout"
 capture.pcm "loopin"
  }
}
}


When start firefox and play a video, I can here nothing until I do
this at the commandline:

arecord -f cd -D loop | aplay -f cd -D hw:0,0

The same line can be adapted for recording:

arecord -f cd -D loop .wav

While recording, I can here nothing and vice versa.

It would be nice, if it would be possible, that audio is audible
(that's audio is for :) ) without any actions from my side
(commandline and such) and recording could be done from a device.
That way, screencast software could use this device for recording.

Cheers!
mcc


On 12/27 08:22, tu...@posteo.de wrote:
> Hi,
> 
> this looks interesting:
> http://www.pogo.org.uk/~mark/trx/streaming-desktop-audio.html
> 
> ...but still not the solution.
> 
> The alsaloop command works fine...so the redirection works.
> 
> But I can't record anything still.
> 
> Cheers!
> mcc
> 
> 
> 
> On 12/27 10:47, Robert M. Riches Jr. wrote:
> > (Apologies if you want reply to list without also a direct reply.
> > My mail client has 'reply' and 'Reply' only.)
> > 
> > I am also using pure ALSA.  After a little web searching a few
> > days ago, I came up with this .asoundrc file that records to a
> > raw file:
> > 
> > v cut here v
> > pcm.Intel { type hw; card Intel; }
> > ctl.Intel { type hw; card Intel; }
> > pcm.NVidia { type hw; card NVidia; }
> > ctl.NVidia { type hw; card NVidia; }
> > 
> > pcm.rate48000Hz {
> >   type rate
> >   slave {
> > pcm writeFile # Direct to the plugin which will write to a file
> > format S16_LE
> > # channels 2
> > rate 48000
> >   }
> > #route_policy copy
> > }
> > 
> > pcm.writeFile {
> >   type file
> >   slave {
> > pcm "Intel" # Now write to the actual sound card
> >   }
> >   file "aplay-D_card0-t_raw-f_S16_LE-r48000-c_2.raw"
> >   format "raw"
> > }
> > 
> > pcm.!default {
> >   type plug
> >   slave.pcm "rate48000Hz"
> > }
> > ctl.!default ctl.Intel
> > ^ cut here ^
> > 
> > Caution: Some web browsers take liberties with how they deal with
> > sound.  For example, some years ago, Firefox Hello (video chat)
> > would work only with very specific .asoundrc content.
> > 
> > Changing the sample rate may or may not work.  With Musescore, I
> > had to use exactly 48000, not 44100.
> > 
> > Here are example commands for converting to WAV and then to MP3:
> > 
> > Convert it to WAV:
> > 
> > sox -r 48k -e signed -b 16 -c 2 \
> > aplay-D_card0-t_raw-f_S16_LE-r48000-c_2.raw \
> > -r 44100 something.wav
> > 
> > Crop it as needed.
> > 
> > Optional: Convert it to MP3:
> > 
> > ffmpeg -i something.wav something.mp3
> > 
> > HTH
> > 
> > Robert
> > 
> > 
> > 
> > > Date: Sun, 27 Dec 2020 10:25:14 +0100
> > > From: tu...@posteo.de
> > > To: alsa-user@lists.sourceforge.net
> > > 
> > > Hi,
> > > 
> > >  I want to record the audio of a live stream video (youtube).
> > > 
> > >  Everything I tried resulted in audio files with constant or
> > >  intermitted sine wave like sounds.
> > > 
> > >  I am using pure alsa. I don't want pulseaudio and with jack
> > >  started firefoxs audio does not work.
> > > 
> > >  How can I accomplish this recording task successfully ?
> > > 
> > >  My setup:
> > > 
> > >  GENTOO Linux
> > >  External USB audio DAC (FIIO Olympus 2)
> > > 
> > >  No $HOME/.asoundrc
> > >  /etc/conf.d/alsasound:
> > > 
> > ># RESTORE_ON_START:
> > ># Do you want to restore your mixer settings?  If not, your cards will 
> > > be
> > ># muted.
> > ># no - Do not restore state
> > ># yes - Restore state
> > >
> > >RESTORE_ON_START="yes"
> > >
> > ># SAVE_ON_STOP:
> > ># Do you want to save changes made to your mixer volumes when alsasound
> > ># stops? 
> > ># no - Do not save state
> > ># yes - Save state
> > >
> > >SAVE_ON_STOP="yes"
> > > 
> > >  arecord -l:
> > > 
> > >  List of CAPTURE Hardware Devices 
> > > card 0: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
> > >   Subdevices: 1/1
> > >   Subdevice #0: subdevice #0
> > > 
> > > 
> > >  arecord -L:
> > > null
> > > Discard all samples (playback) or generate zero samples (capture)
> > > default
> > > Default Audio Device
> > > sysdefault
> > > Default Audio Device
> > > lavrate
> > > Rate Converter Plugin Using Libav/FFmpeg Library
> > > upmix
> > > Plugin for channel 

Re: [Alsa-user] How to record audio from a live video (youtube via firefox) ?

2020-12-27 Thread tuxic
Hi,

this looks interesting:
http://www.pogo.org.uk/~mark/trx/streaming-desktop-audio.html

...but still not the solution.

The alsaloop command works fine...so the redirection works.

But I can't record anything still.

Cheers!
mcc



On 12/27 10:47, Robert M. Riches Jr. wrote:
> (Apologies if you want reply to list without also a direct reply.
> My mail client has 'reply' and 'Reply' only.)
> 
> I am also using pure ALSA.  After a little web searching a few
> days ago, I came up with this .asoundrc file that records to a
> raw file:
> 
> v cut here v
> pcm.Intel { type hw; card Intel; }
> ctl.Intel { type hw; card Intel; }
> pcm.NVidia { type hw; card NVidia; }
> ctl.NVidia { type hw; card NVidia; }
> 
> pcm.rate48000Hz {
>   type rate
>   slave {
> pcm writeFile # Direct to the plugin which will write to a file
> format S16_LE
> # channels 2
> rate 48000
>   }
> #route_policy copy
> }
> 
> pcm.writeFile {
>   type file
>   slave {
> pcm "Intel" # Now write to the actual sound card
>   }
>   file "aplay-D_card0-t_raw-f_S16_LE-r48000-c_2.raw"
>   format "raw"
> }
> 
> pcm.!default {
>   type plug
>   slave.pcm "rate48000Hz"
> }
> ctl.!default ctl.Intel
> ^ cut here ^
> 
> Caution: Some web browsers take liberties with how they deal with
> sound.  For example, some years ago, Firefox Hello (video chat)
> would work only with very specific .asoundrc content.
> 
> Changing the sample rate may or may not work.  With Musescore, I
> had to use exactly 48000, not 44100.
> 
> Here are example commands for converting to WAV and then to MP3:
> 
> Convert it to WAV:
> 
> sox -r 48k -e signed -b 16 -c 2 \
> aplay-D_card0-t_raw-f_S16_LE-r48000-c_2.raw \
> -r 44100 something.wav
> 
> Crop it as needed.
> 
> Optional: Convert it to MP3:
> 
> ffmpeg -i something.wav something.mp3
> 
> HTH
> 
> Robert
> 
> 
> 
> > Date: Sun, 27 Dec 2020 10:25:14 +0100
> > From: tu...@posteo.de
> > To: alsa-user@lists.sourceforge.net
> > 
> > Hi,
> > 
> >  I want to record the audio of a live stream video (youtube).
> > 
> >  Everything I tried resulted in audio files with constant or
> >  intermitted sine wave like sounds.
> > 
> >  I am using pure alsa. I don't want pulseaudio and with jack
> >  started firefoxs audio does not work.
> > 
> >  How can I accomplish this recording task successfully ?
> > 
> >  My setup:
> > 
> >  GENTOO Linux
> >  External USB audio DAC (FIIO Olympus 2)
> > 
> >  No $HOME/.asoundrc
> >  /etc/conf.d/alsasound:
> > 
> ># RESTORE_ON_START:
> ># Do you want to restore your mixer settings?  If not, your cards will be
> ># muted.
> ># no - Do not restore state
> ># yes - Restore state
> >
> >RESTORE_ON_START="yes"
> >
> ># SAVE_ON_STOP:
> ># Do you want to save changes made to your mixer volumes when alsasound
> ># stops? 
> ># no - Do not save state
> ># yes - Save state
> >
> >SAVE_ON_STOP="yes"
> > 
> >  arecord -l:
> > 
> >  List of CAPTURE Hardware Devices 
> > card 0: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > 
> > 
> >  arecord -L:
> > null
> > Discard all samples (playback) or generate zero samples (capture)
> > default
> > Default Audio Device
> > sysdefault
> > Default Audio Device
> > lavrate
> > Rate Converter Plugin Using Libav/FFmpeg Library
> > upmix
> > Plugin for channel upmix (4,6,8)
> > vdownmix
> > Plugin for channel downmix (stereo) with a simple spacialization
> > default:CARD=Audio
> > DigiHug USB Audio, USB Audio
> > Default Audio Device
> > sysdefault:CARD=Audio
> > DigiHug USB Audio, USB Audio
> > Default Audio Device
> > front:CARD=Audio,DEV=0
> > DigiHug USB Audio, USB Audio
> > Front output / input
> > usbstream:CARD=Audio
> > DigiHug USB Audio
> > USB Stream Output
> > 
> > aplay -l:
> >  List of PLAYBACK Hardware Devices 
> > card 0: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > card 0: Audio [DigiHug USB Audio], device 1: USB Audio [USB Audio #1]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > 
> > lsusb -v (excerpt):
> > 
> > Bus 005 Device 002: ID 1852:7022 GYROCOM C Co., LTD Fiio E10
> > Device Descriptor:
> >   bLength18
> >   bDescriptorType 1
> >   bcdUSB   1.10
> >   bDeviceClass0 
> >   bDeviceSubClass 0 
> >   bDeviceProtocol 0 
> >   bMaxPacketSize0 8
> >   idVendor   0x1852 GYROCOM C Co., LTD
> >   idProduct  0x7022 Fiio E10
> >   bcdDevice0.01
> >   iManufacturer   1 FiiO
> >   iProduct2 DigiHug USB Audio
> >   iSerial 0 
> >   bNumConfigurations  1
> >   

Re: [Alsa-user] How to record audio from a live video (youtube via firefox) ?

2020-12-27 Thread tuxic
On 12/27 10:47, Robert M. Riches Jr. wrote:

Hi Robert,

thanks a lot for your reply!

This seems to record as soon as .asoundrc is "active". In my case,
this isn't exactly what I am trying to acchieve.

After I posted my initial question I finally found something, which
may be kinda solutionif it would work ;)

It seems, that with the kernel module snd_aloop and the command
alsaloop one is able to create a "copy" of the existing soundcard
in a way, that what goes into the real soundcard (the sound, firefox
creates) can be recorded from the loopback device.

But until now I can't get this working.

The .asoundrc so far looks like this (with the setup/hardware listed
in my initial posting):


# .asoundrc
pcm.multi {
type route;
slave.pcm {
type multi;
slaves.a.pcm "output";
slaves.b.pcm "loopin";
slaves.a.channels 2;
slaves.b.channels 2;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
}

ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1;
ttable.1.3 1;
}

pcm.!default {
type plug
slave.pcm "multi"
} 

pcm.output {
type hw
card 0
}

pcm.loopin {
type plug
slave.pcm "hw:Loopback,0,0"
}

pcm.loopout {
type plug
slave.pcm "hw:Loopback,1,0"
}

(this is copied from the web mainlu)

But - as mentioned - this does not work currently. The recorded audio
(arecord) produces an "The Sound of Silence"... ;)

But may be this is a starting point ... I am still at the very
beginning of all this it seems...

Cheers!
Meino





> (Apologies if you want reply to list without also a direct reply.
> My mail client has 'reply' and 'Reply' only.)
> 
> I am also using pure ALSA.  After a little web searching a few
> days ago, I came up with this .asoundrc file that records to a
> raw file:
> 
> v cut here v
> pcm.Intel { type hw; card Intel; }
> ctl.Intel { type hw; card Intel; }
> pcm.NVidia { type hw; card NVidia; }
> ctl.NVidia { type hw; card NVidia; }
> 
> pcm.rate48000Hz {
>   type rate
>   slave {
> pcm writeFile # Direct to the plugin which will write to a file
> format S16_LE
> # channels 2
> rate 48000
>   }
> #route_policy copy
> }
> 
> pcm.writeFile {
>   type file
>   slave {
> pcm "Intel" # Now write to the actual sound card
>   }
>   file "aplay-D_card0-t_raw-f_S16_LE-r48000-c_2.raw"
>   format "raw"
> }
> 
> pcm.!default {
>   type plug
>   slave.pcm "rate48000Hz"
> }
> ctl.!default ctl.Intel
> ^ cut here ^
> 
> Caution: Some web browsers take liberties with how they deal with
> sound.  For example, some years ago, Firefox Hello (video chat)
> would work only with very specific .asoundrc content.
> 
> Changing the sample rate may or may not work.  With Musescore, I
> had to use exactly 48000, not 44100.
> 
> Here are example commands for converting to WAV and then to MP3:
> 
> Convert it to WAV:
> 
> sox -r 48k -e signed -b 16 -c 2 \
> aplay-D_card0-t_raw-f_S16_LE-r48000-c_2.raw \
> -r 44100 something.wav
> 
> Crop it as needed.
> 
> Optional: Convert it to MP3:
> 
> ffmpeg -i something.wav something.mp3
> 
> HTH
> 
> Robert
> 
> 
> 
> > Date: Sun, 27 Dec 2020 10:25:14 +0100
> > From: tu...@posteo.de
> > To: alsa-user@lists.sourceforge.net
> > 
> > Hi,
> > 
> >  I want to record the audio of a live stream video (youtube).
> > 
> >  Everything I tried resulted in audio files with constant or
> >  intermitted sine wave like sounds.
> > 
> >  I am using pure alsa. I don't want pulseaudio and with jack
> >  started firefoxs audio does not work.
> > 
> >  How can I accomplish this recording task successfully ?
> > 
> >  My setup:
> > 
> >  GENTOO Linux
> >  External USB audio DAC (FIIO Olympus 2)
> > 
> >  No $HOME/.asoundrc
> >  /etc/conf.d/alsasound:
> > 
> ># RESTORE_ON_START:
> ># Do you want to restore your mixer settings?  If not, your cards will be
> ># muted.
> ># no - Do not restore state
> ># yes - Restore state
> >
> >RESTORE_ON_START="yes"
> >
> ># SAVE_ON_STOP:
> ># Do you want to save changes made to your mixer volumes when alsasound
> ># stops? 
> ># no - Do not save state
> ># yes - Save state
> >
> >SAVE_ON_STOP="yes"
> > 
> >  arecord -l:
> > 
> >  List of CAPTURE Hardware Devices 
> > card 0: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > 
> > 
> >  arecord -L:
> > null
> > Discard all samples (playback) or generate zero samples (capture)
> > default
> > Default Audio Device
> > sysdefault
> > Default Audio Device
> > lavrate
> > Rate Converter Plugin 

[Alsa-user] How to record audio from a live video (youtube via firefox) ?

2020-12-27 Thread tuxic
Hi,

 I want to record the audio of a live stream video (youtube).

 Everything I tried resulted in audio files with constant or
 intermitted sine wave like sounds.

 I am using pure alsa. I don't want pulseaudio and with jack
 started firefoxs audio does not work.

 How can I accomplish this recording task successfully ?

 My setup:

 GENTOO Linux
 External USB audio DAC (FIIO Olympus 2)

 No $HOME/.asoundrc
 /etc/conf.d/alsasound:

   # RESTORE_ON_START:
   # Do you want to restore your mixer settings?  If not, your cards will be
   # muted.
   # no - Do not restore state
   # yes - Restore state
   
   RESTORE_ON_START="yes"
   
   # SAVE_ON_STOP:
   # Do you want to save changes made to your mixer volumes when alsasound
   # stops? 
   # no - Do not save state
   # yes - Save state
   
   SAVE_ON_STOP="yes"

 arecord -l:

 List of CAPTURE Hardware Devices 
card 0: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


 arecord -L:
null
Discard all samples (playback) or generate zero samples (capture)
default
Default Audio Device
sysdefault
Default Audio Device
lavrate
Rate Converter Plugin Using Libav/FFmpeg Library
upmix
Plugin for channel upmix (4,6,8)
vdownmix
Plugin for channel downmix (stereo) with a simple spacialization
default:CARD=Audio
DigiHug USB Audio, USB Audio
Default Audio Device
sysdefault:CARD=Audio
DigiHug USB Audio, USB Audio
Default Audio Device
front:CARD=Audio,DEV=0
DigiHug USB Audio, USB Audio
Front output / input
usbstream:CARD=Audio
DigiHug USB Audio
USB Stream Output

aplay -l:
 List of PLAYBACK Hardware Devices 
card 0: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [DigiHug USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

lsusb -v (excerpt):

Bus 005 Device 002: ID 1852:7022 GYROCOM C Co., LTD Fiio E10
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 
  bDeviceSubClass 0 
  bDeviceProtocol 0 
  bMaxPacketSize0 8
  idVendor   0x1852 GYROCOM C Co., LTD
  idProduct  0x7022 Fiio E10
  bcdDevice0.01
  iManufacturer   1 FiiO
  iProduct2 DigiHug USB Audio
  iSerial 0 
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   0x0182
bNumInterfaces  4
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0x80
  (Bus Powered)
MaxPower  500mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 3 Human Interface Device
  bInterfaceSubClass  0 
  bInterfaceProtocol  0 
  iInterface  0 
HID Device Descriptor:
  bLength 9
  bDescriptorType33
  bcdHID   1.00
  bCountryCode0 Not supported
  bNumDescriptors 1
  bDescriptorType34 Report
  wDescriptorLength  58
 Report Descriptors: 
   ** UNAVAILABLE **
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0012  1x 18 bytes
bInterval  32
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   0
  bInterfaceClass 1 Audio
  bInterfaceSubClass  1 Control Device
  bInterfaceProtocol  0 
  iInterface  3 FiiO USB DAC-E10
  AudioControl Interface Descriptor:
bLength10
bDescriptorType36
bDescriptorSubtype  1 (HEADER)
bcdADC   1.00
wTotalLength   0x003e
bInCollection   2
baInterfaceNr(0)2
baInterfaceNr(1)3
  AudioControl Interface Descriptor:
bLength12
bDescriptorType36
bDescriptorSubtype  2 (INPUT_TERMINAL)
bTerminalID 5
wTerminalType  0x0605 SPDIF interface
bAssocTerminal  0
bNrChannels 2
wChannelConfig 0x0003
  Left Front (L)
  Right Front (R)
iChannelNames   0 
iTerminal   0 
  

[Alsa-user] DSP-Equalizser available ?

2020-05-13 Thread tuxic
Hi,

I have added a simple DAC to my PC, which provides a digital to
anaolog conversion only - there are no further soundcard-like
functionality available.

Now I am looking for an equaliser which works with alsa, does
not need jack or pulseaudio or portaudio and does the equalisation
by itsself - just like a DSP.

But I didn't find any.

Is there such a software available, which I can run in background
as kinda "default equaliser" for all audio sources?

Thanks a lot for any help in advance!
Cheers!
Meino





___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user