Re: question about sound
On Sat 20 Aug 2022 at 07:46:24 (+0200), to...@tuxteam.de wrote: > On Fri, Aug 19, 2022 at 11:55:33PM -0500, David Wright wrote: > > On Fri 19 Aug 2022 at 08:46:29 (-0400), Greg Wooledge wrote: > > > On Thu, Aug 18, 2022 at 11:13:11PM -0500, David Wright wrote: > > > > The attraction of a one-liner is partly because of screens > > > > being around four times wider than high (characterwise). > > > > Wouldn't it be nice if bash had Perl's die …. > > > > > > Some people put a die() function in their scripts, and then use it. > > > > > > die() { printf >&2 '%s\n' "$*"; exit 1; } > > > > > > Or variants thereof. There are almost as many variations as there are > > > shell programmers. > > > > But if I have that, and: > > > > soxy is a function > > soxy () > > { > > [ -z "$1" ] && die "Usage: ${FUNCNAME[0]} > > path-to/sound-file-of-any-type [trim 20 2] > > runs sox to play the file with any arguments given. > > The example above reminds you to put the full argument."; > > local From="$1"; > > shift; > > sox -q "$From" -t alsa default "$@" > > } > > > > then typing just: > > > > $ soxy > > > > into an xterm will have the same effect as: > > > > $ ^D > > > > killing bash and the xterm, whereas what I would want from die is a > > "double-return", quitting both die and soxy, and leaving me at: > > > > $ > > > > just as Perl's die would do (if soxy was a Perl program). > > The problem is... the function is running in your current shell's > process. This is totally different from the Perl case, where your > Perl programm gets its own process, so exit is going to do the > right thing (in both cases, the current process is terminated). > > (Actually, Perl is more complicated, since you can catch a die > with an eval, so it is basically a full-fledged exception machinery). Yes, I understand that, I was just using Perl to illustrate the concept: if I run a Perl program from the command line and, deep within the program, it executes die, I get a message and I'm back at my command line. > I see two ways forward: either use return in your shell function; A macro in emacs made light work of that. > you'd have to build your exception handling level-by-level, by > hand. 90% of the functions are single level, built to make CLI use more efficient. They error check (evidently for likely errors, rather than, say, closing stderr), and second level functions are generally trivial, like: [ -e "$2" ] && msgerr "$2 already exists!" && return 1 … … msgerr () { printf '%s\n' "$*" 1>&2; return 0 } > Or do what everyone does and build your soxy as a command, > which will be executed in its own shell and not as a function. I would think that rather OTT, seeing as soxy merely avoids having to remember the options -q and -t alsa default. Many of my functions are similar; can you imagine having to remember all these options just to put a video soundtrack onto a GoGear mp3 player: ffmpeg -y -i "$1" -f wav -ar 44100 -ac 2 -vn "$Unique1" lame -b "${Fixedbitrate:-128}" "$Unique1" "$Unique2" chmod ug=r,o= "$Unique2" touch -r "$1" "$Unique1" "$Unique2" > You can set traps in the shell for exit and return events, so > you might try to build exception handling on that, but I don't > know whether it is a good idea. But possibly a nice exercise :) By that time, I would have rewritten shell code in Python. For example, I ran a shell script for years to change the X background according to temperature/battery state, but wheezy's 3.x kernel introduced a snag: that /sys/class/power_supply/BAT*/current_now might exist when tested, but not when read by the next line of code. I just converted shell to Python, and used try:/except:. Cheers, David.
Re: question about sound
On Fri, Aug 19, 2022 at 11:55:33PM -0500, David Wright wrote: > On Fri 19 Aug 2022 at 08:46:29 (-0400), Greg Wooledge wrote: > > On Thu, Aug 18, 2022 at 11:13:11PM -0500, David Wright wrote: > > > The attraction of a one-liner is partly because of screens > > > being around four times wider than high (characterwise). > > > Wouldn't it be nice if bash had Perl's die …. > > > > Some people put a die() function in their scripts, and then use it. > > > > die() { printf >&2 '%s\n' "$*"; exit 1; } > > > > Or variants thereof. There are almost as many variations as there are > > shell programmers. > > But if I have that, and: > > soxy is a function > soxy () > { > [ -z "$1" ] && die "Usage:${FUNCNAME[0]} > path-to/sound-file-of-any-type [trim 20 2] > runs sox to play the file with any arguments given. > The example above reminds you to put the full argument."; > local From="$1"; > shift; > sox -q "$From" -t alsa default "$@" > } > > then typing just: > > $ soxy > > into an xterm will have the same effect as: > > $ ^D > > killing bash and the xterm, whereas what I would want from die is a > "double-return", quitting both die and soxy, and leaving me at: > > $ > > just as Perl's die would do (if soxy was a Perl program). The problem is... the function is running in your current shell's process. This is totally different from the Perl case, where your Perl programm gets its own process, so exit is going to do the right thing (in both cases, the current process is terminated). (Actually, Perl is more complicated, since you can catch a die with an eval, so it is basically a full-fledged exception machinery). I see two ways forward: either use return in your shell function; you'd have to build your exception handling level-by-level, by hand. Or do what everyone does and build your soxy as a command, which will be executed in its own shell and not as a function. You can set traps in the shell for exit and return events, so you might try to build exception handling on that, but I don't know whether it is a good idea. But possibly a nice exercise :) Cheers -- t signature.asc Description: PGP signature
Re: question about sound
On Fri 19 Aug 2022 at 08:46:29 (-0400), Greg Wooledge wrote: > On Thu, Aug 18, 2022 at 11:13:11PM -0500, David Wright wrote: > > The attraction of a one-liner is partly because of screens > > being around four times wider than high (characterwise). > > Wouldn't it be nice if bash had Perl's die …. > > Some people put a die() function in their scripts, and then use it. > > die() { printf >&2 '%s\n' "$*"; exit 1; } > > Or variants thereof. There are almost as many variations as there are > shell programmers. But if I have that, and: soxy is a function soxy () { [ -z "$1" ] && die "Usage: ${FUNCNAME[0]} path-to/sound-file-of-any-type [trim 20 2] runs sox to play the file with any arguments given. The example above reminds you to put the full argument."; local From="$1"; shift; sox -q "$From" -t alsa default "$@" } then typing just: $ soxy into an xterm will have the same effect as: $ ^D killing bash and the xterm, whereas what I would want from die is a "double-return", quitting both die and soxy, and leaving me at: $ just as Perl's die would do (if soxy was a Perl program). On Fri 19 Aug 2022 at 22:53:24 (+1000), David wrote: > If you want to stay close to the oneliner style that you already > have, it could be done like this: > > die() { > printf '%s\n' "$@" 1>&2 > return 0 > } > > soxy() { > [[ -z "$1" ]] && die "message" && return 1 > } I think that's the best we can do, unless I'm missing something. Cheers, David.
Re: question about sound
On Fri, 19 Aug 2022 at 14:13, David Wright wrote: > On Thu 18 Aug 2022 at 06:58:20 (-0400), Greg Wooledge wrote: > > On Wed, Aug 17, 2022 at 10:58:17PM -0500, David Wright wrote: > > > $ type soxy > > > soxy is a function > > > soxy () > > > { > > > [ -z "$1" ] && printf '%s\n' "Usage:${FUNCNAME[0]} > > > path-to/sound-file-of-any-type [trim 20 2] > > > runs sox to play the file with any arguments given. > > > The example above reminds you to put the full argument." 1>&2 && > > > return 1; > > > local From="$1"; > > > shift; > > > sox -q "$From" -t alsa default "$@" > > > } > > > > Pedantic note: your error checking can fail. If the printf fails for > > some reason (e.g. because stderr has been closed, or is redirected to > > a file on a file system that's full), the return won't execute. > > True—I guess I was willing to carry the risk. Thanks for noting that. > > > It's best just to use "if" in the normal way: > > > > if [ -z "$1" ]; then > > printf ... > > return 1 > > fi > > > > That way, the return will still be executed even if the printf fails. > > > > If you *insist* on using && because you think it's tres chic or something, > > then you need to use a command group: > > > > [ -z "$1" ] && { > > printf ... > > return 1 > > } > > > > But this is not the recommended practice. > > Not so much très chic as bijou⁰. I can edit, eg > [ -z "$Thepagecount" ] && printf '%s\n' "$1 has no pages!" ¹>&2 && return 1 > to > [ -z "$Thepagecount" ] && { printf '%s\n' "$1 has no pages!" ¹>&2 ; return 1 > ; } > very easily. (I think I have about 350 such constructions in ~/.bash*.) > > The attraction of a one-liner is partly because of screens > being around four times wider than high (characterwise). > Wouldn't it be nice if bash had Perl's die …. Hi David Some further bash script thoughts ... Considating hundreds of identical "printf '%s\n' 1>&2" constructs into one function seems like it would remove a lot of visual noise, and streamline reading and writing that code. My style would be: msg_stderr() { printf '%s\n' "$@" 1>&2 } soxy() { if [[ -z "$1" ]] ; then msg_stderr "Usage:${FUNCNAME[0]} path-to/sound-file-of-any-type [trim 20 2] runs sox to play the file with any arguments given. The example above reminds you to put the full argument." return 1 fi } I find that style easier to read and reason about, but it would involve more editing of your existing code. Aside: I see that you are using ${FUNCNAME[0]}, so bash features are acceptable. Using an array to pass the message lines to the same function would preserve the code indentation, which further improves readability for me. soxy() { if [[ -z "$1" ]] ; then local m=( "Usage:${FUNCNAME[0]} path-to/sound-file-of-any-type [trim 20 2]" "runs sox to play the file with any arguments given." "The example above reminds you to put the full argument." ) msg_stderr "${m[@]}" return 1 fi } If you want to stay close to the oneliner style that you already have, it could be done like this: die() { printf '%s\n' "$@" 1>&2 return 0 } soxy() { [[ -z "$1" ]] && die "message" && return 1 } This avoids the issue of unexpected errors in printf, makes all return values explicit, and avoids mixing && and || operators. And hopefully not much trouble for you to edit, either :)
Re: question about sound
On Thu, Aug 18, 2022 at 11:13:11PM -0500, David Wright wrote: > The attraction of a one-liner is partly because of screens > being around four times wider than high (characterwise). > Wouldn't it be nice if bash had Perl's die …. Some people put a die() function in their scripts, and then use it. die() { printf >&2 '%s\n' "$*"; exit 1; } Or variants thereof. There are almost as many variations as there are shell programmers.
Re: question about sound
On Fri, Aug 19, 2022 at 06:28:47AM +0100, mick.crane wrote: > On 2022-08-18 08:39, to...@tuxteam.de wrote: [...] > > TBH you packed two questions into your original mail. Complaining that > > most people concentrate on one is kinda... well ;-) > > I don't mean to appear am complaining. No sweat. I put a smiley on there, I was half-in-jest... > Mention of teenage Guru was attempted humour. ...as you were, it seems :-D > There were 2 question marks but really one question. > "Is there a numpty's explanation what are these PulseAudio, Alsa, Jack?" > Noticed had sound from the speakers when selecting Pulseaudio as Audio > System but then doing that again I had no sound. ALSA is the basic infrastructure: it includes the kernel drivers. What Pulse and Jack provide is the "sound daemon", a user-space software component which can mix sounds from different sources, and do other user friendly (that's the intention, at least) things. For example overlaying a warning sound from your desktop environment over the heavy metal you're currently listening to, or remembering the settings for different output hardware, or sending the sound over the network, or... Jack focuses on low latency, which is especially important for musical pros, where 20ms of latency do hurt. > Have no idea what an Audio System is. > I have found the Ardour6 manual. Ardour uses one of the above back ends. > The install system looks to have put me and pulse in audio group. > Ardour manual is saying this is possibly not a good idea because only one > person can access soundcard at a time. This is the problem sound daemons try to solve. They sit on your sound card and talk (hopefully) to the different applications. > There may be an explanation why second attempt had no sound output because > something had the soundcard because of user error. There are many variables involved there: is your Ardour trying to talk directly to the hardware and a sound daemon (pulse?) sitting on it? Getting rid of the sound daemon or telling Ardour to talk to it might solve the problem. So to approach the thing, you'd have to look at your ardour's settings *and* do a `ps' to search for your sound daemon (if any) *and* look at its settings (pavuctrl is reportedly a front end to pulse -- I don't know for sure, because I don't use it). And perhaps other things. Yes, it's messy :-) Cheers -- t signature.asc Description: PGP signature
Re: question about sound
On 2022-08-18 08:39, to...@tuxteam.de wrote: On Wed, Aug 17, 2022 at 10:47:40PM +0100, mick.crane wrote: On 2022-08-17 21:00, ghe2001 wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Anybody have anything to say about editing sound files? In the 70s friends went to this house where there was a 14 year old Indian mystic. You were all supposed to wait downstairs until you were called to receive 'the knowledge'. We all left after a day but one guy stayed, after days he got really angry. Stormed up the stairs, " Give me the f#@king knowledge!" funny old times. TBH you packed two questions into your original mail. Complaining that most people concentrate on one is kinda... well ;-) I don't mean to appear am complaining. Mention of teenage Guru was attempted humour. There were 2 question marks but really one question. "Is there a numpty's explanation what are these PulseAudio, Alsa, Jack?" Noticed had sound from the speakers when selecting Pulseaudio as Audio System but then doing that again I had no sound. Have no idea what an Audio System is. I have found the Ardour6 manual. The install system looks to have put me and pulse in audio group. Ardour manual is saying this is possibly not a good idea because only one person can access soundcard at a time. There may be an explanation why second attempt had no sound output because something had the soundcard because of user error. regards mick
Re: question about sound
On Thu 18 Aug 2022 at 06:58:20 (-0400), Greg Wooledge wrote: > On Wed, Aug 17, 2022 at 10:58:17PM -0500, David Wright wrote: > > $ type soxy > > soxy is a function > > soxy () > > { > > [ -z "$1" ] && printf '%s\n' "Usage:${FUNCNAME[0]} > > path-to/sound-file-of-any-type [trim 20 2] > > runs sox to play the file with any arguments given. > > The example above reminds you to put the full argument." 1>&2 && return > > 1; > > local From="$1"; > > shift; > > sox -q "$From" -t alsa default "$@" > > } > > Pedantic note: your error checking can fail. If the printf fails for > some reason (e.g. because stderr has been closed, or is redirected to > a file on a file system that's full), the return won't execute. True—I guess I was willing to carry the risk. Thanks for noting that. > It's best just to use "if" in the normal way: > > if [ -z "$1" ]; then > printf ... > return 1 > fi > > That way, the return will still be executed even if the printf fails. > > If you *insist* on using && because you think it's tres chic or something, > then you need to use a command group: > > [ -z "$1" ] && { > printf ... > return 1 > } > > But this is not the recommended practice. Not so much très chic as bijou⁰. I can edit, eg [ -z "$Thepagecount" ] && printf '%s\n' "$1 has no pages!" ¹>&2 && return 1 to [ -z "$Thepagecount" ] && { printf '%s\n' "$1 has no pages!" ¹>&2 ; return 1 ; } very easily. (I think I have about 350 such constructions in ~/.bash*.) The attraction of a one-liner is partly because of screens being around four times wider than high (characterwise). Wouldn't it be nice if bash had Perl's die …. ⁰ adj. (Brit.) ¹ This is what I actually write, FYI. Cheers, David.
Re: question about sound
On Thu, Aug 18 2022 at 09:39:23 AM, wrote: > On Wed, Aug 17, 2022 at 10:47:40PM +0100, mick.crane wrote: >> On 2022-08-17 21:00, ghe2001 wrote: >> > -BEGIN PGP SIGNED MESSAGE- >> > Hash: SHA256 >> > >> > Anybody have anything to say about editing sound files? >> >> In the 70s friends went to this house where there was a 14 year old Indian >> mystic. >> You were all supposed to wait downstairs until you were called to receive >> 'the knowledge'. >> We all left after a day but one guy stayed, after days he got really angry. >> Stormed up the stairs, " Give me the f#@king knowledge!" >> funny old times. > > TBH you packed two questions into your original mail. Complaining that > most people concentrate on one is kinda... well ;-) > > And why audacity isn't in the Bookworm repo... perhaps it's temporary? > It fails to build because of incompatibility with new ffmpeg: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1004598 Certainly sounds like a temporary problem. According to https://wiki.audacityteam.org/wiki/Release_Notes_3.2, support for ffmpeg 5.0 is coming in the next release. -- regards, kushal
Re: question about sound
On Wed, Aug 17, 2022 at 10:58:17PM -0500, David Wright wrote: > $ type soxy > soxy is a function > soxy () > { > [ -z "$1" ] && printf '%s\n' "Usage: ${FUNCNAME[0]} > path-to/sound-file-of-any-type [trim 20 2] > runs sox to play the file with any arguments given. > The example above reminds you to put the full argument." 1>&2 && return > 1; > local From="$1"; > shift; > sox -q "$From" -t alsa default "$@" > } Pedantic note: your error checking can fail. If the printf fails for some reason (e.g. because stderr has been closed, or is redirected to a file on a file system that's full), the return won't execute. It's best just to use "if" in the normal way: if [ -z "$1" ]; then printf ... return 1 fi That way, the return will still be executed even if the printf fails. If you *insist* on using && because you think it's tres chic or something, then you need to use a command group: [ -z "$1" ] && { printf ... return 1 } But this is not the recommended practice.
Re: question about sound
On Wed, 17 Aug 2022 20:00 +, ghe2001 wrote: > Anybody have anything to say about editing sound files? > > I started to answer the poster's question and found that, in their > infinite wisdom, the Debian designers seem to have removed Audacity from > the upcoming release, Bookworm. I heard some weird things about Audacity. It has been accused of being spyware. You can read more about it here: https://en.wikipedia.org/wiki/Audacity_(audio_editor)#Reception > Bad idea, IMHO. Suggestions for replacements? They are one or more > Debian users that have relied on Audacity for years. Here you'll find 19 Audacity replacements for Linux: https://alternativeto.net/software/audacity/?platform=linux Some of them are forks of Audacity. > Mick, if you're still there, it might be possible to get it from their > website: > > https://www.audacityteam.org/download/ That is an AppImage, so it will certainly work - if you still want to use it.
Re: question about sound
On 2022-08-17, mick.crane wrote: > On 2022-08-17 21:00, ghe2001 wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA256 >> >> Anybody have anything to say about editing sound files? > > In the 70s friends went to this house where there was a 14 year old > Indian mystic. > You were all supposed to wait downstairs until you were called to > receive 'the knowledge'. > We all left after a day but one guy stayed, after days he got really > angry. > Stormed up the stairs, " Give me the f#@king knowledge!" > funny old times. > mick > > After days of waiting the imparted knowledge consisted of your realization that there was so such thing, and that you should therefore stop looking for it. So I guess you got it in a way (without really getting it).
Re: question about sound
On Wed, Aug 17, 2022 at 10:47:40PM +0100, mick.crane wrote: > On 2022-08-17 21:00, ghe2001 wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA256 > > > > Anybody have anything to say about editing sound files? > > In the 70s friends went to this house where there was a 14 year old Indian > mystic. > You were all supposed to wait downstairs until you were called to receive > 'the knowledge'. > We all left after a day but one guy stayed, after days he got really angry. > Stormed up the stairs, " Give me the f#@king knowledge!" > funny old times. TBH you packed two questions into your original mail. Complaining that most people concentrate on one is kinda... well ;-) And why audacity isn't in the Bookworm repo... perhaps it's temporary? Cheers -- t signature.asc Description: PGP signature
Re: question about sound
On Wed, Aug 17, 2022 at 08:00:17PM +, ghe2001 wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Anybody have anything to say about editing sound files? > > I started to answer the poster's question and found that, in their infinite > wisdom, the Debian designers seem to have removed Audacity from the upcoming > release, Bookworm. > > Bad idea, IMHO. Suggestions for replacements? They are one or more Debian > users that have relied on Audacity for years. > > > Mick, if you're still there, it might be possible to get it from their > website: > > https://www.audacityteam.org/download/ It's packaged for Debian, so perhaps OP's life would be a tad easier doing "apt install audacity"? This is a Debian mailing list, after all :) Cheers -- t signature.asc Description: PGP signature
Re: question about sound
On Wed 17 Aug 2022 at 20:00:17 (+), ghe2001 wrote: > Anybody have anything to say about editing sound files? > > I started to answer the poster's question and found that, in their infinite > wisdom, the Debian designers seem to have removed Audacity from the upcoming > release, Bookworm. > > Bad idea, IMHO. Suggestions for replacements? They are one or more Debian > users that have relied on Audacity for years. For Mick's .wav files, I would use mpv to play them, which gives an elapsed time indication, and sox to extract the desired section. (Sound-wise, I'm ALSA-only.) If you don't require too much precision, mpv is a quick wav of finding, say, the gaps between tracks when you dub a vinyl record, using Left/RightArrows, SpaceBar, and l to loop a section. $ sox infile.wav outfile.wav trim will extract a section. If I need precision, or want to impose a fade or other effect, I use soxy to "rehearse" the sound, eg $ soxy infile.wav trim 6:18.8 10 fade h 0 -0 4 would play just the last ten seconds of a recording of length 6:28.8, with a four second face-out. $ type soxy soxy is a function soxy () { [ -z "$1" ] && printf '%s\n' "Usage:${FUNCNAME[0]} path-to/sound-file-of-any-type [trim 20 2] runs sox to play the file with any arguments given. The example above reminds you to put the full argument." 1>&2 && return 1; local From="$1"; shift; sox -q "$From" -t alsa default "$@" } $ For generating multiple tracks for burning to a CD, I've always used my own Python programs for over twenty years. They take account of the divisibility of Nsamples by 2352/4 when the WAV format is CD-type, and chunk the data to prevent overloading CPU/memory. (I was using a Pentium II (Klamath) @266MHz with 384MB at the time, IIRC, for recording, ripping, processing and burning.) Cheers, David.
Re: question about sound
On 2022-08-17 21:00, ghe2001 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Anybody have anything to say about editing sound files? In the 70s friends went to this house where there was a 14 year old Indian mystic. You were all supposed to wait downstairs until you were called to receive 'the knowledge'. We all left after a day but one guy stayed, after days he got really angry. Stormed up the stairs, " Give me the f#@king knowledge!" funny old times. mick
Re: question about sound
On Wed, Aug 17, 2022 at 1:37 PM Bob McGowan wrote: > The command to add a user to a group is: useradd -G > groupname[,groupname...] username > > For example: useradd -G audio,pulsaudio bob > > Useradd creates a new user account. Usermod modifies an existing account. sudo usermod -a -G audio Make sure you use the -a to append the new group to your existing groups or it will wipe out your existing groups. > On 8/17/22 10:21, Jude DaShiell wrote: > > the user that's doing this would need to be added to the audio group and > > maybe the pulseaudio group if that group exists. The groupadd command > can > > do that for the user but groupadd has to be used by root to get that > done. > > Before doing any of that, a user can find what groups they're already in > > by typing the groups command and a list should appear showing the groups. > > Man groupadd can show how to use that command when it's time. > > > > > > Jude . > > > > On Wed, 17 Aug 2022, mick.crane wrote: > > > >> hello, > >> Please take into account I don't know what I'm doing generally and know > >> nothing about audio. > >> Several years ago somebody asked me to edit a radio broadcast to > separate out > >> a few seconds. > >> It took a couple of minutes to install Audacity, figure out the GUI > thing and > >> save the bits of audio. > >> I'm wanting now to edit .wav files. > >> Can't find Audacity in the repository for Bookworm. > >> There is Ardour6. > >> It's a bit complex. > >> By selecting PulseAudio as the wotsit it seemed to be working but I try > again > >> and there is no sound output to hear. > >> There is message like " don't have permission to access". > >> Is there some numpty explanation of how this is supposed to work ? > >> Do these things PulseAudio, Alsa, Jack provide a stream on some bus or > >> something and the Ardour6 programme edits bits out as it goes by ? > >> If it's a physical piece of tape you can imagine you can cut it with a > pair of > >> scissors and cellotape bits together but I've no idea how it's working > with a > >> PC. > >> resource of simplified explanation appreciated. > >> > >> regards > >> > >> mick > >> > >> > >> > > -- ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/ ⠈⠳⣄⠀⠀
Re: question about sound
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Anybody have anything to say about editing sound files? I started to answer the poster's question and found that, in their infinite wisdom, the Debian designers seem to have removed Audacity from the upcoming release, Bookworm. Bad idea, IMHO. Suggestions for replacements? They are one or more Debian users that have relied on Audacity for years. Mick, if you're still there, it might be possible to get it from their website: https://www.audacityteam.org/download/ -- Glenn English -BEGIN PGP SIGNATURE- Version: ProtonMail wsBzBAEBCAAGBQJi/UizACEJEJ/XhjGCrIwyFiEELKJzD0JScCVjQA2Xn9eG MYKsjDJacggAgZBejYMI/XqFYEJYXJsAZnTqsRZeRx2BHkFF+i2+OlXIb69p Gkq5iYRjL7BBIAO1YJI7o066rHiH31ZfcogJyldNlReZpEPbB9AFeLXcQZOG wxUq7y3cmTxY3HpABUjs/rtlBtt9KfPIFwzdGqRx3SvgDYFjzYRPzN4eNqhF gVluBfq+W0H/M3dEIX5Wl2ZoH51N2h/VGKPwWmZOLvZsEZSZfla6F1Jy4C8X 7eGKlDRZUvTqpDRMyfXuuO8gqo020KDR3V6xzWBQrYdmRiTksYdQRvTtUa55 jd1G/iAUYAATG6fPm9hxPuhxuTsedhaWx84IRSstPgrzF7IL6LHiIQ== =YIKE -END PGP SIGNATURE-
Re: question about sound
On Wed, Aug 17, 2022 at 08:10:37PM +0100, mick.crane wrote: > I'm just requesting some comprehensible, simple to understand, overview of > how the sound softwares are working. Too many layers and possibilities to give a comprehensive listing. Let's pick ONE. Plain ALSA, without Pulseaudio or anything else on top of it. ALSA is implemented in the kernel, and the visible connection points to it are character device files: unicorn:~$ ls -l /dev/snd/ total 0 drwxr-xr-x 2 root root 60 Aug 16 07:35 by-id/ drwxr-xr-x 2 root root 80 Aug 16 07:35 by-path/ crw-rw+ 1 root audio 116, 12 Aug 16 07:35 controlC0 crw-rw+ 1 root audio 116, 14 Aug 16 07:35 controlC1 crw-rw+ 1 root audio 116, 10 Aug 16 07:35 hwC0D0 crw-rw+ 1 root audio 116, 11 Aug 16 07:35 hwC0D2 crw-rw+ 1 root audio 116, 3 Aug 16 07:35 pcmC0D0c crw-rw+ 1 root audio 116, 2 Aug 16 07:37 pcmC0D0p crw-rw+ 1 root audio 116, 9 Aug 16 07:35 pcmC0D10p crw-rw+ 1 root audio 116, 4 Aug 16 07:35 pcmC0D2c crw-rw+ 1 root audio 116, 5 Aug 16 07:35 pcmC0D3p crw-rw+ 1 root audio 116, 6 Aug 16 07:35 pcmC0D7p crw-rw+ 1 root audio 116, 7 Aug 16 07:35 pcmC0D8p crw-rw+ 1 root audio 116, 8 Aug 16 07:35 pcmC0D9p crw-rw+ 1 root audio 116, 13 Aug 16 07:35 pcmC1D0c crw-rw+ 1 root audio 116, 1 Aug 16 07:35 seq crw-rw+ 1 root audio 116, 33 Aug 16 07:35 timer As you can see, members of group 'audio' can write to these things, and can therefore cause the computer to emit sounds, or to stop emitting them. But that's not how it normally works in modern Debian. Do you see the '+' signs after the permissions? Those indicate that there's more going on than can be shown in the standard Unix permission bits. In this case, there's an ACL. We can see it with getfacl(1) (from the 'acl' package): unicorn:~$ getfacl /dev/snd/pcmC0D0p getfacl: Removing leading '/' from absolute path names # file: dev/snd/pcmC0D0p # owner: root # group: audio user::rw- user:greg:rw- group::rw- mask::rw- other::--- The 'user:greg:rw-' part indicates that my login name has been added to the Access Control List for this file. I can do stuff with it, even if I'm not in the 'audio' group. (I happen to be in that group, but that's not important here.) So... why am I in this ACL on this file? Because when I logged in, something added me to a bunch of ACLs on my behalf. It's all part of the complex login procedure on modern Debian systems. I can't tell you off the top of my head which program or service does it, but something does. When I logout, presumably this ACL entry will be removed, and I would no longer have access to those files, if I weren't in the 'audio' group. If another user logs in, they'll get a similar ACL entry on the audio device files, and they'll be able to play sounds also -- until they logout, at which time their sound-making privileges are revoked. They don't need to be added to the 'audio' group, and in fact, they shouldn't be. That's reserved for special users, like the one who installed Debian (UID 1000). On my system, that user is 'greg'.
Re: question about sound
On 2022-08-17 18:50, Greg Wooledge wrote: On Wed, Aug 17, 2022 at 10:27:25AM -0700, Bob McGowan wrote: The command to add a user to a group is: useradd -G groupname[,groupname...] username For example: useradd -G audio,pulsaudio bob Debian also allows "adduser username groupname". I sort of understand permissions for files but I'm not understanding permissions for streams whatever that is. I'm just requesting some comprehensible, simple to understand, overview of how the sound softwares are working. mick
Re: question about sound
On Wed, Aug 17, 2022 at 10:27:25AM -0700, Bob McGowan wrote: > The command to add a user to a group is: useradd -G > groupname[,groupname...] username > > For example: useradd -G audio,pulsaudio bob Debian also allows "adduser username groupname".
Re: question about sound
Thanks, I almost always get useradd and groupadd mixed up when I need to use them. Jude "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) . On Wed, 17 Aug 2022, Bob McGowan wrote: > The command to add a user to a group is: useradd -G groupname[,groupname...] > username > > For example: useradd -G audio,pulsaudio bob > > On 8/17/22 10:21, Jude DaShiell wrote: > > the user that's doing this would need to be added to the audio group and > > maybe the pulseaudio group if that group exists. The groupadd command can > > do that for the user but groupadd has to be used by root to get that done. > > Before doing any of that, a user can find what groups they're already in > > by typing the groups command and a list should appear showing the groups. > > Man groupadd can show how to use that command when it's time. > > > > > > Jude . > > > > On Wed, 17 Aug 2022, mick.crane wrote: > > > >> hello, > >> Please take into account I don't know what I'm doing generally and know > >> nothing about audio. > >> Several years ago somebody asked me to edit a radio broadcast to separate > >> out > >> a few seconds. > >> It took a couple of minutes to install Audacity, figure out the GUI thing > >> and > >> save the bits of audio. > >> I'm wanting now to edit .wav files. > >> Can't find Audacity in the repository for Bookworm. > >> There is Ardour6. > >> It's a bit complex. > >> By selecting PulseAudio as the wotsit it seemed to be working but I try > >> again > >> and there is no sound output to hear. > >> There is message like " don't have permission to access". > >> Is there some numpty explanation of how this is supposed to work ? > >> Do these things PulseAudio, Alsa, Jack provide a stream on some bus or > >> something and the Ardour6 programme edits bits out as it goes by ? > >> If it's a physical piece of tape you can imagine you can cut it with a pair > >> of > >> scissors and cellotape bits together but I've no idea how it's working with > >> a > >> PC. > >> resource of simplified explanation appreciated. > >> > >> regards > >> > >> mick > >> > >> > >> > >
Re: question about sound
The command to add a user to a group is: useradd -G groupname[,groupname...] username For example: useradd -G audio,pulsaudio bob On 8/17/22 10:21, Jude DaShiell wrote: the user that's doing this would need to be added to the audio group and maybe the pulseaudio group if that group exists. The groupadd command can do that for the user but groupadd has to be used by root to get that done. Before doing any of that, a user can find what groups they're already in by typing the groups command and a list should appear showing the groups. Man groupadd can show how to use that command when it's time. Jude . On Wed, 17 Aug 2022, mick.crane wrote: hello, Please take into account I don't know what I'm doing generally and know nothing about audio. Several years ago somebody asked me to edit a radio broadcast to separate out a few seconds. It took a couple of minutes to install Audacity, figure out the GUI thing and save the bits of audio. I'm wanting now to edit .wav files. Can't find Audacity in the repository for Bookworm. There is Ardour6. It's a bit complex. By selecting PulseAudio as the wotsit it seemed to be working but I try again and there is no sound output to hear. There is message like " don't have permission to access". Is there some numpty explanation of how this is supposed to work ? Do these things PulseAudio, Alsa, Jack provide a stream on some bus or something and the Ardour6 programme edits bits out as it goes by ? If it's a physical piece of tape you can imagine you can cut it with a pair of scissors and cellotape bits together but I've no idea how it's working with a PC. resource of simplified explanation appreciated. regards mick
Re: question about sound
the user that's doing this would need to be added to the audio group and maybe the pulseaudio group if that group exists. The groupadd command can do that for the user but groupadd has to be used by root to get that done. Before doing any of that, a user can find what groups they're already in by typing the groups command and a list should appear showing the groups. Man groupadd can show how to use that command when it's time. Jude . On Wed, 17 Aug 2022, mick.crane wrote: > hello, > Please take into account I don't know what I'm doing generally and know > nothing about audio. > Several years ago somebody asked me to edit a radio broadcast to separate out > a few seconds. > It took a couple of minutes to install Audacity, figure out the GUI thing and > save the bits of audio. > I'm wanting now to edit .wav files. > Can't find Audacity in the repository for Bookworm. > There is Ardour6. > It's a bit complex. > By selecting PulseAudio as the wotsit it seemed to be working but I try again > and there is no sound output to hear. > There is message like " don't have permission to access". > Is there some numpty explanation of how this is supposed to work ? > Do these things PulseAudio, Alsa, Jack provide a stream on some bus or > something and the Ardour6 programme edits bits out as it goes by ? > If it's a physical piece of tape you can imagine you can cut it with a pair of > scissors and cellotape bits together but I've no idea how it's working with a > PC. > resource of simplified explanation appreciated. > > regards > > mick > > >
Re: question about sound
On 2018-08-07 07:30, deloptes wrote: mick crane wrote: I'm not very good at sound. Sometimes if I watch an mp4 film the volume in parts is low but then there will become some sound event that is very loud. It is true that my hearing is not as it was but I don't think that is it. I'm not exactly sure what controls "volume" but is there software that will cut off the noisier bits at a level without affecting the rest. I think the whole problem comes from the surround channels - why not check the options around mixing multiple channels into L/R that makes sense for an explanation mick -- Key ID4BFEBB31
Re: question about sound
mick crane wrote: > I'm not very good at sound. > Sometimes if I watch an mp4 film the volume in parts is low but then > there will become some sound event that is very loud. > It is true that my hearing is not as it was but I don't think that is > it. > I'm not exactly sure what controls "volume" but is there software that > will cut off the noisier bits at a level without affecting the rest. I think the whole problem comes from the surround channels - why not check the options around mixing multiple channels into L/R
Re: question about sound
On 2018-08-06 21:39, T BkRl wrote: It sounds like a limiter is what you need? Ah, OK seems like VLC might do it in the menu items tools - FROM: mick crane SENT: Monday, August 6, 2018 3:24 PM TO: Debian Users SUBJECT: question about sound hello, sorry is this is not on-topic I'm not very good at sound. Sometimes if I watch an mp4 film the volume in parts is low but then there will become some sound event that is very loud. It is true that my hearing is not as it was but I don't think that is it. I'm not exactly sure what controls "volume" but is there software that will cut off the noisier bits at a level without affecting the rest. mick -- Key ID 4BFEBB31 -- Key ID4BFEBB31
Re: question about sound
It sounds like a limiter is what you need? From: mick crane Sent: Monday, August 6, 2018 3:24 PM To: Debian Users Subject: question about sound hello, sorry is this is not on-topic I'm not very good at sound. Sometimes if I watch an mp4 film the volume in parts is low but then there will become some sound event that is very loud. It is true that my hearing is not as it was but I don't think that is it. I'm not exactly sure what controls "volume" but is there software that will cut off the noisier bits at a level without affecting the rest. mick -- Key ID 4BFEBB31